Repository navigation
Commit 4893a2f
<!-- claude-projects-attribution: {"github_login":"os-project-manager"}
-->
_Requested by **Leehom** · [project
thread](https://claude.ai/code/project/chan_01TenzsRopZj4jMbvjX8uz1X?thread=cmsg_01TenzsRopZj4jMbvjX8uz1X1aK1TeYpi6AVkN7j6eFxUU)_
Part of #25467
Clause-②: no
Metadata-protocol: none
Ruling-ref: 6270097840
Cut 11 of the `protocol.ts` split (#24586 ruling A, recorded in
`6270097840`). Cuts 1–10 landed as #25494, #25518, #25538, #25589,
#25601, #25623, #25642, #25719, #25731 and #25740. The claim is
`6397346543`; the scope is the registry materialize/strip group the cut
10 report (`6393303455`) proposed from Release `6385903828`, as the
server seat approved it in its dispatch order.
Four `ObjectStackProtocolImplementation` members move unedited into a
new module,
`packages/metadata-protocol/src/protocol-registry-materialize.ts`
(#23050 shape B, one `engine` getter). `protocol.ts` loses 22 net lines
(29,791 to 29,769). The cut is move-only, and the card stays open for
later cuts.
Branch `claude/project-thread-f0qmfa` is the harness-pinned branch for
this thread. It names no issue, so the claim comment is the identity
record. It holds one commit, `f081d777`, on `main` `0790d0a469` (cut
10's merge `2c86039515` is in its history).
**Serial with the file's in-flight PRs.** Measured just before this PR
was opened: none of the 12 open PRs touches
`packages/metadata-protocol/src/` (each file list read in full; the
release PR #25640's 226 files include the package's `CHANGELOG.md` and
`package.json` only). `git log 0790d0a..origin/main` is empty at that
moment.
## What moves
| Member | Base line | Visibility | AST tokens (type params + params +
return + body) |
|---|---|---|---|
| `materializeFromRegistry` | `:9071` | private | 119 |
| `governServedObject` | `:9109` | private | 28 |
| `stripMaterializedFromRegistry` | `:9134` | private | 119 |
| `stripServedObjectColumns` | `:9165` | private | 28 |
## The shape (#23050 shape B, as cuts 1–10 apply it)
- **The class keeps every member** with its name, docblock, signature
and position. Each body is now one host literal plus a `.call`, marked
`[#25467 cut 11]`.
- **Typing.** `RegistryMaterializeHost` types every member as the class
member itself (an indexed access on
`ObjectStackProtocolImplementation`). Each moved function keeps the
method's type parameter `T` and types its `this` as the `Pick` of the
host over exactly the members its body reads. Each stub annotates its
literal as `ThisParameterType` of `typeof fn`. No cast, and no member
changes visibility.
- **One new spelling, forced by the generics.** The four members are
generic (`T` in, `T` out). `Function.prototype.call` on a generic
function erases `T` to `unknown`, which `tsc` rejects against the
method's declared `T` return (TS2322). So each stub instantiates the
function first: the stub calls `.call` on the parenthesised
instantiation expression of the function at `T` (`tsc` refuses an
instantiation expression followed directly by a property access, TS1477,
hence the parentheses). The emitted JavaScript is a plain `.call(host,
…)`; cuts 1–10 moved no generic member, so no earlier cut needed it.
- **Members read.** `materializeFromRegistry` and
`stripMaterializedFromRegistry` read the field `engine`, handed over as
a GETTER so the read happens when the body makes it (tests replace
`engine` on a constructed protocol). `governServedObject` calls
`materializeFromRegistry` and `stripServedObjectColumns` calls
`stripMaterializedFromRegistry`, each through a late-bound closure on
the protocol. No private-static member, and nothing on the Release's
stay list. **The order's hypothesis holds.**
- **Every other caller still calls the class method**: the five
`governServedObject` read exits (one in `readFlattenedMetaItems`, three
in `readMetaItem`, one on `getMetaItemLayered`'s effective layer) and
the one `stripServedObjectColumns` write site in `saveMetaItem`.
## Module-level declarations, by reader
- **Two gain `export`, none moves.** The bodies read three module-level
functions of `protocol.ts`: `canonicalMetaType` (already exported), and
`governServedItem` and `stripServedSystemColumns`, which gain `export`
in place, as cut 8 exported `permissionSetOwnerBindingRefusal` and
`runtimeHookWithoutBodyRefusal`. The new module imports all three from
`protocol.js`; the cycle is evaluation-safe because each is read only
inside a function body. `index.ts` names what it publishes from
`protocol.ts` one by one, so the published surface does not move
(measured below).
- **Measured, not assumed:** after the move, the two exported helpers
have no caller left in `protocol.ts`; the moved bodies were their only
callers at base too. They stay there because the class's read and write
paths cite them by name in prose (for example the `getMetaItemLayered`
comment on why `governServedItem` never runs on `overlay`). Moving them
is noted below, not done here.
- **Imports in `protocol.ts`.** No import loses its last reader. The one
new statement is the import of the new module.
## The published `.d.ts`
The series bar is ruling `6348891160`, sorted-union identity, measured
first. Base `0790d0a469` and head `f081d777` were built with `pnpm
--filter @objectstack/metadata-protocol build` against one dependency
tree (the closure built once at head, then the package's `src/` swapped
tree-only to base for the base build and restored from `HEAD` under a
trap; `git diff HEAD` empty and `git status` clean after, both blobs
equal to `HEAD`'s).
- **Raw sha256**:
`325970c1661efaa6a3762ce7de9e6bb205ea16099784f2b6c5950d62d175b331` at
base and at head, on both `dist/index.d.ts` and `dist/index.d.cts`,
772,838 bytes each (the hash cuts 8–10 reported). `cmp` exits 0 on both
pairs. **Raw identity holds**, so sorted-union identity holds too. The
four members are private, so each stays a `private NAME;` line.
- **Normalised sha256**:
`9562749edf7b8bba67ed2f1779799a68b3d6934a8605074934572d9507c55ba6` at
both ends (109 string-literal union runs sorted; this run's own
normaliser).
- **The two builds differ where they should**: `index.js` hashes
`b99c5148b08d3fc5…` at base (cut 10's head hash) and `bbe1a227b80604e0…`
at head; the four functions' `.call(` sites occur 0 times in the base
bundles and 4 times in the head bundles (ESM and CJS alike).
- **Positive control** on the head tree (on disk, restored from `HEAD`
under a trap, hash equal to `HEAD`'s after): `private` dropped from
`stripServedObjectColumns` and the package rebuilt. Both `.d.ts` files
move to `06884ae21a4b72b4…` and print the member's full generic
signature (type parameter `T`, then `(type: string, item: T): T;`), so
the bar can see a change on this member.
- **Export tables.** The ESM and CJS bundles, loaded at runtime from the
package, each export the same 78 names at base and head; the sorted list
hashes to `9f18a0177ac736ed…` on all four. None of the moved functions,
the two newly exported helpers or the host type appears.
No changeset: `skip-changeset`, per ruling `6348891160`.
## Proof of move-only
- **Bodies, by AST token** (the TypeScript compiler's AST leaf tokens,
JSDoc skipped, over type parameters, parameters less the added `this`,
return type and body): 294 tokens compared, **0 differ**. The
type-parameter, parameter, return-type and body text, comments included,
is also equal with whitespace collapsed, for all four. Negative control:
one changed token in `stripMaterializedFromRegistry`'s body (`item ===
null` to `item !== null`, on a copy) makes the check report `differ=1`.
- **Class side.** 299 members at base and at head, in the same order.
The 295 that did not move are byte-identical to base, leading comments
included. Each of the 4 stubs sits at its base position and keeps its
docblock and signature byte-identical.
- **Top level of `protocol.ts`.** 236 of the 238 base statements other
than the class are byte-identical, leading comments included. The other
two are `governServedItem` and `stripServedSystemColumns`, which gain
the `export` keyword and nothing else. Head adds one statement, the new
module's import.
- **Size.** +165 / −53 over 2 files, 218 changed lines.
`protocol-registry-materialize.ts` has 134 lines.
## Readers of the moved lines
Every test and script that reads `protocol.ts` by path, and every test
file in `packages/` and `scripts/`, was grepped for the four member
names, for `governServedItem` and `stripServedSystemColumns`, and for
the four registry seam names the bodies call
(`materializeServedObjectOnto`, `provisionSearchCompanionOnto`,
`stripMaterializedStampsFrom`, `stripProvisionedSearchCompanionFrom`).
- **No by-path reader.** Outside `protocol.ts` the member names occur
only in prose: `metadata-diagnostics.ts` (a comment naming
`governServedObject`'s docblock), two `CHANGELOG.md` entries, and
comments in `packages/objectql` and `packages/rest` tests. No gate,
baseline or ADR anchor names them.
- **The partial-registry-double fallbacks.** Six test files name the
seam methods:
`packages/objectql/src/protocol-meta-effective-schema.test.ts`,
`registry-deployment-platform-global.test.ts`,
`registry-tenant-index-author-declared-column.test.ts`,
`registry-tenant-index-follows-wall.test.ts`,
`meta-object-primary-designation-roundtrip.test.ts`, and
`packages/rest/src/meta-object-materialization-agreement.test.ts`. Each
builds the protocol over a REAL `SchemaRegistry` (which defines all four
seam methods, `packages/objectql/src/registry.ts`) or calls the registry
directly; none reads `protocol.ts` by path, and none builds a double
that answers only the narrower `provisionSearchCompanionOnto` /
`stripProvisionedSearchCompanionFrom` spelling. Verdict: the fallback
arms move verbatim and no in-repo test reaches them (see Acceptance
notes). At head, those six files plus
`meta-object-search-companion-roundtrip.test.ts` pass: objectql 6 files
/ 57 tests, rest 1 file / 12 tests, each `VERDICT command-exit 0`.
- **Bracketed-refusal pin** (`PRODUCERS`): no row owed. The four bodies
hold no `new Error(` (0 by count in base lines 9032–9167); `protocol.ts`
keeps its 74 such sites.
- **ADR anchors and decision letters.** `check-adr-anchors` exits 0 at
both ends with **identical output**: 85 anchored files, 52,707 citations
across 6,638 files, **1,846 → 1,846** decision-letter citations. The
`protocol.ts` anchor file names none of the four members, and the moved
bodies are not the mechanism of any entry paragraph, so the new module
gets no entry.
- **Durability checker** (`check-durability-degradation-log-level
--list`): identical at both ends once `[@:][0-9]+` is stripped (159
lines). The gate exits 0 at both ends with identical output. The moved
`try`/`catch` arms wrap registry seam calls, not storage reads, so
neither rule reads them.
- **Engine-double contract** (`check-engine-double-contract`): exits 0
at both ends. The `updateData`/`deleteData` seams keep their entries at
new line numbers (14044 → 14022, 14069 → 14047). `productionFiles` is
3,690 at base and 3,692 at head: +1 is the new file, +1 is the
gitignored `packages/spec/src/migrations/registry.ts`, which the spec
build writes in the head tree and the clean base tree had not built.
- **Identical output at both ends:** `check-adr-symbol-anchors`,
`check-system-context-census`, `check-tenant-audit-census`,
`check-query-options-erasure-ratchet`, `check-filter-alias-parity`.
`check-nul-bytes` differs only in the scanned file count, +1. The
base-end readings were taken in a clean detached worktree at
`0790d0a469`.
- **Platform checklist.** `check-platform-checklist --changed-from
origin/main`: OK, 29 anchors judged, 0 lost.
- **Governed surface.** `check-governed-merges --branch
claude/project-thread-f0qmfa`: 0 of 2 paths hit the register, NOT
governed; 218 changed lines, under the 3,000-line human-merge bar.
## Verification
All at head `f081d777`.
- `tsc --noEmit` in `packages/metadata-protocol` exits 0. `pnpm exec
eslint --no-inline-config` on the two changed files exits 0, no output.
- **`packages/metadata-protocol` suite**, base and head, compared per
test name and status (vitest `--maxWorkers=2`, JSON reporter, each run
under the shared verify lock, `VERDICT command-exit 0` both legs):
- Base `0790d0a469`: 21,509 tests (21,490 passed, 0 failed, 19 skipped),
266 files.
- Head `f081d777`: 21,509 tests (21,490 passed, 0 failed, 19 skipped),
266 files.
- None lost, none changed status, none added. The base leg is the
package `src/` swapped tree-only from `0790d0a469` (the new module
removed from the tree) and restored from `HEAD` under a trap.
- **Derived gates.** `dispatch-gates --commands --repo
objectstack-ai/objectstack` derives 53 gates on 2 changed paths; all 53
exit 0. `check:dual-build-cjs-loads` and `check:lean-entry-closure`
first answered PREREQUISITE NOT MET (exit 3, unbuilt `dist/`) and exit 0
after a full `pnpm build` (76/76 tasks, `VERDICT command-exit 0`); the
plugin-teardown fixture commit was fetched before the first run.
`dispatch-gates --ran`: 53 derived, 53 run, 0 NOT-MEASURED, 0 UNRUN,
exit 0.
## Acceptance notes
- The fallback arms of `materializeFromRegistry` and
`stripMaterializedFromRegistry` (the narrower
`provisionSearchCompanionOnto` / `stripProvisionedSearchCompanionFrom`
spellings for partial registry doubles) are reached by no test in this
repository: every protocol in the six named test files is built over a
real `SchemaRegistry`, which answers the wider seam first. They move
verbatim; whether to keep them is not this cut's question. Not class
a/b/c.
- `governServedItem` and `stripServedSystemColumns` now have their only
callers in `protocol-registry-materialize.ts`. A later cut could move
them there; it would re-point the `{@link}` references in the class
docblocks and the prose comments that name them.
## Carry-forward
Unchanged from cut 10: public members whose return type is inferred, the
bodies kept by a reader (`probeRecord`, `getMetaItemCached`,
`findReferencesToMeta`, `packagelessAddress`,
`refuseUnmintableMetaType`, `metaTypeNamespaceExists`,
`viewContainerNameCollisionRefusal` with
`overlaidShippedContainerViewNames`, `reportPageRequiresAbsentAtLoad`,
the 7 `applyRegistryWriteThrough` callers,
`readCodeLayerForCarryForward`), and the private-static readers stay in
`protocol.ts`.
---
_Generated by [Claude
Code](https://claude.ai/code/session_011WCU5ZbGMk9LUhayKvYPsx)_
Co-authored-by: Claude <noreply@anthropic.com>
1 parent e2a4b6a commit 4893a2f
2 files changed
Lines changed: 165 additions & 53 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
386 | 386 | | |
387 | 387 | | |
388 | 388 | | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
389 | 396 | | |
390 | 397 | | |
391 | 398 | | |
| |||
560 | 567 | | |
561 | 568 | | |
562 | 569 | | |
563 | | - | |
| 570 | + | |
564 | 571 | | |
565 | 572 | | |
566 | 573 | | |
| |||
583 | 590 | | |
584 | 591 | | |
585 | 592 | | |
586 | | - | |
| 593 | + | |
587 | 594 | | |
588 | 595 | | |
589 | 596 | | |
| |||
9069 | 9076 | | |
9070 | 9077 | | |
9071 | 9078 | | |
9072 | | - | |
9073 | | - | |
9074 | | - | |
9075 | | - | |
9076 | | - | |
9077 | | - | |
9078 | | - | |
9079 | | - | |
9080 | | - | |
9081 | | - | |
9082 | | - | |
9083 | | - | |
9084 | | - | |
9085 | | - | |
9086 | | - | |
9087 | | - | |
9088 | | - | |
9089 | | - | |
9090 | | - | |
9091 | | - | |
9092 | | - | |
9093 | | - | |
9094 | | - | |
9095 | | - | |
9096 | | - | |
9097 | | - | |
| 9079 | + | |
| 9080 | + | |
| 9081 | + | |
| 9082 | + | |
| 9083 | + | |
| 9084 | + | |
9098 | 9085 | | |
9099 | 9086 | | |
9100 | 9087 | | |
| |||
9107 | 9094 | | |
9108 | 9095 | | |
9109 | 9096 | | |
9110 | | - | |
| 9097 | + | |
| 9098 | + | |
| 9099 | + | |
| 9100 | + | |
| 9101 | + | |
9111 | 9102 | | |
9112 | 9103 | | |
9113 | 9104 | | |
| |||
9132 | 9123 | | |
9133 | 9124 | | |
9134 | 9125 | | |
9135 | | - | |
9136 | | - | |
9137 | | - | |
9138 | | - | |
9139 | | - | |
9140 | | - | |
9141 | | - | |
9142 | | - | |
9143 | | - | |
9144 | | - | |
9145 | | - | |
9146 | | - | |
9147 | | - | |
9148 | | - | |
9149 | | - | |
9150 | | - | |
9151 | | - | |
9152 | | - | |
9153 | | - | |
9154 | | - | |
9155 | | - | |
9156 | | - | |
9157 | | - | |
| 9126 | + | |
| 9127 | + | |
| 9128 | + | |
| 9129 | + | |
| 9130 | + | |
| 9131 | + | |
9158 | 9132 | | |
9159 | 9133 | | |
9160 | 9134 | | |
| |||
9163 | 9137 | | |
9164 | 9138 | | |
9165 | 9139 | | |
9166 | | - | |
| 9140 | + | |
| 9141 | + | |
| 9142 | + | |
| 9143 | + | |
| 9144 | + | |
9167 | 9145 | | |
9168 | 9146 | | |
9169 | 9147 | | |
| |||
0 commit comments