Skip to content

Commit 8f915f2

Browse files
docs(adr): ADR-0154 amendments — bounded checkpoints (D4) and the DB session seal lock (D3) (#33489)
<!-- claude-projects-attribution: {"github_login":"os-elon-musk"} --> _Requested by **Elon** · [project thread](https://claude.ai/code/project/chan_01WedDzV26nniwxv7jC88B9D?thread=cmsg_01WedDzV26nniwxv7jC88B9DXuamRUC67fx2TTYrFfyuSH)_ Part of #31908 (governed ADR amendment; seat lands) Clause-②: no Metadata-protocol: none ## 维护者速读 (Maintainer quick read) - 改了什么:只改 ADR-0154 一个文件,追加一节 2026-11-14 修订,并在状态行、D3、D4、D9 与成本行加上指向它的日期标注。原文保留不删。 - 为什么改:两条席位裁决(6884540128 的 S7、6885005594 的 E+B)改变了 D4「每链每窗口一个根」与 D3「只有集群锁」,裁决本身要求以独立的受管 PR 修订 ADR。 - 风险与回滚:纯文档,不改代码、不发布任何包。回滚即还原本 PR。 - 先看:`docs/adr/0154-audit-ledger-tamper-evidence-sealer-signed-checkpoints-amendments-verify.md` 末尾的 Amendment 节(两个小节各对应一条裁决),其次是 Consequences 的成本行标注。 - 两分钟验证:`pnpm check:adr-links && pnpm check:adr-index`,预期两者都通过、README 索引无变化。 - 需要你做的:无,席位落地。 ## What changes One file: `docs/adr/0154-audit-ledger-tamper-evidence-sealer-signed-checkpoints-amendments-verify.md`. A new section, **Amendment (2026-11-14, #31908): bounded checkpoints (D4) and the database session seal lock (D3)**, is appended at the end, in the style other records use for a dated amendment (ADR-0119, ADR-0125, ADR-0131): a status line segment, a `Status of this amendment` paragraph naming the ruling records, and the original text kept with a dated pointer in each place the amendment changes (the status line, D3's "one sealer at a time" and late-rows bullets, D4's heading, D9, and the Consequences cost line). 1. **D4, amended — ruling record 6884540128, item 1 (S7).** A chain's window seals into consecutive checkpoints of at most N = 10,000 leaves; N is a constant, not a knob. Ids are sorted, and `late` checkpoints are capped the same way. The signed body carries a part index and a final flag, so a crash mid-window resumes as `window` and the rest is never mislabelled `late`. The sealer's S1 ("not sealed twice") relaxes for parts of the same window. The verifier faults any row id two checkpoints list. This replaces D4's "one root per chain per window". - **Cost line, restated.** One checkpoint row and one `sys_secret` row per checkpoint, which is now per part: one per active chain per window (the existing "at most 24 per organization per day") while no window holds more than N rows, and one more per further block of up to N rows. The work of one checkpoint is bounded by N; what grows with a window's volume is the number of checkpoints. No new figure is introduced. 2. **D3, amended — ruling record 6885005594 (E + B).** Beside the cluster lock `audit.sealer`, a second named database session lock (the ruling's example name, `objectstack:audit-seal`), following `acquireSchemaMigrationLock` in `packages/objectql/src/schema-migration-lock.ts`: Postgres advisory lock or MySQL `GET_LOCK` on a dedicated out-of-pool connection, taken on the datasource that holds the audit rows (the hot store, where it differs from the primary). Each sealer pass try-locks it and skips while it is held; `os migrate audit-* --apply` holds it for the whole run, waiting up to a timeout longer than a normal sealer pass, then refusing. Where the lock is unavailable (it answers null on SQLite, Turso and other dialects), `--apply` on an object declaring `lifecycle.seal` is refused unless the operator passes the explicit sealer-stopped flag. Red line: never take a lock that excludes nothing and then proceed silently. The cluster lock, the unique `(chain, sequence)` index and D7's amendment-before-rewrite order stay. Options A, C and D are recorded as not taken, with the ruling's reasons. The amendment records the two rulings and adds no design of its own: names the rulings leave open (the session lock's exact key, the sealer-stopped flag's spelling, the part-index and final-flag column names) stay the build card's. ## Tests Docs only: no code, no test. The ADR gates are the verification below. ## Acceptance notes - **Changeset: none.** The diff touches only `docs/adr/**`, which publishes nothing from any package (fast-track path), so it takes the `skip-changeset` route; the area thread applies that label. - **README index unchanged.** `node scripts/adr-index.mjs` regenerates `docs/adr/README.md` byte-identical: the index row's status excerpt is truncated before the appended `Amended` segment, and the record's keyword (`Proposed`) is unchanged. - **Branch base.** Cut from `origin/main` at `0e9ff949c`; one commit behind `origin/main` at open, which touches no `docs/adr/` path. ## Verification All readings at head `96b5a0412`, a clean tree, repository `objectstack-ai/objectstack`. <details><summary>Derived gate families (dispatch-gates --commands, 21) — all exit 0</summary> ```text 0 node scripts/check-adr-links.mjs (1130 relative link destinations under docs/adr/ resolve) 0 node scripts/check-adr-links.mjs --self-test 0 node scripts/check-closing-keyword-parity.mjs (+ --self-test) 0 node scripts/check-comment-mask-corpus.mjs 0 node scripts/ci/plan-test-core-shards.mjs --self-test 0 pnpm --filter @objectstack/lint run check:doc-formula-expressions (first run exit 3 PREREQUISITE NOT MET; built formula + lint, re-run 0) 0 pnpm check:adr-anchors 0 pnpm check:adr-index (docs/adr/README.md is current, every record parsed) 0 pnpm check:adr-symbol-anchors (3592 anchors across 156 records resolve) 0 pnpm check:ci-filter-parity 0 pnpm check:closed-ceremony-text 0 pnpm check:cross-package-test-inputs 0 pnpm check:doc-authoring 0 pnpm check:driver-memory-census 0 pnpm check:gitlink-declared 0 pnpm check:nul-bytes (no raw ASCII control bytes) 0 pnpm check:pm-governed-merges 0 pnpm check:pm-prior-rulings 0 pnpm check:refd-timer-probe 0 pnpm check:watch-hint-literal dispatch-gates --ran: 21 derived, 21 run, 0 NOT-MEASURED, 0 UNRUN ``` </details> Every other family CI runs (the wide-population and roster families, the type-check lanes) is CI's; read it from this PR's check-runs. ## Human Minimum - [x] 1. Schemas start as Zod; `packages/spec` holds no runtime logic. (No code in this PR.) - [x] 2. Every name I added uses the casing for its kind. (No name is added; the amendment quotes the rulings' names.) - [x] 3. No formatter ran; `pnpm lint` passes (eslint on the changed files; the repo-wide run is CI's). (No lintable file changed.) - [x] 4. One issue, one branch off an up-to-date `main`, one pull request. (Cut from `main` at `0e9ff949c`; Part of #31908 by the seat's slicing.) - [x] 5. A change that publishes carries a changeset, and both declaration lines are filled in here and in the changeset. (This change publishes nothing: `docs/adr/**` only, the skip-changeset route; both declaration lines are above.) - [x] 6. `packages/spec` touched: its generated artifacts are regenerated and committed. (Not touched.) - [x] 7. No hand edits to `content/docs/references/`, `packages/*/CHANGELOG.md` or `content/docs/releases/`. - [x] 8. Title, body and comments are in English (the 维护者速读 block is the fleet's Chinese quick read). - [x] The *Before Submitting* list in CONTRIBUTING.md is done. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_016WV4cz2MxDkQYCC4U8indM --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent 1e77fef commit 8f915f2

1 file changed

Lines changed: 43 additions & 5 deletions

File tree

0 commit comments

Comments
 (0)