feat(core-shared): extend wireUseCase with analytics arg and Analyzed brand propagation
Add AnalyticsProtocol to bind-protocols, extend WireUseCaseOptions with optional analytics field, and compose the __analyzed brand inline in wireUseCase (innermost, before withAudit) when analytics is provided. Propagate __analyzed through withCapture and withSpan PROPAGATED_BRANDS so the outermost container binding carries the brand for boot-time assertion checks (Story 05). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -68,3 +68,15 @@ export type MetricsProtocol = {
|
||||
export type AuditLogProtocol = {
|
||||
record(entry: AuditEntry): Promise<void>;
|
||||
};
|
||||
|
||||
/**
|
||||
* Minimal analytics protocol surface. `IAnalytics` (in `@repo/core-analytics`)
|
||||
* extends this — typechecks fail if narrowed below. Feature binders that
|
||||
* receive `ctx.analytics` see only this protocol type.
|
||||
*/
|
||||
export type AnalyticsProtocol = {
|
||||
track(
|
||||
event: string,
|
||||
attributes?: Record<string, string | number | boolean>,
|
||||
): void;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user