Repository navigation
feat(plugin-audit, spec): audit checkpoints verify ES256 beside Ed25519, and a host signer pins the local keys - #34506
Conversation
…, by the trusted key's type A host checkpoint signer whose KMS cannot sign Ed25519 (Azure Key Vault) can now sign ES256: the trusted key's type decides the algorithm, the key id is the SHA-256 of the key's bytes (Ed25519 raw, ES256 SPKI DER), and the ES256 signature is r||s. Anything else fails closed. Pins that a host signer which takes over keeps the local key's checkpoints trusted by pinning them. Claude-Session: https://claude.ai/code/session_01ADHkmQa4dku72AZxb8zKrX Co-authored-by: Claude <noreply@anthropic.com>
… key Claude-Session: https://claude.ai/code/session_01ADHkmQa4dku72AZxb8zKrX Co-authored-by: Claude <noreply@anthropic.com>
… pins the local keys); spec contract text and changeset Claude-Session: https://claude.ai/code/session_01ADHkmQa4dku72AZxb8zKrX Co-authored-by: Claude <noreply@anthropic.com>
📓 Docs Drift CheckThis PR changes 3 package(s): 2 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:
⛔ 2 release-owned page(s) also name something this change touched. These are read-only:
What this run could not see
Coarse fallback — 186 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): Which tree this was computed onThis run read A worktree cut from an older # while this PR is open — GitHub drops the merge commit once it closes
git fetch origin a217bdf1ccf7960105d90a82f00a18d1f8ec72f4 && git checkout a217bdf1ccf7960105d90a82f00a18d1f8ec72f4
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin bdd51769ee827b24355fa1328375bb09c05c8d65 6a9dffbae09ceb6fedbee5babc3bc2f901e7165a && git checkout -B drift-repro bdd51769ee827b24355fa1328375bb09c05c8d65 && git merge --no-ff 6a9dffbae09ceb6fedbee5babc3bc2f901e7165a
node scripts/docs-audit/affected-docs.mjs --json bdd51769ee827b24355fa1328375bb09c05c8d65
|
|
repo:objectstack#2 · os-steve · session_01ADHkmRPxhTmqbUbMrqygh4 Final head for review:
|
|
l2-review#4 · os-steve · session_01ADHkmP44onN8RMzsPMqjRq Contract-review-claim: session_01ADHkmP44onN8RMzsPMqjRq · head 6a9dffb · 2026-11-16T23:52Z |
|
repo:objectstack#2 · os-steve · session_01ADHkmQVWXw7KT8ThxT4CBy 席位核对L1 verdict: ACCEPT · PR #34506 · cards #34165 + #34166 · first review · read 2026-11-16T23:53Z Head-sha: Read from GitHub at this head ( Checklist
Spot checks (mine)
For L2 (named, not REWORK): the key-id binding ( L2 owed: yes, at Landing tier: |
|
l2-review#4 · os-steve · session_01ADHkmP44onN8RMzsPMqjRq Contract reviewServed-tier: Inputs read: cards #34165 and #34166 (bodies and every comment, rulings 6909369413 and 6909375840 included), PR #34506 body and its 8-file list, the net diff against the merge base ① Derived judgments
② Semver level
Clause-②: yes (widening) — correct, and the single arm is the right one: the diff's one accept-set change against the declared contract is the ES256 widening; the id binding is enforcement of the definition on ③ Boundary flags
④ Design judgmentNo must-fix, no should-fix.
Nits (no effect on correctness or on the contract as ruled; none needs a fix on this head):
Implemented-by: VERDICT: PASS |
|
repo:objectstack#2 · os-steve · session_01ADHkmQ2SN4K183oqAvUajA Seat record · 2026-11-16T23:59Z · Head-sha: 6a9dffb 维护者速读
席位意见:同意合并。裁决留给本卡的三个点(ES256 key id、签名编码、显式拒收)都在 PR 里定了,并各有消融用例。 席位核对
|
Requested by Steve · project thread
Fixes #34165
Fixes #34166
Clause-②: yes (widening)
Metadata-protocol: none
维护者速读
packages/plugins/plugin-audit/src/audit-seal/signature.ts(两种编码、失败即拒)、verifier.ts的SigningKeyTrust、docs/adr/0154-…md末尾的修订节。pnpm --filter @objectstack/plugin-audit exec vitest run src/audit-seal/audit-seal-verifier.test.ts,应见 54 passed,含 ES256 与「钉住旧公钥」两组新用例。What changes
#34165 — ES256 beside Ed25519 (ADR-0154 D4, amended; ruling 6909369413).
plugin-audit/src/audit-seal/signature.ts, the one place a trusted key is parsed and a signature checked. The closed pair is Ed25519 and ES256. The algorithm is the trusted key's type. Records carry no algorithm field.SigningKeyTrustnow refuses any key whose bytes do not hash to the id it was asked under, for every anchor. The local anchor and the offline bundle check already enforced this. A host anchor did not.r || s, 64 bytes (IEEE P1363). This is the JWS form that the name ES256 denotes (RFC 7518 §3.4), and what Azure Key Vault returns. AWS KMS and Vault transit return DER by default, so their signer converts before returning. A DER signature never verifies.untrusted_key: P-384, RSA, a compressed point, an Ed25519 key in SPKI form, or base64 that does not round-trip.verifier.ts(SigningKeyTrust, the one admission rule for the live check, the offline check and the redaction amendment writer) andbundle.ts(offline key admission) now go through it.objectstack.audit.proof-bundle.v1. An older reader sees an ES256 key as untrusted, which is the fail-closed direction.#34166 — a host signer pins the local keys (ADR-0154 D6, amended; ruling 6909375840). The ruling adds no fallback and exports nothing. So the framework change is the contract text in the
trustedPublicKeydocblock, the ADR note (including that a host may destroy the wrapped legacy private half at the switch), and the test the ruling names.Contract and record.
packages/spec/src/contracts/audit-checkpoint.ts: docblocks only. No type or export changes. They cover the two algorithms, the key-id and encoding rules, and the host signer's pinning duty.docs/adr/0154-…md: a dated amendment section for D4 and D6, with pointers at D4's signature bullet, D6's seam bullet and the status line.packages/cli/src/commands/audit/verify.ts: docblock and fingerprint comment only. The CLI already passes the host signer as the anchor and the--trusted-keyfingerprints as given, and neither path is algorithm-specific.Tests
All new cases sit in the shared verifier harness,
audit-seal-verifier.test.ts, as two top-leveldescribes. Every live run there is also re-judged offline from its proof bundle (--bundle --trusted-key) and must give the same report.untrusted_key(four cases).untrusted_key.untrusted_key#34166, as the ruling names it:--outbundle's keys become the host signer's pins.untrusted_keyunder the host anchor.untrusted_key.No existing test changed.
Acceptance notes
GOVERNED_APPROVERS.os audit verifywith a registered ES256 signer: proven at the plugin layer throughverifyAuditLedger({ trust }), the function the CLI's live path calls withkernel.getService('audit.checkpointSigner'). The CLI code is unchanged apart from comments, and no CLI spawn test registers a host signer. That would need a host-signer plugin in a stack fixture, and this PR adds none.SigningKeyTrustandanchoredPublicKeyOf. So it admits ES256 checkpoints the same way, and it is not separately pinned here.Verification
All readings were taken at head
6a9dffba(origin/main24b6ae55merged in), in this branch's worktree.pnpm --filter @objectstack/plugin-audit test+typecheck: lock VERDICT command-exit 0, Test Files 99/99, Tests 1665/1665.audit-seal-verifier.test.tsalone: 54/54.pnpm --filter @objectstack/spec build && … check:generated: "All 14 generated artifacts are up to date".pnpm --filter @objectstack/spec typecheck && pnpm --filter @objectstack/cli typecheck: VERDICT command-exit 0.node scripts/pm/dispatch-gates.mjs --commands: 100 derived families, all run, each:: exit 0.--ran: "100 derived famil(ies) accounted for — 100 run, 0 NOT-MEASURED". Five families first exited 3 on a missing build prerequisite or a pinned control commit outside the shallow clone. They were re-run green afterturbo run buildof their named closure and a fetch of that commit.Ablations (each through
scripts/ablation-replace.mjs: the mutation proven on disk, restored to the HEAD blobf929f9a51bc1,git diff HEADempty)The test imports
signature.tsfrom source, so no build sits between the mutation and the run.sha256(bytes) !== keyId → null): red, 2/54. Failing: "trusts no key the anchor answers under an id its bytes do not hash to" and the existing "trusts a key the bundle carries only when it hashes to the fingerprint given".untrusted_key#34166 switch case.Generated by Claude Code