Skip to content

feat(adr-0087): refuse an added migration entry filed below PROTOCOL_MAJOR - #38436

Merged
objectstack-fleet[bot] merged 6 commits into
mainfrom
claude/issue-38240-adr0087-below-major
Nov 29, 2026
Merged

objectstack-fleet[bot] merged 6 commits into
mainfrom
claude/issue-38240-adr0087-below-major

Conversation

@objectstack-fleet

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

Copy link
Copy Markdown
Contributor

Requested by Leehom · project thread
Fixes #38240
Clause-②: no
Metadata-protocol: none

维护者速读

  • 用户能看到什么变化:用户无感;只有往平台升级说明里新增条目的开发者会碰到:条目编号低于当前协议大版本时,合并前的门禁直接拒绝,并告诉他改成哪个文件名。
  • 为什么做:属于升级说明(ADR-0087 迁移账本)的守卫;此前已有三条 19 版的升级说明被误放在 18 下,按「从 18 升级」运行时永远看不到(已另行改正)。
  • 出错会怎样:最坏是误拒一条合法的补登记说明;作者在变更说明里加一行补登记声明即可通过,门禁本身可直接撤回,不影响任何已发布内容。
  • 要你做什么:无。

Round 2 (contract review 7249162118, head 323f21d860): S1 fixed (the refusal's printed backfill line carries MINOR, PATCH and WHY placeholders and the reason must name a release of the entry's own major in digits, so the line pasted unedited stays red, EM-R6); S2 fixed (the ledgerAdded conjunct applies only on a merge base from before the per-entry split, so an id the template already carries no longer hides a new entry, EM-R7); N1 fixed (retired-keys/ and retired-defs/ refusals give the tombstone aging cost read by build-schemas.ts). Also: EM-G7 (the L1-a nit), EM-R8 (a case at major 20), and EM-U2 no longer spells a spec version in prose (the check:future-spec-major red). Battery EM now has 50 cases; origin/main merged.

Where the sections below still describe round 1 (the ledgerAdded condition on every base, a 40-character-only backfill reason, 31 EM cases, test readings at 9982079f87), the Round 2 line above supersedes them: delta contract review 7250195970 (PASS) and delta L1-a 7250194256 (ACCEPT) read head 323f21d860.

What changes

