Repository navigation
feat(receipts): chain every signed verdict as a receipt.v1 per tenant - #12
Open
PermutationResearch wants to merge 1 commit into
Open
PermutationResearch wants to merge 1 commit into
PermutationResearch wants to merge 1 commit into
Conversation
issueSignedReceipt now writes a receipt.v1 into rep_receipt_chain in the same transaction as the signed verdict, under a per-tenant advisory lock. The receipt hash is RFC 8785 (code-point key order), so it no longer depends on the machine's locale; the existing Ed25519 envelope is unchanged. A verdict maps to gateway.verdict by service:sentinel, external false, no approval. `npm run receipts:export -- <tenant>` prints the chain for HSM-II's scripts/receipt-verify.mjs. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Each signed verdict now also writes a
receipt.v1receipt intorep_receipt_chain, in the same transaction, chained per tenant.receipt.v1is the shared decision-receipt format used by Company OS, Hearth and MailOps (HSM-IIdocs/company-os/RECEIPT_V1.md).gateway.verdictbyservice:sentinel,external: false, no approval.evidenceis the verdict'spayload_sha256.seq/preva single sequence. The table is append-only.npm run receipts:export -- <tenant>prints the chain for HSM-II'sscripts/receipt-verify.mjs.Checks
test/receipt-v1.test.ts: the hash matches the HSM-II reference vector on French and non-BMP text. It fails when key sorting is removed.ok: 3 receipts, 1 chains, 0 problems.npm run checkpasses.npm test: 689–690 of 691 pass.auth lockout: repeated bad verify tokens trigger 429also fails onmainwithout this change.proxy: strips caller cookiesfails intermittently.npm run verify:receipts-postgres. It is extended here to check the chain, its order and the append-only refusal, but no isolated test database was available locally.🤖 Generated with Claude Code