Repository navigation
Commit f42bcc1
feat(adr-0087): the eighth disposition category runtime-member-retyped — ADR text (D10) and the registration gate (#38365)
<!-- claude-projects-attribution: {"github_login":"os-project-manager"}
-->
_Requested by **Leehom** · [project
thread](https://claude.ai/code/project/chan_01TenzsRopZj4jMbvjX8uz1X?thread=cmsg_01TenzsRopZj4jMbvjX8uz1XHogQ9ogKPxHhiFfT2UQgJi)_
Fixes #38328
Fixes #37447
Claims: #38328 (7240075259) and #37447 (re-posted 7242295202, naming
this branch).
Clause-②: no
Metadata-protocol: none
## 维护者速读
-
用户能看到什么变化:用户无感。「元数据协议升级契约」这份架构决定记录新增第八种申报类别(已发布类型上的成员留着、但声明的类型改了),登记检查同一笔学会核验它。
- 为什么做:你在决策卡上选了「新增第八类」,这里把它写成成文规则;此前这类改动没有一个如实可选的申报类别,写破坏性变更说明的开发者只能卡住。
- 出错会怎样:只有写破坏性变更说明的开发者会照这段文字申报,运行中的系统不受影响;文字有误可以直接撤回这一笔。
- 要你做什么:审阅并批准合并(Tier H)。文字与门禁两半已按座位路由裁定并进本
PR(门禁的词表钉要求两边同一笔,任一半单独合并都会报红);#38366 已并入关闭。
## What changes
Two files, both halves of one decision, combined by the seat's route
ruling (recorded on #37447 and #38328: combine, reason = the #8299
lockstep pin):
- `docs/adr/0087-metadata-protocol-upgrade-contract.md`: +199 −4 (1538
to 1733 lines) — the ADR half (#38328), described below.
- `scripts/check-adr-0087-registration.mjs`: +922 −93 — the gate half
(#37447 item 2), cherry-picked from
`claude/issue-37447-runtime-member-retyped` (closed PR #38366; os-dev
report 7241851254 on #37447) and then reworked on this branch for L2
record 7242485283 and L2 delta record 7243871018 (os-dev reports
7243462155 and 7244464363 on #38328): `runtime-member-retyped` in
`CATEGORIES`, `verifyRuntimeMemberRetyped` with
`RUNTIME_MEMBER_RETYPED_PREDICATES` (`present-at-both-type-differs`,
`no-metadata-surface`, `from-operands-named`), D9's predicates 2–3
lifted into shared helpers with no behaviour change, an explicit
`strictNullChecks`, and the self-test batteries RMR (83) and RMR-N (3).
The rework adds reading (b) of predicate 1 (see the table below).
`type-surface-only` and its predicate 4 are unchanged apart from one
hint line in an existing refusal.
The ADR's changeset disposition vocabulary gains its eighth category,
`runtime-member-retyped`, for a member that stays on a published type
while its declared type changes. Five places move together:
1. **Status line.** The 2026-11-28 amendment entry: the card and its
parent, the decision's own words 「新增第八类」, and where the decision is
recorded.
2. **Vocabulary block** (2026-08-13 addendum). The eighth marker line,
`runtime-member-retyped PACKAGE#TYPE.MEMBER`.
3. **The two prose enumerations beside that block.** The list of
categories resting on a checked fact, which the 2026-11-12 amendment
offers a refused narrowing, and the sentence that names each added
category and the addendum that explains it.
4. **A dated note under D8's predicate 4.** The retyped-member class got
a category of its own instead of a limb on predicate 4, which reads
exactly as it did.
5. **A new addendum (2026-11-28) with D10.** Provenance, the dead end
the category closes (measured), the operands, the three predicates by
name, what the category inherits and what it leaves alone, the worked
example, and what it does not decide.
No untouched text is rewritten, and no existing category's wording
changes.
**The category, as written.** It is D9's sibling. The operand is a
member of a type the package's published entry exports (or a member of
an exported value, read on that value's type as D9's reader reads it),
`PACKAGE#TYPE.MEMBER`, or `PACKAGE/SUBPATH#TYPE.MEMBER` behind a literal
subpath key. An export operand and the whole-package operand are refused
by name. Three predicates, checked by name:
| predicate | what it asks |
|---|---|
| `present-at-both-type-differs` | The type is exported at the merge
base and at HEAD, the member is on it at both, and the type the checker
prints for the member (with its optionality, under `strictNullChecks`)
differs. A vanished member, an added member, and a declaration naming a
type the reader cannot resolve are refused. Reading (b), added in the L2
rework: also refused as unprovable, at either revision, a member whose
printed type names a type with no declaration behind it, or carries more
`any` than the member's own declarations write. An `any` the declaration
writes is still compared as written. The refusal covers what leaves a
trace (the member's own declaration, the printed type); a type that
rests on something unresolved without a trace is compared, on three
named roads carried by #38379. |
| `no-metadata-surface` | D9's predicate 2, asked at both revisions. |
| `from-operands-named` | D9's predicate 3, unchanged. |
It inherits the `no-migration-prescription` refusal as D9 does, it does
not go through D8's text walker, and D8's predicate 4 gains no limb.
**Agreement with the gate half.** The text was first read against the
gate branch for #37447 at `a2b044f1fb` and `e657c303b2`. The gate in
this PR is no longer that file: the L2 reworks changed it on this branch
(blob `e56281db17` first, `15df493f67` at `e2661365c1`, `bc082d7904` at
`8c1017d6d2` and this head), and the ADR changed with it each time:
predicate 1 corrected and scoped to traces, and "What this does not
decide" gaining the trace-less item and one scoped clause. Category
name, operand forms, the three predicate names and each predicate's
reading agree, and neither half departs from the decision's design.
**The vocabulary pin is green on this head.** The gate pins the
categories the ADR documents to the categories it accepts, both ways;
either half alone was red (`documented but not accepted` / `documented
nowhere`), which is why they are one PR.
**Read first** (by risk)
1. The three predicates under D10, from "An author may claim the
category when". Predicate 1's reading is the part the gate has to
implement word for word.
2. The paragraph "D8's predicate 4 is not weakened" and the 2026-11-28
note under D8. The risk is any wording that could be read as a limb on
predicate 4.
3. The table under "The dead end it closes". Two of its rows record
admissions, not refusals: `already-registered` on any old id, and the
two catch-all categories on a body the detector does not read.
**Two-minute check.** Run `node scripts/check-adr-0087-registration.mjs
--self-test` on this branch: it prints 960 assertions (V3 included) and
exits 0.
## Tests
The gate's suite is its own `--self-test` (no test file names the
script). The L2 rework changes behaviour, so it carries new pins and
ablations:
- New pins: RMR-R12 / R12b (inferred `any` at both revisions, refused as
unprovable, not "the SAME"), RMR-R13 (`any` at one revision, refused),
RMR-R14 (annotation naming a local alias over an unresolved name),
RMR-R15 (a mapped type's member), RMR-G4 (a written `any` is still
compared and its retyping admitted); for the nits RMR-G5, R16, G6, R17.
Round 3 adds RMR-C1 (road b, a named compare on the `keyof` shape, to
turn red when the road is closed), RMR-G7 and G7b (a member of an
exported value; the `any` count over an initialiser), RMR-R17's wording
pin with R17b and R17c (the private-package refusal names a retyping;
D9's sentence unchanged), and one pin each on RMR-R12 and R13 for the
remedy line. RMR goes from 44 to 83 cases, its floor with it; the
self-test from 921 to 960 assertions.
- Ablations at `e2661365c1` (accept-set; the arm did not move after it),
direction written before each run, restored each time (`git diff HEAD`
empty): (A) the new arm off: predicted 14, observed 14 red; (C1) the
`any` rule alone off: 8 / 8; (C2) the name rule alone off: 6 / 6; (D)
the written-`any` allowance zeroed: 1 / 1 (RMR-G4); (B) RMR floor at 73:
refused, fixing the battery at exactly 72. At `8c1017d6d2` (the gate
blob of this head): (N7) the wording handed back to D9's: 2 / 2; (N8a)
the merge-base clause off: 1 / 1; (N8b) the clause always on: 1 / 1; (D)
the written-`any` allowance zeroed: 3 / 3 (RMR-G4, G7, G7b); (B) the
floor at 84: refused, fixing the battery at 83.
- On the real `@objectstack/client`, `ObjectStackClient.connect` was
refused as "the SAME at both revisions" at `31596e5b6e` and is now
refused as unprovable, naming `GetDiscoveryResponse`. On the real
`@object-ui/auth`, `AuthClient.updateUser` is still verified and
`AuthClient.signOut` still "the SAME".
- **What predicate 1 does not refuse, stated and carried.** The refusal
covers what leaves a trace. A type that rests on something unresolved
without one is compared, on three roads, each measured through the
shipping gate: (a) the `any` count is a count, not a position, and the
produced `any` arrives through a local alias or by inference; (b) an
operator such as `keyof` consuming an unresolved type behind a local
alias (pinned by RMR-C1 as a named compare); (c) inference through a
local overloaded function. Predicates 2 and 3 hold on all three. The ADR
and the gate header both state this and name the carrier, #38379; until
it lands, that item is the contract. Road b was left stated, not closed:
following every local alias would refuse the by-design named compare.
<details>
<summary>The dead end, measured: the worked example under every existing
disposition</summary>
Method: the net diff of PR #37433 (head `ac218b2489`) applied on
`4cb162bfb9` in a detached comparison worktree, the changeset's marker
and its FROM / TO spelling rewritten per variant, each variant committed
locally and judged by the shipping gate's own `assertInputs` and `scan`.
Nothing from that worktree was pushed.
| variant | marker | how the fix is spelled | outcome |
|---|---|---|---|
| V0 | `type-surface-only`, bare | the PR's own two-line pair | refused,
predicate 4 |
| V1 | `type-surface-only`, dotted member path | two-line pair |
refused, predicate 4 |
| V2 | `no-migration-prescription` | two-line pair | admitted |
| V3 | `runtime-interface-only` | two-line pair | admitted |
| V4 | `runtime-export-retired`, member operand | two-line pair |
refused, predicate 1 |
| V5 | `unpublished` | two-line pair | refused |
| V6 | `registered`, an id not in the diff | two-line pair | refused |
| W1, W3 | the two catch-all categories | one arrowless FROM … TO line |
admitted |
| W2, W4 | the two catch-all categories | an arrow line under no
migration label | admitted |
| W5, W6 | `runtime-export-retired`, member operand | arrowless line,
arrow line | refused, predicate 1 |
| W7 | `already-registered`, a real id older than the merge base |
two-line pair | admitted |
| X1, X2 | the two catch-all categories | a labelled FROM → TO arrow
line | refused by the prescription detector |
| X3 | `type-surface-only`, bare | labelled arrow line | refused,
predicate 4 |
</details>
<details>
<summary>The two halves in one tree: green, and the worked example is
accepted</summary>
Joint tree `e121e0e10c`, a local-only merge of the gate branch at
`a2b044f1fb` with this branch at `819cdf7cd0`. This reading predates the
L2 rework: the ADR and the gate both changed at `e2661365c1`, so the 921
below is that tree's number, not this head's (960). R2 and R6 were
re-measured on this head's gate and still hold.
- `node scripts/check-adr-0087-registration.mjs --self-test` printed `✓
check-adr-0087-registration --self-test: 921 assertions over real temp
git repos (real scan()/assertInputs() path)`, exit 0.
- `node scripts/check-adr-0087-registration.mjs --base origin/main` exit
0.
Each half alone:
- This branch: exit 1, `category documented but not accepted:
runtime-member-retyped`; the self-test reports one failure, `V3`.
- The gate branch at `e657c303b2`: exit 1, `category documented nowhere:
runtime-member-retyped`.
The worked example on the joint tree, same driver:
| variant | marker and how the fix is spelled | outcome |
|---|---|---|
| R1 | `runtime-member-retyped @object-ui/auth#AuthClient.updateUser`,
the PR's own two-line pair | refused by predicate 3: the body carries a
vertical FROM / TO pair, which this category does not read |
| R2 | same marker, one FROM … TO … line with `AuthClient.updateUser` on
the FROM side | accepted; the gate prints the member's declared type at
both revisions |
| R3 | same marker, an arrow line | accepted |
| R4 | an export operand | refused by name |
| R5 | the whole-package operand | refused by name |
| R6 | a member the diff did not retype, `AuthClient.signOut` | refused,
predicate 1: the same type at both revisions |
| R7 | `type-surface-only`, bare | still refused by predicate 4 |
</details>
<details>
<summary>The compiler delivers the break (D10's channel
argument)</summary>
TypeScript 6.0.3 on the worked example's shape. A caller that reads the
result gets `TS2339` (the property does not exist on type void). A host
that passes its own implementation returning a Promise of AuthUser gets
`TS2322` (not assignable to a Promise of void).
</details>
## Acceptance notes
- **Done-when, first bullet.** The ADR names the eighth category with
its three predicates, and every enumeration of the vocabulary carries
it: the marker block and the two prose lists beside it. The status line
carries the amendment entry. Every occurrence of the seventh category's
name was read to find a list that omits the eighth; there is none. The
ADR counts categories by ordinal only (fifth, sixth, seventh, now
eighth), so no count word needed changing.
- **"The two land in either order" does not hold.** This branch alone
fails the vocabulary pin, and the gate half alone fails it in the other
direction. The two agree and are green together, in one merged tree
only.
- **One sentence on the parent card is narrower than it reads.** It says
the two catch-all categories are refused for a body that carries a FROM
→ TO. Measured, that depends on how the pair is spelled: the detector
reads a labelled arrow line and refuses, and it reads neither the
two-line pair PR #37433 carries nor an arrowless line, so both
categories are admitted there. The ADR records the measured outcomes.
Across the 114 pending changesets, two carry a two-line pair the
detector does not read, and both describe behaviour in prose and
prescribe no rewrite. Noted, not filed.
- **PR #37433 needs one edit beyond its marker.** Under the new category
its two-line pair is refused by predicate 3 (R1), and one FROM … TO …
line is accepted (R2). The ADR's worked-example paragraph says so; the
edit itself belongs to that PR.
- **The gate half is no longer carried unchanged.** The L2 reworks
changed it on this branch (blob `e56281db17` before, `bc082d7904` at
this head). Its header now follows the ADR's measured table on the two
catch-all categories: refused on a labelled arrow line the detector
reads; admitted on the two-line pair, an arrowless line, and an arrow
line under no migration label (the ADR's row names the first two). It
also corrects the old reason for the unresolved-name refusal: "two
unresolved names print alike" is measured false on TypeScript 6.0.3; the
true reason is that a name is only its spelling, so one spelling can be
two types at two revisions.
- **Ablations of the gate half** were run by its dev on its branch
(report 7241851254 on #37447): each new refusal reds its own case when
removed. The rework's ablations were run on this branch (see Tests).
- **The private-package refusal names a retyping.** Under this category
it reads "no published entry to retype a member on" (L2 delta N7, L1
item 2); D9's own sentence and its pin REX-R9 are unchanged.
- **Landing pointer for PR #37433.** Under this category #37433's
two-line `FROM:`/`TO:` pair is refused by predicate 3 (R1); it lands
only with one `FROM … TO …` line naming `AuthClient.updateUser` before
TO (R2). The seat posts that pointer on #37433 when this PR lands; the
edit belongs to that PR.
## Verification
Local, head `1f7fcfd66c` (merge base `eef1cbfe4a`, 0 behind main at the
run): the 44 commands of `dispatch-gates --commands` for the two-file
diff, under the shared verify lock (`VERDICT command-exit 0` in two
holds, 976 s and 485 s), each exit captured before any pipe.
- 44 of 44 exit 0, among them `check-adr-0087-registration --base
origin/main`, its `--self-test` (960 assertions), `pnpm
check:changeset-gate-self-tests` (167 + 960 + 456) and `pnpm
check:pm-dispatch-gates` (fast tier, 2385 cases).
- Reconciliation: `dispatch-gates --ran: 44 derived famil(ies) accounted
for - 44 run, 0 NOT-MEASURED`.
- `overlap-check` before the push: `VERDICT clean exit 0`, against
origin/main and 0 PR heads.
NOT MEASURED locally, CI-owned: the slow tier of the dispatch-gates
self-test, the type-check lanes, the governed-merges audit over workflow
variables. No changeset: both files ship in no package.
---
_Generated by [Claude
Code](https://claude.ai/code/session_01FEkQ5oPfjnm2yWHEwkiYrn)_
<!-- signed: repo:objectstack#5 · os-project-manager ·
session_01FEkQ5oPfjnm2yWHEwkiYrn -->
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent c610020 commit f42bcc1
2 files changed
Lines changed: 1121 additions & 97 deletions
0 commit comments