Repository navigation
fix(plugin-audit)!: seal a window into checkpoints of at most 10,000 rows, and bound the idle re-walk (P4b2) - #33637
Conversation
…, the keyset tie arm, and one opening per checkpoint per run New pins, written before the fixes: a late checkpoint never lists a row another sealer sealed since the pass read the window's lists (N1); the seed of a checkpoint whose sequence another checkpoint holds is dropped (N2); rows of one created_at straddling the page boundary are each read once (S2 tie arm, N3); and one redaction run verifies each checkpoint and opens each seed once, while still refusing every row a checkpoint that does not verify, or whose seed does not open, lists. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WV4cz2MxDkQYCC4U8indM
…run; re-read a window's lists before a late checkpoint; drop a seed whose sequence another checkpoint holds The redaction amendment writer verified every listed checkpoint, rebuilt its root and opened its seed once per row (#32737). Each is now worked out once per checkpoint per run and reused for every row it lists, the answer that refuses included, so a checkpoint that does not verify, or whose seed does not open, still refuses every row it lists. The sealer re-read a chain's window head before a window insert only (S1). A late checkpoint now re-reads the window's checkpoints once the chain head is known and drops the rows already listed, so a row another sealer sealed in between is not listed twice (N1). When a rejected insert reads back a checkpoint at its sequence holding another seed, the seed it sealed can never be stored and is dropped rather than left an orphan (N2). Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WV4cz2MxDkQYCC4U8indM
…the package registers sys_audit_amendment too The comment still called sys_audit_amendment the one name in the group the package does not register; AuditPlugin registers and provisions it beside the checkpoints and the signing keys. Comment only. Adds the changeset for this slice. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WV4cz2MxDkQYCC4U8indM
…lt skips only its chain, sealed_through holds, verify stays loud Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WV4cz2MxDkQYCC4U8indM
…lt skips only its chain, each chain resumes from its own cursor, sealed_through holds at a skipped window Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WV4cz2MxDkQYCC4U8indM
…s crypto provider, never over an explicit one Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WV4cz2MxDkQYCC4U8indM
…s provider when the instance was composed with none Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WV4cz2MxDkQYCC4U8indM
…d AuditPlugin, real class only Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WV4cz2MxDkQYCC4U8indM
…Plugin composed with none Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WV4cz2MxDkQYCC4U8indM
…lation and the app AuditPlugin hand-over Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WV4cz2MxDkQYCC4U8indM
…er holds back Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WV4cz2MxDkQYCC4U8indM
…n recovers into window checkpoints, never late ones Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WV4cz2MxDkQYCC4U8indM
P4a merged into main as its own commit, so sealer.ts and audit-seal-sealer.test.ts conflicted. Main's copies of both are byte-identical to P4a's head (3bcc332), so this branch's version, which builds on P4a, is kept as is. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WV4cz2MxDkQYCC4U8indM
…ng fault and the bounded idle re-walk (S7, review#3 S1) Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WV4cz2MxDkQYCC4U8indM
…most 10,000 leaves, and bound the idle re-walk (S7, review#3 S1) A chain's window seals into parts cut in D1 order, each with its own seed; the signed body carries part_index and final_part. A pass that stopped mid-window resumes it as further window parts. Late sealings split the same way. The verifier faults a row id two checkpoints list. Windows that seal nothing are capped per pass at one late horizon, and the stop is reported. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WV4cz2MxDkQYCC4U8indM
…ads as one final part, and the checkpoint part columns are nullable Also regenerates the plugin-audit translation bundles for the two new checkpoint columns, and adds the changeset. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WV4cz2MxDkQYCC4U8indM
📓 Docs Drift CheckThis PR changes 1 package(s): 5 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:
⛔ 3 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 70cec0b154e7e50a57faf83bf0cc7e93a091c51e && git checkout 70cec0b154e7e50a57faf83bf0cc7e93a091c51e
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 12a0f09fca49bf90747e9cea21d566229c33de70 55dfebcfc26c1eacf0085e9813a43598222d1b10 && git checkout -B drift-repro 12a0f09fca49bf90747e9cea21d566229c33de70 && git merge --no-ff 55dfebcfc26c1eacf0085e9813a43598222d1b10
node scripts/docs-audit/affected-docs.mjs --json 12a0f09fca49bf90747e9cea21d566229c33de70
|
|
domain:server#5 · os-elon-musk · session_016WV4czXwx6JtQPvacrzzUw Seat rulings on P4b2 (A2's three questions), reviewed once before posting. 1.
2. A. 3. A, no continuity or final-part check, but fix the wording. Chain links expose a removed interior part ( |
|
Contract-review-claim: session_016WV4d1PGptBW3QRQNmy5e6 · head 0dd58a8 · 2026-11-15T03:38Z review#3. |
Contract reviewServed-tier: Read: the three commits on top of the P4b1 head ① Derived judgmentsThe parts partition the window exactly.
The two reads are consistent.
Resume after a crash between parts is correct.
The verifier.
must-fix M1: the declarations say
must-fix M2: the PR body says "Chain links already catch a removed part as a gap." That is true only of an interior part (ruling 6888674846 item 3).
The idle cap (review#3 S1 on #33503).
② Semver level
③ Boundary flags
④ Design judgmentThe design is right. Reading ids first and leaves per part keeps one checkpoint's work bounded by N, as the amended cost line says. Resuming from the newest non-final part reuses P4b1's per-chain cursor instead of adding a second mechanism. The read-then-filter through Nits:
Implemented-by: VERDICT: FAIL |
…en the two reads, an emptied last part and its resume, removed parts, the pre-amendment S1 refusal, and re-sealing after the idle cap
The seal-store testkit now judges a where the way a SQL driver does: a
comparison with a NULL column is never true, where JavaScript's null >= 0 is
true, and { $null: true } is IS NULL. Under the old testkit the S1 re-check
looked as if it refused a part 0 beside a checkpoint written before the
amendment, which SQL does not (review#3 N2).
New pins (review#3 N2, N3, N4, M2):
- a window part is refused beside a pre-amendment window checkpoint of that
window, NULL part columns (S1, N2);
- a created_at tie that straddles a part boundary cuts the same way in
either write order;
- a row deleted, or moved to another window, between the two reads is left
out of its part, and the moved row seals in its new window;
- an emptied middle part is skipped without taking its index (0, 2);
- an emptied last part leaves the window with no final part; the next pass
resumes it, and a row that arrives then is window part 1, never late;
- a removed interior part is a gap, a removed newest part is not seen by the
links and its rows read unsealed;
- after the idle cap was hit, the whole object seals again once the skipped
chain is fixed, and once its refused row is gone.
Claude-Session: https://claude.ai/code/session_016WV4cyNkH7W7e89m6j4aQq
Co-authored-by: Claude <noreply@anthropic.com>
|
Contract-review-claim: session_016WV4czb1FQB8j27FVgnMye · head ff13294 · 2026-11-15T05:16Z review#3. |
Contract reviewServed-tier: Read: the delta from my FAIL head ① Derived judgmentsThe extra fix (
M1, closed. The changeset and the PR body declare
The title and the changeset summary carry M2, closed. The PR body (Acceptance notes, N1–N4, closed.
The late-part numbering matches the #33489 line: ② Semver level
③ Boundary flags
④ Design judgmentThe design is right, and the round-2 fix makes the idle cap what round 1 judged it to be: a bound on re-reading while a chain is skipped, which delays sealing and loses nothing. The cap counts only while there is something to wait for. With no chain skipped, the walk goes on to the window that moves the floor. That is the only way the floor can move, so it is the right choice. Nit (new, does not block): N5: the changeset's verify paragraph says a removed newest part's rows "read as late and unsealed". That holds while another part of that window survives. When the removed checkpoint was the only one naming the newest window, it is head truncation, which stage 1 cannot see. The PR body says this and the changeset does not. One clause would align them. Implemented-by: VERDICT: PASS |
…erify fails on a row two checkpoints list, and what a removed checkpoint shows objects.mdx said each hour seals into one checkpoint per organization, and cli.mdx's exit code 1 named no duplicate listing: both stopped being true with the parts and the listed_twice fault. cli.mdx also says what verify shows of a removed checkpoint, interior and newest (review#3 M2). The changeset carries the Skills-docs line the (narrowing) arm owes. Claude-Session: https://claude.ai/code/session_016WV4cyNkH7W7e89m6j4aQq Co-authored-by: Claude <noreply@anthropic.com>
…-walk tests Each drives stalled(): some 200 windows sealed and signed over a dozen passes. On the green Test Core (8/8) shard at ff13294 they took 1891, 3663 and 4587 ms against vitest's 5 s default; on the loaded shard after the main merge (suite test time 140 s -> 204 s) two of them took 5596 and 6754 ms and timed out. Nothing in their import closure changed in that merge; the budget is now stated instead of borrowed from the default. Claude-Session: https://claude.ai/code/session_016WV4cyNkH7W7e89m6j4aQq Co-authored-by: Claude <noreply@anthropic.com>
|
Contract-review-claim: session_016WV4czb1FQB8j27FVgnMye · head b234eee · 2026-11-15T08:45Z review#3. |
Contract reviewServed-tier: Read: the delta from my PASS head ① Derived judgmentsThe merge changes nothing on the PR side. I compared The docs match the code and the amended ADR.
The timeouts are test-only and hide no stall.
So a longer budget weakens no check. The work is about 200 signed checkpoints and their seeds over in-memory stores, plus one verify of 200 rows. The commit message reports 1.9 to 6.8 s, so 30 s leaves roughly 4 to 5 times headroom. A non-terminating M1 (must fix):
The spelling of the line follows the rule, but the reason it gives is false. The PR is
This touches only the text of the changeset and the PR body, so the code verdict does not move. ② Semver levelUnchanged from 6889660447: ③ Boundary flags
④ Design judgmentThe design and code are as I passed them at Implemented-by: VERDICT: FAIL |
Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WV4cyNkH7W7e89m6j4aQq
…up owes in Skills-docs The eval objects-fields-relationships.json and rules/lifecycle.md still teach one checkpoint per organization per hour; skills/** changes only on a domain:skills PR, so the line reads follow-up owed instead of none. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WV4cyNkH7W7e89m6j4aQq
review#3 M1 (record 6891899947): the `Skills-docs:` declaration names the filed follow-up card instead of `follow-up owed`. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016WV4cyNkH7W7e89m6j4aQq
|
Contract-review-claim: session_016WV4czb1FQB8j27FVgnMye · head 55dfebc · 2026-11-15T10:16Z review#3. |
Contract reviewServed-tier: Read: the delta from my FAIL head ① Derived judgmentsThe merge changes nothing on the PR side. I compared M1 of 6891899947 is closed. The changeset line and the PR body line are byte-identical. Each now reads
#33773 is a proper follow-up card. It is open, filed by the fleet, and labelled N1 (nit, PR body only): the Round 2 list says "5ef334ec merges ② Semver levelThis is unchanged from 6889660447 and 6891899947: ③ Boundary flags
④ Design judgmentThe design and code are as I passed them at Implemented-by: VERDICT: PASS |
|
domain:server#5 · os-elon-musk · session_016WV4cyNkH7W7e89m6j4aQq ACCEPT · area A2 · 2026-11-15T10:50Z
|
#33637 (P4b2) landed on main as ac0b9a5 and this PR's base is now main. Two conflicts, both from P4b2 reaching main as one squash commit while this branch carries its commits: the P4b2 changeset takes main's side (main's copy is the P4b2 tip's, 55dfebc), and audit-seal-sealer.test.ts takes this branch's side (main's copy equals the merged base 5ef334e, so this branch's file is that plus the P4b3 describe). sealer.ts and seal-store.testkit.ts auto-merged to this branch's side. Claude-Session: https://claude.ai/code/session_016WV4cyNkH7W7e89m6j4aQq Co-authored-by: Claude <noreply@anthropic.com>
…LOG line, and an 18-5 page erratum (objectstack-ai#34042) <!-- claude-projects-attribution: {"github_login":"os-steve"} --> _Requested by **Steve** · [project thread](https://claude.ai/code/project/chan_01FdL1XeUyvVNxLreh3F4Qi9?thread=cmsg_01FdL1XeUyvVNxLreh3F4Qi9EaC9kmPYBDw3v97tMkTaQu)_ Fixes objectstack-ai#33903 Clause-②: no Metadata-protocol: none ## 维护者速读 - 改了什么:18.5.0 已发布但发布说明漏记的 11 条变更,补进 14 个包的 CHANGELOG 18.5.0 节(私有包 app-shell 补在它这次发的 18.4.1 节),删掉这 11 个 changeset 文件,并在 18-5 发布页加一节勘误。 - 为什么改:18.5.0 的版本提交 `b914e724` 没有消化这 11 个 changeset,代码已随 18.5.0 发出,但 CHANGELOG 和发布页都没写;其中 objectstack-ai#33637 是破坏性变化(`os audit verify` 遇到被两个 checkpoint 同时列出的行,现在报 `listed_twice` 并失败)。按裁决 6896138728「事后补就可以」只做补记。 - 风险与回滚:纯文字,不发布代码;删掉的 changeset 若留着,下一个版本会把它们当新变化再发一遍。回滚即 revert 本 PR。 - 先看:`content/docs/releases/v18/18-5.mdx` 的勘误节;`packages/plugins/plugin-audit/CHANGELOG.md`(破坏性那条);`packages/spec/CHANGELOG.md`(两条,其中一条进 Minor Changes)。 - 两分钟验证:`git grep -c -E '^- (ac0b9a5|2e1e3b9|fbe349f|2673f59|0feb5ff|1e65a38|e302d32|f8f35db|e0775f7|4b5024d|81371e1): ' -- '*CHANGELOG.md'` 预期 14 个文件共 18 行;`ls .changeset/*.md | wc -l` 比 main 少 11。 - 需要你做的:无,席位落地(Check Changeset 会按规则保持红色,见下方 DELIBERATE CORRECTION)。 ## What changes `packages/*/CHANGELOG.md` and `content/docs/releases/` are release-owned. AGENTS.md (Documentation Guardrails) routes a factual error in a released entry, or on a releases page, to a dedicated docs-only PR, and the maintainer's ruling on this card (comment 6896138728, verbatim: 「没必要,事后补就可以:让发布流程在版本提交之前还有没消化的 changeset 时,拒绝发正式版。」) keeps only the amendment half. This is that PR. Precedent: objectstack-ai#33925. The 18.5.0 version commit `b914e724` (objectstack-ai#33097) consumed 283 of the 294 changesets on its parent. The other 11 landed on `main` after the Version Packages branch point `b76df9a6` and before the merge; each one's adding commit is an ancestor of `b914e724`, and its file is byte-identical on `b914e724` and on this branch's base `bc6b7ffd`. 1. **CHANGELOG entries.** Each changeset's entry is added to the release section `b914e724` wrote for each package it names, in the stock generator's form (`- SHA7: ` + the summary, continuation lines indented two spaces), under the commit that added the changeset, in the `### Minor Changes` or `### Patch Changes` list its bump names, after the last changeset entry and before the `Updated dependencies` lines. No dependents line is invented. 2. **The 11 changeset files are deleted**, so the next version commit does not present them as new. 3. **The 18-5 page** gains `## Erratum — eleven changes 18.5.0 shipped with no CHANGELOG line [#erratum]`: objectstack-ai#33637's FROM → TO and what an operator does, one line for each of the other nine, and a pointer from the release-facts row that said 284 were consumed. objectstack-ai#33725 is already on the page (自动迁移, "Announced, not yet at any door"); it is checked, not repeated. | Changeset | Package | Added to | Commit | 18-5 page | | :--- | :--- | :--- | :--- | :--- | | `31908-p4b2-bounded-checkpoints` | `@objectstack/plugin-audit` | `## 18.5.0` › Patch Changes | `ac0b9a5` (objectstack-ai#33637) | Erratum, breaking: FROM → TO, what to do, rollback note | | `33186-managed-add-people-actions` | `@objectstack/platform-objects` | `## 18.5.0` › Patch Changes | `2e1e3b9` (objectstack-ai#33755) | Erratum, one line | | `33609-related-list-parent-lookup-page` | `@object-ui/console`, `@object-ui/plugin-detail` | `## 18.5.0` › Patch Changes | `fbe349f` (objectstack-ai#33780) | Erratum, one line | | `33649-messaging-preferences-emitting-organization` | `@objectstack/service-messaging` | `## 18.5.0` › Patch Changes | `2673f59` (objectstack-ai#33779) | Erratum, one line | | `33660-ai-model-picker-cost-multiplier` | `@objectstack/spec`, `@object-ui/plugin-chatbot`, `@object-ui/i18n`, `@object-ui/console`; `@object-ui/app-shell` | `## 18.5.0` › Patch Changes; app-shell `## 18.4.1` › Patch Changes | `0feb5ff` (objectstack-ai#33746) | Erratum, one line | | `33689-ai-action-confirmation-elicited` | `@objectstack/spec` | `## 18.5.0` › Minor Changes | `1e65a38` (objectstack-ai#33725) | Already covered (自动迁移 row), not repeated | | `33724-install-relaxes-declared-not-null` | `@objectstack/driver-sql`, `@objectstack/cloud-connection`, `@objectstack/driver-turso` | `## 18.5.0` › Patch Changes | `e302d32` (objectstack-ai#33769) | Erratum, one line | | `33739-scenario-runner-effort` | `@objectstack/scenarios` | `## 18.5.0` › Patch Changes | `f8f35db` (objectstack-ai#33767) | Erratum, one line | | `33753-scenario-dates-follow-run-date` | `@objectstack/scenarios` | `## 18.5.0` › Patch Changes | `e0775f7` (objectstack-ai#33776) | Erratum, one line | | `33754-scenario-grader-written-date` | `@objectstack/scenarios` | `## 18.5.0` › Patch Changes | `4b5024d` (objectstack-ai#33797) | Erratum, one line | | `a2-skills-docs-32678-32825` | `@objectstack/skills` | `## 18.5.0` › Patch Changes | `81371e1` (objectstack-ai#33355) | Erratum, one line | **DELIBERATE CORRECTION.** This PR adds no changeset and deletes eleven (`git diff --name-status` over `.changeset/*.md`: 11 × `D`, 0 × `A`). Each deleted note is already released: its text now stands, unchanged, as the entry named in the table above, in the 18.5.0 tarballs' release section. Under ruling D on objectstack-ai#18375 (the Check Changeset step's route 0) and `.claude/agents/os-dev.md`, `skip-changeset` is not applied to a PR that deletes an existing changeset, so `Check Changeset` stays red by design; it is not a required context. The diff publishes nothing until the next release republishes the tarballs. ## Tests No source changes, so no test suite moves. The CHANGELOG lines are generated, not hand-typed: the summary parse and the stock release-line format were re-implemented in a script and first checked against `b914e724^`: for every changeset `b914e724` consumed among the first 60 (103 package entries), the generated text is found verbatim in that package's CHANGELOG; the only miss is `31908-p4b2-bounded-checkpoints`, the unconsumed one this PR adds. The script asserts, per changeset, one adding commit, an identical blob at the tag and at the base, the release section being the top section of the version `b914e724` gave the package, and the entry not already present. The diff of every CHANGELOG is insertions only. ## Acceptance notes 1. `@object-ui/app-shell` is private and `b914e724` versioned it `18.4.1`, not `18.5.0` (the 18-5 page's release facts say so too), so its entry goes into its `## 18.4.1` section. 2. The 18-5 page still opens with "Release status: 18.4.0 is released, and 18.5.0 is not yet." and its release facts say no 18.5.0 tag or npm version exists. Both are stale since the publish. Outside this card's file surface; left for the seat (noted, not filed). 3. The changeset of objectstack-ai#33649 has no summary line, so its entry opens `- 2673f59: Clause-②: no`, as the stock generator would have written it. ## Verification <details><summary>Premise readings, at base bc6b7ff and the 18.5.0 spec tag = b914e72</summary> - `git ls-tree --name-only b914e72 .changeset/` minus `README.md` and `config.json`: 11 files, the card's list. `b914e724^` holds 294; `b914e724` deletes 283. - For each of the 11: `git rev-parse b914e72:PATH` equals `git rev-parse bc6b7ff:PATH`; the adding commit (`git log --diff-filter=A`, one per file) is an ancestor of `b914e724` (`merge-base --is-ancestor` exit 0, after deepening the shallow clone by 800 commits). The adding commits all fall between `b76df9a6` (the Version Packages branch point the 18-5 page names) and `b914e724`. - Before this PR: `listed_twice`, `ac0b9a5`, `objectstack-ai#33637` each 0 hits on `content/docs/releases/v18/18-5.mdx`. - The erratum's wording is read from the changeset text and `packages/plugins/plugin-audit/src/audit-seal/verifier.ts` (`listed_twice` fault: `checkpoint N: lists row(s) … that another checkpoint already lists`), `content/docs/deployment/cli.mdx` § `os audit verify` (exit 1 when two checkpoints list the same row), and the 18.5.0 entry `f4cafd5` (a late checkpoint leaves out every row a checkpoint stored in between already lists). </details> <details><summary>Gates</summary> Head `f5754612`. Derived with `node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack` (no paths): 99 commands, each run with stdin from `/dev/null` and its exit captured before any pipe; `--ran` reconciliation: 99 derived, 99 run, 0 NOT-MEASURED, 0 UNRUN. - 98 exit 0. Eleven of them first exited 3 (PREREQUISITE NOT MET, no `dist/` in a fresh worktree) and were re-run exit 0 after the builds they name, each under `scripts/pm/os-verify-lock.sh` with VERDICT command-exit 0: the `@objectstack/lint...` closure plus the `check:i18n` extract closure (64/64 tasks), `@objectstack/client` and `client-react` (43/43), then `pnpm build` (119/119). Re-run: `check:doc-formula-expressions`, `check:doc-security-posture`, spec `check:docs`, spec `check:skill-examples`, `check:docs-transcript-drift`, `check:i18n`, `check:dts-closure`, `check:dual-build-cjs-loads`, `check:lean-entry-closure`, `check:sourcemap-no-sources-content`; and `pnpm --dir ui exec vitest run scripts/`, which first failed 22 files only on the missing `@objectstack/spec` `dist/` and then passed (171 files passed, 2 skipped; 5,065 tests passed). - 1 exit 1, by design: `node scripts/check-empty-changeset.mjs --base origin/main` refuses the eleven deletions as edits of existing notes (one `::error` per file). This is the DELIBERATE CORRECTION class declared above; it stays red, and so does `Check Changeset`. - Release-text gates all exit 0 on the amended tree: `check-release-section-coverage` (plain and `--strict`), `check:release-notes`, `check:release-page-status`, `check-affected-docs`, `check:doc-authoring`, `check:doc-anchors`, `check:nul-bytes`, `check-adr-0087-registration --base origin/main`. `origin/main` moved to `159757ab` while the gates ran; the commits since the base `bc6b7ffd` touch none of this PR's paths (they add four other changesets), so no merge was taken. </details> --- _Generated by [Claude Code](https://claude.ai/code/session_01ADHkmPfCRZtZTTC4KzLjJR)_ 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01ADHkmPfCRZtZTTC4KzLjJR <!-- signed: domain:devx#2 · os-steve · session_01ADHkmQTVjryTSkqydKVS6z --> Co-authored-by: Claude <noreply@anthropic.com>
Requested by Elon · project thread
Part of #31908 (slice P4b2)
Blocked-by: #33489 (governed ADR-0154 amendment; merged to
mainas 8f915f2, which this branch now contains)Clause-②: yes (narrowing) — narrowed:
os audit verifyreports a row id that two checkpoints list as the new chain faultlisted_twiceand fails the run, where the 18.4.0 verifier accepted it, and the 18.4.0 sealer could write such a chain when two of its late sealings overlapped. Widened: two optional signed-body fields (part_index,final_part), two nullablesys_audit_checkpointcolumns for them, and theAuditChainFaultKindmemberlisted_twice.Metadata-protocol: none
Skills-docs: follow-up #33773 — skills/objectstack-data/evals/objects-fields-relationships.json, skills/objectstack-data/rules/lifecycle.md — both still teach that the sealer signs each
created_athour into one checkpoint per organization, where this change cuts a window into checkpoints of at most 10,000 rows each (the eval's gradedexpected_output, andlifecycle.md§ Sealing); the card also carries their older stale claim that no verifier exists, whichos audit verifyalready contradicts.skills/**is changed only on adomain:skillsPR, so this one does not edit them;content/docs/data-modeling/objects.mdxandcontent/docs/deployment/cli.mdxgain the parts, the new fault and what a removed checkpoint shows in this change.BREAKING for
os audit verifyon a chain that an 18.4.0 sealer wrote while two of its late sealings overlapped (two replicas with no cluster service, whose lock is in-process only, or a lease that lapsed). Such a chain lists one late row in two checkpoints. Verify now reports it aslisted_twiceand fails, where it passed. No tolerance and no repair ships for it (seat ruling 6888674846 item 1). A chain one sealer wrote at a time is not affected. ADR-0087 disposition, in the changeset:not-required (no-migration-prescription).@objectstack/plugin-auditstayspatch, becauseMetadata-protocol: none.Maintainer quick read
os audit verifynow fails when two checkpoints list the same row. While one organization's chain is stuck, a pass stops re-reading old windows after 168 windows that seal nothing, and once no chain is stuck the walk is not cut, so sealing catches up.linkfault. No object opts into sealing by default, so this only matters for an app that declaredlifecycle.seal.packages/plugins/plugin-audit/src/audit-seal/sealer.ts(the walk inrunand what counts toward the idle cap, the S1 re-check inwriteCheckpoint,writeChain,leavesOf), thensigned-body.ts(checkpointPartOfand the part docblocks), thenverifier.ts(listed_twiceinjudgeCheckpoint).pnpm --filter @objectstack/plugin-audit exec vitest run --maxWorkers=2 src/audit-seal/audit-seal-sealer.test.ts: expect 52 passed, including the "bounded checkpoints" and "uncounted re-walk" groups.What changes
S7: bounded checkpoints (ADR-0154 D4 as amended in #33489).
AUDIT_SEAL_MAX_LEAVES = 10_000leaves. N is a fixed exported constant, not a knob. The internalAuditSealerOptions.maxLeavesis a test seam besidenow.AuditPluginnever passes it, and the sealer is not exported from the package.(created_at, id), and each part's leaves are in that order. Each part draws its own seed (D2), so one seed still covers one checkpoint.created_at, then each part's rows by id, in$inbatches of 500, hashed under that part's seed. So one checkpoint's hashing, ids, body and memory are bounded by N. A row deleted or moved between the two reads is left out of its part.part_index(from 0) andfinal_part.sys_audit_checkpointstores them in two new nullable columns.windowcheckpoint is not final resumes that window as furtherwindowparts. They continue its part count and seal only rows no checkpoint lists yet. They are never sealed aslate.latesealings split the same way. A late part's index counts within that one late sealing (the prose line for this is on docs(adr): ADR-0154 amendments — bounded checkpoints (D4) and the DB session seal lock (D3) #33489, seat ruling 6888674846 item 2).windowpart is refused when the chain already holds a later window, a part of this window at this index or past it, or a checkpoint of this window written before the amendment (NULL part index).os audit verifyfaults a row id that two checkpoints list, as the new fault kindlisted_twice. The second listing holds nothing for that row.What verify does and does not see of a removed part (seat ruling 6888674846 item 3). Verify adds no continuity check and no final-part check. The chain links expose a removed interior part, as a
gapor alinkfault. They do not see a removed newest part; its rows are reported as late and unsealed instead, because a surviving part of the same window still names that window as sealed. A final part cannot be required, becausewriteChainskips a part whose rows all went between the two reads:part_indexcan then skip a number, and a window whose last part emptied has no final part.review#3 S1: bounded idle re-walk. The separate cap
AUDIT_SEAL_MAX_IDLE_WINDOWS_PER_PASS(168, one late horizon of windows) counts windows that seal nothing, and only while a chain is skipped in the pass. A pass that has walked that many stops walking, and the sealer reports it aterror, naming the skipped chains. With no chain skipped the walk is not cut, so it reaches the next window that seals something and the floor moves past the rest.Why the cap and not the seek. Seeking from the minimum per-chain cursor is only correct if the sealer knows every chain that still has rows. Per-chain cursors exist only for chains with a
windowcheckpoint at or past the floor. Two kinds of chain are missing from that set:Neither is recorded anywhere durable. A seek would pass over their windows, and once the floor moved their on-time rows would seal as
late. That breaks S4's rule that a skipped chain resumes "from its own oldest unsealed window" aswindowcheckpoints. The cap never changes how a row seals, only when. Its cost: after about a week of a chain that stays skipped, chains past the cap wait for it, and that is loud.The window-major pin and the no-late-sweep pin from P4b1 are unchanged and green.
Docs.
content/docs/data-modeling/objects.mdxsaid each hour seals into one checkpoint per organization; it now says one checkpoint, or consecutive checkpoints of at most 10,000 rows.content/docs/deployment/cli.mdxgains what verify shows of a removed checkpoint, and its exit code 1 entry now names a row that two checkpoints list.Spec. The signed body is declared in
plugin-audit(audit-seal/signed-body.ts), not inpackages/spec. There is no Zod schema, generated JSON schema or reference doc for it, so nothing in spec is regenerated.Round 2: what each item of review#3 got
Clause-②: yes (narrowing), carry the BREAKING banner, and the changeset holds one ADR-0087 marker,not-required (no-migration-prescription), stating that a chain sealed by 18.4.0 with overlapping late sealers now reportslisted_twice.Metadata-protocol: none, sopatch. No tolerance or heal code.part_index/final_partdocblocks and in the changeset. Pinned: a removed interior part is agap, and a removed newest part reads unsealed with no chain fault.$orgains{ window_start in this window, part_index: { $null: true } }. The seal-store testkit now judges awhereas SQL does (a comparison with a NULL column is never true, and$nullisIS NULL), so the pin is red without the arm.part_indexdocblock says the count may skip an emptied part.Skills-docs:line that the(narrowing)arm owes.mainafter fix(plugin-audit, cli): isolate audit sealer faults per chain; os serve hands its crypto provider to an app-supplied AuditPlugin #33503 merged;origin/mainis merged in (faadaaa, then 60960cd, which brings in docs(adr): ADR-0154 amendments — bounded checkpoints (D4) and the DB session seal lock (D3) #33489), and this PR's diff againstmainis P4b2 alone.mainagain (412fbf7); the full dogfood battery at 5ef334e ran green, 467 test files and 3958 tests. 55dfebc (review#3 record 6891899947, M1): the changeset'sSkills-docs:line and this body's now name the filed follow-up card, skills(objectstack-data): audit sealing still teaches one checkpoint per organization-hour; #33637 seals into parts of at most 10,000 rows #33773, in place offollow-up owedandnone.Why
Seat ruling 6884540128 item 1 (S7), with the ADR-0154 amendment in #33489. review#3's should-fix S1 on #33503 (comment 6885454935). review#3 on this PR (comment 6888713592) and seat rulings 6888674846.
Tests
Each new pin that covers new behaviour was run red before its fix.
Round 1: the pins were committed first (4827322), the implementation files were set back to the base, and the pins were run. 10 failed: the seven S7 sealer pins, the duplicate-id verifier pin, two signed-body pins, and the idle re-walk pin, which read 200 windows in one pass before the cap. The pin "a checkpoint written before the amendment still verifies" was run red against the first implementation, before the compatibility fix in 0dd58a8.
Round 2: the pins were committed first (b189644, then e930216 for one precondition) and run against the round-1 implementation, on the tree merged with
main:expected 1 to be +0: a secondwindowcheckpoint listingr1was written);expected [ 'a0', … (182) ] to deeply equal [ 'a0', … (197) ], and the same with 181 and 196: 15 of org_a's rows never sealed);New pins this round, in
audit-seal-sealer.test.ts:created_attie that straddles a part boundary cuts the same way whichever order the rows were written in: the id decides the side.windowpart 1, final, neverlate.gapfault and its rows read unsealed; a removed newest part raises no chain fault and its rows read unsealed.late, and the second case verifies ok.plugin-audit suite at f08afca, merged with main at 8f915f2 (under os-verify-lock)
The round-2 red runs, before 6bb7f49 (under os-verify-lock)
Acceptance notes
latepart counts within the one late sealing that wrote it. A second late sealing of the same window starts at 0 again. Seat ruling 6888674846 item 2 accepts this; its prose line is on docs(adr): ADR-0154 amendments — bounded checkpoints (D4) and the DB session seal lock (D3) #33489.part_indexcan skip a number. If that was the last part, the window has no final part; the next pass resumes it, and a row that arrives in it later seals as the nextwindowpart. Verify checks neither part continuity nor a final part. The chain links show a removed interior part as agaporlinkfault; they do not show a removed newest part, whose rows read unsealed instead. When the removed checkpoint was the only one naming the object's newest window, that is ADR-0154's head truncation, which this check alone cannot see.created_atortenant_id) are left out of the part. They are sealed later in their new window (aslateif that window is already sealed), or the verifier reports them.(sealed_object, chain_key, sequence)index does not cover it, because the later pass reads the chain head after the other sealer's insert.Verification
All local runs below were at head f08afca, the tree merged with
mainat 8f915f2, except the direct dependents: I ran them at ff13294 (merged withmainat d95ddeb), and the A2 landing step that mergedmainin ran them again at 60960cd, which differs from f08afca only in two docs pages and the changeset (cli unit 421 files / 5979 tests, verify 51 / 437, service-storage 86 / 1651 passed and 1 skipped, plugin-security 267 / 6681 passed and 45 skipped, service-automation 282 / 3976; all exit 0).pnpm --filter @objectstack/plugin-audit typecheck: exit 0. Tests are included throughcheck:test-typecheck.--no-inline-configon the 8 changed source and test files: exit 0.node scripts/check-test-source-alias.mjs,node scripts/check-nul-bytes.mjs: exit 0.check-adr-0087-registration --base origin/main: exit 0, one declared-breaking changeset,not-required (no-migration-prescription).check-changeset-no-major --base origin/mainwith this body as thepull_requestpayload: exit 0, "declares clause-②yes (narrowing)and metadata-protocolnone... a non-protocol change atpatch".@objectstack/plugin-audit, after building their closure:typecheckexit 0 forcli,verify,service-storage,service-automationandplugin-security. Tests:cliunit layer 421 files / 5972 tests passed (its integration layer is CI's);verify51 / 437;service-storage86 / 1641 passed, 1 skipped;plugin-security267 / 6679 passed, 45 skipped;service-automation282 / 3959. All exit 0.dispatch-gates --commands: 97 derived on this tree (the docs pages add 31 doc families), all run. 96 exit 0, includingcheck:doc-authoring, thedocs-auditchecks,check:i18n,check:dts-closureandcheck:dual-build-cjs-loads. 1 exits 3, PREREQUISITE NOT MET, so NOT MEASURED:check-plugin-teardown-shape --self-test(needs an unshallow clone; its scan is green).dispatch-gates --ranwith the exit codes: 97 derived, 96 run, 1 NOT-MEASURED, 0 UNRUN.(narrowing)arm): at ff13294,pnpm --filter @objectstack/dogfood testunder os-verify-lock gaveTest Files 467 passed | 3 skipped (470),Tests 3953 passed | 42 skipped,VERDICT command-exit 0(28m49s). NOT MEASURED at f08afca: the re-run was stopped during its closure build when the area thread asked for the report. Since ff13294 this branch gained themainmerge, two docs pages, the changeset line and the test-only b234eee, and no change to this PR's code.TypeScript Type Check,Lint & Repo Gates,Check Changeset,Build Core,Governed Surface Queue Guardand the eightTest Coreshards concluded success. The reds on b189644, faadaaa and 6bb7f49 were lanes concludedcancelledby my next push (noerror TSin those logs), not failures. CI at f08afca is in the round-2 report on plugin-audit + objectql lifecycle: build the audit tamper-evidence ADR — sealer, signed checkpoints, redaction and expiry amendments,os audit verify#31908.Human Minimum
packages/specholds no runtime logic. (spec not touched)pnpm lintis CI's).main, one pull request.packages/spectouched: n/a.content/docs/references/,packages/*/CHANGELOG.mdorcontent/docs/releases/.🤖 Generated with Claude Code
https://claude.ai/code/session_016WV4cyNkH7W7e89m6j4aQq