fix(attestation-envelope): bridge to audit-chain's real writeRecord() shape (v0.14.0)#31
Open
stackbilt-admin wants to merge 1 commit into
Open
fix(attestation-envelope): bridge to audit-chain's real writeRecord() shape (v0.14.0)#31stackbilt-admin wants to merge 1 commit into
stackbilt-admin wants to merge 1 commit into
Conversation
… shape (v0.14.0) AttestationEnvelope's 0.5.0 CHANGELOG entry claimed it was the "canonical shape for... audit-chain entries," but audit-chain's actual AuditRecord (record_id, namespace, event_type, hash, prev_hash, actor, timestamp, payload, metadata?) shares no field vocabulary with the envelope (traceId, tenantId, ticketRef, model, costUsd, result, sealedAt, hmac) — the claim was aspirational and had zero real consumers. Add toAuditChainWriteOptions() to bridge the two as separate layers: the envelope becomes the record's payload, with namespace/actor defaults derived from tenantId/agentId rather than forcing a field-for-field merge. Surfaced while scoping a generalized rubric-contract primitive off of evidence-core, whose src/audit/adapter.ts independently reimplements this same bridge (correctly) because no shared version existed to depend on.
Member
Author
|
Parent tracking issue for this initiative: Stackbilt-dev/aegis#699 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
AttestationEnvelope's 0.5.0 CHANGELOG entry claimed it was the "canonical shape for... audit-chain entries," but audit-chain's actualAuditRecord(record_id, namespace, event_type, hash, prev_hash, actor, timestamp, payload, metadata?) shares no field vocabulary with the envelope (traceId, tenantId, ticketRef, model, costUsd, result, sealedAt, hmac) — confirmed the claim was aspirational: zero real consumers exist, and none of the four named instances (stackd, audit-chain, reading-envelope, evals) have adopted it.toAuditChainWriteOptions(envelope, options?)to bridge the two as separate layers instead of forcing a field-for-field merge: the envelope becomes the record'spayload, withnamespace/actordefaults derived fromtenantId/agentId.Surfaced while scoping a generalized rubric-contract primitive off
@stackbilt/evidence-core, whosesrc/audit/adapter.tsindependently reimplements this exact bridge (correctly, matching audit-chain's real shape) because no shared version existed to depend on.Test plan
pnpm run typecheck— cleanpnpm run build— cleanpnpm run test:run— newtests/attestation-envelope.test.ts(8 tests) passes; no regressions in other suites (pre-existing unrelated timeouts infoodfiles-sql-diff.test.ts/generator-syntax.test.ts— slow cross-filesystem imports under WSL/mnt/c, not touched by this change)🤖 Generated with Claude Code