You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
feat(receiptspec): extract public stdlib-only receipt protocol package - #34
Extract the receipt protocol into pkg/receiptspec (stdlib only). internal/receipt forwards to it via type aliases. One implementation. Wire format unchanged.
Why
The Clawdlinux operator needs the same receipt format and verifier. A second producer must not reimplement chaining or verification.
HashRecord and VerifyRecordBinding bind an arbitrary decision record to a receipt through params_sha256. No enum change. See pkg/receiptspec/DECISION.md.
cmd/agentgate-verify reads and verifies through receiptspec.
Gateway ledger builds receipts with receiptspec.Chain.
Verification
go build, go vet, gofmt clean.
go test ./...: 19 ok packages, 0 FAIL. Golden vectors and external tests unchanged and passing.
go list -deps ./pkg/receiptspec: standard library only.
Fuzz run on canonical JSON: no failures.
Follow-up
Tag v0.1.4 after merge so the operator can drop its local replace.
Move the receipt type, canonical hashing, chain and manifest verification,
and JSONL encoding into pkg/receiptspec. internal/receipt now forwards to it
with type aliases, so there is one implementation and the wire format is
unchanged. Add a Chain builder for other producers, plus HashRecord and
VerifyRecordBinding for decision records bound through params_sha256.
agentgate-verify uses receiptspec for JSONL parsing and verification.
Signed-off-by: Shreyansh Sancheti <43677304+shreyanshjain7174@users.noreply.github.com>
…und input)
Seal and Chain.Next clone DelegationChain so returned receipts never alias
caller slices. VerifyManifest and VerifyChain reject wrong-length trusted
public keys instead of panicking in ed25519.Verify. CanonicalRecord bounds raw
input at 1 MiB before decoding.
Signed-off-by: Shreyansh Sancheti <43677304+shreyanshjain7174@users.noreply.github.com>
The constructor retains the caller's mutable key slice but caches its KID. Reusing or clearing that buffer changes later signatures while the signer still reports the original KID. Receipts then fail verification against the original public key. Clone priv before computing the KID and storing the key.
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
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.
What
Extract the receipt protocol into
pkg/receiptspec(stdlib only).internal/receiptforwards to it via type aliases. One implementation. Wire format unchanged.Why
The Clawdlinux operator needs the same receipt format and verifier. A second producer must not reimplement chaining or verification.
Changes
pkg/receiptspec: Receipt, Validate, canonical hashing, Chain builder, JSONL, trust root, chain and manifest verification.HashRecordandVerifyRecordBindingbind an arbitrary decision record to a receipt throughparams_sha256. No enum change. Seepkg/receiptspec/DECISION.md.cmd/agentgate-verifyreads and verifies through receiptspec.receiptspec.Chain.Verification
go build,go vet,gofmtclean.go test ./...: 19 ok packages, 0 FAIL. Golden vectors and external tests unchanged and passing.go list -deps ./pkg/receiptspec: standard library only.Follow-up
Tag
v0.1.4after merge so the operator can drop its localreplace.