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:
@@ -28,7 +28,11 @@ export function withCapture<Args extends unknown[], R>(
|
||||
tags: Record<string, string>,
|
||||
fn: (...args: Args) => Promise<R>,
|
||||
): Captured<(...args: Args) => Promise<R>> {
|
||||
const PROPAGATED_BRANDS = ["__instrumented", "__audited"] as const;
|
||||
const PROPAGATED_BRANDS = [
|
||||
"__instrumented",
|
||||
"__audited",
|
||||
"__analyzed",
|
||||
] as const;
|
||||
|
||||
const wrapped: (...args: Args) => Promise<R> = async (...args) => {
|
||||
try {
|
||||
|
||||
@@ -2,7 +2,7 @@ import type { ITracer, SpanOpts } from "./tracer.interface";
|
||||
import type { Instrumented } from "../conformance/brands";
|
||||
import { attachBrand } from "../conformance/brand-runtime";
|
||||
|
||||
const PROPAGATED_BRANDS = ["__captured", "__audited"] as const;
|
||||
const PROPAGATED_BRANDS = ["__captured", "__audited", "__analyzed"] as const;
|
||||
|
||||
export function withSpan<Args extends unknown[], R, Extra extends object>(
|
||||
tracer: ITracer,
|
||||
|
||||
Reference in New Issue
Block a user