/** * The published ACP → transcript-chunk conformance vectors (#534). * * Golden triples `(ACP session/update) → (exact on-wire chunk bytes) → (expected typed event)` that * BOTH sides of the transcript wire import and hold themselves to: * * - the PRODUCER (the c8ctl-nano ACP harness) asserts `acpUpdateToTranscriptChunk(update) === chunk`, * so it can never regress to the old marker-as-value (type/v) envelope shape, and * - the CONSUMER (the `@nanobpm/agentic/transcript` parser / the cockpit) asserts * `parseTranscriptEvent({ offset, chunk })` decodes to `event` (never a raw `stream-chunk`) and * `deriveView` folds it into a message / tool card. * * Because the SAME bytes pin both sides, a slice can no longer be green on one end while the wire * disagrees on the other — the ADR 0004 shared-contract-coordination failure class this issue closes. * * The `update` objects are the `params.update` of a real ACP `session/update` notification. Each * `chunk` is the EXACT string a producer appends (a committed golden — a bridge change that alters the * body bytes fails the round-trip test) and is `null` for an `ignored` ACP update (a `plan`, an * intermediate `tool_call_update`, a non-text chunk): there is no canonical chunk to emit. `event` is * the typed event the parser decodes the chunk into at the given offset, or `null` when `chunk` is * `null`. * * The envelope's marker key/version prefix is DERIVED from the one canonical definition * ({@link TRANSCRIPT_EVENT_MARKER} / {@link TRANSCRIPT_EVENT_VERSION}), never hardcoded — the transcript * drift-guard requires the marker string live only in `transcript/events.ts`, and deriving it here keeps * this golden honest against a marker/version change while still pinning the exact body bytes. * * Coverage spans every core ACP update kind the transcript wire carries: `agent_message_chunk`, * `agent_thought_chunk`, `user_message_chunk`, `tool_call`, a terminal `tool_call_update`, and an * `ignored` `plan`. */ import { type TranscriptEvent } from "../../transcript/events.ts"; /** One `(ACP update) → (chunk bytes) → (typed event)` golden triple pinning the transcript wire. */ export interface AcpTranscriptVector { readonly name: string; /** The ACP `update.sessionUpdate` discriminant this vector exercises. */ readonly sessionUpdate: string; /** The raw ACP `session/update` `update` object (`params.update`) fed to the bridge / classifier. */ readonly update: Record; /** Exact on-wire chunk bytes the bridge emits, or `null` when the update is `ignored` (no chunk). */ readonly chunk: string | null; /** The typed event the parser decodes `chunk` into (at `offset`), or `null` when `chunk` is `null`. */ readonly event: TranscriptEvent | null; /** The store offset the vector's expected `event` is decoded at (arbitrary; the wire bytes are offset-free). */ readonly offset: number; } /** * The published golden triples. Imported by this repo's bridge round-trip test AND by the cross-repo * producer (jwulf/c8ctl-plugin-nano) so neither side can drift from the canonical wire. */ export declare const ACP_TRANSCRIPT_VECTORS: readonly AcpTranscriptVector[];