Skip to content

docs(adr-0067): stale rollback claims follow the code: the in-memory driver rolls back, and revert runs per item - #33465

Merged
os-zhuang merged 4 commits into
mainfrom
claude/project-thread-0ky6fu
Nov 15, 2026
Merged

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

Conversation

@objectstack-fleet

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

Copy link
Copy Markdown
Contributor

Requested by Leehom · project thread

Fixes #32504

domain:skills#1 · os-project-manager · session_01FEkQ5n1GK9KeZD8fhHUf49

Clause-②: no
Metadata-protocol: none

维护者速读

  • 改了什么:五处代码注释不再说「内存驱动不能回滚」(它用整库快照实现了 beginTransaction / rollback);ADR-0067 新增 2026-11-14 修订节,写明 revertCommit 是逐项回退、返回 reverted[] / failed[],rollbackToPackageCommit 是逐个 commit 调 revertCommit,两者都不开跨项事务;注册表同步等写后故障不进 failed[];回退一个回退 commit 目前什么也恢复不了(列为待定)。原句保留,就地加注指向修订节。
  • 为什么改:文字与 main 上的代码相反:读注释的人会以为内存驱动上的测试没测到回滚;读 ADR 的人会以为一次失败的回退不会留下「回退了一半」的包。
  • 风险与回滚:只改注释与一个 ADR 文件,不改任何行为;因注释随 .d.ts 发布,带一个三包 patch changeset;回滚即还原本 PR。
  • 先看:docs/adr/0067-commit-history-and-rollback-for-ai-authoring.md 文末「Amendment (2026-11-14, Stale rollback claims: three code comments say the in-memory driver cannot roll back, and ADR-0067 D3 calls revertCommit atomic #32504)」节,重点是「What this amendment does not decide」:是否把回退改成原子仍待你定,本 PR 不做。
  • 两分钟验证:git diff origin/main...HEAD --stat,预期 6 个文件(含一个 changeset);git grep -n "in-memory driver in tests\|against in-memory drivers" packages/ 无命中。
  • 需要你做的:受管面 Tier H(docs/adr/**):请批准或合并。

What changes

Item 1 — the in-memory driver rolls back (comments only). packages/drivers/driver-memory/src/memory-driver.ts implements beginTransaction (copies every table and record into a snapshot) and rollback (restores it), and declares no transactionsUnsupported, so driverSupportsTransactions and engineCanRollBack answer yes for it. Five docblocks said otherwise:

  • packages/spec/src/data/driver.zod.ts, driverSupportsTransactions clause 1: the in-memory driver is no longer listed among drivers with no beginTransaction; the clause says it implements one over a snapshot.
  • packages/metadata-protocol/src/sys-metadata-repository.ts, SysMetadataEngine.transaction docblock: "must not rely on rollback … against in-memory drivers" becomes "where the engine cannot roll back (engineCanRollBack answers no …)".
  • packages/metadata-protocol/src/sys-metadata-repository.ts, withTxn docblock (same file, same defect class, the docblock the card names): drops "in-memory drivers … get no rollback, which is acceptable because production always runs on a SQL driver with real ACID" — both halves are false on main (the in-memory driver rolls back; remote Turso is SQL without rollback, per the ADR-0067 2026-11-12 amendment).
  • packages/spec/src/contracts/objectql-engine.ts, EngineTransactionOptions.require docblock: the callers the no-transaction degrade suits are test doubles; "in-memory drivers" is dropped from that parenthesis (the driver implements beginTransaction).
  • packages/objectql/src/engine.ts, ObjectQL.transaction docblock: the no-rollback examples become a test double, remote Turso and OData; the in-memory driver runs the callback inside a transaction.
  • The three docblocks that now say the in-memory driver rolls back (SysMetadataEngine.transaction, withTxn, ObjectQL.transaction) carry the caveat the ADR-0067 2026-11-12 amendment records: the rollback restores the whole store to its state at begin, with no isolation, and also discards what other callers wrote since that begin (unsafe with concurrent writers). driver-memory is reachable outside tests (os serve's storage driver), so the repository docblock must not read as permission to rely on it.

Item 2 — ADR-0067 D3 (docs/adr/0067-commit-history-and-rollback-for-ai-authoring.md). No ruled sentence is deleted or rewritten:

  • Status line: a new · **Amended** (2026-11-14, #32504 — …) entry, in the form of the two before it.
  • TL;DR 3 and both D3 bullets (revertCommit, rollbackToPackageCommit): an italic *(Amended 2026-11-14: … — see the Amendment of that date at the end.)* marker appended in place, the form D2's caveat and the Costs line already use for the 2026-11-12 amendment.
  • New section ## Amendment (2026-11-14, #32504): what the two doors do on main: a per-item walk in reverse apply order; each item's row and history write in the repository's per-item withTxn; no transaction across items; an item refused, or whose removal or restore throws, goes into failed[] and the walk continues; a fault after the row write (registry write-through or heal, the projector, storage sync) does not reach failed[] and the item stays in reverted[] (one exception: an object_extension heal's store-read fault is rethrown); an item with no prevVersion is skipped, in neither list, which is every item a revert commit restored, so reverting a revert commit restores nothing today; the revert commit written from reverted[] and best effort (recordPackageCommit catches every error and returns no record; the revert then answers without revertCommitId and is on no package-commit timeline); success only when failed[] is empty and something was reverted. Then the partly-reverted shape, and what the amendment does not decide: whether revert should become atomic; whether a revert commit should carry the versions it restored, and whether post-write faults should reach failed[] (both code questions); Decision-2 and the publish door unchanged.

The rollbackToPackageCommit bullet ("as one transaction") is the same stale claim one line below the card's sentence, and TL;DR 3 names both doors, so both are marked (os-dev bounded in-place fix: same defect class, same file, mechanical, same gate families).

Acceptance notes

Every claim was read from the code on origin/main at ba35dfd7:

Claim Read from
in-memory beginTransaction / rollback over a snapshot; no transactionsUnsupported packages/drivers/driver-memory/src/memory-driver.ts (readonly supports = {}, beginTransaction, rollback)
remote Turso and OData declare no rollback packages/drivers/driver-turso/src/turso-driver.ts (transactionsUnsupported: this.transportMode === 'remote'), packages/drivers/driver-odata/src/odata-driver.ts
revertCommit opens no transaction packages/metadata-protocol/src/protocol-package-commits.ts: zero transaction / withTxn hits in the file
per-item walk in reverse apply order; per-item try/catch into failed[]; commit from reverted[]; success ProtocolPackageCommitsFacet.revertCommit (for (const it of [...items].reverse()), catch (e) pushing failed, recordPackageCommit({ items: reverted.map(…) }), success: failed.length === 0 && reverted.length > 0)
per-item write in withTxn SysMetadataRepository.restoreVersion returns this.put(…); put and delete run in this.withTxn
a fault after the row write does not reach failed[] restore limb: applyRegistryWriteThrough (protocol-registry-hydration.ts) catches and warns, its result is not read; runMutationProjector (protocol-mutation-fan-out.ts) catches and returns { success: false }, not read; ensureObjectStorage's refusal goes on advisories. Soft-remove limb: restoreArtifactRegistryView's outer catch logs ("the delete has committed and is not failed here"); its object_extension branch calls resyncStoredObjectExtensions before that try, which rethrows a store-read fault other than an unprovisioned table
an item with no prevVersion is skipped restoreToVersion is null unless existedBefore and a prevVersion; the walk has if (!it.existedBefore) and else if (restoreToVersion !== null) and no other branch. A revert commit's plan is existedBefore: r.action === 'restored', prevVersion: null; readRevertableCommit does not refuse a revert commit
rollback = one revertCommit per commit; failures collected, none stops it ProtocolPackageCommitsFacet.rollbackToPackageCommit (for (const c of toRevert), step.failed folded, catch folded)
revert commit record is best effort protocol-package-commit-record.ts recordPackageCommit (catch: unprovisioned table logs once at info, any other failure logs at error, both return null); revertCommit spreads revertCommitId only when a record came back
in-memory rollback is store-wide, no isolation memory-driver.ts rollback assigns this.db = tx.snapshot, the snapshot taken at that transaction's beginTransaction
pinned protocol.revert-stored-type-canonical.test.ts "reverts the neighbours of a refused item and reports the mix honestly"
  • docs(adr): ADR-0067 D2 says atomicity is a SQL-driver guarantee and "production is SQL", but remote Turso is SQL and cannot roll back #32480 (ADR-0067 D2 amendment) has landed; this text sits after it and does not touch it. Its "makes no statement about Decision-3's revert doors" line is the gap this amendment fills.
  • No other in-repo text repeats the stale claims: git grep -i -C2 "in-memory" over non-test packages/**/*.ts, filtered for atomic|transaction|rollback|ACID, leaves only registry-mutation comments (not drivers) and the driver's own snapshot docblock, now that objectql-engine.ts is fixed (round 1's grep missed it: a one-line pattern did not reach atomicity on the line before; content/docs/releases/ is release-owned and not touched). ADR-0067 D2's original caveat (L79) was already marked by docs(adr): ADR-0067 D2 says atomicity is a SQL-driver guarantee and "production is SQL", but remote Turso is SQL and cannot roll back #32480.
  • Not decided here: making revertCommit / rollbackToPackageCommit atomic (a behaviour change: a revert with one refused item would revert nothing). The amendment names it as open.
  • Changeset: .changeset/32504-in-memory-rollback-docblocks.md, patch for @objectstack/spec, @objectstack/objectql, @objectstack/metadata-protocol (TSDoc only; Clause-②: no, Metadata-protocol: none). The edited docblocks land in shipped dist/*.d.ts, and spec ships src/**/*.zod.ts itself (contract review 6884842817 ②). The skip-changeset label is the seat's to remove.
  • Round 2 (contract review 6884842817): ② changeset added; ④ the amendment now says the revert commit record is best effort and no longer says every returned rollback step "has recorded" its revert commit; ④ the in-memory caveat added to three docblocks; nit "reverted work" reads "rolled-back work". Outside this diff: protocol.ts's rollbackToPackageCommit docblock ("records its revert commit") has the same best-effort gap; named in the report for a follow-up (filed as docs(metadata-protocol): rollbackToPackageCommit docblock says each step records its revert commit; the record is best effort #33486).
  • Round 3 (at-tier contract review 6886701800, FAIL on 75c0229): M1 the amendment no longer says a fault after the row write reaches failed[]; it says what the code does (and the acceptance row above is corrected; round 1's row was wrong). S1 the skipped outcome is named, "cannot itself be reverted" now claims only the missing commit row, and D3's "itself revertible" is listed under "does not decide"; the D3 revertCommit marker adds "reverting a revert commit restores nothing today". S2 objectql-engine.ts fixed in place, changeset prose extended. Nits: "reverse apply order", "no package-commit timeline", and in engine.ts the rollback is now the subject of "restores". Beyond the review: the object_extension heal exception, read from resyncStoredObjectExtensions. The amendment heading now reads "reports per item" (it said "names what it could not do", which the post-write and skipped outcomes make untrue).
  • Tier: dispatch-gates --tier reads the MANDATORY contract-review tier for docs/adr/**; this card thread ran at the claim's default model. The seat's in-seat contract review is the owed record (named deviation).
  • Governed: check-governed-merges.mjs --branch claude/project-thread-0ky6fu — GOVERNED, 1 of 4 paths (docs/adr/**), landing tier H; 99 changed lines, under the 3000 threshold.

Verification

Derived gates on head 461a0de (91 of 92 exit 0, 1 NOT MEASURED)

node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack derived 92 commands; each ran with its exit captured before any pipe, after turbo run build --filter=@objectstack/metadata-protocol... --filter=@objectstack/lint... --filter=@objectstack/driver-memory... --filter=@objectstack/objectql... under the lock (VERDICT command-exit 0). --ran: "92 derived famil(ies) accounted for — 91 run, 1 NOT-MEASURED (1 DERIVED from a recorded exit 3)".

  • NOT MEASURED: pnpm check:dual-build-cjs-loads (exit 3, PREREQUISITE NOT MET: it loads every package's built entry points; no full build here). CI runs it.
  • check:dts-closure and check:sourcemap-no-sources-content exit 0 over the built packages only.
  • Typecheck on head 461a0de under the lock: @objectstack/spec, @objectstack/objectql, each VERDICT command-exit 0 (@objectstack/metadata-protocol is unchanged since 75c0229, where it was green). No package tests: comments, a changeset and ADR text only, no behaviour.
  • Earlier rounds: 86ee1df 84 derived, 83 exit 0; 75c0229 90 derived, 89 exit 0; the same one NOT MEASURED each time.
node scripts/check-adr-0087-registration.mjs --base origin/main :: exit 0
node scripts/check-adr-0087-registration.mjs --self-test :: exit 0
node scripts/check-adr-links.mjs :: exit 0
node scripts/check-adr-links.mjs --self-test :: exit 0
node scripts/check-changeset-no-major.mjs --base origin/main :: exit 0
node scripts/check-closing-keyword-parity.mjs :: exit 0
node scripts/check-closing-keyword-parity.mjs --self-test :: exit 0
node scripts/check-comment-mask-adoption.mjs :: exit 0
node scripts/check-comment-mask-adoption.mjs --self-test :: exit 0
node scripts/check-comment-mask-corpus.mjs :: exit 0
node scripts/check-dev-prereqs.mjs --self-test :: exit 0
node scripts/check-dts-emitted.mjs --self-test :: exit 0
node scripts/check-empty-changeset.mjs --base origin/main :: exit 0
node scripts/check-empty-changeset.mjs --self-test :: exit 0
node scripts/check-engine-split-ratio.mjs --self-test :: exit 0
node scripts/check-issue-citations.mjs :: exit 0
node scripts/check-plugin-teardown-shape.mjs :: exit 0
node scripts/check-plugin-teardown-shape.mjs --self-test :: exit 0
node scripts/ci/assert-turbo-remote-cache.mjs --self-test :: exit 0
node scripts/ci/plan-test-core-shards.mjs --self-test :: exit 0
node scripts/ci/prune-turbo-cache.mjs --self-test :: exit 0
node scripts/ci/snapshot-next.mjs --self-test :: exit 0
node scripts/docs-audit/check-affected-docs.mjs :: exit 0
node scripts/docs-audit/check-drift-comment.mjs :: exit 0
node scripts/pm/release-rehearsal-clone.mjs --self-test :: exit 0
node scripts/release-pending-publish.mjs --self-test :: exit 0
pnpm --filter @objectstack/lint run check:doc-formula-expressions :: exit 0
pnpm --filter @objectstack/spec run check:api-surface :: exit 0
pnpm --filter @objectstack/spec run check:authorable-surface :: exit 0
pnpm --filter @objectstack/spec run check:browser-reachable-entries :: exit 0
pnpm --filter @objectstack/spec run check:docs :: exit 0
pnpm --filter @objectstack/spec run check:dual-source-exports :: exit 0
pnpm --filter @objectstack/spec run check:duration-unit-keys :: exit 0
pnpm --filter @objectstack/spec run check:empty-state :: exit 0
pnpm --filter @objectstack/spec run check:entry-nameability :: exit 0
pnpm --filter @objectstack/spec run check:error-code-provenance :: exit 0
pnpm --filter @objectstack/spec run check:export-origins :: exit 0
pnpm --filter @objectstack/spec run check:exported-any :: exit 0
pnpm --filter @objectstack/spec run check:liveness :: exit 0
pnpm --filter @objectstack/spec run check:llms-txt :: exit 0
pnpm --filter @objectstack/spec run check:skill-refs :: exit 0
pnpm --filter @objectstack/spec run check:strictness-ledger :: exit 0
pnpm --filter @objectstack/spec run check:variant-docs :: exit 0
pnpm --filter @objectstack/spec run check:yaml-examples :: exit 0
pnpm check:adr-anchors :: exit 0
pnpm check:adr-index :: exit 0
pnpm check:adr-symbol-anchors :: exit 0
pnpm check:changeset-gate-self-tests :: exit 0
pnpm check:ci-filter-parity :: exit 0
pnpm check:closed-ceremony-text :: exit 0
pnpm check:cross-package-test-inputs :: exit 0
pnpm check:dispatcher-error-vocabulary :: exit 0
pnpm check:doc-authoring :: exit 0
pnpm check:driver-memory-census :: exit 0
pnpm check:dts-closure :: exit 0
pnpm check:dual-build-cjs-loads :: exit 3
pnpm check:durability-log-level :: exit 0
pnpm check:error-status-conformance :: exit 0
pnpm check:facade-delegation-only :: exit 0
pnpm check:gitlink-declared :: exit 0
pnpm check:init-service-contract :: exit 0
pnpm check:issue-citations :: exit 0
pnpm check:keyed-text-bounds :: exit 0
pnpm check:lean-entry-closure :: exit 0
pnpm check:logger-receiver-detach :: exit 0
pnpm check:merge-driver :: exit 0
pnpm check:nul-bytes :: exit 0
pnpm check:object-def-param-keys :: exit 0
pnpm check:optional-error-sink :: exit 0
pnpm check:org-identifier :: exit 0
pnpm check:page-declaration-shape :: exit 0
pnpm check:platform-object-tenancy-census :: exit 0
pnpm check:pm-governed-merges :: exit 0
pnpm check:pm-prior-rulings :: exit 0
pnpm check:published-files :: exit 0
pnpm check:refd-timer-probe :: exit 0
pnpm check:registry-log-declared :: exit 0
pnpm check:rest-log-spy-declared :: exit 0
pnpm check:settings-bind-window :: exit 0
pnpm check:slot-lookup :: exit 0
pnpm check:sourcemap-no-sources-content :: exit 0
pnpm check:spec-docblock-symbol-anchors :: exit 0
pnpm check:spec-parsed-alias :: exit 0
pnpm check:startup-registry-verdict :: exit 0
pnpm check:swallow-census-controls :: exit 0
pnpm check:system-context-census :: exit 0
pnpm check:test-source-alias :: exit 0
pnpm check:tier-file-adoption :: exit 0
pnpm check:undeclared-dep-imports :: exit 0
pnpm check:verify-stand-in :: exit 0
pnpm check:vouch-for-reference-callers :: exit 0
pnpm check:watch-hint-literal :: exit 0

Generated by Claude Code

…ack; revert is per item)

Three code comments said the in-memory driver cannot roll back; it
implements beginTransaction/rollback over a snapshot of its store.
ADR-0067 TL;DR 3 and D3 called revertCommit and rollbackToPackageCommit
atomic; neither opens a transaction across items. A dated amendment
records what the doors do, marking the ruled sentences in place.
Comments and ADR text only; no behaviour change.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FEkQ5n1GK9KeZD8fhHUf49
@objectstack-fleet objectstack-fleet Bot added the skip-changeset PR has no user-facing published change; bypasses the changeset gate label Nov 14, 2026
@github-actions github-actions Bot added size/m documentation Improvements or additions to documentation protocol:data labels Nov 14, 2026
@github-actions

github-actions Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 3 package(s): @objectstack/metadata-protocol, @objectstack/objectql, @objectstack/spec, touching 3 documentable anchor(s). ⚠️ 1 changed file(s) yielded no anchor (packages/spec/src/data/driver.zod.ts), so the pages documenting them are NOT COVERED by this run — this is not a clean bill of health for those files.

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

  • content/docs/concepts/metadata-lifecycle.mdx (via SysMetadataRepository (symbol, a top-level class))
What this run could not see
  • 1 changed file(s) yielded no anchor (packages/spec/src/data/driver.zod.ts) — pages documenting those are invisible to this run
  • 1 anchor(s) matched too much of the corpus to be a work list: ObjectQL (symbol, 81 pages)
  • 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 — 175 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 03dc62673e223d53dffb6b8fc619de9fbfc59dc4 → packageMentionDocs.

Which tree this was computed on

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

node scripts/docs-audit/affected-docs.mjs --json 03dc62673e223d53dffb6b8fc619de9fbfc59dc4

⚠️ 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 03dc62673e223d53dffb6b8fc619de9fbfc59dc4 → 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

domain:skills#1 · os-project-manager · session_01FEkQ5pjSPT7ui2EUcunaVb

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 86ee1dfcc3cf5ce4b33b52a6295007759af23103
Local-runs: none
Scope: packages/spec/src/data/driver.zod.ts, docs/adr/0067-commit-history-and-rollback-for-ai-authoring.md + packages/metadata-protocol/src/sys-metadata-repository.ts, packages/objectql/src/engine.ts

Read, not reviewed: on main (d683e6f, merge base ba35dfd; none of the cited code moved between them, only six added lines in protocol.ts elsewhere) packages/drivers/driver-memory/src/memory-driver.ts (beginTransaction, commit, rollback, supports), packages/core/src/utils/migration-journal.ts (engineCanRollBack), packages/metadata-protocol/src/protocol-package-commits.ts (revertCommit, rollbackToPackageCommit), protocol-package-commit-record.ts (recordPackageCommit), protocol.ts (the two door docblocks), packages/drivers/driver-odata/src/odata-driver.ts, packages/drivers/driver-turso/src/turso-driver.ts. Also card #32504 with every comment, and the check-runs on the head.

① Derived judgments

  • Accept set: none moves. All four files change only comments or ADR prose. No schema, no .describe(), no export, no authorable key, no runtime path. Right.
  • Public surface: no symbol, signature or type changes. The changed TSDoc does ship (see ②). The generated-artifact gates on the head agree that nothing generated moves. In Type Check · source gates (success), the steps "check:generated ledger", "generated reference docs are in sync with the spec" and "generated skill references are in sync" all pass. So no regenerated artifact is owed. check:api-surface (in Type Check · consumer gates) was still running at review time. The PR body records it at exit 0 locally.
  • Check-runs at review time: 15 success, 13 skipped, 20 still running (Build Core, Lint ×6, Test Core 1–8, Type Check workspace, consumer gates, debt ledger, Live E2E UI). None failed. The running ones are the merge gate. This record does not stand in for them.

② Semver level

  • Clause-②: no and Metadata-protocol: none in the PR body are right. No author-writable surface moves.
  • skip-changeset is wrong. should-fix. AGENTS.md (Post-Task Checklist, step 3) says the label "is for a diff that publishes nothing from any released package". os-dev.md L297 gives the test: published means what each package's files[] actually ships. By that test:
    • @objectstack/spec ships src/**/*.zod.ts verbatim, so the edited driver.zod.ts is itself a shipped file. driverSupportsTransactions is also exported, so its TSDoc lands in dist d.ts.
    • @objectstack/objectql ships dist. ObjectQL.transaction is public, so its docblock is in the d.ts.
    • @objectstack/metadata-protocol ships dist. SysMetadataEngine is exported from src/index.ts, so its transaction docblock is in the d.ts.
    • No package sets removeComments.
    • Precedent agrees: the metadata-protocol and objectql CHANGELOGs carry a TSDoc-only patch entry that says why in these same words ("land in the shipped dist/*.d.ts … All three packages ship dist in files[]").
    • The os-dev.md fast-track line ("注释,不发布", "comments don't publish") contradicts its own L297 test and AGENTS.md. Escalated in ③.
  • Check Changeset on the head is success, but only through the label exemption. Its job ran the live label re-read and skipped every other step. So the gate never judged this diff, and its green is not evidence either way.
  • Fix: one patch changeset for @objectstack/spec, @objectstack/objectql and @objectstack/metadata-protocol, carrying Clause-②: no and Metadata-protocol: none. Then remove skip-changeset.

③ Boundary flags

  • Dev deviation "skip-changeset … if the seat reads that as published, a patch changeset … is the fix": the seat reads it as published. See ②. Escalated to the PM/maintainer: os-dev.md's fast-track entry "注释" (comments) conflicts with AGENTS.md step 3 and with os-dev.md L297. That conflict should be ruled in one place, so the next comment-only package diff does not repeat this.
  • Dev deviation "ran at the claim's default model; the in-seat contract review is the owed record": answered. This record is that review, at CONTRACT_REVIEW_TIER.
  • Dev deviation "scope: withTxn docblock and the D3 rollbackToPackageCommit bullet": accepted. Both carry the same defect class in a file the card already names. The card's own quote for withTxn is actually the SysMetadataEngine.transaction sentence, so both docblocks had to move together. TL;DR 3 names both doors.
  • Dev deviation "HTML signature comment vs os-dev.md": not a contract matter, no finding.
  • open_questions: empty.
  • Out-of-scope "whether the revert doors should become atomic": correctly left open and named in the amendment's "does not decide". It stays with the maintainer, as the ruling says (text follows code; revert is not made atomic here).

④ Design judgment

docs/adr/0067-commit-history-and-rollback-for-ai-authoring.md

  • No ruled sentence deleted: holds. The diff has four modified lines and no removals. On each of them (status line, TL;DR 3, D3 revertCommit bullet, D3 rollbackToPackageCommit bullet), the original text survives as an exact prefix, with an italic marker or a new · **Amended** entry appended. This is the form the docs(adr): ADR-0067 D2 says atomicity is a SQL-driver guarantee and "production is SQL", but remote Turso is SQL and cannot roll back #32480 amendment already uses. Nothing else in the record claims revert atomicity unmarked. TL;DR 4's "atomic + revertible commits" is about D2's apply.
  • Amendment against revertCommit on main: holds, sentence by sentence.
    • It walks the items newest first: [...items].reverse().
    • A created item is soft-removed through repo.delete. A modified item is restored through repo.restoreVersion, which returns this.put.
    • put and delete each run in withTxn. The function opens no transaction of its own (zero hits).
    • The stored-type pre-flight pushes to failed[] with code and continues. The outer catch pushes the client-facing text and code.
    • Registry write-through, storage sync and the projector run after the row write, inside the same try. So the "row written, item still in failed[]" sentence is right.
    • The commit is built from reverted.map(…). success is true only when failed is empty and reverted is non-empty.
    • The "partly reverted" consequence is the honest one, and it matches the ObjectStackProtocolImplementation#revertCommit contract.
  • rollbackToPackageCommit marker and amendment bullet: hold.
    • Each apply commit strictly newer than the target gets one revertCommit, in listCommits order (newest first).
    • A step that throws adds one entry. A returned step's failed[] items are folded in one by one.
    • Neither stops the loop. The D3 marker "not one transaction; one revertCommit per commit, each step's failures collected" is right.
  • should-fix: "every step that returns has recorded its own revert commit" overclaims. The same applies, more softly, to "the revert commit is recorded from reverted[]". The record write is best effort. recordPackageCommit catches every error, including an unprovisioned sys_metadata_commit, logs at info or error, and returns null. revertCommit then omits revertCommitId and still returns normally. So a returned step can have recorded nothing, and that revert is then neither on the timeline nor itself revertible. That is D3's own append-only promise, in an amendment whose job is to state what the code does. Fix, in prose only: "every step that returns has attempted its own revert commit; the record is best effort (recordPackageCommit returns null, logs, and the answer omits revertCommitId, when the commit store is unprovisioned or the write fails)". protocol.ts's rollbackToPackageCommit docblock ("records its revert commit") has the same gap. It is outside this diff, so it belongs on a follow-up, not here.
  • nit: "audit rows written during reverted work still remain" uses "reverted" for transaction rollback. In an ADR about revertCommit, that reads as the revert door. Suggest "rolled-back work". Either reading is true, so this does not affect the contract.
  • D2 (docs(adr): ADR-0067 D2 says atomicity is a SQL-driver guarantee and "production is SQL", but remote Turso is SQL and cannot roll back #32480) not contradicted: holds. The new section places the per-item withTxn rollback behind "the gate of the" docs(adr): ADR-0067 D2 says atomicity is a SQL-driver guarantee and "production is SQL", but remote Turso is SQL and cannot roll back #32480 amendment (engineCanRollBack). It says it changes nothing in Decision-2 or the publish door. It fills exactly the gap docs(adr): ADR-0067 D2 says atomicity is a SQL-driver guarantee and "production is SQL", but remote Turso is SQL and cannot roll back #32480 left ("makes no statement about Decision-3's revert doors"). The new withTxn docblock's "a SQL driver is not by itself a guarantee of rollback" agrees with docs(adr): ADR-0067 D2 says atomicity is a SQL-driver guarantee and "production is SQL", but remote Turso is SQL and cannot roll back #32480's scope section. The new docblocks' "the in-memory driver rolls back" agrees with docs(adr): ADR-0067 D2 says atomicity is a SQL-driver guarantee and "production is SQL", but remote Turso is SQL and cannot roll back #32480's "The in-memory driver is not on that list".

packages/spec/src/data/driver.zod.ts: holds. Clause 1 now names a test double and a foreign engine as having no beginTransaction. It says the in-memory driver implements beginTransaction and rollback by snapshotting the whole store and restoring the snapshot. This matches memory-driver.ts: beginTransaction copies every table array and every record, rollback swaps this.db back, and supports = {}. The copy is shallow per record, not the "deep-clone" its own comment says. That is sufficient, because every write path replaces or splices records and never mutates them in place. driverSupportsTransactions answers yes for it. The sentence states mechanism only and claims no isolation.

packages/metadata-protocol/src/sys-metadata-repository.ts and packages/objectql/src/engine.ts

  • should-fix: the claims around rollback hold, but three sentences drop the caveat that docs(adr): ADR-0067 D2 says atomicity is a SQL-driver guarantee and "production is SQL", but remote Turso is SQL and cannot roll back #32480 already records. The sentences are SysMetadataEngine.transaction's "The in-memory driver rolls back, by restoring a snapshot of its whole store", withTxn's "the in-memory driver does roll back", and ObjectQL.transaction's "so the callback runs inside a transaction there".
    • What the memory driver actually guarantees: rollback restores the whole store to its state at begin, and nothing more.
    • No isolation: uncommitted writes are visible to every reader at once.
    • No safety for concurrent writers: each beginTransaction takes its own whole-store snapshot. So a rollback also discards what other callers wrote, committed or not, between that begin and the rollback. That includes another engine.transaction() that already committed.
    • Nesting through the engine is not exposed, because D2 joins the ambient transaction, so a nested driver begin does not arise there.
    • This matters because driver-memory is not test-only (packages/cli/src/commands/serve.ts and utils/storage-driver.ts reach it). Also, the repository docblock now reads as permission to rely on rollback for correctness on it.
    • Fix, comments only: append the docs(adr): ADR-0067 D2 says atomicity is a SQL-driver guarantee and "production is SQL", but remote Turso is SQL and cannot roll back #32480 amendment's own caveat to those three sentences, for example "the whole store, to its state at begin: no isolation, and a rollback also discards what other callers wrote meanwhile".
  • Everything else in these two files holds:
    • withTxn calls engine.transaction whenever the method exists, and ObjectQL.transaction degrades on driverSupportsTransactions false. So "a test fake with no transaction, and an engine whose driver cannot roll back … get no rollback: the degrade ADR-0119 D1 declares" is accurate.
    • engineCanRollBack's two driver arms are named correctly.
    • The examples are correct: remote Turso declares transactionsUnsupported when remote, and OData declares it unconditionally and refuses beginTransaction.
    • Dropping "production always runs on a SQL driver with real ACID" is right. Remote Turso is SQL and cannot roll back.

Implemented-by: claude/project-thread-0ky6fu
Reviewed-by: session_01FEkQ5pjSPT7ui2EUcunaVb

VERDICT: PASS

Adopted by the seat 2026-11-14T21:59Z · isolated sub-agent at CONTRACT_REVIEW_TIER · Ruling-ref: Leehom card cmsg_01TenzsRopZj4jMbvjX8uz1XFhuiZmTH8VFgMmHRmpiGAb, option A, tapped 2026-11-14T15:37Z

…with no isolation; patch changeset

The ADR-0067 2026-11-14 amendment now says the revert commit record is
best effort (recordPackageCommit returns no record on an unprovisioned
or failed write, and the revert answers without revertCommitId), and
reads rolled-back for the carve-out's audit rows. The three transaction
docblocks add the in-memory driver's caveat: the rollback restores the
whole store to its state at begin, with no isolation, and discards other
callers' writes since then. The edited TSDoc ships in published d.ts, so
one patch changeset covers spec, objectql and metadata-protocol.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FEkQ5n1GK9KeZD8fhHUf49
@github-actions github-actions Bot added the tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface label Nov 14, 2026
@objectstack-fleet objectstack-fleet Bot removed the skip-changeset PR has no user-facing published change; bypasses the changeset gate label Nov 14, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:skills#1 · os-project-manager · session_01FEkQ5pjSPT7ui2EUcunaVb

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 75c0229004fabf0b7a1d1fa46e2b41e1764c2ccf
Local-runs: none
Scope: packages/spec/src/data/driver.zod.ts, docs/adr/0067-commit-history-and-rollback-for-ai-authoring.md + packages/objectql/src/engine.ts, packages/metadata-protocol/src/sys-metadata-repository.ts

Delta review. The previous record (comment 6884842817) was a PASS on 86ee1dfc with should-fix findings. This record judges the fix delta 86ee1dfc..75c02290 (one commit, four files) on top of it. The new .changeset/32504-in-memory-rollback-docblocks.md is judged under ② only.

Read, not reviewed: on main (b392ff7; merge base still ba35dfd7, and none of the cited code moved between them) packages/drivers/driver-memory/src/memory-driver.ts (beginTransaction, commit, rollback, idCounters), packages/metadata-protocol/src/protocol-package-commit-record.ts (recordPackageCommit), packages/metadata-protocol/src/protocol-package-commits.ts (revertCommit, rollbackToPackageCommit), packages/objectql/src/engine-transactions-section.ts (the transaction body). Also card #32504 with every comment, the PR body, labels and file list, and the check-runs on the head (including the Check Changeset job's steps).

Delta

  • ② skip-changeset on a diff that publishes (should-fix): fixed. The label is gone (labels now: documentation, size/m, tooling, protocol:data). The new changeset is patch for @objectstack/spec, @objectstack/objectql and @objectstack/metadata-protocol, and carries Clause-②: no and Metadata-protocol: none. Check Changeset on the head now really ran: "Require a changeset", "Reject an empty-frontmatter changeset", "Require an ADR-0087 disposition" and the major-bump guard all succeeded, and the label-window step was skipped. See ②.
  • ④ ADR amendment: "every step that returns has recorded its own revert commit" overclaims (should-fix): fixed. The rollbackToPackageCommit bullet now says "has attempted its own revert commit, best effort as above". The revertCommit bullet now says "written from reverted[]". A new bullet, "The revert commit itself is best effort", states the null path. The "partly reverted" paragraph now says "(and recorded, where the record write lands)". Each sentence holds against the code (see ④). The same gap in protocol.ts's rollbackToPackageCommit docblock is outside this diff. The previous record sent it to a follow-up, and the PR body names it for one. It stays with the seat and is not a finding here.
  • nit "audit rows written during reverted work": fixed. It now reads "rolled-back work".
  • ④ Three in-memory-rollback sentences drop the docs(adr): ADR-0067 D2 says atomicity is a SQL-driver guarantee and "production is SQL", but remote Turso is SQL and cannot roll back #32480 caveat (should-fix): fixed. SysMetadataEngine.transaction, withTxn and ObjectQL.transaction now each say the rollback restores the whole store to its state at begin, with no isolation, and discards what other callers wrote since that begin. Two of them also say it is unsafe or not safe with concurrent writers. All of this holds against memory-driver.ts (see ④).
  • ③ escalation (os-dev.md's "comments don't publish" fast-track line conflicts with AGENTS.md step 3 and os-dev.md L297): this diff does not touch it, and it remains with the PM/maintainer. It is not a finding on this PR.

① Derived judgments

  • Accept set: the delta changes comments, ADR prose and one changeset. No schema, .describe(), export, authorable key or runtime path moves. Unchanged from the previous record.
  • Public surface: no symbol, signature or type changes. The edited TSDoc ships in d.ts (and as driver.zod.ts source in spec), which is why ② now owes and has a patch changeset.
  • Check-runs on 75c02290 at review time: 15 success, 16 skipped, 21 still running (Build Core, Build UI Deps, Lint ×6, Test Core 1–8, Type Check workspace, source gates, consumer gates, debt ledger, Live E2E UI). None failed. Check Changeset, Spec property liveness, Check Documentation Links, Flag docs affected by code changes, Governed Surface Queue Guard and the PR-body guards are among the successes. The running ones are the merge gate, and this record does not stand in for them.

② Semver level

  • Coverage: the diff touches three published packages, @objectstack/spec (driver.zod.ts), @objectstack/objectql (engine.ts) and @objectstack/metadata-protocol (sys-metadata-repository.ts). The changeset names exactly those three. The ADR is not in a published package. Holds.
  • Level: patch is right for TSDoc-only edits with no behaviour, type or export change. It matches the TSDoc-only patch precedent cited in the previous record. No major, so ADR-0087 has nothing to judge, and the gate agrees.
  • Clause-②: no and Metadata-protocol: none: right, on both the changeset and the PR body. No author-writable surface moves.
  • The changeset's prose matches the tree. It lists the in-memory driver as no longer among drivers with no beginTransaction, and names the no-rollback drivers as a test double, remote Turso and OData. It also states the store-wide, no-isolation caveat.
  • skip-changeset removed, and Check Changeset judged the diff on its merits (steps listed in Delta). Holds.

③ Boundary flags

  • The dev's report deviation "skip-changeset … a patch changeset … is the fix": resolved as the previous record asked.
  • Out of scope, carried, not a finding: protocol.ts rollbackToPackageCommit docblock ("records its revert commit") has the same best-effort gap. Whether revertCommit / rollbackToPackageCommit should become atomic is still a maintainer decision. The amendment's "does not decide" still names it.
  • Nothing in the delta reaches outside the claimed file surface. The changeset is the only new file.

④ Design judgment

docs/adr/0067-commit-history-and-rollback-for-ai-authoring.md: holds. Sentence by sentence against main:

  • "recordPackageCommit catches every error": holds. The whole body is one try, and the catch has no rethrow.
  • "where sys_metadata_commit is unprovisioned it logs once at info": holds. isMissingTableError(error, 'sys_metadata_commit') leads to console.info, guarded by commitStoreUnprovisionedNoted, so it logs once per protocol instance.
  • "where the write fails it logs at error": holds (console.error).
  • "either way it returns no record": holds. Both arms return null.
  • "revertCommit then answers without revertCommitId and returns normally": holds. It spreads revertCommitId only when a record came back, and nothing in the record path throws.
  • "D3's append-only promise holds only where the record write lands": holds.
  • "every step that returns has attempted its own revert commit": holds. revertCommit calls host.recordPackageCommit unconditionally after the walk, even when reverted[] is empty.
  • "the revert commit is written from reverted[]": holds (items: reverted.map(…)).
  • "reverted (and recorded, where the record write lands)": holds.
  • "rolled-back work": holds. The 2026-08-06 carve-out is about the system-ledger rows that enforceTransactionOrigin executes outside the transaction.
  • No ruled sentence is deleted. The delta touches only the amendment section the PR itself adds.
  • nit: "Such a revert is on no timeline and cannot itself be reverted" goes a step too far. Each item's restore or soft-remove still writes its sys_metadata_history event inside withTxn. The amendment's own first bullet says so ("the row and its history event"), and D6 calls that log the commit substrate. What is missing is the package commit row, so the revert is absent from listCommits and cannot be reverted as a commit. recordPackageCommit's own error line says exactly that ("absent from the package commit timeline"). Suggest "on no package commit timeline and cannot itself be reverted as a commit". The contract consequence the sentence draws is right, so this is a nit.

packages/metadata-protocol/src/sys-metadata-repository.ts: holds.

  • What the code does on main: beginTransaction copies every table into tx.snapshot at begin. Writes go straight to this.db, so there is no isolation. rollback assigns this.db = tx.snapshot. There is no lock or queue in the memory driver, and none in engine-transactions-section.ts.
  • So a rollback discards every write made since that begin, whoever made it, committed or not. That includes an overlapping transaction's committed writes, and tables created after the begin.
  • SysMetadataEngine.transaction ("so it is not safe with concurrent writers") and withTxn (the same caveat without that clause) both state this correctly.
  • Not a finding: idCounters is not part of the snapshot, so ids issued inside rolled-back work are not reused. This is the safe direction, and "store" reads naturally as the records.

packages/objectql/src/engine.ts: holds.

  • The caveat sentence is accurate, for the same reasons as sys-metadata-repository.ts above.
  • The change from "It is DECLARED behaviour" to "The degrade is DECLARED behaviour" is right and needed. With the in-memory sentence inserted before it, "It" would have pointed at the in-memory transaction. "The degrade" now points at the no-rollback fall-through the bullet opens with ("runs directly … (no rollback)"). That is the same thing the next clause's "the degrade warns once per driver" and opts.require: true refer to. It is also what ADR-0119 D1 declares.
  • nit: "a transaction there — one that restores the whole store to its state at begin, … and whose rollback also discards …" makes the transaction, not its rollback, the subject of "restores". The "also" then describes the same act twice. Suggested wording: "a transaction whose rollback restores the whole store to its state at begin: no isolation, and it discards what other callers wrote since that begin (unsafe with concurrent writers)". A reader is not misled, so this is a nit.

packages/spec/src/data/driver.zod.ts: unchanged in the delta. The previous record's "holds" stands. That sentence states mechanism only and claims no isolation, so it does not owe the caveat.

No must-fix and no should-fix. The two nits alone end the round.

Implemented-by: claude/project-thread-0ky6fu
Reviewed-by: session_01FEkQ5pjSPT7ui2EUcunaVb

VERDICT: PASS

Adopted by the seat 2026-11-14T22:45Z · isolated sub-agent at CONTRACT_REVIEW_TIER · Ruling-ref: Leehom card cmsg_01TenzsRopZj4jMbvjX8uz1XFhuiZmTH8VFgMmHRmpiGAb, option A, tapped 2026-11-14T15:37Z

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:skills#1 · os-project-manager · session_01FEkQ5pjSPT7ui2EUcunaVb

维护者速读

  • 改了什么:四处代码注释不再说“内存驱动不能回滚”(它用整库快照实现了 beginTransaction / rollback),并在 SysMetadataEngine.transaction、withTxn、ObjectQL.transaction 写明:内存驱动的回滚把整库恢复到事务开始时的状态,没有隔离,会丢掉其他调用方在此期间的写入。ADR-0067 新增 2026-11-14 修订节:revertCommit 是逐项回退,返回 reverted[] / failed[];rollbackToPackageCommit 逐个 commit 调它;回退本身的 commit 记录是尽力而为,写失败时不返回 revertCommitId。外加 spec、objectql、metadata-protocol 三包 patch changeset。
  • 为什么改:文字与 main 上的代码相反(卡 Stale rollback claims: three code comments say the in-memory driver cannot roll back, and ADR-0067 D3 calls revertCommit atomic #32504)。
  • 风险与回滚:只改注释与一个 ADR,不改任何行为。回滚即还原本 PR。
  • 先看:ADR-0067 文末 “Amendment (2026-11-14, Stale rollback claims: three code comments say the in-memory driver cannot roll back, and ADR-0067 D3 calls revertCommit atomic #32504)”,其中 “What this amendment does not decide” 写明:要不要把回退改成原子仍由你定,本 PR 不做。
  • 两分钟验证:git diff origin/main...HEAD --stat,预期 5 个文件。
  • 需要你做的:受管面 Tier H(packages/spec/**、docs/adr/**),契约复审 PASS 评论 6884842817(含 3 条应修)与增量复审 PASS 评论 6885400346(Head-sha 75c0229004fabf0b7a1d1fa46e2b41e1764c2ccf)已在案,请批准或直接合并。
  • 席位意见:可以合。首轮三条应修(缺 changeset、ADR 说回退 commit 一定有记录、三处注释漏了内存驱动的无隔离说明)都已改好,增量复审逐句对照 main 的 recordPackageCommit 与 memory-driver.ts 确认成立。

席位核对

Verdict: ACCEPT, held for the maintainer · head 75c0229004fabf0b7a1d1fa46e2b41e1764c2ccf · card #32504 · report 6884742258 · contract review 6884842817 (PASS with should-fix on 86ee1dfc) and delta 6885400346 (PASS on this head, CONTRACT_REVIEW_TIER; Ruling-ref for the in-seat review: Leehom card cmsg_01TenzsRopZj4jMbvjX8uz1XFhuiZmTH8VFgMmHRmpiGAb option A).

  • Shape: draft → main, Fixes #32504. packages/spec/src/data/driver.zod.ts, packages/objectql/src/engine.ts, packages/metadata-protocol/src/sys-metadata-repository.ts (TSDoc only), docs/adr/0067-commit-history-and-rollback-for-ai-authoring.md, one changeset patch for the three packages. GOVERNED, Tier H. Clause-②: no; Metadata-protocol: none.
  • Should-fix closure: ② skip-changeset removed and the changeset added (Check Changeset now ran the real path and passed); ④ "recorded its own revert commit" now "attempted … best effort", matching recordPackageCommit's single try/catch; ④ the in-memory caveat is on all three docblocks, matching memory-driver.ts's snapshot swap with no lock.
  • Gates: 90 derived, 89 exit 0, 1 NOT MEASURED (check:dual-build-cjs-loads, no build closure owed). Check-runs on the head all concluded, none failing.
  • Accepted deviations (delta nits): "Such a revert is on no timeline" means no package-commit timeline (each item's history event is still written, as the amendment's first bullet says); in engine.ts the caveat makes "a transaction" the subject of "restores" where its rollback is meant. Both are wording only.
  • Follow-up: protocol.ts's rollbackToPackageCommit docblock has the same best-effort gap and lies outside this diff; the seat files it as a card.
  • Docs drift: the drift bot lists content/docs/concepts/metadata-lifecycle.mdx via SysMetadataRepository; this PR changes no behaviour, so no page is falsified.
  • Process: the thread ran at the default tier, met by these in-seat reviews.
  • Landing: Tier H. The seat does not flip this PR ready or enqueue it. It needs the maintainer's merge, or an authorised APPROVED review after which the seat lands it.

@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 14, 2026
@os-zhuang
os-zhuang marked this pull request as ready for review November 14, 2026 22:51
@os-zhuang
os-zhuang added this pull request to the merge queue Nov 14, 2026
@github-actions

Copy link
Copy Markdown
Contributor

⛔ merge queue 构建失败 — 先分诊,再决定要不要重排

队列构建 43654334666 红了。队列跑的是全量套件(PR 侧 CI 只跑 affected 子集),
所以失败的测试可能在本 PR 没碰过的包里 —— 那不是重排能修的。每次盲目重排都会让排在后面的所有 PR 重建一轮。

分类:failure —— 按下面的日志分诊。

失败的 job(日志抽取,best effort):

  • Test Core (7/8) — 失败步骤: Run this shard's tests

    @objectstack/cli:test:  FAIL   integration  src/commands/migrate/plan.telemetry-sibling.integration.test.ts > os migrate plan / apply plan each object against the database it lives in (#22579) > after
      ↳ 失败原因: @objectstack/cli:test: AssertionError: a table the serving boot did not provision
    

↳ 失败原因 是判读的关键:超时(Test timed out in … / Hook timed out in …)多半是负载/时序,不是本 PR 的回归;
断言(AssertionError: …)才指向真实的行为改变。两者的 FAIL 行长得一模一样,只有这一行能区分。

⚠️ 断言这一侧有一类例外,判据是断言在测什么,不是它是不是 AssertionError。 断言的对象是产品行为(一个值、一个形状、一次拒收)⇒ 照上面读:真实的行为改变,去查,⛔ 不要重排掉;
断言的对象是这次实验自身的有效性前提(跑完的耗时、负载下的先后、任何只在时间预算内才成立的条件)⇒ 它跟超时是同一类,同样对负载敏感,重排一次是合法的判别手段。
识别是机械的:断言的消息或它比较的值本身点名了一段时长、一个时间戳、一个耗时计数。实测过的一对 —— AssertionError: SecurityPlugin.init() ran: expected false to be true 测的是产品行为(真回归);
AssertionError: this run took over a second, so second-precision stamps could have differed too: expected 1006 to be less than 1000 测的是实验前提:它守护的那条不变式当时是绿的,同一个 head 原样重排一次即成功。
穿着 AssertionError 外衣的时间测量,仍然是时间测量。(⛔ 这只改「怎么读一次红」,不改「哪些测试可以重排」——后者由别处管。)

跨 PR 相同签名(24h,按失败测试文件聚合):

  • src/commands/migrate/plan.telemetry-sibling.integration.test.ts — 24h 窗口内只有本 PR 撞到过,暂不汇总(再有一个不同 PR 撞到就会自动开汇总 issue)。
  • ⚠️ 24h 评论账本没读完(超过 5 页仍未读到窗口尽头),所以上面的「不同 PR 数」是下界,不是全量。

历史信号:

  • 本 PR 过去 24h 无队列失败记录(首次)。
  • 过去 24h 队列共有 21 个失败构建(不含本次)。

分诊清单:

  1. 失败测试在本 PR 改动的包里 → 真回归,修 PR。
  2. 失败测试与本 PR 无关 → 看上面的「跨 PR 相同签名」;已有汇总 issue ⇒ flaky/环境问题实锤,去那张 issue 上谈,修好前重排只会再烧一轮全队列。
  3. 两者都不是 → 可能与同组 PR 语义冲突;等前面的 PR 落地或失败出队后再重排一次即可,不要连续重排。

Generated by Claude Code · merge-queue-triage workflow (#4859)

@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 15, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:skills#1 · os-project-manager · session_01FEkQ5pjSPT7ui2EUcunaVb

Correction: contract-review tier

The contract-review record(s) 6884842817, 6885400346 on this PR say Served-tier: CONTRACT_REVIEW_TIER, and the seat adopted them as "isolated sub-agent at CONTRACT_REVIEW_TIER". That is wrong. The seat launched the reviewing sub-agent without the tier, so it ran at the seat's own default tier, not at CONTRACT_REVIEW_TIER. The seat found this on its own audit. The review was still isolated and adversarial, and its findings stand as an off-tier review. They are not the at-tier record AGENTS.md and the in-seat review ruling require.

The seat re-runs the review at CONTRACT_REVIEW_TIER on this PR's head and posts that record here. Until it does, this PR has no at-tier record.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:skills#1 · os-project-manager · session_01FEkQ5pjSPT7ui2EUcunaVb

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 75c0229004fabf0b7a1d1fa46e2b41e1764c2ccf
Local-runs: none
Scope: packages/spec/src/data/driver.zod.ts, docs/adr/0067-commit-history-and-rollback-for-ai-authoring.md + packages/metadata-protocol/src/sys-metadata-repository.ts, packages/objectql/src/engine.ts

At-tier re-review of the whole net diff against main (merge base ba35dfd7). The two earlier records on this PR (6884842817, 6885400346) are not used as evidence; ③ says which of their findings this record confirms or rejects.

Read, not reviewed, on main at 8e63ed87 (none of the cited functions moved since the merge base): packages/drivers/driver-memory/src/memory-driver.ts (supports, beginTransaction, commit, rollback, the write paths), packages/core/src/utils/migration-journal.ts (engineCanRollBack), packages/objectql/src/engine-transactions-section.ts (transaction), packages/metadata-protocol/src/protocol-package-commits.ts (revertCommit, rollbackToPackageCommit, listCommits, readRevertableCommit), protocol-package-commit-record.ts (recordPackageCommit), protocol-registry-hydration.ts (applyRegistryWriteThrough, applyObjectRegistryMutation, ensureObjectStorage), protocol-mutation-fan-out.ts (runMutationProjector), protocol-history-and-publish.ts (the commit plan capture), protocol.ts (the two door docblocks), sys-metadata-repository.ts (put, delete, restoreVersion, withTxn), packages/spec/src/contracts/objectql-engine.ts, driver-turso and driver-odata (transactionsUnsupported). Also card #32504 with every comment, the PR body and file list, and the check-runs on the head.

① Derived judgments

  • Accept set: none moves. The four source and ADR files change comments and prose only: no schema, no .describe(), no export, no authorable key, no runtime path. Right.
  • Public surface: no symbol, signature or type changes. The edited TSDoc ships (spec ships src/**/*.zod.ts; objectql and metadata-protocol ship dist d.ts), which ② covers.
  • Check-runs on the head: all concluded, none failed (Build Core, Test Core 1 to 8, Type Check workspace, source, consumer and debt-ledger gates, the six Lint jobs, Spec property liveness, Check Changeset, Check Documentation Links, Governed Surface Queue Guard, PR-body guards: success; the rest skipped by design). The generated-artifact and docblock-anchor gates are among the successes, so no regenerated artifact is owed.
  • Not a check-run on this head, noted only: the merge-queue build 43654334666 went red on @objectstack/cli plan.telemetry-sibling.integration.test.ts. This diff changes no behaviour, so it cannot be the cause; it is the queue's to triage, not a finding here.

② Semver level

  • Changeset .changeset/32504-in-memory-rollback-docblocks.md: patch for @objectstack/spec, @objectstack/objectql, @objectstack/metadata-protocol. Those are exactly the three published packages the diff touches; the ADR is in no package. patch is right for TSDoc-only edits. Holds.
  • Clause-②: no. Right, on the PR body and the changeset: no author-writable surface moves. Metadata-protocol: none is right.
  • skip-changeset is gone and Check Changeset is success on its real path. Holds.
  • The changeset prose matches the tree.

③ Boundary flags

  • Dev deviations (report 6884742258): scope widened to the withTxn docblock and the D3 rollbackToPackageCommit bullet: accepted, same defect class in files the card names. Default-tier thread: answered by this record. skip-changeset: resolved by the changeset. open_questions: empty.
  • Out-of-scope carried by the dev (should the revert doors become atomic): correctly left to the maintainer and named in the amendment.
  • Earlier record 6884842817, confirmed: ② skip-changeset was wrong (fixed on this head); ④ "has recorded its own revert commit" overclaimed (fixed: "attempted ... best effort"); ④ the three in-memory sentences owed the store-wide, no-isolation caveat (fixed on all three); the "reverted work" nit (fixed).
  • Earlier record 6884842817, REJECTED: its line "Registry write-through, storage sync and the projector run after the row write, inside the same try. So the 'row written, item still in failed[]' sentence is right". Those three calls sit inside the try, but none of them throws. See ④ finding 1. The PR body's acceptance row for the same claim is wrong for the same reason.
  • Earlier record 6885400346, confirmed: its two nits ("on no timeline" means no package commit timeline; the engine.ts sentence makes the transaction, not its rollback, the subject of "restores"). Both stay nits. Its "No must-fix and no should-fix" is rejected by ④ below.
  • Escalated to the seat, outside this diff, for cards (not findings on this PR):
    • revertCommit discards what its post-write steps report: applyRegistryWriteThrough returns a refusal or only warns, runMutationProjector returns success: false, and neither result is read. The door's own docblock in protocol.ts says a revert that answers success: true is one the running process has already acted on.
    • A revert commit's own plan stores prevVersion: null for every item, so reverting a revert commit restores nothing (④ finding 2). D3 and the protocol.ts docblock both say "the revert is itself revertible".
    • protocol.ts rollbackToPackageCommit docblock still says each step "records its revert commit" (the best-effort gap the earlier record already named).

④ Design judgment

docs/adr/0067-commit-history-and-rollback-for-ai-authoring.md

Holds: no ruled sentence is deleted (four modified lines, each keeps its original text as an exact prefix and appends a marker or a status entry, the form the 2026-11-12 amendment uses). Against the code: the walk is [...items].reverse(); a created item goes through repo.delete, a modified one through repo.restoreVersion, which returns this.put; put and delete each write the row and the history event inside withTxn; revertCommit opens no transaction; the pre-flight refusal and the catch push to failed[] and the walk continues; the revert commit is built from reverted.map(...); success is true only when failed is empty and reverted is not; recordPackageCommit is one try whose catch logs at info once (unprovisioned) or error and returns null either way, and revertCommitId is spread only when a record came back; rollbackToPackageCommit runs one revertCommit per apply commit newer than the target in listCommits order (newest first), folds a thrown step and every returned failed[] item, and stops for neither. The "does not decide" section and the Decision-2 statement agree with the 2026-11-12 amendment.

  1. must-fix. "a fault after the item's row write (its registry write-through, say) reports it there too" is contradicted by the code it describes. On the restore limb the three steps after repo.restoreVersion are applyRegistryWriteThrough, ensureObjectStorage and runMutationProjector. None of them throws on a fault:

    • applyRegistryWriteThrough: the non-object branch catches and console.warns ("registry write-through failed ...") and returns undefined; the object branch (applyObjectRegistryMutation) catches, warns and returns { error }. revertCommit awaits the call and discards the result.
    • ensureObjectStorage: catches and returns an advisory; revertCommit puts it on advisories, not failed[].
    • runMutationProjector: catches, warns and returns { success: false, error }; the result is discarded.

    So an item whose row was restored and whose registry write-through failed is pushed to reverted[] as restored, and success can be true. That is the opposite of what the sentence says, and it is the case the amendment's own heading ("names what it could not do") and its closing line ("reported, not prevented") lean on. The function's own finding: revertCommit has no STORED_TYPE_NOT_CANONICAL pre-flight, so a non-canonical stored item degrades to a console.warn where the sibling doors give a wire-visible code #9174 comment records exactly this outcome as measured (success: true, restored, the only trace a server-side warn). An amendment whose whole job is to state what the door does must not state this. Fix, prose only: drop the example and the generalisation, and say instead that failed[] holds an item that was refused or whose removal or restore threw, and that a fault in what follows the row write (registry write-through, storage sync, the projector) does not reach failed[]: the item is still reported in reverted[], the fault is a server-side warning or an advisories entry, and success does not see it. Correct the PR body's acceptance row with it.

  2. should-fix. The walk has a third outcome the amendment does not name, and it is the one that decides "a revert is itself revertible". An item recorded existedBefore: true with no prevVersion takes neither limb: it is in neither reverted[] nor failed[]. That is not a corner: it is the plan every revert commit writes for the items it restored (existedBefore: r.action === 'restored', prevVersion: null), and readRevertableCommit accepts a revert commit. So reverting a revert commit restores nothing: its restored items are skipped silently (all skipped gives success: false with an empty failed[]), and its removed items are reported removed again with nothing recreated. The amendment says an item "that is refused or throws goes into failed[]" as if that were the only way not to be reverted, and its best-effort bullet says an unrecorded revert "cannot itself be reverted — D3's append-only promise holds only where the record write lands", which reads as: where the record lands, it can. Fix, prose only: one sentence naming the skipped outcome and that a revert commit's plan carries no prevVersion; and either reword "cannot itself be reverted" so it claims only the missing commit row, or add the D3 "itself revertible" clause to "What this amendment does not decide". The code question goes to a card (③).

  3. nit. "walks the commit's items newest first": the items of one commit have no age; the code walks them in reverse apply order.

  4. nit (confirmed from 6885400346). "Such a revert is on no timeline": each item's sys_metadata_history event is still written; what is missing is the package commit row.

packages/spec/src/data/driver.zod.ts

The changed sentence holds against memory-driver.ts: supports = {}, beginTransaction copies every table and every record into tx.snapshot, rollback assigns this.db = tx.snapshot, and every write path replaces or splices records rather than mutating them, so the per-record shallow copy is enough. driverSupportsTransactions answers yes for it. It states mechanism only and claims no isolation, so it owes no caveat.

  1. should-fix. The same stale claim survives one file over in the same published package, and the PR says it does not. packages/spec/src/contracts/objectql-engine.ts, EngineTransactionOptions.require: "a driver without beginTransaction runs the callback with no transaction and no rollback ... That degrade is right for callers who can live without atomicity (test doubles, in-memory drivers)". After this PR @objectstack/spec says in driver.zod.ts that the in-memory driver is not a driver without beginTransaction, and in the contract docblock a caller reads when choosing require that in-memory drivers are where the degrade applies. The card's reach ("anyone reading those docblocks to decide whether tests on the in-memory driver exercise rollback") is not met for that reader, and the PR body's "No other in-repo text repeats the stale claims" is false. The file is outside the diff, so it is read here, not reviewed; the finding is on the change's claim of completeness. Fix: the same bounded in-place edit the dev already made for withTxn (drop "in-memory drivers" from that parenthesis; the existing changeset already covers spec), or a follow-up card plus a corrected PR-body line.

packages/metadata-protocol/src/sys-metadata-repository.ts (implementing)

Agrees with the code, sentence by sentence. withTxn calls engine.transaction whenever the member exists and otherwise calls the callback directly; ObjectQL.transaction degrades when driverSupportsTransactions is false; engineCanRollBack's two driver arms are the two the docblock names, and remote Turso declares the bit. Dropping "production always runs on a SQL driver with real ACID" is right. The in-memory caveat (whole store to its state at begin, no isolation, a rollback discards what other callers wrote since that begin) is what rollback does: writes go straight to this.db, there is no lock, and the snapshot is per beginTransaction. No finding.

packages/objectql/src/engine.ts (implementing)

Agrees with the code. The no-rollback examples are right (a double with no beginTransaction, remote Turso, OData, which declares the bit unconditionally and refuses beginTransaction). "The degrade is DECLARED behaviour" now points at the fall-through, which the inserted in-memory sentence would otherwise have captured.

  1. nit (confirmed from 6885400346). "a transaction there — one that restores the whole store to its state at begin ... and whose rollback also discards" makes the transaction the subject of "restores" and says the rollback twice.

One must-fix (finding 1), two should-fix (findings 2 and 5), three nits. The fixes for 1 and 2 are prose in the ADR amendment this PR adds; they move the head and earn a delta review.

Implemented-by: claude/project-thread-0ky6fu
Reviewed-by: session_01FEkQ5pjSPT7ui2EUcunaVb

VERDICT: FAIL

Adopted by the seat 2026-11-15T00:35Z · isolated sub-agent at CONTRACT_REVIEW_TIER (served model verified by the seat) · Ruling-ref: Leehom card cmsg_01TenzsRopZj4jMbvjX8uz1XFhuiZmTH8VFgMmHRmpiGAb, option A, tapped 2026-11-14T15:37Z

@objectstack-fleet
objectstack-fleet Bot marked this pull request as draft November 15, 2026 00:37
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:skills#1 · os-project-manager · session_01FEkQ5pjSPT7ui2EUcunaVb

ACCEPT 6885400346-era hand-off withdrawn: the at-tier contract review 6886701800 on head 75c02290 is FAIL (must-fix: the ADR-0067 amendment says a fault after the row write lands in failed[], but revertCommit on main discards those faults and reports the item restored). The seat converted this PR back to draft and took pm:awaiting-merge off; the fixes go back to the card thread, and a new at-tier review follows the push. Maintainers: please do not re-enqueue this head. 2026-11-15T00:37Z

@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 15, 2026
…outcome, and the require docblock

ADR-0067's 2026-11-14 amendment no longer says a fault after an item's
row write reaches failed[]: the registry write-through, heal and
projector catch and log, storage sync reports on advisories, and the
item stays in reverted[]. It names the third outcome (an item with no
prevVersion is skipped, which is every item a revert commit restored),
so reverting a revert commit restores nothing today, and lists that and
the post-write faults under what it does not decide. The spec
EngineTransactionOptions.require docblock stops naming in-memory drivers
among the no-transaction callers. Wording nits in the amendment and the
ObjectQL.transaction docblock.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FEkQ5n1GK9KeZD8fhHUf49
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:skills#1 · os-project-manager · session_01FEkQ5pjSPT7ui2EUcunaVb

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 461a0debbb4d56dcf2898b888098b474e3f8c40d
Local-runs: none
Scope: packages/spec/src/data/driver.zod.ts, docs/adr/0067-commit-history-and-rollback-for-ai-authoring.md + packages/spec/src/contracts/objectql-engine.ts, packages/metadata-protocol/src/sys-metadata-repository.ts, packages/objectql/src/engine.ts

Full at-tier review of the net diff against main (merge base ba35dfd7, 6 files), round 3. Not a delta: the whole scope was judged again on the tree at this head. The earlier records on this PR (6884842817, 6885400346, 6886701800) are not used as evidence; ③ says what became of 6886701800's findings.

Read, not reviewed, at this head (none of these files is in the diff, so they are as on the merge base): packages/metadata-protocol/src/protocol-package-commits.ts (revertCommit, rollbackToPackageCommit, listCommits, readRevertableCommit), protocol-package-commit-record.ts (recordPackageCommit), protocol-registry-hydration.ts (applyRegistryWriteThrough, applyObjectRegistryMutation, restoreArtifactRegistryView, reconcileViewExpansions, ensureObjectStorage), protocol-class-head.ts (resyncStoredObjectExtensions), protocol-discovery-and-bases.ts (rethrowUnlessMetadataStoreUnprovisioned), protocol-mutation-fan-out.ts (runMutationProjector), protocol-stored-expression-fill.ts, protocol.ts (the two door docblocks), sys-metadata-repository.ts (put, delete, restoreVersion, withTxn), packages/core/src/utils/migration-journal.ts (engineCanRollBack), packages/drivers/driver-memory/src/memory-driver.ts (supports, beginTransaction, rollback), driver-turso and driver-odata (transactionsUnsupported), packages/objectql/src/registry.ts (registerItem). Also card #32504 with every comment, the PR body and file list, and the check-runs on the head.

① Derived judgments

  • Accept set: none moves. Five source and ADR files change comments and prose only; the sixth is the changeset. No schema, no .describe(), no export, no authorable key, no runtime path. Right.
  • Public surface: no symbol, signature or type changes. The edited TSDoc ships (spec ships src/**/*.zod.ts and its dist d.ts; objectql and metadata-protocol ship dist d.ts), which ② covers.
  • Check-runs on the head, as read at render time. Concluded success: Check Changeset, Check Documentation Links, Check PR Size, Dogfood Regression Gate, Flag docs affected by code changes, Governed Surface Queue Guard, Lint PM dispatch-gates, Lint repo and tooling gates, Lint scoped tooling self-tests, PR-body guards, Plan Test Core shards, Plan Test UI shards, Spec property liveness, Type Check source gates, Auto Label, filter. None failed. Still in progress, so NOT yet a verdict: Build Core, Build UI Deps, Test Core 1 to 8, Type Check workspace, consumer gates and debt ledger, Lint ESLint, Lint docs and code guards, Lint CI release and engine gates, the two other scoped Lint jobs, Live E2E UI. This record's PASS is on the contract; it does not stand in for those runs. The seat reads them concluded before it adopts or hands off. dual-build-cjs-loads (NOT MEASURED locally) is Build Core's to answer.
  • The diff changes no behaviour, so no pending run can be turned red by what this record judges except a docblock or ADR text gate (Lint docs and code guards); the dev's 91 derived exits cover those locally, and the platform run decides.

② Semver level

  • Changeset .changeset/32504-in-memory-rollback-docblocks.md: patch for @objectstack/spec, @objectstack/objectql, @objectstack/metadata-protocol. Those are exactly the three published packages the diff touches (the new objectql-engine.ts edit is in spec, already listed); the ADR is in no package. patch is right for TSDoc-only edits. Holds.
  • Clause-②: no. Right, on the PR body and the changeset: no author-writable surface moves. Metadata-protocol: none is right.
  • The changeset prose matches the tree, including the new EngineTransactionOptions.require line. Check Changeset is success.

③ Boundary flags

  • Dev deviations (report 6884742258): scope widened to the withTxn docblock and the D3 rollbackToPackageCommit bullet, and on this head to EngineTransactionOptions.require: accepted, same defect class. open_questions: empty. The out-of-scope question (should the revert doors become atomic) stays with the maintainer and is named in the amendment.
  • Record 6886701800 (head 75c0229), finding by finding on this head:
    • M1 (must-fix, "a fault after the row write reports it there too"): FIXED. The bullet now says an item that is refused, or whose removal or restore throws, goes to failed[], and that what follows the row write does not reach it. Checked against the code in ④: it agrees.
    • S1 (should-fix, the skipped third outcome and "itself revertible"): FIXED. New bullet "An item can also be skipped", the D3 bullet marker ("reverting a revert commit restores nothing today"), the best-effort bullet's last sentence, and a new line under "does not decide". Checked in ④: it agrees.
    • S2 (should-fix, the stale claim in objectql-engine.ts): FIXED in the diff, and the changeset names it. A grep of non-test packages/**/src at this head for the in-memory driver beside transact, rollback, ACID or atomic leaves only this corrected line.
    • Nit 3 ("newest first" for the items of one commit): FIXED ("in reverse apply order").
    • Nit 4 ("on no timeline"): FIXED ("on no package-commit timeline (each item's sys_metadata_history event is still written)").
    • Nit 6 (engine.ts, the transaction as the subject of "restores"): FIXED ("with no isolation: its rollback restores the whole store ...").
  • The developer's added claim: CONFIRMED from code. restoreArtifactRegistryView returns for an organization-scoped call, runs reconcileViewExpansions, and then, for an object_extension, awaits host.resyncStoredObjectExtensions(name) and returns. That branch sits ABOVE the function's outer try, whose catch is what turns every other heal fault into a console.error. Inside resyncStoredObjectExtensions, the sys_metadata read is in its own try whose catch calls rethrowUnlessMetadataStoreUnprovisioned(error, 'sys_metadata'), which rethrows anything but an unprovisioned table. In revertCommit the heal call comes after repo.delete and inside the per-item try, so the rethrown fault reaches the per-item catch: the item is pushed to failed[], never to reverted[], its projector and mutation event are skipped, and its row is already gone (where a row existed). The per-row re-register faults in the same function are caught and warned, so the store read is the only way through. The ADR's parenthesis says this correctly; its words "a store fault" are slightly wider than the code (an unprovisioned table is swallowed), which cannot matter here because the delete on the same table has just succeeded. Not a finding.
  • Escalated to the seat for cards, outside this diff (unchanged from 6886701800, restated because the amendment now points at them): the protocol.ts door docblocks say a revert answering success: true is one the process has acted on, that a revert is itself revertible, and that each rollback step records its revert commit; and whether a post-write fault should reach failed[] and whether a revert commit should carry the versions it restored. The amendment names all of these as open or as text the record overrides. No finding on this PR.

④ Design judgment

docs/adr/0067-commit-history-and-rollback-for-ai-authoring.md

No ruled sentence is deleted: the four modified lines each keep their original text as an exact prefix and append a status entry or an italic marker, the form the 2026-11-12 amendment uses. The amendment, sentence by sentence against the code:

  • Walk: for (const it of [...items].reverse()). Created item: repo.delete; modified item: repo.restoreVersion, which returns this.put; put and delete each run their row and history write in withTxn. revertCommit contains no transaction or withTxn call. Agrees.
  • failed[]: the finding: revertCommit has no STORED_TYPE_NOT_CANONICAL pre-flight, so a non-canonical stored item degrades to a console.warn where the sibling doors give a wire-visible code #9174 pre-flight refusal and the per-item catch (with clientFacingFailureText and, where present, clientFacingFailureCode) are the two pushes; the loop continues after both. Agrees.
  • "What follows an item's row write does not reach failed[]": on the restore limb applyRegistryWriteThrough catches and warns on all three of its branches (the object branch returns a refusal, which revertCommit awaits and drops); ensureObjectStorage catches both of its driver calls and returns a notice that goes to advisories; runMutationProjector catches and returns success: false, dropped. On the soft-remove limb the heal's outer catch logs, and the projector is the same. reverted.push follows unconditionally and success reads only the two arrays. Agrees. I looked for a second way through: registerItem ahead of the object branch's try, captureStoredExpressionChange, and emitMetadataMutation are in-memory and outside a catch, but none is a fault source for these inputs (the registry's throws are gated on a package id or on other types; the capture reads the registry; the emit isolates its listeners). The one real way through is the object_extension exception, which the text names.
  • Skipped outcome: restoreToVersion is null when existedBefore is true and prevVersion is null or undefined; with existedBefore true the first limb is not taken either, so nothing is pushed. The revert commit's own plan is existedBefore: r.action === 'restored', prevVersion: null, and readRevertableCommit does not filter on operation. So reverting a revert commit skips every restored item and sends every removed item down the soft-remove limb, where no row is found and nothing is recreated. Agrees, including "restores nothing today" on the D3 bullet.
  • Revert commit: built from reverted.map(...); success is true only when failed is empty and reverted is not. Agrees.
  • Best effort: recordPackageCommit is one try; its catch logs once at info for an unprovisioned table, at error otherwise, and returns null both ways; revertCommitId is spread only when a record came back. Agrees.
  • rollbackToPackageCommit: listCommits sorts newest first; the filter keeps apply commits newer than the target; one revertCommit per commit; a thrown step and each returned failed[] item are folded; neither stops the loop. "has attempted its own revert commit, best effort" is right. Agrees.
  • "Does not decide" and the closing paragraph agree with the 2026-11-12 amendment and with the protocol.ts docblocks they cite (read: the three quoted claims are there). The pinned test name exists in protocol.revert-stored-type-canonical.test.ts.

The amendment holds against its first consumer (protocol-package-commits.ts) and against the card's reach: a reader judging whether a failed revert can leave a package half-reverted is now told yes, and how it is reported.

  1. nit. The closing summary is looser than the bullet it recaps. "A fault after an item's row write is not named there": by the bullet eight lines up, a refused storage sync IS in the response (on advisories), and the object_extension exception IS named in failed[]. The bullet is the precise statement and is right; the recap could say "is not named in failed[], bar the exception above".
  2. nit. The amendment lists what follows the row write as the registry step, the projector and storage sync. The door also runs the stored-expression fill once after the walk and the commit record (metadata-protocol: a rollback or revert that changes a stored computed field leaves existing rows unfilled (the save/publish doors fill since #32527) #32700), which writes data rows and reports on advisories, never failing the revert. Not a contradiction (the text makes no claim it breaks), and it is outside the atomicity question the amendment is about; a clause would complete the list.

packages/spec/src/data/driver.zod.ts

Holds against memory-driver.ts: readonly supports = {}; beginTransaction copies every table and record into a snapshot; rollback assigns this.db = tx.snapshot. driverSupportsTransactions (two lines, in this file) answers yes for it. The sentence states mechanism only and claims no isolation, so it owes no caveat. The rest of clause 1 is unchanged. No finding.

packages/spec/src/contracts/objectql-engine.ts (in the diff; the same published contract face)

The stale "in-memory drivers" example is gone and the replacement is true. This closes S2.

  1. nit. The parenthesis names callers, then drivers: "callers who can live without atomicity (test doubles; the in-memory driver is not one of these drivers: it implements beginTransaction)". There are no "these drivers" in the sentence. Reads correctly on a second pass; wording only.

packages/metadata-protocol/src/sys-metadata-repository.ts (implementing)

Agrees with the code. withTxn calls engine.transaction when the member exists and the callback directly otherwise. The two driver arms the SysMetadataEngine.transaction docblock gives for engineCanRollBack answering no are the two driverSupportsTransactions has, and remote Turso declares the bit (transactionsUnsupported: this.transportMode === 'remote'). The in-memory caveat (whole store to its state at begin, no isolation, a rollback discards what others wrote since) is what rollback does. No finding.

packages/objectql/src/engine.ts (implementing)

Agrees with the code: OData declares transactionsUnsupported: true, remote Turso as above, and the in-memory driver takes the transactional path. "The degrade is DECLARED behaviour" still points at the fall-through. No finding.

PR body (prose face, not part of the head)

  1. nit. The body was not brought to this head. It still carries the acceptance row "a fault after the row write still lands in failed[]" that M1 refuted and the amendment now contradicts; it says the diff is 5 files (it is 6, with objectql-engine.ts); its "What changes" omits the EngineTransactionOptions.require edit; and its gate block names head 75c0229. Fixable on the body without moving the head.

No must-fix and no should-fix. Four nits; 1 to 3 are in files of the head, so they are left as accepted deviations or a follow-up (a fix moves the head and this record no longer covers it); 4 is fixable on the PR body.

Implemented-by: claude/project-thread-0ky6fu
Reviewed-by: session_01FEkQ5pjSPT7ui2EUcunaVb

VERDICT: PASS

Adopted by the seat 2026-11-15T01:38Z · isolated sub-agent at CONTRACT_REVIEW_TIER (served model verified by the seat) · Ruling-ref: Leehom card cmsg_01TenzsRopZj4jMbvjX8uz1XFhuiZmTH8VFgMmHRmpiGAb, option A, tapped 2026-11-14T15:37Z

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:skills#1 · os-project-manager · session_01FEkQ5pjSPT7ui2EUcunaVb

维护者速读

  • 改了什么:四处代码注释不再说“内存驱动不能回滚”(它用整库快照实现了 beginTransaction / rollback),并写明内存驱动的回滚把整库恢复到事务开始时的状态、没有隔离;EngineTransactionOptions.require 的注释同步更正。ADR-0067 新增 2026-11-14 修订节,按 main 的代码写明 revertCommit 逐项回退:被拒或删除/恢复抛错的项进 failed[];行写入之后的故障(注册表回写、投影、存储同步)不进 failed[],唯一例外是 object_extension 的修复读错会抛出;没有 prevVersion 的项被跳过,所以“回退一个回退 commit”目前什么也不恢复;回退本身的 commit 记录是尽力而为。外加 spec、objectql、metadata-protocol 三包 patch changeset。
  • 为什么改:文字与 main 上的代码相反(卡 Stale rollback claims: three code comments say the in-memory driver cannot roll back, and ADR-0067 D3 calls revertCommit atomic #32504)。
  • 风险与回滚:只改注释与一个 ADR,不改任何行为。回滚即还原本 PR。
  • 先看:ADR-0067 文末 “Amendment (2026-11-14, Stale rollback claims: three code comments say the in-memory driver cannot roll back, and ADR-0067 D3 calls revertCommit atomic #32504)” 及其 “What this amendment does not decide”:回退要不要改成原子、回退 commit 要不要带上恢复的版本、行写入后的故障要不要进 failed[],都留给你定,本 PR 不做。
  • 两分钟验证:git diff origin/main...HEAD --stat,预期 6 个文件。
  • 需要你做的:受管面 Tier H(packages/spec/**、docs/adr/**)。达档(CONTRACT_REVIEW_TIER,席位已核对实际模型)全量复审 PASS 评论 6887419547(Head-sha 461a0debbb4d56dcf2898b888098b474e3f8c40d),请批准或直接合并。
  • 席位意见:可以合。上一轮达档复审 FAIL(6886701800,ADR 一句与代码相反)及两条应修都已改好,本轮逐句对照 revertCommit、restoreArtifactRegistryView、resyncStoredObjectExtensions 确认成立。

席位核对

Verdict: ACCEPT, held for the maintainer · head 461a0debbb4d56dcf2898b888098b474e3f8c40d · card #32504 · at-tier contract review 6887419547 (PASS, full review of this head; Ruling-ref for the in-seat review: Leehom card cmsg_01TenzsRopZj4jMbvjX8uz1XFhuiZmTH8VFgMmHRmpiGAb option A). Earlier records 6884842817 and 6885400346 were served off-tier (correction on this PR); 6886701800 was the at-tier FAIL this round answers.

@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 15, 2026
@os-zhuang
os-zhuang marked this pull request as ready for review November 15, 2026 01:47
@os-zhuang
os-zhuang added this pull request to the merge queue Nov 15, 2026
Merged via the queue into main with commit f31f784 Nov 15, 2026
78 checks passed
@os-zhuang
os-zhuang deleted the claude/project-thread-0ky6fu branch November 15, 2026 04:13
scbdzhwl pushed a commit to scbdzhwl/objectstack-analysis that referenced this pull request Nov 16, 2026
…e, and names the real api-surface lane (objectstack-ai#33592)

<!-- claude-projects-attribution: {"github_login":"os-project-manager"}
-->
_Requested by **Leehom** · [project
thread](https://claude.ai/code/project/chan_01TenzsRopZj4jMbvjX8uz1X?thread=cmsg_01TenzsRopZj4jMbvjX8uz1X4PXFtzm5wm1iyzZhryfwUG)_

Fixes objectstack-ai#33572

domain:skills#1 · os-project-manager · session_01FEkQ5kJFi5T1hSXrdUxhzH

Clause-②: no
Metadata-protocol: none

## 维护者速读

- 改了什么:内部退役
playbook(`.claude/skills/spec-property-retirement/SKILL.md`)四处措辞。开篇把「门禁串行失败、一个过期面遮住其余」改为
CI 的实测行为:lane 内红门不挡其余门,仍会遮蔽的只剩三处(构建步红、`Spec property liveness`
逐步串行、dogfood 只在合并队列跑);§4 把不存在的 `Check Generated Artifacts` 换成
`check:api-surface` 真正所在的 lane 名;§5 本地命令的 `&&` 改 `;`;§6
删掉已无锚点的「串行门禁互相遮蔽」。
- 为什么改:原文与它引用的 AGENTS.md 一节相反,还点名了一个不存在的 workflow,读它的 agent 会去找一个永远不会报的
check-run。
- 风险与回滚:只动给 agent 读的内部文档,不发布、不动代码或门禁;回滚即还原本 PR。
- 先看:该文件第 28–31 行(开篇),第 251–253 行(§4 api-surface 一行),第 330–332 行(§6)。
- 两分钟验证:`git diff origin/main -- .claude/`,预期只见上述四处;在任一近期 PR 的 checks
列表里能找到 `Type Check · consumer gates`、`Type Check · source
gates`、`TypeScript Type Check`,找不到 `Check Generated Artifacts`。
- 需要你做的:无,席位落地(Tier S)。

## What changes

`.claude/skills/spec-property-retirement/SKILL.md` only (336 to 336
lines, ceiling 337).

1. **Opening paragraph (L28–31).** "The gates fail separately and
serially, one stale surface hides the rest" becomes what CI does: inside
a CI lane a red gate does not stop the rest (`lint.yml` header EVERY
GATE RUNS). The three measured cases that still hide a gate are named: a
red build step skips the gates and tests that read it; `Spec property
liveness` runs its steps serially, so a red step skips every later one
(including `check:variant-docs`); dogfood does not run on a PR, only on
the merge queue (pointer to §4's dogfood item).
2. **§4 orphan-schema item (L251–253).** "Its gate lives in another
workflow (`TypeScript Type Check`, not `Check Generated Artifacts`)"
becomes: its gate lives in `Type Check · consumer gates`, not in `Type
Check · source gates` where `check:docs` and the other spec
generated-artifact gates run (`check:i18n` is a consumer-lane gate,
`lint.yml:6333`); both feed the required `TypeScript Type Check`; it
reads the `dist/*.d.ts` that lane builds first.
3. **§5 command block.** `pnpm check:i18n && pnpm --filter
@objectstack/spec test` becomes `pnpm check:i18n; I=$?; pnpm --filter
@objectstack/spec test; echo "i18n=$I test=$?"`, so a red `check:i18n`
no longer hides the spec tests locally and both exit codes are printed
(a bare `;` would exit with the test's status only). This is the one
serial case in the playbook's own text.
4. **§6 lead.** "Four traps anchored elsewhere" becomes three: "serial
gates hide each other" is dropped, because the AGENTS.md section it
pointed at now says the opposite and item 1 states the measured cases in
place.

Line ceiling paid in place: item 1 +1 line, §6 -1 line, items 2 and 3
zero. No ceiling touched.

## Acceptance notes

**Order assumption 1 (measured).** AGENTS.md L654–656 holds for the
`lint.yml` lanes, and the reach is wider than the spec gates: every gate
step of every `Lint · *` and `Type Check · *` lane carries
`continue-on-error: true` plus an `id:`, and the last step `Lane
verdict` keeps the red (`.github/workflows/lint.yml:167-189`). What
still hides, measured:

- **Build steps stay fail-fast** (`lint.yml:174-176`). In `Type Check ·
consumer gates` the `Build workspace packages` step
(`lint.yml:6008-6013`) has no `continue-on-error`, so a build red skips
every gate behind it, including `check:api-surface` (`:6113-6116`) and
`check:i18n` (`:6330-6333`). Test Core's `Build this shard's dependency
closure` (`ci.yml:1359-1384`) is the same; inside the test step
`--continue=dependencies-successful` runs every other package but
withholds a package whose own dependency failed (`ci.yml:1589-1598`).
- **`Spec property liveness`**
(`.github/workflows/spec-liveness-check.yml:57-82`): `check:liveness`,
`check:empty-state`, `check:variant-docs`, `check:strictness-ledger` are
plain steps with no `continue-on-error`, so a red liveness ledger (the
UNCLASSIFIED / ORPHAN failures §2 warns about) skips the three after it,
including `check:variant-docs`, the gate §4 says bites retirements.
`check:variant-docs` runs nowhere else in `.github/workflows/`.
- **Dogfood** never runs on `pull_request` (`ci.yml:120-128`, job `if:`
at `ci.yml:2734`); it first runs on the merge-queue build, where its
matrix is fail-fast (`ci.yml:2749`), as is Test Core's there
(`ci.yml:1061`, `:1599-1603`). The pull_request run of Test Core still
names every shard's reds.
- **Not hiding:** `check:authorable-surface` feeds `check:docs`
(`lint.yml:191-195`), but the second red names its cause.

**Order assumption 2 (measured).** `Check Generated Artifacts` is not a
workflow `name:` in `.github/workflows/*.yml` and appears nowhere in the
tree except this line. `TypeScript Type Check` is real: the required
aggregate job (`lint.yml:6465-6466`) of workflow `Lint & Type Check`
(`lint.yml:1`), not a workflow. Check-run names read on PR objectstack-ai#33483 head
82cc3c1: `Type Check · source gates`, `Type Check · workspace`, `Type
Check · debt ledger`, `Type Check · consumer gates`, `TypeScript Type
Check`, all present. The generated-artifact gates (`check:skill-docs`,
`check:spec-changes`, `check:upgrade-guide`, `check:authorable-surface`,
`check:docs`, `check:skill-refs`, `check:react-blocks`) run in `Type
Check · source gates` (`lint.yml:5145-5444`); `check:api-surface` runs
in `Type Check · consumer gates` (`lint.yml:6113-6116`). `Spec property
liveness` was read as a check-run on PR objectstack-ai#33465.

**AGENTS.md (not in scope, not changed).** L651-653 says the six
artifact gates "all live in one job, `TypeScript Type Check`"; they run
in two lanes behind that aggregate job. The required-context reading is
right; the "one job" wording is loose. Named for the seat; no card class
applies.

`check:required-contexts` scans this file (scan-only,
`scripts/check-required-contexts.mjs:676-680`); it stays green with the
new lane names.

## Verification

Head `df8c9050` (review fix on top of 2b04592), base `origin/main`
4bba8b8.

<details><summary>Derived gates: 19 derived, 19 green</summary>

`node scripts/pm/dispatch-gates.mjs --commands --repo
objectstack-ai/objectstack` derived 19 families for the one path. Each
ran on df8c905 with its exit captured before any pipe, after `turbo run
build --filter=@objectstack/lint...` under the verify lock (VERDICT
command-exit 0):

- exit 0: `check-closing-keyword-parity` (scan and `--self-test`),
`check-comment-mask-corpus`, `plan-test-core-shards --self-test`,
`check-harness-current --self-test`, `@objectstack/lint
check:doc-formula-expressions`, `check:agent-test-spelling`,
`check:ci-filter-parity`, `check:cross-package-test-inputs`,
`check:doc-authoring`, `check:driver-memory-census`,
`check:gitlink-declared`, `check:nul-bytes`, `check:pm-governed-merges`,
`check:pm-skill-ratchet`, `check:refd-timer-probe`,
`check:required-contexts`, `check:skill-frame-sync`,
`check:watch-hint-literal`.
- `--ran` reconciliation: "19 derived famil(ies) accounted for — 19 run,
0 NOT-MEASURED".
- CI families are read from this PR's check-runs, not re-run here.

</details>

<details><summary>Line budget</summary>

- `node scripts/pm/check-skill-line-ratchet.mjs`: exit 0, "is 336 lines
(ceiling 337; headroom 1)"; no line over 120 bytes. Its info line on
this file (widest table row 324, pin 326) is unchanged by this diff: no
table row is touched.
- No `skills/**` path: the token ratchet and the published-package
readings do not apply. `skip-changeset` (`.claude/**` does not ship).

</details>

<details><summary>Tier and governed readings</summary>

- `dispatch-gates --tier`: no path-derived mandate (the surface hits
none of the declared globs); the tier stays the seat's per-card call.
- `node scripts/pm/check-governed-merges.mjs --branch
claude/project-thread-j01qh2`: GOVERNED, Tier S (`.claude/**` ×1). Size
+11 / -11 at 2b04592, three lines more changed at df8c905; under the
3000 threshold.

</details>

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_01FEkQ5kJFi5T1hSXrdUxhzH

<!-- signed: domain:skills#1 · os-project-manager ·
session_01FEkQ5kJFi5T1hSXrdUxhzH -->

---------

Co-authored-by: Claude <noreply@anthropic.com>
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 pm:awaiting-merge PR only: landing waits on the maintainer's own review and merge (SKILL.md 复核 ②); never on an issue protocol:data size/m tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Stale rollback claims: three code comments say the in-memory driver cannot roll back, and ADR-0067 D3 calls revertCommit atomic

3 participants