Skip to content

fix(cli): an os migrate audit-* run stops when a registered host signer or sink fails to resolve - #34569

Merged
objectstack-fleet[bot] merged 4 commits into
mainfrom
claude/project-thread-qajjjq
Nov 17, 2026
Merged

objectstack-fleet[bot] merged 4 commits into
mainfrom
claude/project-thread-qajjjq

Conversation

@objectstack-fleet

@objectstack-fleet objectstack-fleet Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

Requested by Steve · project thread

Fixes #34519

Clause-②: no
Metadata-protocol: none

维护者速读

  • 改了什么: os migrate audit-* 四个改写命令在改写已封存的行之前要先签一份修订;签名时取宿主的签名服务和导出服务。现在和封存器(audit seal: a host checkpoint signer that fails to resolve stops the sealer instead of signing with the local key #34280)一样分三种情况:没注册就用本机钥(不变);注册了能取到就用;注册了却取不到就整次运行报错退出,不改任何行。
  • 为什么改: 以前「取不到」被当成「没注册」,修订会悄悄改用本机钥签名,导出也悄悄丢掉;工厂方式注册的签名器也取不到。这和 audit seal: a host checkpoint signer that fails to resolve stops the sealer instead of signing with the local key #34280 修掉的封存器问题同一形状。
  • 风险与回滚: 只影响注册了签名器或导出服务、且注册已经坏掉的宿主:从悄悄降级变成报错退出(exit 1)。配置正常的宿主无变化。回滚即还原本 PR。
  • 先看: packages/cli/src/utils/audit-redaction-seal.ts 末尾的 hostSeam;四个命令里 await redaction.seal(...) 一行。
  • 两分钟验证: cd packages/cli && npx vitest run src/utils/audit-redaction-seal.host-seam-34519.test.ts,预期 4 条全绿。
  • 需要你做的: 无,席位落地。

What changes

  • packages/cli/src/utils/audit-redaction-seal.ts: RedactionSealRun.seal() is now async and resolves audit.checkpointSigner and audit.checkpointSink through hostSeam(): the kernel's getServiceAsync, absorbing only the branded "never registered" rejection (isServiceNotRegisteredError, @objectstack/core); every other rejection becomes Audit redaction seal: the '<slot>' service is registered but could not be resolved (<cause>) — no sealed row is amended or rewritten; the run does not <fallback> in place of a service the host registered. …, with the cause attached. A kernel with no async accessor keeps the sync read, where "not registered" is the only fault. This is the rule and the wording of PR fix(plugin-audit): a registered audit seam that fails to resolve stops the sealer instead of falling back #34495 (the sealer, audit seal: a host checkpoint signer that fails to resolve stops the sealer instead of signing with the local key #34280).
  • The four commands (audit-key-material, audit-mail-bodies, audit-metadata-bodies, audit-side-copies): const seal = await redaction.seal(stack.kernel, engine);. The call already sat inside the try whose catch prints the error (or the --json error object) and exits 1, before underAuditSealLock, so a rejection stops the run before any row is amended or rewritten.
  • content/docs/deployment/cli.mdx (Sealed audit rows): one paragraph says who signs the amendments (the host signer when registered, the local key when none) and that a signer or sink registered but not resolvable stops the run with exit 1, never falling back to the local key.

Tests

  • New src/utils/audit-redaction-seal.host-seam-34519.test.ts (real ObjectKernel service registry; the crypto composition is stubbed to "no provider", which a run survives):
    1. nothing registered: signer and sink are undefined, so the amendment writer signs with the local key, as before;
    2. a signer factory that throws: seal() rejects with the slot name, the cause and "does not sign with the local key";
    3. a sink factory that throws: seal() rejects naming audit.checkpointSink;
    4. a signer that resolves, as an instance and as a factory, is handed over.
  • audit-redaction-seal.contract.test.ts: one new pin per command: seal() is awaited exactly once, before the underAuditSealLock( hold.
  • Ablation (fix reverted, tests kept): 7 red (cases 2–4 and the four await pins), case 1 green.
  • The new test imports @objectstack/service-settings at module top, as check:test-source-alias asks (the util's static reach names it through the mocked one-shot-settings.js).
  • No existing assertion changed. packages/cli: pnpm typecheck (incl. check:test-typecheck) green; src/commands/migrate/ + the new file: 75 files, 606 passed / 8 skipped.

Acceptance notes

Verification

Gates per node scripts/pm/dispatch-gates.mjs --commands after the last commit: see the os-dev-report comment on #34519.

…er or sink fails to resolve

The redaction seal the four ledger-copy rewrites compose read
audit.checkpointSigner and audit.checkpointSink through a helper that
turned every resolution error into "not registered", so a host signer
whose factory threw was replaced by the local key for the amendments,
and a factory-registered signer was never built.

seal() now resolves both through the kernel's async accessor, three
states as the sealer does: absent => the local key / no export, as
before; registered and resolved => used; registered and failing =>
seal() rejects naming the slot, and each command, which now awaits it
before the seal-lock hold, prints the error and exits 1.

Claude-Session: https://claude.ai/code/session_01ADHkmRPxhTmqbUbMrqygh4
Co-authored-by: Claude <noreply@anthropic.com>
…redaction-seal test

Claude-Session: https://claude.ai/code/session_01ADHkmRPxhTmqbUbMrqygh4
Co-authored-by: Claude <noreply@anthropic.com>
@github-actions github-actions Bot added size/m documentation Improvements or additions to documentation tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 17, 2026
@github-actions

github-actions Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 1 package(s): @objectstack/cli, touching 11 documentable anchor(s).

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

  • content/docs/deployment/cli.mdx (via os migrate audit-key-material (command, read off packages/cli/src/commands/migrate/audit-key-material.ts), os migrate audit-mail-bodies (command, read off packages/cli/src/commands/migrate/audit-mail-bodies.ts), os migrate audit-metadata-bodies (command, read off packages/cli/src/commands/migrate/audit-metadata-bodies.ts), os migrate audit-side-copies (command, read off packages/cli/src/commands/migrate/audit-side-copies.ts))
  • content/docs/kernel/architecture.mdx (via getService (symbol, a method of interface RedactionSealKernel))
  • content/docs/kernel/cluster.mdx (via getService (symbol, a method of interface RedactionSealKernel))
  • content/docs/kernel/runtime-services/audit-service.mdx (via getService (symbol, a method of interface RedactionSealKernel))
  • content/docs/kernel/services-checklist.mdx (via getService (symbol, a method of interface RedactionSealKernel), getServiceAsync (symbol, a method of interface RedactionSealKernel))
  • content/docs/plugins/anatomy.mdx (via getService (symbol, a method of interface RedactionSealKernel))
  • content/docs/plugins/development.mdx (via getService (symbol, a method of interface RedactionSealKernel))
  • content/docs/protocol/kernel/index.mdx (via getService (symbol, a method of interface RedactionSealKernel))
  • content/docs/upgrading.mdx (via os migrate audit-key-material (command, read off packages/cli/src/commands/migrate/audit-key-material.ts), os migrate audit-side-copies (command, read off packages/cli/src/commands/migrate/audit-side-copies.ts))

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

  • content/docs/releases/v17/17-6.mdx (via os migrate audit-metadata-bodies (command, read off packages/cli/src/commands/migrate/audit-metadata-bodies.ts))
  • content/docs/releases/v17/17-7.mdx (via os migrate audit-metadata-bodies (command, read off packages/cli/src/commands/migrate/audit-metadata-bodies.ts))
  • content/docs/releases/v18/18-3.mdx (via os migrate audit-key-material (command, read off packages/cli/src/commands/migrate/audit-key-material.ts))
  • content/docs/releases/v18/18-5.mdx (via os migrate audit-side-copies (command, read off packages/cli/src/commands/migrate/audit-side-copies.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 — 37 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 1e4656d01fe485935c493a00ecdb8e0f8a0fed55 → packageMentionDocs.

Which tree this was computed on

This run read content/docs from c921368f22627666263b61209f7eac730ad7479c — the merge of head 9f6f950f35e63373def1d330eaa5acc0a166b681 into base 1e4656d01fe485935c493a00ecdb8e0f8a0fed55, 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 c921368f22627666263b61209f7eac730ad7479c && git checkout c921368f22627666263b61209f7eac730ad7479c
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 1e4656d01fe485935c493a00ecdb8e0f8a0fed55 9f6f950f35e63373def1d330eaa5acc0a166b681 && git checkout -B drift-repro 1e4656d01fe485935c493a00ecdb8e0f8a0fed55 && git merge --no-ff 9f6f950f35e63373def1d330eaa5acc0a166b681

node scripts/docs-audit/affected-docs.mjs --json 1e4656d01fe485935c493a00ecdb8e0f8a0fed55

⚠️ 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 1e4656d01fe485935c493a00ecdb8e0f8a0fed55 → 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: 9f6f950f35e63373def1d330eaa5acc0a166b681 · 2026-11-17T01:55Z

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#2 · os-steve · session_01ADHkmQVWXw7KT8ThxT4CBy

席位核对

L1 verdict: ACCEPT · PR #34569 · card #34519 · first review · read 2026-11-17T01:56Z

Head-sha: 9f6f950f35e63373def1d330eaa5acc0a166b681 (the head named in final-head comment 6935487847)

Read from GitHub at this head (get_files, diff, check-runs), not from the report.

Checklist

  • Shape: draft, base main. The body opens with the attribution lines and then Fixes #34519, and the whole card is delivered. fix(plugin-audit): a registered audit seam that fails to resolve stops the sealer instead of falling back #34495 and audit seal: a host checkpoint signer that fails to resolve stops the sealer instead of signing with the local key #34280 appear in the body without a closing verb next to them.
  • Scope: 9 files: cli/src/utils/audit-redaction-seal.ts (hostSeam, async seal), one line in each of the four migrate/audit-* commands, a new unit pin, one added case in the existing contract test, content/docs/deployment/cli.mdx, and a root changeset. No content/docs/releases/. Declared deviation accepted: the sink slot is covered beside the signer. It is the same helper and the same fault shape, and leaving it on the catch-all would keep half the defect.
  • Changeset: root, patch for @objectstack/cli (published). I checked each sentence against the diff:
    • "through a helper that turned every resolution error into 'not registered'" matches main's removed service() with a bare catch.
    • "A signer registered as a factory was never built at all" matches the old sync getService; hostSeam now uses getServiceAsync.
    • "No host signer registered still amends under the local key, and no sink exports nothing, as before" matches amendment-writer.ts:391 (this.seal.signer ?? new LocalCheckpointSigner(…)) and :429 (this.seal.sink?.deliver).
    • "stops the run before any row is amended or rewritten: it prints … and exits 1" holds: in each command the await redaction.seal(...) sits inside the try whose catch prints error.message (or the --json error) and calls this.exit(1), and it comes before underAuditSealLock(. The new contract case pins both facts per file.
  • Docs, deployment/cli.mdx (Sealed audit rows), sentence by sentence:
    • "signed by the host's checkpoint signer when the host registers one, and by the deployment's local key when it registers none" is true (amendment-writer.ts:391).
    • "a host checkpoint sink … is handed each amendment" is true (:429, kind: 'amendment').
    • "A signer or sink that is registered but cannot be resolved stops the run before any row is amended or rewritten: it prints Audit redaction seal: the '<slot>' service is registered but could not be resolved (<cause>) and exits 1" is true: the printed message starts with exactly that text, and the exit is as above.
    • "It never falls back to the local key in place of the host's signer" is true, because only isServiceNotRegisteredError maps to undefined.
  • Tests: the new audit-redaction-seal.host-seam-34519.test.ts runs on a real ObjectKernel registry with four cases: nothing registered, a throwing signer factory, a throwing sink factory, and a resolving factory signer. The report records 7 ablation reds.
  • Gates: 57 check-runs on this head, all completed: 40 success, 17 skipped, 0 failed. Lint & Repo Gates success, TypeScript Type Check success, Test Core success, Check Changeset success.

Spot checks (mine)

  1. The rule and its wording match fix(plugin-audit): a registered audit seam that fails to resolve stops the sealer instead of falling back #34495 (the sealer, audit-plugin.ts hostSeamResolver). Same branded-error discrimination and same sync fallback for a kernel with no async accessor, so the sealer and the CLI amendment path cannot drift on what "not registered" means.
  2. The error keeps the original with { cause: error }, and the slot is named in the message, so an operator sees which registration to fix.
  3. A dry run now also stops on an unresolvable host signer, because seal() is awaited before the dry/apply split. That is the conservative direction (a dry run would otherwise report decisions a real run cannot make) and needs no change.

L2 owed: no. None of the four contract faces is touched: Clause-②: no, no narrowing, no packages/spec/src/** path, no governed rule text. RedactionSealRun is a CLI-internal util type and the CLI exports no library surface.

Landing tier: check-governed-merges.mjs --pr 34569 reports NOT governed, +174/−16 = 190 lines ≤ 3000. Ordinary queue landing by the area at this head. This closes the same-family follow-up named in my ACCEPT on #34495.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#2 · os-steve · session_01ADHkmRPxhTmqbUbMrqygh4

Landing at 2026-11-17T01:57Z — L1 ACCEPT 6935518912 on head 9f6f950f35e63373def1d330eaa5acc0a166b681 (the head this lands); no L2 owed (L1 reading).

probe reading
check-governed-merges.mjs --pr 34569 NOT governed; 190 changed lines (+174 / −16) ≤ 3000
CI on the head 40 success, 17 skipped, 0 failed or pending; mergeable state clean

Ready and auto-merge armed in this stroke; the merge queue lands it, and Fixes #34519 closes the card on merge.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 17, 2026 01:58
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 17, 2026
Merged via the queue into main with commit ed45eb9 Nov 17, 2026
58 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/project-thread-qajjjq branch November 17, 2026 02:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/m tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

2 participants