Repository navigation
fix(plugin-audit): a registered audit seam that fails to resolve stops the sealer instead of falling back - #34495
Conversation
…s the sealer instead of falling back The sealer resolved audit.checkpointSigner, audit.checkpointSink and cluster through a helper that turned every resolution error into "not registered", so a host signer whose factory threw was silently replaced by the local key, a failing sink dropped the export, and a failing cluster service let the pass run on the in-process lock. It also used the sync accessor, which cannot build a factory-registered seam. Seams now resolve once per pass through the kernel's async accessor, three-state: never registered => the stand-in, as before; registered and resolved => used (factories included); registered and failing => the pass seals nothing and reports at error, naming the slot. Claude-Session: https://claude.ai/code/session_01ADHkmRPxhTmqbUbMrqygh4 Co-authored-by: Claude <noreply@anthropic.com>
📓 Docs Drift CheckThis PR changes 1 package(s): 4 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 — 12 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 10520036599bdf242ebb1eaeead9b5cc76fea424 && git checkout 10520036599bdf242ebb1eaeead9b5cc76fea424
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 495a79c7b38c82b4ca4c840b387626b6a1a4b16e 34600be3f54e9a41bffd21abc8b52ff3be4bb86c && git checkout -B drift-repro 495a79c7b38c82b4ca4c840b387626b6a1a4b16e && git merge --no-ff 34600be3f54e9a41bffd21abc8b52ff3be4bb86c
node scripts/docs-audit/affected-docs.mjs --json 495a79c7b38c82b4ca4c840b387626b6a1a4b16e
|
|
repo:objectstack#2 · os-steve · session_01ADHkmRPxhTmqbUbMrqygh4 Final head for review:
|
|
repo:objectstack#2 · os-steve · session_01ADHkmQVWXw7KT8ThxT4CBy 席位核对L1 verdict: ACCEPT · PR #34495 · card #34280 · first review · read 2026-11-16T23:51Z Head-sha: Read from GitHub at this head ( Checklist
Spot checks (mine)
Narrowing declaration: agreed, Outside this PR, owed: L2 owed: no. None of the four contract faces is touched: Landing tier: |
|
repo:objectstack#2 · os-steve · session_01ADHkmRPxhTmqbUbMrqygh4 Landing at 2026-11-16T23:52Z — L1 ACCEPT 6933008071 on head
Ready and auto-merge armed in this stroke; the merge queue lands it, and |
Requested by Steve · project thread
Fixes #34280
Clause-②: no
Metadata-protocol: none
维护者速读
packages/plugins/plugin-audit/src/audit-seal/sealer.ts的resolveSeams;packages/plugins/plugin-audit/src/audit-plugin.ts末尾的hostSeamResolver。cd packages/plugins/plugin-audit && npx vitest run src/audit-seal/audit-seal-host-seam-resolve-34280.integration.test.ts,预期 5 条全绿。What changes
audit-seal/sealer.ts: a pass resolves its three host seams (audit.checkpointSigner,audit.checkpointSink,cluster) once, at its start, inresolveSeams(). A getter that answersundefinedmeans "not registered" and keeps its stand-in (local signer, no export, in-process lock). A getter that throws means "registered and not resolvable": the pass seals nothing and reports aterror, naming the slot and the fallback it refused, once perREPORT_REPEAT_MSwhile it lasts (the sealer's existingreport()discipline). The resolved sink and cluster are handed to the lock and the object passes; the lock no longer absorbs a throwing cluster getter, and delivery no longer re-resolves the sink per checkpoint. A sink whosedeliver()fails is still only a warning, unchanged. The getters may now return a promise;AuditSealeris not exported from the package root.audit-plugin.ts:startSealerresolves each seam withhostSeamResolver, which uses the kernel's async accessor and absorbs only the branded "never registered" rejection (isServiceNotRegisteredError,@objectstack/core), the patternservice-automationalready uses fortenancy. Every other rejection propagates. The async accessor also builds a factory-registered seam, which the sync accessor refused with "is async" and the old helper read as absent. A host with no async accessor (LiteKernel, no factories) keeps the sync accessor, where "not registered" is the only fault.Tests
New
src/audit-seal/audit-seal-host-seam-resolve-34280.integration.test.ts, on a realObjectKernelwith ObjectQL over SQLite (wasm):sys_audit_signing_keyrow); no error.runPass()→ 0, no checkpoint, no local key created, exactly one error namingaudit.checkpointSignerand "does not sign with the local key"; a second pass adds no second line.audit.checkpointSink; a resolving sink factory is handed the checkpoint.cluster.Ablation (fix reverted, test kept): cases 2–5 red (
expected 1 to be +0for 2/4/5; case 3's factory leg signs under the local key), case 1 green.No existing test changed.
plugin-audit: 100 files / 1659 tests green;pnpm typecheck(incl.check:test-typecheck) green.Acceptance notes
Clause-②: no. No key, config value or service shape a host writes is refused; what changes is the reaction to a registration that already fails. A host whose signer, sink or cluster registration threw used to seal silently with the local key or without its lock and now seals nothing until it is fixed, which is the card's rule. A working host sees no change. The changeset says this in its last paragraph.packages/cli/src/utils/audit-redaction-seal.tsresolvesaudit.checkpointSigner/audit.checkpointSinkwith the same catch-all helper, so a CLI redaction run with a failing host signer falls back to the local signer inamendment-writer.ts. Handed to the seat for a follow-up card.REPORT_REPEAT_MSwhile the fault lasts, as every other sealer fault does; the test pins that a second pass inside the window adds no line.Verification
Gates per
node scripts/pm/dispatch-gates.mjs --commandsafter the last commit: see theos-dev-reportcomment on #34280.