feat(tools): carry trusted agent provenance sidecars [SAP-3020] - #759
Conversation
Keep opaque callsite evidence and signed lineage receipts out of request and result JSON, forwarding receipts only for exact direct SDK result handoffs.\n\nRefs: SAP-3020
Exercise direct output identity, delayed-dispatch exclusion, and error privacy for the v1 carrier.\n\nRefs: SAP-3020
Refs: SAP-3020
Make callsite and lineage carriers one-shot, require build evidence for forwarding, keep receipt state lexical to the agent runtime, and redact reflected private values from invocation and status errors.\n\nRefs: SAP-3020
Exercise clean-built CJS and ESM carriers, pin mixed-format isolation, and document the exact detectable handoff boundary without claiming recursive queue or storage inference.\n\nRefs: SAP-3020
Route ESM root and carrier exports through the canonical CJS closure so mixed-format direct handoffs retain private one-shot provenance without global state or public store helpers. Refs: SAP-3020
Bundle root and carrier runtimes into one closure so module-cache inspection cannot extract or rebind private callsite helpers while CJS and ESM handoffs retain shared state. Refs: SAP-3020
Allow the Test workflow to run for pull requests targeting any legitimate base branch so stacked PRs exercise the post-build runtime provenance package probe. Refs: SAP-3020
Generate CJS and ESM agent facades backed by the canonical lexical provenance runtime so supported stub imports cannot reach a removed private store artifact. Extend the package probe to execute both stub formats and reject private helpers from their cache surfaces. Refs: SAP-3020
Review — PR #759 (round 1)1. 🔴 Build canonicalization ships a second copy of the whole package and splits class identity
The changeset is 2. 🟠 All
|
Refs: SAP-3020
Refs: SAP-3020
Refs: SAP-3020
Refs: SAP-3020
Refs: SAP-3020
Review — PR #759 (round 2, delta since
|
Refs: SAP-3020
|
/review |
Review — PR #759 (round 3, delta since
|
|
Review finding 1 adjudication (no code change): the concrete DOMException failure does not reproduce on the supported Node range. Against the exact built package at bc89e2d, Node 18.20.8, 20.20.2, and 24.15.0 all report the thrown DOMException as instanceof Error and preserve exact object identity, name=AbortError, message=Aborted, and a string stack. Metadata-absent calls also return before traversal. For a genuinely opaque instrumented throwable, we cannot prove the private callsite is absent from private/internal state without invoking user code. Returning it would reopen the round-2 confidentiality hole; wrapping String(error) would invoke the explicitly forbidden custom toString path. The accepted repair contract says privacy takes precedence for opaque surfaces and permits a conservative inert marker. Therefore the orange finding is non-actionable under the ticket contract. The two yellow packaging notes remain explicitly out of scope, and no further automated-review loop will be triggered. |
|
Closing as superseded by the plan-first Agent Map direction. Disposition: preserve the private-header, one-shot provenance, and fail-closed transport lessons. Defer implementation until there is a smaller end-to-end, plan-aware runtime reconciliation consumer. Frozen head: Replacement direction: Agent Studio: Plan-First Agent Map No branch or commit history is being deleted. Any future extraction should be proposed in a new, consumer-scoped PR. |
Summary
Add the private, versioned runtime-provenance bridge for
@sapiom/toolsagent invocations. Opaque build callsite evidence and server-signed lineage receipts stay outsideAgentRunSpec, request/result JSON, public result properties, analytics, logs, and surfaced errors. Supported v1 lineage is forwarded only when a trusted build-carried callsite and an exact SDK result reference meet at the next observed agent boundary.This is stacked on SAP-2986 / PR #755 at
ee72cd56ff34328c2ebb1701e81dcc7f80aea9ee. It intentionally excludes server minting/verification, persistence, and Phase-C projection. The current bounded-repair head isbc89e2d8cc561bbb056c130af4f5cbb64ead2c08; exact-head Node 20/22/examples CI is green; the bounded delta review is complete, with its sole orange claim rejected by exact Node 18/20/24 reproduction and the approved fail-closed contract.Changes
@sapiom/tools/_internal/agent-runtime-provenance, which may change in any releasedefaultTransport(); the core bundles an inert transport shim and never eagerly loads the other format's real client/analytics graphspec.inputonce, snapshot validated callsite scalars, consume callsite/lineage once, and expire supported handoffs after the current turnHeaders/Map/Set/Datethrough captured prototype intrinsics, preserving typed prototypes, causes, stacks, descriptors, cycles/shared references, and original graph immutability while replacing opaque/custom/accessor/symbol surfaces with inert redaction markersDetectable boundary
The SDK does not recursively infer data flow through arbitrary containers or persisted objects. A timer turn, changed identity, or an uninstrumented agent invocation prevents later forwarding; exact-reference array and
Mapreplays are covered after an uninstrumented boundary. A synchronous same-turn exact-reference array/Mapround trip is indistinguishable from a direct handoff.Testing
@sapiom/toolsJest suite: 35 suites, 645 tests passedHeaders, symbol-onlyHeaders,Map/Set, opaque custom-instance, custom-accessor, cycle/shared-reference, and original-immutability probes; poisoned instance methods/accessors remain uninvokeddist/cjs/_client/index.jsSandbox,Repository, and public HTTP error constructors; one CJS default-transport singleton@sapiom/toolstypecheck@sapiom/toolslintgit diff --checkand stacked-base diff checkRelated
Checklist