Skip to content

feat(amp-semantic): scaffold semantic capture package - #2113

Merged
jxiwang merged 3 commits into
mainfrom
codex/semantic-context-visibility
Nov 4, 2026
Merged

jxiwang merged 3 commits into
mainfrom
codex/semantic-context-visibility

Conversation

@jxiwang

@jxiwang jxiwang commented Oct 30, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Establish the @amplitude/amp-semantic workspace package before adding event capture. This PR contains package metadata, clean CommonJS/ESM builds and declarations, lint/test setup, shared version/identity/envelope contracts, and public-contract tests. Package ownership is assigned to @amplitude/session-replay-sdk in .github/CODEOWNERS.

There are no event families, recorders, capture runtime, browser listeners, storage access, or Session Replay changes in this PR. No existing SDK depends on the package yet.

Merge sequence

  1. Merge this package scaffold.
  2. Add context/visibility, the capture runtime, identity generation, and Session Replay integration in the stacked follow-up PR feat(amp-semantic): add composable capture runtime #2120.
  3. Add dialog/notice and subsequent event families in later PRs.

The complete implementation remains preserved in #2082. The context/visibility implementation is preserved in #2120 (codex/semantic-context-visibility-events).

Validation

  • Node 24: install, full workspace build, typecheck, documentation, lint, dependency checks, and bundle-size checks passed.
  • pnpm test --concurrency=2: all 32 projects passed, including the scaffold's public-contract test with 100% coverage.
  • Verified clean package output contains only index/types JavaScript and declarations; no stale event implementation is packaged.
  • Existing repository blocker, documented with maintainer approval: pnpm test:examples cannot start because jest.setup.examples.js is absent from main.

Checklist

  • PR title follows the conventional commit format.
  • Breaking change: No existing SDK API or capture behavior changes.

Note

Low Risk
Greenfield scaffold with types and tests only; no changes to existing SDKs or capture behavior.

Overview
Introduces @amplitude/amp-semantic as a new workspace package—the first increment toward semantic event capture, with no runtime capture or Session Replay wiring yet.

The package adds standard monorepo tooling (CJS/ESM builds with a clean lib step, typecheck, Jest, ESLint) and documents a planned multi-PR rollout. Public API is limited to SEMANTIC_VERSION, SemanticIdentity (tab_id, document_id), and the generic SemanticEventEnvelope type that merges caller payload with version and identity. Tests exercise JSON shape and compile-time constraints on event names and required metadata.

CODEOWNERS assigns /packages/amp-semantic/ to @amplitude/session-replay-sdk alongside other Session Replay packages. pnpm-lock.yaml registers the new package’s tslib and rimraf entries.

Reviewed by Cursor Bugbot for commit 82928e0. Bugbot is set up for automated code reviews on this repo. Configure here.

@github-actions

github-actions Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

size-limit report 📦

Path Size
packages/analytics-browser/lib/scripts/amplitude-min.js.gz 68.37 KB (0%)
packages/session-replay-browser/lib/scripts/session-replay-browser-min.js.gz 138.22 KB (-0.01% 🔽)
packages/unified/lib/scripts/amplitude-min.umd.js.gz 224.33 KB (-0.01% 🔽)
@amplitude/element-selector (gzipped esm) 3.48 KB (0%)
@amplitude/analytics-browser/lite (gzipped esm) 21.75 KB (0%)

@github-actions

Copy link
Copy Markdown

Session Replay Browser E2E Results

passed  157 passed

Details

stats  157 tests across 18 suites
duration  4 minutes, 27 seconds
commit  152ea3c

@jxiwang jxiwang changed the title feat(amp-semantic): add context and visibility capture feat(amp-semantic): scaffold semantic capture package Nov 3, 2026
@jxiwang
jxiwang marked this pull request as ready for review November 3, 2026 18:01
@jxiwang
jxiwang requested a review from a team as a code owner November 3, 2026 18:01
@jxiwang
jxiwang merged commit e3f76a3 into main Nov 4, 2026
24 checks passed
@jxiwang
jxiwang deleted the codex/semantic-context-visibility branch November 4, 2026 20:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants