GeezerVison is showing github.com — impl(fleet): stamp signature — sign/verify canonical provenance (stamp_sig, stamped_by, auth_subject), both editions (#12586) by dezren39 · Pull Request #12854 · developing-today/code
Conversation
dezren39
commented
Nov 23, 2026
•
edited by blacksmith-sh
Bot
Loading
Uh oh!
There was an error while loading. Please reload this page.
Implements #12586 — the stamp signature slice of component C (#9081), on the merged #12583 skeleton + #12584 session registry. Deliberately does NOT touch the create-path stamping endpoint (#12585) or the query/collector surfaces (#12587): this is the shared sign/verify core both consume.
What landed
src/stamp-sig.ts — canonical provenance form + Ed25519 sign/verify.
- Signed object: the block's
provenance object (the pm stack: multi-board hierarchy + full task genealogy #9060 §12 stamp set plus the §5 additive fields), stamp_sig removed. Caller-owned block fields (direct_parent, links, lineage) live outside provenance and are never inputs.
- Canonical form: deterministic JSON, JCS-shaped (RFC 8785) over the provenance value domain — keys sorted, no whitespace, nulls preserved; numbers must be safe integers and anything uncanonicalizable refuses (fail closed) rather than risk the two editions serializing it differently. Canonicalization covers every provenance key present except
stamp_sig, so a future additive fleet-owned field is signed automatically.
stamp_sig format: v1.ed25519.<kid>.<base64url sig> — self-describing; the kid is the rotation handle (verifiers hold several kids at once).
verifyStamp classification (what the collector/query path reports per pm stack: multi-board hierarchy + full task genealogy #9060 §15): verified / diverged (signature_mismatch, malformed_stamp_sig, unknown_key, unsupported_stamp_version) / unsigned (pre-signature legacy — not a forgery) / unverifiable (no keys configured — never verified).
src/config.ts — key material by name only: STAMP_SIGNING_KEY_PKCS8 / STAMP_SIGNING_KEY_ID / STAMP_VERIFY_KEYS_JSON, parsed and length-checked fail-closed (the tenancy-fixture idiom). Unconfigured signing refuses with the skeleton's 503 idiom (stamp_signing_not_configured); no key material is logged or reported anywhere.
The §8.2 build-start decision (algorithm + key custody)
Ed25519 with a dedicated service key. The design's other option — a fleet-CA-issued certificate — is not implementable at this build start: the CA program (#9155) is design + synthetic proof only, production CA generation/signing is approval-blocked there, and its baseline scheme (ML-DSA-44) has no WebCrypto implementation, so the hosted verifier could not verify it and verification would stop being edition-blind. Ed25519 is deterministic, WebCrypto-native in Workers and Node, and available to the native edition identically.
Parity
There is no native stamp implementation on main (#9073 is still open and the Metadata create layer is unimplemented — design §1), so parity is proven by construction + fixtures: the same verifyStamp code path verifies hosted-stamped and native-stamped provenances, and the tests embed byte-exact golden vectors for both editions (fixed test keys → exact canonical bytes + exact stamp_sig). Per design §6's shared-fixture discipline, these vectors are the conformance target #9073's signing hook must reproduce.
Judgment calls (also recorded on #12586)
- The §5 additive fields (
workspace_ref, auth_subject, stamped_by, stamp_sig) live inside the provenance object: §5's table is the stamp set field-by-field against the native provenance fields, stamped_by is explicitly "provenance about provenance", and one canonical object keeps the collector/DB extraction single-sourced.
- Canonical membership = every key present in
provenance except stamp_sig (not a hardcoded field list), so additive fleet-owned fields are covered without a format change.
Evidence

Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
…fy, both editions (#12586)
Implements design §4.3 layer 2 / §5 for component C of #9081: the
stamp signature over the canonical provenance object (fleet-owned
fields only; caller-owned block fields never enter it), written as
stamp_sig alongside stamped_by and auth_subject, with edition-blind
verification for the collector/query path.
Build-start decision per the §8.2 deferral: Ed25519 with a dedicated
service key. The fleet-CA-certificate option is not implementable at
this build start — the CA program (#9155) is design + synthetic proof
only with production CA signing approval-blocked, and its ML-DSA-44
baseline has no WebCrypto implementation, so the hosted verifier
could not verify it and verification would stop being edition-blind.
- src/stamp-sig.ts: deterministic canonical form (JCS-shaped over the
provenance value domain; non-integer numbers refuse), sign/verify,
stamp_sig format v1.ed25519.<kid>.<base64url sig>, and the verify
classification the collector reports per #9060 §15: verified /
diverged (signature_mismatch, malformed_stamp_sig, unknown_key,
unsupported_stamp_version) / unsigned (legacy, not a forgery) /
unverifiable (no keys configured — never verified).
- src/config.ts: stamp key material by name only (STAMP_SIGNING_KEY_
PKCS8 / STAMP_SIGNING_KEY_ID / STAMP_VERIFY_KEYS_JSON), parsed and
length-checked fail-closed like the tenancy fixture; unconfigured
signing refuses with the skeleton's 503 idiom.
- test/stamp-sig.test.ts: 14 tests including byte-exact golden
vectors for a hosted-stamped and a native-stamped provenance — the
conformance fixtures the native signing hook (#9073) must reproduce
(design §6 shared-fixture discipline). Suite 70/70, tsc clean.
Judgment calls, recorded on #12586: the §5 additive fields
(workspace_ref, auth_subject, stamped_by, stamp_sig) live inside the
provenance object (one canonical object; §5's table is the stamp set
against the native provenance fields); canonicalization covers every
provenance key present except stamp_sig, so future additive
fleet-owned fields are signed automatically.
Warning
Review limit reached
You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.
Next included review available in 44 minutes.
Check out review usage here.
View limit details
-
Limit details: You’ve used the included review currently available.
Learn how review limits work.
Review configuration:
Run configuration
-
- Source mode: Auto
- Repository: Unavailable
- Branch: Unavailable
- File: No configuration file from this repository applied
- Commit: Unavailable
- Layers: defaults
- Review profile: CHILL
- Plan: Advanced
- Run ID:
1901001a-1af0-4f90-a002-b263eee66bf8
Commits
-
Reviewing files that changed from the base of the PR and between f06c0ee and 9f59987.
Files selected for processing: 4
-
pkgs/fleet/hosted-worker/package.json
pkgs/fleet/hosted-worker/src/config.ts
pkgs/fleet/hosted-worker/src/stamp-sig.ts
pkgs/fleet/hosted-worker/test/stamp-sig.test.ts
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Share
-
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
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.
|