Repository navigation
Commit ec4ef94
<!-- claude-projects-attribution: {"github_login":"os-project-manager"}
-->
_Requested by **Leehom** · [project
thread](https://claude.ai/code/project/chan_01TenzsRopZj4jMbvjX8uz1X?thread=cmsg_01TenzsRopZj4jMbvjX8uz1XNBLp4i8Un5xSqTRfqBZH2G)_
Part of #25467
Clause-②: no
Metadata-protocol: none
Ruling-ref: 6270097840
Cut 9 of the `protocol.ts` split (#24586 ruling A, recorded in
`6270097840`). Cuts 1–8 landed as #25494, #25518, #25538, #25589,
#25601, #25623, #25642 and #25719. The claim is `6391854672`; the scope
is the carry-forward credential group the cut 8 report (`6391184870`)
proposed from Release `6385903828`, as the server seat approved it.
Four `ObjectStackProtocolImplementation` members move unedited into a
new module,
`packages/metadata-protocol/src/protocol-credential-carry-forward.ts`
(#23050 shape B; one getter, `credentialChannels`). `protocol.ts` loses
26 net lines (29,821 to 29,795). A fifth member of the group,
`readCodeLayerForCarryForward`, stays in the class (see "Readers of the
moved lines"). The cut also replaces cut 7's placeholder header line in
`protocol-package-install.ts` with a written header (comment only). The
cut is move-only, and the card stays open for later cuts.
Branch `claude/project-thread-uly5ki` is the harness-pinned branch for
this thread. It names no issue, so the claim comment is the identity
record. It holds one commit on `main` `e5cf9f049c`.
**Serial with the file's in-flight PRs.** Measured just before this PR
was opened: none of the 19 open PRs touches
`packages/metadata-protocol/src/` (each PR's file list read in full;
#25718's 9,209-file list was checked by `git diff --name-only` against
its merge base, since the files API caps at 3,000). `git log
e5cf9f0..origin/main -- packages/metadata-protocol/` is empty at
`43edf90b5`; `main`'s two new commits touch other packages, and `git
merge-tree` of this head with `origin/main` is clean.
## What moves
| Member | Base line | Visibility | Tokens (params + return + body) |
|---|---|---|---|
| `credentialChannelFor` | `:6872` | private | 24 |
| `carryForwardRedactedCredentials` | `:9190` | private | 103 |
| `storedBodyForCarryForward` | `:9215` | private | 167 |
| `restoredCredentialPathsFor` | `:9264` | private | 202 |
## The shape (#23050 shape B, as cuts 1–8 apply it)
- **The class keeps every member** with its name, docblock, signature
and position, less `async`. Each body is now one host literal plus
`fn.call(host, …)`, marked `[#25467 cut 9]`.
- **Typing.** `CredentialCarryForwardHost` types every member as the
class member itself (`ObjectStackProtocolImplementation['m']`). Each
moved function 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.
- **Members read:** the field `credentialChannels`, as a getter; the
methods `credentialChannelFor`, `getOverlayRepo`,
`readCodeLayerForCarryForward` and `storedBodyForCarryForward`, as
late-bound closures. No field is assigned.
- **`credentialChannelFor` moves cleanly**, as the order asked to
measure first. Its other readers (the cut 8 host literals in
`restoredBodyDerivation` and `refuseRestoredBodyTheSaveDoorRefuses`,
`saveMetaItem`, `promoteDraftForPublish`) still call the class method,
which keeps its signature, so neither `protocol-authoring-gate.ts` nor
`AuthoringGateHost` changes. No pin reads it by path.
## Module-level declarations, by reader
- **None moves, and none gains `export`.** No module-level declaration
of `protocol.ts` is read by the moved bodies; everything they read comes
from the module `protocol.ts` imports it from (`metadata-redaction.ts`,
`@objectstack/spec/shared`). From `protocol.ts` the new module imports
types only (`ObjectStackProtocolImplementation`,
`MetadataCredentialChannel`), so there is no runtime module cycle.
- **Imports in `protocol.ts`.** `carryForwardRedactedValues` and
`redactedPathsCarriedForward` lose their last reader and leave the
`metadata-redaction.js` import list (`hasMetadataRedactor` keeps a
reader and stays). 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 `e5cf9f049c` and head `428f9aa9` were built with `pnpm
--filter @objectstack/metadata-protocol build` against one dependency
tree (`turbo run build --filter='@objectstack/metadata-protocol^...'`
once, 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
after).
- **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 cut 8 reported). `diff` exits 0. **Raw
identity holds**, so sorted-union identity holds too.
- **Normalised sha256**:
`9562749edf7b8bba67ed2f1779799a68b3d6934a8605074934572d9507c55ba6` at
both ends, both files (109 string-literal union runs sorted). This run's
normaliser is its own script, so the hash is not comparable with cut 8's
normalised figure; the raw hashes are.
- **The two builds differ** where they should: `index.js` hashes
`12c3ff329045d303…` at base (cut 8's head hash) and `a41e81cf2349514e…`
at head; `storedBodyForCarryForward.call` and
`credentialChannelFor.call` each occur 0 times in the base bundle and
once in the head bundle.
- **Positive control** on a copy of the head `index.d.ts`, the first
`private engine;` changed to `engine;`: raw `3c2a24456c659dbf…`,
normalised `66c9d4dcf48487eb…`. Both move.
- **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
or the host type appears.
No changeset: `skip-changeset`, per ruling `6348891160`.
## Proof of move-only
- **Bodies, by AST token** (TypeScript scanner over parameters less the
added `this`, return type and body): 496 tokens compared, **0 differ**.
The parameter and body text, comments included, is also equal with
whitespace collapsed, for all four. Negative control: one changed token
in `restoredCredentialPathsFor`'s body (`held.length > 0` to `> 1`, on a
copy) makes the check report `differ=1`.
- **Class side.** 299 members at base and at head. The 295 that did not
move are byte-identical to base. Each of the 4 stubs sits at its base
position and keeps its docblock and signature byte-identical, less
`async`.
- **Top level of `protocol.ts`.** 235 of the 236 base statements other
than the class are byte-identical, leading comments included. The other
one is the `metadata-redaction.js` import that loses two names. Head
adds one statement, the new module's import.
- **Size.** +239 / −60 over 3 files, 299 changed lines.
`protocol-credential-carry-forward.ts` has 164 lines.
## Readers of the moved lines
Every test and script that reads `protocol.ts` by path (86 files) was
grepped for each moved member's name and for the calls their bodies
make.
- **`protocol.lookup-artifact-item-call-sites.test.ts`** records
`readCodeLayerForCarryForward: lookupArtifactItem(type, name, pkg)` as a
site it reads in `protocol.ts`, keyed by a four-space class-member
header. Moving that body would take the site out of the file the pin
reads and leave a forwarding closure (`this.lookupArtifactItem(...a)`)
in its place. **Verdict: `readCodeLayerForCarryForward` stays in the
class**, the same disposition the Release gives
`viewContainerNameCollisionRefusal` for the same pin.
`storedBodyForCarryForward` reaches it through the host. The pin is
unchanged and green.
- **`protocol.view-expansion-reconcile-call-sites.test.ts`** censuses
`this.getOverlayRepo()` acquisitions in `protocol.ts`.
`restoredCredentialPathsFor`'s `const repo = this.getOverlayRepo();` is
the census's exempt spelling and leaves with the body (14 to 13 such
lines), and the body makes no stored-row write. **Verdict: no edit**, as
cuts 5 and 6 moved the same line. The census stays green and keeps its
population of writes.
- No other hit. No cross-package test or script names any moved member
(the hypothesis in the order holds), and no `docs/` or `content/` page
does.
- **Bracketed-refusal pin** (`PRODUCERS`): the new module has no `new
Error(` (0), so it gets no row.
- **ADR anchors and decision letters.** `check:adr-anchors` output is
identical at both ends: 85 anchored files, **1,846 → 1,846**
decision-letter citations. No paragraph of the `protocol.ts` anchor
entry describes the carry-forward, 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.
- **Engine-double contract** (`check-engine-double-contract`): exits 0
at both ends. The `updateData`/`deleteData` seams keep their entries at
new line numbers (14065 → 14039, 14090 → 14064). `productionFiles` is
3,684 at base and 3,686 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 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.
`check-platform-checklist --changed-from origin/main`: OK, 29 anchors
judged, 0 lost.
- **Governed surface.** `check-governed-merges --branch
claude/project-thread-uly5ki`: 0 of 3 paths hit the register, NOT
governed; 299 changed lines, under the 3,000-line human-merge bar.
## Verification
- `pnpm --filter @objectstack/metadata-protocol typecheck` exits 0.
`eslint --no-inline-config packages/metadata-protocol` exits 0.
- **`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):
- Base `e5cf9f049c`: 21,504 tests (21,485 passed, 0 failed, 19 skipped),
266 files.
- Head `428f9aa9`: 21,504 tests (21,485 passed, 0 failed, 19 skipped),
266 files.
- None lost, none added, none changed status. The base leg is the
package `src/` swapped tree-only from `e5cf9f049c` and restored from
`HEAD` under a trap; `git diff HEAD` empty and `git status` clean after.
The suite includes both pins named above (15 tests, all passed at head).
- **Derived gates.** `dispatch-gates --commands --repo
objectstack-ai/objectstack` derives 53 gates on 3 changed paths. 52 exit
0 at head. `check-plugin-teardown-shape --self-test` and
`check:lean-entry-closure` first answered PREREQUISITE NOT MET (a pinned
fixture commit outside the shallow clone; an unbuilt `objectql/dist`)
and exit 0 once the commit was fetched and objectql built.
`check:dual-build-cjs-loads` is NOT MEASURED locally: it needs every
package's `dist/` and is left to CI; this package's CJS bundle was
loaded directly above. `--ran` reconciles 53 of 53: 52 run, 1
NOT-MEASURED, 0 UNRUN.
## Acceptance notes
- `protocol-package-install.ts` (cut 7) now carries a written header in
the shape of the other cut modules: which members are getters (`engine`,
`getServicesRegistry`), which are callbacks (`packagePersistService`,
`packageInstallUndo`), the three helpers that moved with the bodies, and
the two `protocol.ts` declarations it imports. Comment only; that file
has no other change.
- The class docblock of `carryForwardRedactedCredentials` keeps its
`{@link carryForwardRedactedValues}`, which `protocol.ts` no longer
imports. The docblock is unchanged by design (move-only); the link names
the function in `metadata-redaction.ts`.
## Carry-forward
Unchanged from cut 8, plus one: 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, and now
`readCodeLayerForCarryForward`), and the private-static readers stay in
`protocol.ts`.
---
_Generated by [Claude
Code](https://claude.ai/code/session_018R7PXvRqqGBhprFi6EWucU)_
Co-authored-by: Claude <noreply@anthropic.com>
1 parent f3fea0a commit ec4ef94
3 files changed
Lines changed: 239 additions & 60 deletions
File tree
- packages/metadata-protocol/src
| 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 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 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 | + | |
4 | 45 | | |
5 | 46 | | |
6 | 47 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
236 | 236 | | |
237 | 237 | | |
238 | 238 | | |
239 | | - | |
240 | 239 | | |
241 | 240 | | |
242 | | - | |
243 | 241 | | |
244 | 242 | | |
245 | 243 | | |
| |||
376 | 374 | | |
377 | 375 | | |
378 | 376 | | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
379 | 384 | | |
380 | 385 | | |
381 | 386 | | |
| |||
6870 | 6875 | | |
6871 | 6876 | | |
6872 | 6877 | | |
6873 | | - | |
| 6878 | + | |
| 6879 | + | |
| 6880 | + | |
| 6881 | + | |
| 6882 | + | |
| 6883 | + | |
6874 | 6884 | | |
6875 | 6885 | | |
6876 | 6886 | | |
| |||
9187 | 9197 | | |
9188 | 9198 | | |
9189 | 9199 | | |
9190 | | - | |
| 9200 | + | |
9191 | 9201 | | |
9192 | 9202 | | |
9193 | 9203 | | |
| |||
9197 | 9207 | | |
9198 | 9208 | | |
9199 | 9209 | | |
9200 | | - | |
9201 | | - | |
9202 | | - | |
9203 | | - | |
| 9210 | + | |
| 9211 | + | |
| 9212 | + | |
| 9213 | + | |
| 9214 | + | |
9204 | 9215 | | |
9205 | 9216 | | |
9206 | 9217 | | |
| |||
9212 | 9223 | | |
9213 | 9224 | | |
9214 | 9225 | | |
9215 | | - | |
| 9226 | + | |
9216 | 9227 | | |
9217 | 9228 | | |
9218 | 9229 | | |
9219 | 9230 | | |
9220 | 9231 | | |
9221 | 9232 | | |
9222 | 9233 | | |
9223 | | - | |
9224 | | - | |
9225 | | - | |
9226 | | - | |
9227 | | - | |
9228 | | - | |
9229 | | - | |
9230 | | - | |
9231 | | - | |
9232 | | - | |
9233 | | - | |
9234 | | - | |
9235 | | - | |
9236 | | - | |
9237 | | - | |
9238 | | - | |
9239 | | - | |
9240 | | - | |
9241 | | - | |
9242 | | - | |
9243 | | - | |
9244 | | - | |
9245 | | - | |
| 9234 | + | |
| 9235 | + | |
| 9236 | + | |
| 9237 | + | |
| 9238 | + | |
9246 | 9239 | | |
9247 | 9240 | | |
9248 | 9241 | | |
| |||
9261 | 9254 | | |
9262 | 9255 | | |
9263 | 9256 | | |
9264 | | - | |
| 9257 | + | |
9265 | 9258 | | |
9266 | 9259 | | |
9267 | 9260 | | |
9268 | 9261 | | |
9269 | 9262 | | |
9270 | | - | |
9271 | | - | |
9272 | | - | |
9273 | | - | |
9274 | | - | |
9275 | | - | |
9276 | | - | |
9277 | | - | |
9278 | | - | |
9279 | | - | |
9280 | | - | |
9281 | | - | |
9282 | | - | |
9283 | | - | |
9284 | | - | |
9285 | | - | |
9286 | | - | |
9287 | | - | |
9288 | | - | |
9289 | | - | |
9290 | | - | |
9291 | | - | |
9292 | | - | |
9293 | | - | |
9294 | | - | |
9295 | | - | |
| 9263 | + | |
| 9264 | + | |
| 9265 | + | |
| 9266 | + | |
| 9267 | + | |
| 9268 | + | |
| 9269 | + | |
9296 | 9270 | | |
9297 | 9271 | | |
9298 | 9272 | | |
| |||
0 commit comments