Skip to content

feat(plugin-audit, spec): audit checkpoints verify ES256 beside Ed25519, and a host signer pins the local keys - #34506

Merged
os-zhuang merged 4 commits into
mainfrom
claude/project-thread-lwtcxr
Nov 17, 2026
Merged

os-zhuang merged 4 commits into
mainfrom
claude/project-thread-lwtcxr

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Steve · project thread

Fixes #34165
Fixes #34166

Clause-②: yes (widening)
Metadata-protocol: none

维护者速读

  • 改了什么:审计封印的签名器接缝除 Ed25519 外接受 ES256(P-256),算法由可信公钥的类型决定,记录里不带算法字段;主机签名器接管后,旧本地钥签的历史靠它「钉住旧公钥」继续可信。
  • 为什么改:Azure Key Vault 签不了 Ed25519,cloud#4128 的 Azure 客户无法把签名移进自己的 KMS;换签名器那天旧历史又会整体读成 untrusted_key。按你 11-16 的两条裁决做。
  • 风险与回滚:只放宽验证端,Ed25519 指纹、本地签名器、证明包 v1 都不变,旧链照旧验过;新增「公钥字节须哈希到 key id」对所有锚生效(本地锚本来就满足)。回滚=revert 本 PR。
  • 先看: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 与「钉住旧公钥」两组新用例。
  • 需要你做的:本 PR 改了 ADR(Tier H),请在审核席核过后批准合入。

What changes