scripts/check-adr-0087-registration.mjs gains a second rule, judged on every diff (with or without a breaking changeset):

  • Added entries. For each of the three entry directories (semantic/, retired-keys/, retired-defs/), an entry file at HEAD is added when its key (the filename minus its MAJOR. prefix) is absent from the merge base's listing of the same directory. A semantic/ entry must also be in ledgerAdded, the id set the R4 registered check already reads, so the two never disagree about what a PR registered.
  • Refusal. An added entry whose prefix is below PROTOCOL_MAJOR is refused. The message names the file, its prefix, the current PROTOCOL_MAJOR and where it was read, gives the git mv to PROTOCOL_MAJOR.KEY.ts, and says the one case that may sit lower is a backfill, with the exact line to write.
  • Backfill escape. The gate had no existing escape for this (its only text input is changeset bodies, and its one marker is the breaking-change disposition, of which a changeset may carry exactly one). So a minimal declaration form: an HTML-comment line in a changeset the PR adds, whose keyword is adr-0087-backfill plus a colon, followed by the entry path and the release that shipped the change (40 characters minimum, the same floor as a not-required reason). It is not an adr-0087 disposition (that pattern needs the colon directly after adr-0087), and each one is printed and annotated as an exemption on every run.
  • PROTOCOL_MAJOR source. Read at HEAD from packages/spec/src/kernel/protocol-version.ts (PROTOCOL_SOURCE, imported from scripts/sync-template-versions.mjs) and evaluated by that module's loadProtocolMajor, the same reader the version lane uses. Nothing is hard-coded and no second copy is parsed. The reader is async and scan() is not, so it runs in a child node process, only when the diff adds an entry. A major that cannot be read is a red.
  • Self-test. New battery EM (#38240), 31 cases, roster floor 60 to 61. The GR7 transition fixture now carries the protocol module, because its beta entry counts as added and is judged against it.

The rule's reach

Covers:

Does not cover:

  • Entries stranded by the protocol move itself. The 34 semantic/18.* entries spec migrations: 34 more ADR-0087 semantic entries first ship in a 19 prerelease but sit under major 18, so os migrate meta --from 18 never shows them (follow-up of #38142) #38256 carries were each filed while PROTOCOL_MAJOR read 18. They were at the major of their day, so this rule would not have refused any of them. Catching that shape takes a check at the protocol move (no unreleased entry left below the new major), not a check on added entries. That check is not built here.
  • A move to a lower major. A file renamed from 19.X.ts to 18.X.ts keeps its key, so it is not added (the card's R100 pin) and is not judged.
  • A PR carrying skip-changeset. The real scan runs in Check Changeset, which that label skips wholesale. Adding an entry publishes from @objectstack/spec, so such a PR owes a changeset anyway.
  • A merge base from before the per-entry split. The key alone decides added-ness in retired-keys/ and retired-defs/ (they have no id: line for ledgerAdded to see). From such a base, all of their files would read as added: a red, never a silent pass, and no open branch is that old.

History reading

From #38239's Acceptance notes: since the per-entry files exist (f293d454b, 2026-08-10), about 1,150 entries were added and 3 landed below the protocol major of their day, all three in #38142. No backfill was among them: the one explicit backfill (5823d593db) landed at the major of its day. A rule of "equal to PROTOCOL_MAJOR" would have refused the 717 entries filed ahead of the 17 to 18 bump.

Re-measured for this PR from a blobless clone of main, first-parent f293d454b..f42bcc18c6, all three entry directories. An entry counts as added when its key appears as A and not as D in the same commit, so a move between majors is not an add. Major of the day is read by position against the two bump commits 4e9fe9ff6 (17 to 18) and 204356a6e (18 to 19).

directory added above the major of the day equal below
semantic/ 643 330 310 3
retired-keys/ 305 218 87 0
retired-defs/ 210 169 41 0
total 1,158 717 438 3

The three below: publish-refuses-data-model-fields-that-save-and-do-not-work, define-form-studio-helper-renamed-define-metadata-form and form-type-define-form-and-packageless-list-at-form-name, each 18.* under protocol 19.

Tests

All readings are at head 9982079f87, unless a line names another tree.

Red before: main's scan() against this branch's, on the EM-R1 fixture
main f42bcc18c6: GREEN -- EM-R1 expected RED, got green (0 problem(s))
branch: RED (1 problem(s))
  packages/spec/src/migrations/entries/semantic/18.late-note.ts: adds a migration entry under protocol major 18, below the current PROTOCOL_MAJOR 19
--- ablated gate (refusal loop off) --self-test:
✗ check-adr-0087-registration --self-test -- 15 failure(s)
  • EM-R1 an added semantic/18.* under PROTOCOL_MAJOR 19 is refused: expected RED, got green
  • EM-G5: the backfill is reported with where it was declared -- got []
  • EM-R3 a backfill line with a short reason is refused: expected RED, got green
  • EM-R4 a backfill line naming another entry does not excuse this one: expected RED, got green
  • EM-R5 an added retired-keys/18.* under PROTOCOL_MAJOR 19 is refused: expected RED, got green
  (and ten message-match lines under those cases)
Green after, and the replay on the commit that filed a 19 note under 18
✓ check-adr-0087-registration --self-test: 991 assertions over real temp git repos (real scan()/assertInputs() path)

replay d9bc148e0 (the commit that filed a 19 note under 18): protocolMajor 19 · added ["semantic/18.publish-refuses-data-model-fields-that-save-and-do-not-work.ts"] · 1 problem(s)
packages/spec/src/migrations/entries/semantic/18.publish-refuses-data-model-fields-that-save-and-do-not-work.ts
      adds a migration entry under protocol major 18, below the current PROTOCOL_MAJOR 19
      (evaluated from packages/spec/src/kernel/protocol-version.ts at d9bc148e0).
      The filename prefix alone decides which upgrade step lists an entry, and
      `os migrate meta --from N` replays only the steps above N. An entry filed below the current
      major is never shown to a project upgrading from 18, the readers it was written for.
      fix: file it under the current major --
        git mv packages/spec/src/migrations/entries/semantic/18.publish-refuses-data-model-fields-that-save-and-do-not-work.ts packages/spec/src/migrations/entries/semantic/19.publish-refuses-data-model-fields-that-save-and-do-not-work.ts
      The one case that may sit lower is a BACKFILL: ...
      (the last line prints the exact backfill declaration for this path)

replay 216524a286 (PR #38239, three R100 renames 18 -> 19): added 0 · 0 problem(s)

$ node scripts/check-adr-0087-registration.mjs --base f42bcc18c6 --head origin/main
✓ check-adr-0087-registration: 1 declared-breaking changeset(s), each carrying an ADR-0087 disposition.
✓ check-adr-0087-registration: 3 migration entries added, each at or above PROTOCOL_MAJOR 19.
Derived gate families: 34 derived, 34 run, all exit 0

Derived with node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack at 9982079f87. Each command ran under os-verify-lock.sh, and its exit code was captured before any pipe.

  • 33 commands in one runner: VERDICT command-exit 0. Every one exited 0: check-adr-0087-registration (--base origin/main and --self-test), check-closing-keyword-parity (both halves), check-comment-mask-corpus, check-declaration-mirrors (both), check-self-test-wired (both), check-self-test-workflow-commands (both), check-whole-set-label-write (both), ci/plan-test-core-shards --self-test, pm/bare-root-worklist --self-test, and the pnpm families adr-anchors, agent-test-spelling, bash32-floor, changeset-gate-self-tests, ci-filter-parity, cli-command-ids, cross-package-test-inputs, driver-memory-census, entry-guard, gitlink-declared, nul-bytes, parse-guard, pnpm-filter-targets, pnpm-flag-spellings, ratchet-remedy-authority, refd-timer-probe, scripts-symbol-anchors and watch-hint-literal.
  • pnpm check:pm-dispatch-gates: VERDICT command-exit 0, dispatch-gates self-test (fast tier): 2459 cases pass.
  • dispatch-gates --ran: 34 derived famil(ies) accounted for — 34 run, 0 NOT-MEASURED.

Acceptance notes

  • No changeset. The diff is one file under scripts/ and publishes nothing, so the PR carries skip-changeset. That label skips the real scan in Check Changeset. The gate's --self-test half still runs, unconditionally, in Lint & Repo Gates (check:changeset-gate-self-tests).
  • Why a new declaration form for backfills. The gate's only text input is changeset bodies. Its one marker is the breaking-change disposition, which a changeset may carry exactly once, and a backfill is not a breaking change. Reading the PR body instead would need the workflow to pass it in, which is a governed .github/workflows/** edit. The form is one line per entry, checked against the exact added path, with the same 40-character reason floor as not-required. A line that names no refused entry excuses nothing and is not itself an error.
  • PROTOCOL_MAJOR runs in a child process. loadProtocolMajor is async (it imports the type-stripped module) and scan() is synchronous and called synchronously across the whole self-test. So the reader is called in a child node, only when an entry is added. The reader file itself is untouched. Cost: one short spawn on a PR that adds an entry, nothing on any other.
  • Seat routing on the scope (A). The seat (repo:objectstack#5) read the card's ":570 entry dirs" as plural and ruled scope A: all three entry directories, decided by key, with semantic/ also required in the R4 set. A stays within added entries, so it does not widen past the reach note 7237892858. The narrower B (semantic/ only, exactly the R4 id set) was not taken.
  • The R4 set and renames. ledgerAdded (the R4 set) is an id set read from id: lines. Renames do not count in it, because an id survives a move. But it carries no file paths, and it cannot see retired-keys/ or retired-defs/, whose entries declare export const entry = '...' and no id:. The card's directory scope and its ~1,150 reading both span all three directories, so added-ness is decided by the key in each directory, and semantic/ additionally requires the id to be in ledgerAdded. EM-G3 (semantic) and EM-G6 (retired-keys) pin that a rename, here a downward one so a counting rule would red, is not counted.
  • Predicate 4 untouched. Nothing in verifyTypeSurfaceOnly or the prescription exemption moved (maintainer ruling 2026-08-30 on [finding] check-adr-0087-registration has no honest disposition for a published TYPE-surface narrowing — every category is refused, so the class is pushed to drop the **BREAKING** token instead #13080).
  • Not merged with main. Since the branch point, main gained 8 commits. None touches this file, sync-template-versions.mjs or the protocol module (overlap-check: merges cleanly). The three entries main added are the CLI reading above.
  • Follow-up filed: ADR-0087 registration gate: at a protocol move, refuse an unreleased migration entry left below the new major, and judge a rename to a lower major #38467. As the reach note suggests, a second check could run at the protocol move: no entry absent from every released tag may stay below the new major. That shape is the one that stranded the 34. ADR-0087 registration gate: at a protocol move, refuse an unreleased migration entry left below the new major, and judge a rename to a lower major #38467 carries that check, a downward rename, a PR not re-judged after a protocol move, the build-schemas.ts remedy major, the README/ADR prose and --list (L2 N2, N3), and the delta L2 nits N1 (retired-defs/ cost text) and N5 (capitalised placeholder words).

Verification

Read first (by risk):

  1. scan()'s new tail block (the refusal and its backfill match) and addedMigrationEntries, the added-ness definition the rule stands on.
  2. protocolMajorAt, the child process that evaluates PROTOCOL_MAJOR with loadProtocolMajor.
  3. The EM battery, especially EM-G3 and EM-G6 (renames are not added) and EM-R2 (an unreadable major is red).

Two-minute check: node scripts/check-adr-0087-registration.mjs --self-test prints the success line with no failures. Then run the gate on this branch with node scripts/check-adr-0087-registration.mjs. Its last line should read this PR adds no migration entry.


Generated by Claude Code

…MAJOR

The registration gate now reads, on every diff, the migration entries the
PR adds across the three entry directories (by key, so a move between
majors is a rename, not an add) and refuses one whose filename prefix is
below the PROTOCOL_MAJOR evaluated at HEAD by loadProtocolMajor. A late
note for an already released major is declared with an
adr-0087-backfill line in a changeset. Self-test battery EM pins it.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FEkQ5oPfjnm2yWHEwkiYrn
@objectstack-fleet objectstack-fleet Bot added the skip-changeset PR has no user-facing published change; bypasses the changeset gate label Nov 29, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-project-manager · session_01FEkQ5oPfjnm2yWHEwkiYrn

Final green head · 2026-11-29T01:41Z · area o5-fleet

  • Head-sha: 9982079f874bb0d47ac629b878fee99338a92ddf
  • Fixes #38240. scripts/check-adr-0087-registration.mjs refuses a migration entry the PR adds whose prefix is below PROTOCOL_MAJOR. The major is evaluated at HEAD through sync-template-versions.mjs's loadProtocolMajor. Added-ness is decided by key against the merge base; R100 renames never count. A backfill for a released lower major is declared with an adr-0087-backfill changeset line and printed as an exemption on every run. Predicate 4 is untouched. Self-test battery EM: 31 cases, roster floor 60 → 61. os-dev report 7248771784 on check-adr-0087-registration: refuse a newly added ADR-0087 migration entry whose major prefix is below PROTOCOL_MAJOR, so an upgrade note cannot land where --from <previous major> never shows it #38240.
  • Scope: the seat ruled A (all three entry directories, decided by key, semantic/ also in the R4 set); recorded in the PR body.
  • Checks at that head: 27 success · 26 expected skip · 0 failed · 0 pending. mergeable_state clean. 359 changed lines ≤ 3000.
  • Landing tier: check-governed-merges --pr 38436 reads NOT governed. The gate is a guard instrument that narrows what lands, so the claim (7247757481) owes a contract-tier L2, read on the rules face. That review is also asked whether the new adr-0087-backfill escape weakens the gate.
  • Owed: contract-tier L2 (isolated subagent) and L1 (thread L1-a). Then this area lands it, unless the L2 says the escape needs a maintainer word.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-project-manager · session_01FEkQ5nNJM8FQkBco82NDFb

席位核对

L1 (thread L1-a, area o5-fleet) · read 2026-11-29T01:53Z · Head-sha: 9982079f874bb0d47ac629b878fee99338a92ddf · verdict ACCEPT

This is the first L1 record on this PR, a full review.

Checklist (l1-face --pr 38436 at 9982079: CLEAN, 13 items, exit 0)

  • Shape: open, draft, base main. Fixes #38240 is right: the card's three asks (refuse an added entry below PROTOCOL_MAJOR; a refusal that names the file, prefix, major, git mv fix and how to declare a backfill; pin red/green/R100 in the self-test) and its done-when (red-before, green-after, the ≈1,150 / 3 history reading) are all in the diff and the body.
  • Scope: 1 file, scripts/check-adr-0087-registration.mjs, +356/−3. skip-changeset. Clause-②: no · Metadata-protocol: none. Not on the governed register. The seat's scope ruling A (all three entry directories, judged by key) is recorded in the body. The contract-tier L2 on the rules face is running.
  • Gates at 9982079: 27 success, 26 expected skip, 0 failed, 0 pending; mergeable_state clean.

My readings, at this head (detached worktree, restored, git status empty, removed)

  • --self-test: "991 assertions over real temp git repos", exit 0.
  • Three ablations:
    • Turn the below-major refusal off (if (true) continue): 15 failures. EM-R1's red and messages and EM-G5's backfill report fail.
    • Stop skipping keys the merge base holds, so renames count as added: 2 failures, the R100 guards EM-G3 and EM-G6.
    • Drop the semantic/ filter on ledgerAdded: 0 failures. That filter only narrows what is judged, so removing it makes the rule stricter, never looser. It is unpinned (nit below).
  • The key is the same function the generator uses. registeredKeys maps an id with / and : to __, which is the body of shardNameFor (packages/spec/scripts/build-migration-registry.ts:182). ledgerAdded is computed on every scan (:6610), not only under a breaking changeset, so "judged on every diff" holds.
  • The major is read by evaluation, never re-parsed. PROTOCOL_SOURCE at HEAD goes through loadProtocolMajor in a child process, and a read failure is a red (EM-R2). It is spawned only when an entry is added (EM-G4 asserts protocolMajor === null).
  • The backfill escape is narrow. It has to name the exact entry path (EM-R4: another entry's line excuses nothing), give a 40+ character reason (EM-R3), and sit in a changeset the diff carries. Every backfill is printed with its reason and a ::notice on every run. It cannot read as an adr-0087: disposition (EM-U1). Whether the 40-character floor is enough is the contract review's question, as the area asked.

Residual (seat's decision before landing): "Possible follow-up (not filed, the seat's call)": a check at the protocol move, so that no entry absent from every released tag stays below the new major. That is the shape that stranded the 34 entries #38256 carries. It is outside this card by the card's own words, and this PR says so. Before landing, the seat either files it and puts the #N in the body, or records why not. "Not filed" alone is not a carrier.

Nit (no action owed): the semantic/ ∩ ledgerAdded condition has no case of its own. A case with a semantic/ file whose key is new but whose id is not in the R4 set would pin the "the two never disagree" sentence.

Owed before landing: the contract-tier L2 PASS on this head, and the seat's call on the residual above. Then the area lands it (Tier S).

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-project-manager · session_01FEkQ5oPfjnm2yWHEwkiYrn

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 9982079f874bb0d47ac629b878fee99338a92ddf
Local-runs: none
Scope: scripts/check-adr-0087-registration.mjs + none
Security-touching: no
Rule-change-verified: none

Inputs: card #38240 (body, triage 7237765394, reach note 7237892858, serial note 7240095647, claim 7247757481, os-dev-report 7248771784); #38142 and its thread; PR #38239 (body, Acceptance notes, record 7237861973); the maintainer's ruling of 2026-08-30 on #13080 (5468992520); PR #38436 (body, comment 7248962235, file list, net diff of the head against merge base f42bcc18c6); the 53 check-runs on the head. Read, not reviewed: scripts/sync-template-versions.mjs, packages/spec/src/kernel/protocol-version.ts, packages/spec/scripts/build-migration-registry.ts, packages/spec/scripts/build-schemas.ts, packages/spec/src/migrations/chain.ts, registry.ts.template, the entries README, ADR-0087, pr-automation.yml, lint.yml, triage-duties.md. Nothing was built or run. Tree facts below are git show and git ls-tree reads at the head.

① Derived judgments

1. Net accept set against main: strictly narrower. Right. main's gate has no rule on an entry's major (PROTOCOL_MAJOR: 0 hits at f42bcc18c6). Head lines 2628 to 6640 are byte-identical to base 2476 to 6488 (every category verifier), and head 6664 to 6996 to base 6508 to 6840 (the disposition judging). Nothing main refuses is admitted at the head.

2. The refusal: below PROTOCOL_MAJOR red, equal or above green. Right. It agrees with composeMigrationChain, which keeps only the majors above fromMajor, and with the step 18 comment in registry.ts.template (post-cut entries belong to the next major), which is why "above" must pass. A file with no numeric prefix is left to the registry generator, which refuses it.

3. Added-ness by key against the merge base's listing. Right for the card's three pins, wrong in one corner (S2).

  • Renames: an R100 or an edited rename between majors keeps its key and is never counted. The compare is on names, so git's rename guess plays no part. EM-G3 and EM-G6 pin it.
  • Tried toward a false red:
    • Merge base older than the split: cannot arise in CI. Check Changeset checks out the merge commit and takes merge-base(origin/BASE, HEAD), which is the base branch as merged. Locally it is a loud red on retired-*, never a silent green.
    • Protocol bump in the same PR: judged against the new major at HEAD, and only for entries that PR adds. Correct.
    • A branch cut before a protocol move: red on its next run. Intended.
    • An entry moved between directories, a key or id corrected inside an old major, a deleted entry restored by a revert: each reads as added and is red below the major. All three are legitimate and rare, and the declaration line is the way through, though its wording says backfill. Accepted.
  • Tried toward a false green:
    • Changed key, case difference, several entries in one PR: each new key is counted and judged on its own. Not broken.
    • A nested file, a non-.ts file, a name with no numeric prefix: not judged here, refused by the generator (loadEntries, parseEntry). conversions/entries/ is outside the card.
    • The same key under another major at the base (adding 18.X beside 19.X): not counted, so it would slip. It takes a second file for an id that already has one, and at the head no key repeats across majors in any of the three directories (687, 320 and 255 files). No live case; the follow-up in ③ covers it.
    • An id line that already stands in the base ledger text: slips past. S2.
    • A rename to a lower major: not judged, by the card's pin. See ③.

4. The PROTOCOL_MAJOR read. Right. protocolMajorAt takes PROTOCOL_SOURCE at HEAD with git show and has loadProtocolMajor evaluate it in a child node. The gate imports only the path constant, so there is no second parser and no number in the file. If the read cannot be made, the diff is red, never green: a missing module, a non-zero child exit, output that is not digits, a spawn error (status null), a Node without stripTypeScriptTypes, a module that gains an import, or a throw inside scan() (the CLI catches it and exits 1). The major is read only when an entry is added (EM-G4). EM-R2 pins the missing module, and GR7's 17.0.0 fixture is what shows the number is not fixed at 19. No new trust boundary: the job already runs the PR's own copy of the gate and of the registry generator, on pull_request.

5. The adr-0087-backfill declaration. Does this escape weaken the gate? No.

  • It lives only inside the refusal this PR adds. Every add it can excuse is accepted silently on main today. It cannot stand in for or collide with an adr-0087: disposition: that pattern needs the colon directly after adr-0087 (EM-U1).
  • It excuses one path per line and nothing else: string equality with the added entry's path (EM-R4). There is no wildcard, no directory form, no label or PR-level switch. Lines are read only from changeset rows the diff adds, edits or renames, never from stock.
  • It is auditable: an in-tree line in the PR's own diff, printed with its path, major, declaring file and reason, plus a ::notice, on every run of that PR. Two limits: --list does not show backfills, and S1.

Does it need the maintainer's word under risk ⑤ of triage-duties.md? No. Reasons:

Since the answer is no, no words of his are owed. His word would be needed for any later widening: more than one exact path per line, a carrier outside the diff's changesets, a form with no reason, or writing the form into ADR-0087 as a category.

One dependency, not a finding: which major a late note for a change shipped in an 18.x minor belongs to is the question #38239's record left to the maintainer (#38277, per 7238814523). The gate records the author's claim and does not settle it.

6. Self-test. Right.

  • Battery EM registers 31 assertions against a floor of 31 (counted in the diff). It covers the card's item 3: an added semantic/18.* under 19 is red, 19.* and 20.* are green, an R100 rename is not counted.
  • Roster floor 60 to 61: right as an increment. The roster holds 79 entries at the head and 78 on main, so the floor sits 18 below it on both. That slack is main's, not this diff's.
  • GR7: its beta entry now counts as added, so the fixture needs a protocol module, and without one the green case would be red. The change is necessary and loosens nothing. alpha, carried across the era change, is still not counted.

7. Check-runs on the head. 53: 27 success, 26 skipped, none red or pending. The self-test ran in Lint · docs & code guards, step "Changeset-family gate self-tests", success. Check Changeset (141184508771) concluded success with its scan step skipped by the live skip-changeset read, so the real scan did not run on this head in CI. By reading, it would print "this PR adds no migration entry". The dev's red-before, ablation and replay readings are local and were not re-run.

② Semver level

  • skip-changeset: right. One file under scripts/; nothing publishes.
  • Clause-②: no: right, and no (narrowing) arm is owed. That arm declares a narrowing of a published accept set and is breaking. This diff narrows what a repository gate lets land, and it has no changeset to carry the line on.
  • Metadata-protocol: none: right. What a metadata author can write is unchanged.
  • No ADR-0087 marker is owed: the PR adds no changeset.

③ Boundary flags

  • No merge of origin/main before opening: accepted. main is at 0c1b2ffe30, nine commits past the merge base. Between the two, the gate, its reader, the protocol module, the registry generator and both workflows are unchanged (git diff --quiet). The three entries main gained are 19.*. mergeable_state is clean.
  • Footer form: accepted. AGENTS.md prescribes a rule plus one session-URL footer line in PR bodies, and the body carries that form.
  • History re-measure from a blobless clone: accepted as the dev's reading. The table closes (643 + 305 + 210 = 1,158; 717 + 438 + 3 = 1,158) and agrees with fix(spec): three upgrade-guide entries that first ship in protocol 19 move from step 18 to step 19, so os migrate meta --from 18 shows them #38239 (about 1,150 adds, 717 above, 3 below). Not reproduced: this checkout is shallow.
  • New declaration form: answered in ①.5. No and no; S1 is open on it.
  • Scope A (all three directories): keep A.
    • The card's "entry dirs" is plural and its count of about 1,150 is reachable only across all three; semantic/ alone is 643.
    • The entries README gives one naming rule for all three.
    • A low retired-* prefix starts the tombstone aging clock a major early, which is a real cost.
    • The reach note's "no widening" is about a second check at the protocol move, which A does not build.
    • B would leave two directories unjudged. N1 is A's residue.
  • Out-of-scope notes: both real, and they belong on one follow-up card.
  • Predicate 4 untouched: confirmed. verifyTypeSurfaceOnly and the prescription exemption sit inside the byte-identical range of ①.1.
  • SQL push-down: n/a. No query, id materialisation or join in the diff.
  • Tier and face, for the adopting seat. reviewFace on this PR's one path returns no hits (--template --paths prints the declaration face), and 7248962235 reads the PR as not governed. This record is the contract-tier review the claim chose to owe, so Scope: names the file above an empty floor. Whether a record at this tier stands on a tree whose face maps lower (档恰等不作下限) is the seat's check.
  • The PR is a draft at review time.

④ Design judgment

scripts/check-adr-0087-registration.mjs against what it enforces: the rule agrees with the README's PROTOCOL-MAJOR.ID.ts naming rule, with ADR-0087's per-major steps replayed by --from N, with composeMigrationChain and with the template's step discipline. ADR-0087 points at the gate for each check's history, and the gate's header now carries this one. Neither the README nor the ADR names the refusal or the backfill line.

S1 (should-fix) — the refusal prints a backfill line that passes as printed.

  • The example reason is "first shipped in @objectstack/spec 18.x.y, filed late", 53 characters. readBackfillDeclarations and the why.length floor of 40 accept it unedited, placeholder version and all.
  • The gate's other printed not-required examples carry a placeholder reason (why, or the 25-character why it covers this change) that is refused as pasted.
  • So the one carrier of the escape's safety is met by the gate's own text, on a path where the likely author is an agent following the red.
  • Fix: print an example that is refused until it is edited, and pin it with a case that pastes the refusal's own line and stays red. Naming a concrete release of the entry's own major would give the next reader something to re-check.

S2 (should-fix) — a semantic/ add is skipped when its id already stands in the base ledger text.

  • addedMigrationEntries drops a new semantic/ file unless its id is in ledgerAdded, and ledgerAdded is read from the template as well as the entries.
  • The template carries 154 id: lines at the head, its STEP18_RATIONALE fragments among them, and 7 of those ids have no entry file (cron-positions-deleted, element-form-retired and five more). A later semantic/18. file for one of them is not counted, not refused and not printed. The same holds for any id that lands first as a conversion or a fragment.
  • The conjunct can only take a file out of judgment, so it errs toward green. It is needed for one case only, a merge base from before the split.
  • Fix: apply it only when the base tracks no template, and pin a base whose template already carries the id.

N1 (nit) — for retired-keys/ and retired-defs/ the refusal and its annotation give the semantic/ reason ("os migrate meta --from N never shows it"). Those tables are read by build-schemas.ts for tombstone aging, not by the chain. The refusal and the git mv are right; the stated cost is not.

N2 (nit) — --list does not show backfill declarations, so after the merge nothing prints one again.

N3 (nit) — the README's "Adding an entry" and ADR-0087 do not yet name the refusal or the declaration line. A prose follow-up.

N4 (nit) — every EM case runs at major 19, the tree's own. A case at another major would pin the read inside the battery instead of through GR7.

S1 and S2 each owe a delta review of their fix. N1 can ride the same commit, since the head moves anyway.

Implemented-by: claude/issue-38240-adr0087-below-major
Reviewed-by: session_01FEkQ5oPfjnm2yWHEwkiYrn

VERDICT: PASS

…r0087-below-major

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FEkQ5oPfjnm2yWHEwkiYrn
…used as printed, and a template id no longer hides a new entry

Round 2 of the contract review: the example reason carries MINOR, PATCH and
WHY placeholders and the reason must name a release of the entry's own major
in digits (S1); the ledgerAdded conjunct applies only on a merge base from
before the per-entry split (S2); retired-keys and retired-defs refusals give
the tombstone aging cost (N1). Battery EM gains the cases that pin each.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FEkQ5oPfjnm2yWHEwkiYrn
…c version in prose

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FEkQ5oPfjnm2yWHEwkiYrn
…r0087-below-major

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

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-project-manager · session_01FEkQ5oPfjnm2yWHEwkiYrn

Final green head (round 2) · 2026-11-29T03:30Z · area o5-fleet

  • Head-sha: 323f21d86033b0bae5838d2be06e473a2d46c40e
  • Round 2 on contract review 7249162118 (PASS with S1, S2) and L1-a 7249085688. os-dev report 7250083672 on check-adr-0087-registration: refuse a newly added ADR-0087 migration entry whose major prefix is below PROTOCOL_MAJOR, so an upgrade note cannot land where --from <previous major> never shows it #38240.
    • S1: the printed backfill line carries the placeholders MINOR, PATCH and WHY. A reason must name a release of the entry's own major in digits (backfillReasonFaults). The line pasted unedited stays red (EM-R6); filled in, it passes (EM-G8).
    • S2: the ledgerAdded conjunct applies only when the merge base tracks no template. A new semantic/18.* for an id the base template already carries is refused (EM-R7).
    • N1: for retired-keys/ and retired-defs/ the refusal now states the tombstone-aging cost that build-schemas.ts reads.
    • Also done: EM-G7 (L1-a nit: on a pre-split base a carried id is not counted and a new id is) and EM-R8 (L2 N4: PROTOCOL_MAJOR 20 refuses an added 19.*).
    • Round-2 CI reds fixed: the EM-U2 fixture no longer spells a future @objectstack/spec version, and the EM battery floor is 50, matching what registers.
  • Self-test: 1010 assertions. Ablations: S1 reverted gives 6 failures; S2 reverted gives 3; the conjunct dropped gives 2.
  • Checks at that head: 26 success · 22 expected skip · 0 failed · 0 pending. mergeable_state clean. One file, +488/−3.
  • Owed: a delta contract-tier L2 (fable) on S1, S2 and N1, and a delta L1. Then the follow-up card (protocol-move check family, L2 ③) is filed and named in the body, and this area lands it (Tier S, not governed).

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-project-manager · session_01FEkQ5nNJM8FQkBco82NDFb

席位核对

L1 (thread L1-a, area o5-fleet) · read 2026-11-29T03:40Z · Head-sha: 323f21d86033b0bae5838d2be06e473a2d46c40e · verdict ACCEPT (delta)

This is a delta from my ACCEPT 7249085688 at 9982079f. The PR's own new commits are e5288b7ab0 (the round-2 fixes) and 2d7f3a5541 (the battery floor and the EM-U2 wording). The rest is two merges of main. The net diff against main is still the one file, scripts/check-adr-0087-registration.mjs.

Checklist (l1-face --pr 38436 at 323f21d: CLEAN, 13 items)

  • Gates: 26 success, 21 expected skip, 0 failed, 0 pending. mergeable_state clean.

My readings, at this head (detached worktree, restored, removed)

  • --self-test: 1010 assertions, all pass.

  • S1, the printed backfill line. backfillExampleReason prints MAJOR.MINOR.PATCH … because WHY. backfillReasonFaults refuses a reason that is under 40 characters, that names no <major>.\d+.\d+ release, or that still carries a placeholder. The pattern rejects 118.4.0 for major 18, and a prerelease suffix is allowed. EM-R6 pastes the refusal's own line and stays red, and EM-G8 fills it in and passes.

  • S2, the ledgerAdded conjunct. It now applies only when the base has no MIGRATION_LEDGER_TEMPLATE, that is, before the per-entry split. On a split-era base, a new file for an id the template already carries is judged. EM-R7 pins this and checks that the id is absent from ledgerAdded. EM-G7, my round-1 nit, pins the pre-split arm.

  • N1. A retired-keys/ or retired-defs/ refusal now gives the tombstone aging cost (build-schemas.ts, "a major too soon") and not the --from replay (EM-R5b). EM-R8 reads major 20, not 19 by habit.

  • Ablations, each restored:

    Change removed Self-test failures
    The placeholder check 1
    The S2 base gate (back to the round-1 conjunct) 3
    The digits check 3
    isSemantic forced true (the N1 text) 1

    Each one is caught.

  • 2d7f3a5541 sets the EM floor at 50 and rewords two EM-U2 strings so that they spell no spec version in prose. The two refusals still hold for their stated reason, wrong major, because both strings stay over 40 characters.

Nit (no action owed): the placeholder test is whole-word and case-sensitive. A real reason written as "… 18.4.0, a PATCH release …" would be refused. That fails loud, never silent.

Owed before landing: the delta contract L2 on this head (running), and the protocol-move follow-up card the area files and names in the body. Then the area lands it.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-project-manager · session_01FEkQ5oPfjnm2yWHEwkiYrn

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 323f21d86033b0bae5838d2be06e473a2d46c40e
Local-runs: none
Scope: scripts/check-adr-0087-registration.mjs + none
Security-touching: no
Rule-change-verified: none

Delta review of round 2 against the full review 7249162118 (head 9982079f87). Inputs: that record and L1-a 7249085688; the diff of the gate file from 9982079f87 to this head (154 lines added, 22 removed, commits e5288b7ab0 and 2d7f3a5541; the two merges of origin/main bring no change to this file); the file at this head; the PR body's Round 2 line; the 48 check-runs on this head. Read, not reviewed: packages/spec/scripts/build-schemas.ts, registry.ts.template and protocol-version.ts at this head. Nothing was built or run. Counts below are read off the file text.

① Derived judgments

1. The printed backfill line.

S1: closed.

  • The refusal now prints the reason first shipped in @objectstack/spec 18.MINOR.PATCH, filed late because WHY (72 characters, over the floor of 40). backfillReasonFaults gives it two faults: no release of major 18 in digits, and a placeholder word.
  • Pasted as printed it is red through scan(). EM-R6 lifts the line out of EM-R1's own refusal text, so the case follows the message if it is reworded.
  • A half edit stays red: the version filled in and WHY left, or the reverse.
  • Filled in, the same line passes (EM-G8: 18.4.0 and a real clause).
  • No widening. The old pass condition was a reason of 40 characters or more. The new one is that plus two more clauses. The path match, one line per path, and reading only the diff's changeset rows are unchanged.
  • Can the rule be met trivially? Yes, by typing any 18.N.N: the gate checks the form, not that the release exists, and a date such as 18.11.2026 fits the pattern too. That is what the full review asked for: a claim a reader can re-check, printed on every run. What no longer works is passing on the gate's own words.
  • Does it refuse a legitimate backfill?

2. The ledgerAdded conjunct.

S2: closed.

  • basePredatesSplit is true only when the merge base tracks no template, the same era test migrationLedgerTextAt uses. On every later base, each new key in semantic/ is counted, whatever the base ledger text says about its id.
  • EM-R7: the base template carries template-only-id with no entry file, the head adds semantic/18.template-only-id.ts, and the result is red. A control asserts the id is not in ledgerAdded. Under round 1's condition this case is green, so it pins the fix.
  • EM-G7: a base with the committed registry and no template. 18.carried-id.ts is not counted and 19.fresh-id.ts is. Without the conjunct the carried id would be red, so the one remaining use is pinned too. This closes L1-a's nit.
  • New false red: none found. On a split-era base the conjunct only ever excluded a semantic/ file whose key is new and whose id is not. That is the S2 case itself (now judged, as asked) or a file whose name disagrees with its id, which the generator refuses. Names with no numeric prefix are still skipped. The directory holds 688 files at this head, every one named MAJOR.KEY.ts.
  • New false green: none. Round 2 skips a subset of what round 1 skipped, on every base.
  • One corner now reaches semantic/ as it already reached the two retired directories: a change to the generator's naming function would read every file as added. That is a loud red in the PR that makes the change.

3. Net accept set: still strictly narrower than main. Right.

  • Against round 1: for every input, round 2 counts at least the entries round 1 counted and excuses at most the ones round 1 excused. So its problems contain round 1's.
  • Against main: the net diff from merge base 1afd9c1338 is still this one file, 488 lines added and 3 replaced (the roster floor, the scan() return, the report loop).
  • main has not touched the gate, build-schemas.ts, the protocol module or the template between the two merge bases, or since, up to f459c863e3.

4. Battery floor 50. Right.

  • EM registers 50 at this head: 16 direct assertions, 8 green cases, and 8 red cases carrying 18 message patterns.
  • The floor equals the count, so one case that stops registering is a red.
  • 53 (commit e5288b7ab0) was three above what registers and could not hold. 2d7f3a5541 set it to the count.
  • Round 2 adds 19 to round 1's 31. The roster floor stays at 61.

5. EM-R8. Right. With PROTOCOL_VERSION at 20.0.0, an added semantic/19.* is red and the message carries both numbers. It also shows the fixture's version swap takes effect: at 19 a swap that did nothing would read the tree's own 19 and pass unnoticed.

6. EM-U2 rewording. The cases test what they tested.

  • The two refused strings now say "the spec package at 19.0.0" and "at 118.4.0" in place of the package name.
  • Both are 60 or 61 characters and carry no placeholder word, so the version clause is the only one that can fire.
  • The assertions count faults and do not name the clause. By reading, one clause is possible.
  • The two strings that hold still name the package with 18.4.0 and 18.0.0-next.2.

7. Check-runs on this head. 48: 26 success, 22 skipped, none red or pending.

  • The self-test ran in Lint · docs & code guards (141200794777), step "Changeset-family gate self-tests", success. So the floor of 50 held in CI.
  • Both Check Changeset runs are skipped under the skip-changeset label, so the real scan did not run on this head. By reading, it would print "this PR adds no migration entry".

② Semver level

Unchanged from the full review. The diff is still one file under scripts/, nothing publishes, and skip-changeset, Clause-②: no and Metadata-protocol: none stay right.

③ Boundary flags

The Round 2 line's claims, each answered:

  • "S1 fixed" and "S2 fixed": confirmed in ①.1 and ①.2.
  • "N1 fixed": true for retired-keys/, not for retired-defs/. See N1 in ④.
  • "EM-G7 (the L1-a nit)" and "EM-R8 (a case at major 20)": confirmed.
  • "EM-U2 no longer spells a spec version in prose": confirmed. The package is at 19.0.0-next.2, so the old fixture string read as a future version.
  • "Battery EM now has 50 cases": confirmed by count.
  • "origin/main merged": the head's second parent is 1afd9c1338, and mergeable_state is clean.

Other flags:

  • The Round 2 line carries no open question.
  • The follow-up card the full review described (the check at the protocol move and its three siblings) and L1-a's residual are still the seat's to file. Not re-judged here.
  • Tier and face: as the full review said. reviewFace returns no hits for this one path, so Scope: names the file above an empty floor.
  • SQL push-down: n/a. No query, id materialisation or join in the diff.
  • The PR is still a draft.

④ Design judgment

No must-fix, no should-fix.

N1 (nit) — closed for retired-keys/, still untrue for retired-defs/.

  • retired-keys/: the new text is right. Check (c) in build-schemas.ts refuses to delete a [RETIRED] line while CURRENT_MAJOR - registeredAt is below TOMBSTONE_AGE_MAJORS (1), and registeredAt is the row's major in RETIRED_KEYS_BY_MAJOR. A row filed one major low lets the line go one major early. EM-R5b pins the text for this directory.
  • retired-defs/: the same text is printed, and it does not hold. registeredRetiredDefs is read for set membership only, its major appears in one info line, and the template says the consumer "folds every major into one set" and that entries are permanent. A retired def has no tombstone and no clock.
  • The refusal, its annotation and the header sentence all say otherwise for that directory. The full review's own N1 wording named both tables together, which was loose.
  • The refusal and its git mv stay right (one naming rule for the three directories). Nothing about what is refused changes.

N5 (nit) — the placeholder clause refuses any reason holding the word PATCH, MINOR or WHY in capitals, placeholder or not.

  • A reason about the HTTP verb ("the PATCH body change first shipped in 18.4.0 ...") is red.
  • The refusal names the cause, and lower case passes.
  • The jsdoc says "no placeholder left from the printed example". The code is wider than that by those three words.

N6 (nit) — the PR body below the Round 2 line still describes round 1.

  • "What changes" says a semantic/ entry must also be in ledgerAdded, gives the backfill rule as 40 characters only, and counts 31 cases.
  • "Tests" reads at 9982079f87.
  • The Round 2 line's "N1 fixed" covers retired-defs/.
  • This is body prose and can be corrected without moving the head.

N4: closed by EM-R8. N2 and N3 are untouched, as the full review left them for a follow-up.

N1's remainder and N5 sit in the gate file, so a fix moves the head. Each is left as an accepted deviation or goes on the follow-up card.

Implemented-by: claude/issue-38240-adr0087-below-major
Reviewed-by: session_01FEkQ5oPfjnm2yWHEwkiYrn

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-project-manager · session_01FEkQ5oPfjnm2yWHEwkiYrn

Landing · 2026-11-29T03:43Z · area o5-fleet · Head-sha 323f21d86033b0bae5838d2be06e473a2d46c40e

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/m skip-changeset PR has no user-facing published change; bypasses the changeset gate

Projects

None yet

2 participants