Repository navigation
docs(spec): freeze RECEIPT-v1 with golden vectors and version lock - #49
Merged
Merged
Conversation
Pin deterministic vectors to prevent silent v1 changes. Signed-off-by: Shreyansh Sancheti <43677304+shreyanshjain7174@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.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.
Plan
Phase 1 of the AgentGate scale-out prompt: freeze the receipt spec as the code behaves today. No Rust or v2 work starts before this is merged.
What changed
docs/spec/RECEIPT-v1.mddescribes exactly what the code does:params_sha256;§10 has a byte-level worked example produced by the code.
20 golden vectors in
pkg/receiptspec/testdata/v1/: valid chains (genesis, multi-receipt, delegation, unicode, boundary values), tampered body, reordered chain, truncated chain (middle and tail), wrong-key signature, badprev_hash, unknown signer, manifest mismatch and more. A committed generator with fixed keys rebuilds them byte for byte.TestV1GoldenVectorsruns every vector through the realReadJSONL,LoadTrustedKeysandVerifyBundle, under explicit and embedded trust.Version lock. A test hashes the canonical preimages of the
okvectors and compares them against digests the generator never writes. Any encoding change fails it, with a message to bumpformat_versionand writeRECEIPT-v2.md.The README and package docs link the spec. Production code is unchanged apart from a 2-line doc comment.
Code and doc differences found (documented, not changed)
DECISION.md.genesis-unicode-max.binactually holds seqMaxUint64.Validation
go build ./...: passedgo vet ./...: passedgo test -race ./...: passedsemgrep --config auto --error --quiet ./internal ./cmd ./pkg: passed, no findingsgit diffemptyReview
Reviewed by a second model (Claude Opus 5.5). It recomputed §10's example independently: key, key ID, 183-byte preimage, entry hash, Ed25519 signature and manifest hash all match. It also rehashed every receipt in the valid vectors. Verdict: approved, no spec errors.