#34165 — ES256 beside Ed25519 (ADR-0154 D4, amended; ruling 6909369413).

  • New internal module 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.
  • The ruling left three points to this card. This PR fixes them as follows:
    • ES256 key id: the lowercase hex SHA-256 of the key's DER SubjectPublicKeyInfo, P-256, point uncompressed (91 bytes). Ed25519 keeps the SHA-256 of its raw 32 bytes. So the key id binds the type, and for ES256 the curve too. SigningKeyTrust now 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.
    • Signature encoding: 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.
    • Explicit key-type check: the key must be raw 32 bytes (Ed25519) or a P-256 SPKI that re-encodes to exactly the bytes given. Anything else fails closed as 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) and bundle.ts (offline key admission) now go through it.
  • The bundle format stays 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 trustedPublicKey docblock, 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-key fingerprints 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-level describes. Every live run there is also re-judged offline from its proof bundle (--bundle --trusted-key) and must give the same report.

  • An ES256 host signer seals a ledger. It verifies live under the signer's anchor and offline under its fingerprint. The bundle carries the key as SPKI under the SHA-256 of those bytes.
  • A forged ES256 signature fails, and that checkpoint holds nothing.
  • The DER encoding of a valid ES256 signature fails.
  • A record signed by a P-384, RSA, compressed-P-256 or Ed25519-SPKI key that the anchor answers for is untrusted_key (four cases).
  • An Ed25519 signature, also 64 bytes, never verifies under an EC key.
  • A key answered under an id its bytes do not hash to is untrusted_key.
  • A registered host signer replaces the local trust anchor, so every checkpoint the local key signed reads untrusted_key #34166, as the ruling names it:
    1. A local-sealed chain is built, and its --out bundle's keys become the host signer's pins.
    2. The ES256 host signer seals the next window on the same chains.
    3. All six rows verify, live and offline, under both keys.
    4. A key planted after the switch (its wrapped half opens, so D6's own derivation would trust it) re-signs a checkpoint and reads untrusted_key under the host anchor.
  • A companion case: a host signer with no pins reads the local key's checkpoints untrusted_key.

No existing test changed.

Acceptance notes

  • The ADR amendment makes this PR Tier H: it lands only on an approval from GOVERNED_APPROVERS.
  • Done-when, live os audit verify with a registered ES256 signer: proven at the plugin layer through verifyAuditLedger({ trust }), the function the CLI's live path calls with kernel.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.
  • The amendment writer reads trust through the same SigningKeyTrust and anchoredPublicKeyOf. So it admits ES256 checkpoints the same way, and it is not separately pinned here.

Verification

All readings were taken at head 6a9dffba (origin/main 24b6ae55 merged 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.ts alone: 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 after turbo run build of 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 blob f929f9a51bc1, git diff HEAD empty)

The test imports signature.ts from source, so no build sits between the mutation and the run.

  1. Delete the key-id binding (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".
  2. Admit Ed25519 only (the behaviour before this PR): red, 10/54. Every ES256 case fails, and so does the A registered host signer replaces the local trust anchor, so every checkpoint the local key signed reads untrusted_key #34166 switch case.
  3. Accept a DER ES256 signature (drop the 64-byte check and pick the encoding by length): red, 1/54. Failing: "refuses a valid ES256 signature in DER encoding".
    • A first attempt that kept the length check stayed green, 54/54. The length check alone refuses DER, so that mutation removed nothing the test depends on. The re-run anchored on both lines.

Generated by Claude Code

…, 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>
… pins the local keys); spec contract text and changeset

Claude-Session: https://claude.ai/code/session_01ADHkmQa4dku72AZxb8zKrX
Co-authored-by: Claude <noreply@anthropic.com>
@github-actions

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 3 package(s): @objectstack/cli, @objectstack/plugin-audit, @objectstack/spec, touching 17 documentable anchor(s).

2 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:

  • content/docs/data-modeling/objects.mdx (via os audit verify (command, read off packages/cli/src/commands/audit/verify.ts))
  • content/docs/deployment/cli.mdx (via os audit verify (command, read off packages/cli/src/commands/audit/verify.ts))

⛔ 2 release-owned page(s) also name something this change touched. These are read-only:

  • content/docs/releases/v18/18-4.mdx (via os audit verify (command, read off packages/cli/src/commands/audit/verify.ts))
  • content/docs/releases/v18/18-5.mdx (via os audit verify (command, read off packages/cli/src/commands/audit/verify.ts))

content/docs/releases/ is RELEASE-OWNED (AGENTS.md "Documentation Guardrails"): release
notes are written centrally at release time, and a code PR that edits them is the exact PR
that guardrail exists to stop. They are still audited — read-only. If one of them is actually
wrong, file an issue or open a dedicated docs-only PR; do not edit it here.

What this run could not see
  • 3 name(s) were too generic to anchor anything (single lowercase words)
  • the SDK route bridge reached 65 of 247 client-bound route-ledger rows — the other 182 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 182: 0 are remediable by widening that discovery convention (an in-repo file declares the path; the convention did not scan it); 59 are structural — on a ledger where NOT ONE row is declared in-repo, so no discovery change reaches them at any price; 123 are undecided (no in-repo declaration, on a ledger that has other in-repo registrars — absence and an unreadable spelling are not distinguishable here). The rows themselves: node scripts/docs-audit/affected-docs.mjs --bridge-coverage
  • a page that states a rule by its inputs shares no identifier with the emitter that implements the rule, so an emitter-only diff cannot list it — not on this run and not on any run. Measured on fix(driver-sql): emit varchar(maxLength) for a text field a declared index keys on #11430: content/docs/protocol/objectql/types.mdx documents the text-family column mapping by the ObjectQL type names it maps FROM (text / textarea / html) while the diff changed createColumn; it went unlisted, and it was the page that diff falsified, in four places. No shared token exists to detect this on, so a rule your change carries has to be re-read by hand in the pages that restate it.
  • a key NAME is not a key, so the hand re-read the line above prescribes can land on the wrong schema. The same spelling is authorable on one governed type and a [REMOVED] tombstone on another for each of active, aria, joins, objects, template, tools and version (censused on [finding] tools is a key on BOTH AgentSchema (tombstoned, dead) and SkillSchema (live, cloud-attested), so a name-based search attributes skill examples to the agent key — it produced a false stop-the-line alarm on PR #19059 #19093 over the liveness ledger's governed types, top-level keys); nothing in a search result distinguishes the two, so a grep hit on a LIVE example reads as evidence about the DEAD key. Measured on fix(spec): the agent.tools liveness row says dead — it claimed live on a key the schema tombstoned #19059: content/docs/ai/agents.mdx was reported as contradicting the agent.tools tombstone over its tools: example at :161, which is inside the defineSkill({ block opened at :155 — the page was already correct. Settle ownership by PARSING the value against both schemas, never by the name: that literal PASSES SkillSchema, and as an AgentSchema it FAILS at tools with the tombstone prescription. ⛔ These names are not the whole class — a key retired through a .strict() guidance map leaves no tombstone in the walked shape and none of them here (tool.category, live as AIToolDefinition.category).

Coarse fallback — 186 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): node scripts/docs-audit/affected-docs.mjs --json bdd51769ee827b24355fa1328375bb09c05c8d65 → packageMentionDocs.

Which tree this was computed on

This run read content/docs from a217bdf1ccf7960105d90a82f00a18d1f8ec72f4 — the merge of head 6a9dffbae09ceb6fedbee5babc3bc2f901e7165a into base bdd51769ee827b24355fa1328375bb09c05c8d65, which is what actions/checkout gives a pull_request run. Not the PR head.

A worktree cut from an older main holds a different content/docs, so re-deriving there can legitimately return a different list — that is a different tree, not a wrong row. To answer on the same tree:

# 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

⚠️ That checkout carried uncommitted changes, so the commit above does not fully identify what was read.

Advisory only, and a precision-first one (#9192): a page is listed because it names a
symbol, wire route or SDK method this diff touched — not because it mentions a changed
package. Each row says which anchor put it there, so a wrong row is reportable rather than
merely annoying. To re-verify, run the docs-accuracy-audit workflow scoped to these files:
node scripts/docs-audit/affected-docs.mjs bdd51769ee827b24355fa1328375bb09c05c8d65 → pass the list as
args.docs, on the commit named under Which tree this was computed on.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#2 · os-steve · session_01ADHkmRPxhTmqbUbMrqygh4

Final head for review: 6a9dffbae09ceb6fedbee5babc3bc2f901e7165a · 2026-11-16T23:51Z

  • CI on this head: 56 success, 11 skipped, 0 failed or pending. One non-required run is cancelled: Auto Label (PR Automation run 43978145911, pull_request, cancelled by its own concurrency group); the relay's re-run fence takes only failed ci.yml / check-links.yml runs, so it stays as it is and is named here for the landing step.
  • Gates: dispatch-gates --ran 0 NOT-MEASURED (record in the dev report on The checkpoint signer seam is Ed25519-only, and Azure Key Vault cannot sign Ed25519 #34165, 6932342479).
  • Declarations: Clause-②: yes (widening), Metadata-protocol: none; governed path docs/adr/0154-* ⇒ Tier H. Sent to L1 for a first review and to the contract review.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

l2-review#4 · os-steve · session_01ADHkmP44onN8RMzsPMqjRq

Contract-review-claim: session_01ADHkmP44onN8RMzsPMqjRq · head 6a9dffb · 2026-11-16T23:52Z

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#2 · os-steve · session_01ADHkmQVWXw7KT8ThxT4CBy

席位核对

L1 verdict: ACCEPT · PR #34506 · cards #34165 + #34166 · first review · read 2026-11-16T23:53Z

Head-sha: 6a9dffbae09ceb6fedbee5babc3bc2f901e7165a (the head named in final-head comment 6933004723)

Read from GitHub at this head (get_files, diff, check-runs), not from the report. This is L1 only: L2 and the Tier H human approval are owed separately (below).

Checklist

  • Shape: draft, base main. The body opens with the attribution lines, then Fixes #34165 and Fixes #34166. Both cards are delivered as their rulings scope them. A registered host signer replaces the local trust anchor, so every checkpoint the local key signed reads untrusted_key #34166's ruling (record 6909375840, the maintainer's option A, carried by the fleet) adds no fallback and no API: its work is the trustedPublicKey contract sentence, the ADR note and the named test, and all three are here.
  • Scope: 8 files: plugin-audit signature.ts (new), verifier.ts, bundle.ts, the verifier test, spec/src/contracts/audit-checkpoint.ts (docblocks only, no type or export change), the CLI audit/verify.ts (comments only), the ADR-0154 amendment, and a root changeset. Nothing unrelated, no content/docs/releases/.
  • Changeset: root .changeset/34165-…md, patch for @objectstack/plugin-audit and @objectstack/spec. That is right for Clause-②: yes (widening) with Metadata-protocol: none (AGENTS.md: a non-protocol change ships patch). I checked each sentence against the diff:
    • "The trusted key's type decides the algorithm. A record carries no algorithm field" matches verifyAuditSignature, which branches on trusted.algorithm from auditTrustedKeyOf only.
    • "An ES256 signature is r || s, 64 bytes … A DER signature does not verify" matches the length check plus dsaEncoding: 'ieee-p1363'.
    • "Fails closed … P-384, RSA, a compressed point, an Ed25519 key in SPKI form … a key whose bytes do not hash to the id" matches the curve check, the canonical uncompressed-SPKI re-encode compare, the round-trip base64 check and the SHA-256 binding.
    • "Unchanged: Ed25519 key ids, the local signer … bundle v1" matches: the 32-byte branch builds the same JWK as main, and AUDIT_PROOF_BUNDLE_FORMAT is untouched.
    • The switching paragraph matches the new trustedPublicKey docblock and the ADR D6 amendment.
  • Tests: two new top-level describes in the shared verifier harness, and each live run there is re-judged offline from its bundle. They cover ES256 live and offline, a forged signature, DER refused, the four refused key shapes, Ed25519-under-EC refused, and an id-mismatch refused. The A registered host signer replaces the local trust anchor, so every checkpoint the local key signed reads untrusted_key #34166 switch case covers local history pinned, host seals next, all six rows trusted, and a post-switch planted key untrusted_key, plus a pins-nothing companion. Three recorded ablations went red (2/54, 10/54, 1/54). The PR body is candid that the first DER ablation stayed green and was re-anchored. The only removed test lines are two import lines; no assertion changed.
  • Gates: 68 check-runs on this head: 56 success, 11 skipped, 1 cancelled. Lint & Repo Gates success, TypeScript Type Check success, Test Core 1–8 success. The cancelled one is the non-required Auto Label (PR Automation, cancelled by its own concurrency group), named in the final-head comment. It is for the landing step to clear or account for under the true-green rule; it does not change this verdict.

Spot checks (mine)

  1. SigningKeyTrust is the one admission point for the live check, the offline bundle check (BundleCheck.publicKeyOf now calls auditTrustedKeyOf) and the amendment writer, so no second Ed25519-only path is left behind.
  2. auditTrustedKeyOf rejects before parsing (empty, non-round-trip base64, hash ≠ id), and its whole parse sits in try/catch → null, so a malformed anchor answer cannot throw out of the verifier.
  3. The ADR change is a dated amendment section plus italic pointers on D4's signature bullet, D6's seam bullet and the status line. The three removed lines are those three lines re-written with the pointer appended; no decision text is deleted.

For L2 (named, not REWORK): the key-id binding (sha256(bytes) === keyId) is now enforced for a host anchor too, where main did not check it. main's own contract text already defines AuditCheckpointSignature.keyId as "the lowercase hex SHA-256 of the raw public key", and the repo ships no host signer. So I read this as enforcing the stated contract, not a narrowing arm. The L2 record should confirm or overrule that against the Clause-②: yes (widening) declaration.

L2 owed: yes, at CONTRACT_REVIEW_TIER: packages/spec/src/contracts/audit-checkpoint.ts is a non-test packages/spec/src/** path, docs/adr/** is governed rule text, and Clause-②: yes is declared. Per the final-head comment it has already been sent to the L2 seat at this head.

Landing tier: check-governed-merges.mjs --pr 34506 reports GOVERNED, docs/adr/** ×1, so Tier H (+400/−46 = 446 lines). It lands only on an approval from GOVERNED_APPROVERS after the L2 PASS. The seat hands it off; no seat flips it ready before then.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

l2-review#4 · os-steve · session_01ADHkmP44onN8RMzsPMqjRq

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 6a9dffbae09ceb6fedbee5babc3bc2f901e7165a
Local-runs: none
Scope: packages/spec/src/contracts/audit-checkpoint.ts, docs/adr/0154-audit-ledger-tamper-evidence-sealer-signed-checkpoints-amendments-verify.md + packages/plugins/plugin-audit/src/audit-seal/signature.ts, packages/plugins/plugin-audit/src/audit-seal/verifier.ts, packages/plugins/plugin-audit/src/audit-seal/bundle.ts, packages/cli/src/commands/audit/verify.ts
Security-touching: yes

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 24b6ae55, and the check-runs on this head. Check-runs: 68, every one completed; each concludes success or skipped, except Auto Label, which was cancelled and is a labeller, not a gate. Check Changeset, Governed Surface Queue Guard, Spec property liveness, Check Documentation Links, the Test Core shards, the Type Check jobs and the Lint jobs are green. Remainder at TIER_DEFAULT for the lane seat: .changeset/34165-audit-checkpoint-es256.md (read for ② only) and audit-seal-verifier.test.ts (read only to confirm the pins the rulings name exist).

① Derived judgments

  • Verifier accept set widens: ES256 beside Ed25519. Right. A checkpoint or amendment signed by a P-256 key the anchor answers as its uncompressed-point SPKI DER, under the SHA-256 of those bytes, with an r || s signature, now verifies live, in the amendment writer and offline. On main every such record read untrusted_key. This is what ruling 6909369413 orders, and nothing wider: the pair is closed in signature.ts.
  • Ed25519 accept set under the local anchor: unchanged. Right. trustedSigningKey (signer.ts, read at head, outside the diff) answers a row's public_key only after unwrapPrivateHalf has shown it equals the canonical base64 of the derived raw 32 bytes and that the fingerprint is their SHA-256. So every key the local anchor answers passes the new admission rule, and no sealed Ed25519 chain changes its verdict.
  • Offline accept set: widens by ES256 only. Right. bundle.ts on main already required 32 bytes, a base64 round trip and the hash to equal the fingerprint; the diff routes the same three conditions through auditTrustedKeyOf and adds the SPKI form.
  • The host anchor is now also held to "key id equals SHA-256 of the key bytes" (the point L1 raised, comment 6933043525). Ruled: enforcement of a definition main already declares, not a narrowing; no Clause-②: no (narrowing) line is owed. The text read on main (packages/spec/src/contracts/audit-checkpoint.ts): AuditCheckpointSignature.keyId is "The id of the key that signed: its fingerprint, the lowercase hex SHA-256 of the raw public key", and trustedPublicKey answers "The public key (base64, raw 32 bytes) this signer vouches for under keyId". The id is defined as the hash of the key, for every signer, with no carve-out for a host signer. A host signer that answered bytes not hashing to the id was already outside the declared contract. Two further readings of main agree: its offline check already refused such a key (bundle.ts: the hash must equal the fingerprint), so a chain signed that way verified live but never from its own proof bundle, and the diff settles that disagreement on the declared side; and no shipped consumer registers a host signer (the card's Responsibility line: cloud#4128 stage 2, not yet shipped), so no installed deployment's verdict moves. The same reasoning covers the base64 round trip the host path now shares with the offline path. The changeset states the id check openly ("The id check applies to every anchor").
  • Public surface. @objectstack/spec: docblocks only in audit-checkpoint.ts; no type, export or member changes. @objectstack/plugin-audit: signature.ts is a new internal module and index.ts is not in the diff, so nothing new is exported, as ruling 6909375840 requires (trustedSigningKey stays internal). SigningKeyTrust.keys changes its value type, on a class marked internal. The proof bundle format stays objectstack.audit.proof-bundle.v1. Right.
  • Older readers. Right. main's offline check requires 32 bytes, and main's live check builds every anchor key as an Ed25519 JWK, so a reader built before this change gives an ES256 key no trust: the fail-closed direction the ruling names.

② Semver level

.changeset/34165-audit-checkpoint-es256.md: patch on @objectstack/plugin-audit and @objectstack/spec, Clause-②: yes (widening), Metadata-protocol: none. Correct against AGENTS.md rule 3: no metadata key, value or type changes, so the kind is none and the level is patch; "a non-protocol change, widening or breaking, ships patch". The CLI hunk is a docblock and a comment and publishes no behaviour. The PR body carries the same two lines. Check Changeset is green.

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 main (ruled in ①), so no narrowing arm and no BREAKING banner are owed.

③ Boundary flags

  • Dev report (The checkpoint signer seam is Ed25519-only, and Azure Key Vault cannot sign Ed25519 #34165 comment 6932342479), open_questions: none raised. security_findings: none — this review found none either.
  • Deviation, "test:repo and the cli integration tier not run locally, declared to CI": answered by the head's check-runs, all green.
  • Deviation, PR body opens with the harness attribution comment, and one report for the two folded cards: process only, no contract effect. Accepted.
  • PR acceptance note, "live os audit verify with a registered ES256 signer is proven at the plugin layer": accepted. verify.ts at head passes kernel.getService(AUDIT_CHECKPOINT_SIGNER_SERVICE) as trust to verifyAuditLedger, unchanged by this diff, and the new cases drive exactly that function with a host anchor.
  • PR acceptance note, "the amendment writer is not separately pinned": accepted. amendment-writer.ts builds its trust as new SigningKeyTrust(anchoredPublicKeyOf(engine, crypto, this.seal.signer)), the one admission rule this diff changes.
  • Ruling pins, all present in the added cases: forged ES256 fails; DER encoding fails; P-384, RSA, compressed P-256 and Ed25519-in-SPKI keys read untrusted_key; an Ed25519 signature never verifies under an EC key; a key answered under a foreign id is untrusted; and for A registered host signer replaces the local trust anchor, so every checkpoint the local key signed reads untrusted_key #34166 the three steps the ruling names (local chain, host anchor with pins takes over, old checkpoints trusted and a planted key untrusted), plus the no-pin companion.
  • SQL push-down: no query, id materialisation or in-app join is added or changed. Nothing to flag.

④ Design judgment

No must-fix, no should-fix.

packages/spec/src/contracts/audit-checkpoint.ts — holds against both rulings and against its first consumer, signature.ts and SigningKeyTrust. Sentence by sentence: the closed pair; the algorithm read from the type of the key trustedPublicKey answers, never from the record; the key id as the SHA-256 of the bytes as answered (raw 32 for Ed25519, SPKI DER for ES256); one signature encoding with DER refused; and the pinning duty of a host signer, including that an unpinned fingerprint is untrusted even when its row was planted on the host. Each is what the code at head does. The pinning paragraph is the "contract sentence in the trustedPublicKey docblock" ruling 6909375840 asks for.

docs/adr/0154-…md — holds against the rulings and against the code. The D4 amendment restates 6909369413 and fixes the three points it left to the build card (key id, signature encoding, explicit key-type check) the way the code implements them. The D6 amendment restates 6909375840, including the sentence that a host may destroy the wrapped legacy private half. The dated pointers at D4's signature bullet, D6's seam bullet and the status line resolve to the amendment heading. One claim was tested hard, "os audit verify --out ... lists each trusted fingerprint with its public key": it holds, and holds for a narrowed run too. readCheckpoints and admitAmendments check the signature of every stored checkpoint and amendment of every sealed object before any --org / --from / --to filter is applied, and the bundle's keys is the unfiltered set of keys those records named and the anchor vouched for. So a pin taken from any --out run is complete for the records then stored.

signature.ts (implementing) — agrees with the contract. One key admission function for all three readers; the id hash and the base64 round trip are checked before any parsing; 32 bytes is the only route to Ed25519 and a P-256 SPKI that re-encodes byte for byte is the only route to ES256, so the two encodings cannot be confused with each other and the key's length alone never selects ES256; every other type, curve or encoding returns no key; the verify step is chosen by the parsed key's algorithm and the ES256 path refuses any signature that is not 64 bytes. I tried the usual confusions (a key of one type answered for the other, a non-canonical or over-long encoding of an admitted key, a signature of the other algorithm or the other encoding, an id that does not bind the bytes) against the code as written and found none that the contract says is refused and the code admits.

verifier.ts, bundle.ts (implementing) — agree. SigningKeyTrust.trustedKey and BundleCheck.publicKeyOf both admit through auditTrustedKeyOf; anchoredPublicKeyOf asks the host signer alone when one is given and the local derivation otherwise, never both, which is the "no fallback" of ruling 6909375840. Docblocks match the code.

packages/cli/src/commands/audit/verify.ts (implementing) — comment and docblock only; both sentences are true of the code beside them.

Nits (no effect on correctness or on the contract as ruled; none needs a fix on this head):

  • N1 (nit) — the contract says a key is answered as "base64", and the code admits only the canonical padded spelling of it (a spelling that does not re-encode to itself is no trusted key). A signer that answers an unpadded or URL-safe spelling fails closed with untrusted_key on every record. One clause in the trustedPublicKey docblock, in a later prose pass, would save the first host implementer the surprise.
  • N2 (nit) — the D6 amendment puts in quotation marks D6's "kept for as long as any checkpoint it signed is"; D6 reads "kept for as long as any checkpoint or amendment it signed is". The meaning is unchanged.
  • N3 (nit, suggested follow-up for the cloud#4128 consumer) — the amendment says a host may destroy the wrapped legacy private half at the switch, as the ruling orders, and does not say that this makes the switch one-way on that host: if the host signer is later unregistered, the local anchor trusts none of those keys, and the local signer cannot sign while the active key row names a half that is gone (signer.ts, openPrivateHalf). The permission is the ruling's; the consequence belongs in the host's switch runbook.

Implemented-by: claude/project-thread-lwtcxr
Reviewed-by: session_01ADHkmP44onN8RMzsPMqjRq

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#2 · os-steve · session_01ADHkmQ2SN4K183oqAvUajA

Seat record · 2026-11-16T23:59Z · Head-sha: 6a9dffb

维护者速读

  • 改了什么:审计封印的签名器接缝在 Ed25519 之外接受 ES256(P-256)。用哪种算法由可信公钥的类型决定,记录里不带算法字段。主机签名器接管后,可以「钉住」旧的本地公钥,旧本地钥签的历史继续可信。
  • 为什么改:Azure Key Vault 签不了 Ed25519,cloud#4128 的 Azure 客户没法把签名移进自己的 KMS;而换签名器那天,旧历史会整体读成 untrusted_key。本 PR 照你 11-16 的两条裁决做(6909369413、6909375840)。
  • 风险与回滚:只放宽验证端。Ed25519 指纹、本地签名器、证明包 v1 都不变,旧链照旧验过。新增一条规则「公钥字节必须哈希到它的 key id」,对所有锚生效(本地锚本来就满足)。回滚即 revert。
  • 先看: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 与「钉住旧公钥」两组新用例。
  • 需要你做的:审批这个受治理 PR(Tier H,改了 ADR-0154)。L1 ACCEPT 6933043525 与达档契约复审 PASS 6933135109 都在同一 head 6a9dffba;复审判定 key id 哈希绑定是在执行既有契约,不是收窄。批准后席位落地。

席位意见:同意合并。裁决留给本卡的三个点(ES256 key id、签名编码、显式拒收)都在 PR 里定了,并各有消融用例。

席位核对

  1. 形态:两卡合一 PR(The checkpoint signer seam is Ed25519-only, and Azure Key Vault cannot sign Ed25519 #34165、A registered host signer replaces the local trust anchor, so every checkpoint the local key signed reads untrusted_key #34166 同在审计封印验证端),8 个文件 +400/−46;Clause-②: yes (widening),Metadata-protocol: none。
  2. 前提实测:两条裁决在案;spec 只改 docblock,不动类型和导出;生成物 14 项都是最新。
  3. 门禁 check-runs:head 6a9dffba 上 CI 已绿(o2-I 读数)。非必查的 Auto Label 被它自己的并发组取消,中继不让重跑,已在定稿评论 6933004723 点名,落地前处置。派生门禁 100 族,全部 exit 0,--ran 0 NOT-MEASURED。
  4. 接受的偏差:完成条件「用已注册的 ES256 签名器跑真实的 os audit verify」是在插件层用 CLI 实际调用的同一个函数证明的;CLI 代码除注释外没改,也没加 CLI 进程级测试(要加一个宿主签名器插件的 stack fixture,本 PR 不做)。L2 nit N1(trustedPublicKey 文档块可以补一句只认规范补齐的 base64)不推新 head,留到下一次文字修订。
  5. 范围外去向:同族的 CLI 签名器回退已立卡 cli audit-redaction-seal: service() swallows every getService error, so a host signer that fails to resolve silently falls back to the local key (same family as #34280) #34519(Blocked-by audit seal: a host checkpoint signer that fails to resolve stops the sealer instead of signing with the local key #34280)。
  6. 落地条款:Tier H。授权批准在案后,席位翻 ready 并经合并队列落地;两卡由 Fixes 关闭。

@objectstack-fleet objectstack-fleet Bot added the pm:awaiting-merge PR only: landing waits on the maintainer's own review and merge (SKILL.md 复核 ②); never on an issue label Nov 17, 2026
@os-zhuang
os-zhuang marked this pull request as ready for review November 17, 2026 02:10
@os-zhuang
os-zhuang added this pull request to the merge queue Nov 17, 2026
Merged via the queue into main with commit 52ec26f Nov 17, 2026
73 of 74 checks passed
@os-zhuang
os-zhuang deleted the claude/project-thread-lwtcxr branch November 17, 2026 03:00
@objectstack-fleet objectstack-fleet Bot removed the pm:awaiting-merge PR only: landing waits on the maintainer's own review and merge (SKILL.md 复核 ②); never on an issue label Nov 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

3 participants