--- id: product-analytics-channel prd: docs/work/prds/product-analytics-channel.prd.md title: Product analytics as a fourth capture channel (ADR-024 implementation) type: epic status: done features: [core-analytics, core-shared, core-testing, core-eslint] created: 2026-05-18T12:00:00Z updated: 2026-05-18T16:05:30.519Z --- ## Goal Ship `@repo/core-analytics` as an optional core package that codifies product analytics as the fourth capture channel alongside `ITracer`, `ILogger`, and `IAuditLog`. Adds `IAnalytics` interface, `NoopAnalytics` + `RecordingAnalytics` implementations, `Analyzed` brand, `withAnalytics` wrapper, `analyticsEvents` manifest field, `assertFeatureConformance` extension, `AnalyticsProtocol` in `BindContext`, `no-undeclared-analytics-event` ESLint rule, and a React provider scaffold — all mirroring the audit channel shape with ADR-024's three deliberate divergences. ## Why Consumers routinely bolt analytics SDKs on at the React component layer, bypassing manifests, brands, and the five-gate conformance system. Codifying analytics as a channel with the same structural shape as `core-audit` means the conformance gates extend to a fourth signal at zero new gate count. ## Stories - [x] [01 — Scaffold @repo/core-analytics package](01-scaffold-core-analytics-package/_story.md) - [x] [02 — Add RecordingAnalytics to @repo/core-testing](02-recording-analytics/_story.md) - [x] [03 — Add Analyzed brand and withAnalytics wrapper](03-analyzed-brand-and-with-analytics-wrapper/_story.md) - [x] [04 — Extend manifest schema and wireUseCase with analyticsEvents](04-manifest-schema-and-wire-use-case/_story.md) - [x] [05 — Extend assertFeatureConformance to check Analyzed brand](05-assert-feature-conformance-analyzed/_story.md) - [x] [06 — Add AnalyticsProtocol and BindContext.analytics](06-analytics-protocol-bind-context/_story.md) - [x] [07 — Add no-undeclared-analytics-event ESLint rule](07-eslint-rule-no-undeclared-analytics-event/_story.md) - [x] [08 — Add React provider to @repo/core-analytics](08-react-provider/_story.md) - [x] [09 — Documentation](09-documentation/_story.md)