Repository navigation
fix(metadata-protocol): the save door refuses a view container saved under a name another stored container of the same object expands to (#21620) - #21637
Conversation
…under a name another stored container of the same object expands to A second container stored under a name a sibling container expands to became that name's own row, so the sibling's expansion no longer filled it: the object door listed nothing under the name and the by-name read answered the raw container. The save door now refuses that save with VALIDATION_ERROR / 400, judged by the readers' own row selection and expansion, before the identity stamp. Claude-Session: https://claude.ai/code/session_017ErfyP2Rx7XWHJA27QjyUi Co-authored-by: Claude <noreply@anthropic.com>
…pansion name refusal Claude-Session: https://claude.ai/code/session_017ErfyP2Rx7XWHJA27QjyUi Co-authored-by: Claude <noreply@anthropic.com>
…ntainer-named-after-object
📓 Docs Drift CheckThis PR changes 1 package(s): 27 hand-written doc(s) name something this change touched — list omitted above 15 rows. Re-derive on the tree named below: ⛔ 8 release-owned page(s) also affected — read-only, see AGENTS.md Documentation Guardrails. What this run could not see
Coarse fallback — 11 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): Which tree this was computed onThis run read A worktree cut from an older # while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 8c2545abd0208fcdf8a3cda333c1c7a163af1f2a && git checkout 8c2545abd0208fcdf8a3cda333c1c7a163af1f2a
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 5b5e83f446bde0bf6e13db304b9f07f115635704 13736a50f64ea4a3ce6b76fa8e0b1f5b847bf912 && git checkout -B drift-repro 5b5e83f446bde0bf6e13db304b9f07f115635704 && git merge --no-ff 13736a50f64ea4a3ce6b76fa8e0b1f5b847bf912
node scripts/docs-audit/affected-docs.mjs --json 5b5e83f446bde0bf6e13db304b9f07f115635704
|
REWORK — PR #21637 at head
|
…sibling container, never a save under its name The refusal told the author to save the container under its object's name. In the card's own pair that name holds the sibling container, so following the arm literally replaced the sibling's row and dropped the view the refusal keeps serving. It now names the stored container that expands the name and prescribes adding the view as a member of it, or saving a view item under the expanded name. One pin per kernel; the changeset's fix carries the same two arms. Claude-Session: https://claude.ai/code/session_017ErfyP2Rx7XWHJA27QjyUi Co-authored-by: Claude <noreply@anthropic.com>
…sibling's name appears
The first spelling only asserted the message never says "under 'crm_lead'",
which the old wording ("under its object's name, 'crm_lead'") also
satisfied. Every occurrence of the sibling's name must now name it as the
container, or as the object a view binds to.
Claude-Session: https://claude.ai/code/session_017ErfyP2Rx7XWHJA27QjyUi
Co-authored-by: Claude <noreply@anthropic.com>
ACCEPT — PR #21637 at head
|
… that decided them (stage 13 of objectstack-ai#20595) (objectstack-ai#21640) Part of objectstack-ai#20595 Clause-②: no ## What changed Stage 13 of the `domain:engine` lane of the dead-citation sweep: `packages/metadata-fs/**`, comment and docblock prose only, per the claim (`5973452558`). Stages 1 to 11 landed as `a7d9768ec`, `d150c3039`, `4bf4e7e70`, `13a24ece2`, `db0cf2231`, `85986144c`, `48fa7a381`, `c205b6c35`, `c98a72d69`, `fd5a1cd59` and `f97660cdd`; stage 12 (`packages/formula`) is PR objectstack-ai#21635, in review, with a disjoint file surface. objectstack-ai#20595 stays open: this PR does not touch `formula`, nor the test-string sites the card carries for a widened stage, and the seat decides the card's close-out. Every comment or docblock site in the package that cited a tracker number answering 404 is rewritten in ruling C+D's form C (record `5749154545` on objectstack-ai#19123): the ADR when one records the decision, otherwise the commit in this repository's history that made it. That is **3 sites on 3 lines in 3 files, all citing one number (objectstack-ai#11021), all re-anchored to one commit, `7d81c889f`**: - **2 census sites** (2 lines: `src/repository.ts:230` and `src/sync.ts:41`): the whole `allocated-but-absent` population of the gate's own census in this package at the base; - **1 test-comment site** (`test/close-terminates-watch.test.ts:103`), outside the census glob (`test/` is not under `src/`, and the census defers test files anyway). Same number; - **outside the census glob, inside the claimed surface: none.** `README.md`, `tsconfig.test.json` and `vitest.config.ts` carry 10 citations between them, and all 10 resolve on the enumerated board (below); `package.json`, `tsconfig.json` and `tsup.config.ts` carry none; - **dead comment ids: none.** The package carries no ten-digit comment id and no `issuecomment` or `discussion_r` link (git grep exit 1). **Anchors: 1 number, by commit; 0 by ADR, 0 by repository qualifier; 1 sha.** `7d81c889f` is the anchor stage 1 (`a7d9768ec`) and stage 9 (`c98a72d69`) already chose for the same number; it is reused here and re-proven below for this package's sentences. Only comments changed. All three files keep their line counts (3 lines out, 3 in, plus the changeset), so no line citation into any of them moves. No code token moves (the guard below). All 6 changed lines under `packages/` open with a comment marker. **No citation number is added**: the only tracker number on a `+` line is `objectstack-ai#11127` on `sync.ts:41`, carried over unchanged from the `-` line, and it resolves (a closed issue). The only new nine-hex span is `7d81c889f`, 3 times. **A `patch` changeset**: 1 of the 2 rewritten non-test lines is in the published `dist` (the `FileSystemRepository.close()` docblock, in the declarations and in the JavaScript esbuild emits), and `dist` is not byte-identical with the base text (see Changeset). ## H0: the package and its size The gate's own `node scripts/check-issue-citations.mjs --census --json` at base `0fc80878f` (the before run below), `allocated-but-absent` per remaining `domain:engine` package (stage 12's H0 list): | package | before | after this stage | |---|---|---| | `metadata-fs` | **2** | **0** | | `formula` | 4 | 4 (removed by stage 12, PR objectstack-ai#21635, not yet on `main`) | | `drivers/driver-mongodb`, `drivers/driver-turso`, `metadata-core`, `core`, `metadata-protocol`, `objectql`, `metadata`, `drivers/driver-sql`, `drivers/driver-memory`, `drivers/driver-sqlite-wasm`, `plugins/plugin-pinyin-search`, `platform-objects` | 0 each | 0 each | `metadata-fs` reads 2, both objectstack-ai#11021, at `repository.ts:230` and `sync.ts:41`, exactly as stage 12's head census (`b89eb86cb`) read it. So the stage went ahead. On this branch's tree the lane total goes 6 to 4; with stage 12's PR it is 0. ## Census: `metadata-fs`, before and after **Instrument.** The gate's own `node scripts/check-issue-citations.mjs --census --json`, read-only and unchanged. The count is its `allocated-but-absent` findings under `packages/metadata-fs/`. | reading | tree | board | whole-repo `allocated-but-absent` | sites | lines | files | numbers | |---|---|---|---|---|---|---|---| | before | base `0fc80878f`, run 21:04:24Z to 21:07:44Z | enumerated, 195 pages, frontier objectstack-ai#21636, 19,457 records | 119 | **2** | 2 | 2 | 1 | | after | `67f182575`, run 21:14:26Z to 21:17:43Z | enumerated, 195 pages, frontier objectstack-ai#21637, 19,458 records | 117 | **0** | 0 | 0 | 0 | | head | `32de59091`, run 21:37:42Z to 21:40:56Z | enumerated, 195 pages, frontier objectstack-ai#21639, 19,460 records | 117 | **0** | 0 | 0 | 0 | The whole-repo drop is 2, and the before and after finding sets differ by exactly the 2 rows of this package, removed; none was added. `resolves` (35,763), `resolves-as-pull-request` (2,383) and `cross-repo-unjudged` (1,254) did not move: `objectstack-ai#11127` stays on `sync.ts:41` and still resolves. The head's only later commit is the changeset; the head run's finding set is identical to the after run's, line numbers included. **Supplementary instrument, the whole package.** The census reads neither test files nor strings nor files outside `src`. A second reading runs the gate's own exported `extractCitations` (whole-file and comment-prose projections) over every tracked file in the package (24) and classifies each citation with the gate's `classifyCitation` against one board enumerated by the gate's `enumerateBoard` (195 pages, frontier objectstack-ai#21636, 19,457 records, read from 21:09:16Z to 21:12:31Z), the same board for both readings. | reading | citations | dead | src comment | test comment | test string | other files | changelog | |---|---|---|---|---|---|---|---| | before, `0fc80878f` | 137 | **5** | 2 | 1 | 0 | 0 | 2 | | after, `67f182575` | 134 | **2** | 0 | 0 | 0 | 0 | 2 | The citation count drops by 3, the 3 rewritten sites; no respelling stays a citation. The live counts did not move (src comment: 39 resolve as issues, 2 as pull requests; test comment: 44 and 9; test string: 10 and 0; files outside `src` and `test`: 8 and 2; changelog: 16 and 2). A third, raw reading (every `#` followed by 2 to 6 digits, whatever surrounds it, `CHANGELOG.md` aside) counts 117 before and 114 after: also a drop of 3. **Single reads** over the issues endpoint: objectstack-ai#11021 answers 404; objectstack-ai#11127 answers 200 (a closed issue: `FileSystemRepository.close()` never reaching its broker); objectstack-ai#11136 answers 200 (the pull request whose squash is `7d81c889f`). ## Per-number table `src` counts census sites, `test` the test-comment sites. | number | src | test | anchor | kind | source | what it decided | |---|---|---|---|---|---|---| | `objectstack-ai#11021` | 2 | 1 | `7d81c889f` | commit | reused (stage 1 `a7d9768ec`, stage 9 `c98a72d69`), re-proven here | `close()` terminates watch iterators instead of emitting a drain event: it measured why a synthetic drain event is the wrong shape (the filter and the numeric `since` drop it, and delivering an event never ends an iterator), fixed that defect in `SysMetadataRepository`, and wrote invariant 8 in `metadata-core`'s `repository.ts` (the squash of PR objectstack-ai#11136) | Each sentence, judged against the decision it describes rather than the number: - **`repository.ts:230`** says a synthetic drain event 「would be the wrong shape and was measured to be so」. The measurement is `7d81c889f`'s: its message and its invariant 8 text record both halves (the filters drop it; delivery never ends an iterator). The `metadata-fs` fix that wrote this docblock, `46644e25a` (objectstack-ai#11127), cites objectstack-ai#11021 as that earlier decision. - **`sync.ts:41`** sends the reader to invariant 8 in `metadata-core`'s `repository.ts` and names the pair `(objectstack-ai#11021, objectstack-ai#11127)`. `git blame` at the base puts invariant 8's statement (`repository.ts` :53 to :76) on `7d81c889f` (its line :63 since re-anchored by stage 9), and its conformance rows for `FileSystemRepository` and `InMemoryRepository` (:77, :79 to :88) on `46644e25a`, the objectstack-ai#11127 fix. So the dead half of the pair becomes `commit 7d81c88`, and the live `objectstack-ai#11127` stays. - **`close-terminates-watch.test.ts:103`** contrasts this package's hang with 「the sibling defect」: the filter-dependent drain-event drop in `SysMetadataRepository`, which is the defect `7d81c889f` fixed. The proof, per the earlier stages' standard: - `git rev-parse --disambiguate=7d81c889f` matches exactly one commit, `7d81c889f1f190a273e59ee584b7522ca6a792fa`. - `git merge-base --is-ancestor` puts it under the base `0fc80878f`, under `origin/main` `a1ca156da` at the time, and under `main` `5b5e83f44` fetched later (exit 0 each; exit 0 is self-proving, and the repository is not shallow). - It names objectstack-ai#11021 in its message (the subject) and in its diff (7 diff lines). - `git blame` at the base puts all 3 changed lines on `46644e25a`, which cites objectstack-ai#11021 as the sibling decision; that decision is `7d81c889f`'s diff, as the three bullets above set out. - No ADR names objectstack-ai#11021 or the drain-event decision (git grep over `docs/adr` for the number, 「drain event」 and 「Shutdown terminates」, exit 1). ## Wordings to check All 3 rewrites swap a tag in place, in forms the earlier stages already use: - `(objectstack-ai#11021)` became `(commit 7d81c88)` at `repository.ts:230` (stage 1's `(#N)` form). - `(objectstack-ai#11021, objectstack-ai#11127)` became `(commit 7d81c88, objectstack-ai#11127)` at `sync.ts:41`. The mixed commit-and-issue pair already stands in `packages/cli` (`(commit 44813ba, objectstack-ai#14554)`). - 「unlike the sibling defect in objectstack-ai#11021」 became 「unlike the sibling defect commit 7d81c88 fixed」 at `close-terminates-watch.test.ts:103`, the form `packages/cli/src/commands/generate-multiple-json-column.pin.test.ts:57` uses (「the defect commit ee370d3 fixed」). **No reflow.** No line was reflowed, so `repository.ts:230` and `close-terminates-watch.test.ts:103` are now longer than their block's wrap. `eslint.config.mjs` declares no line-length rule, and a reflow would move neighbouring lines. No file cites a line of any of the three touched files (git grep exit 1), and neither changed phrase is quoted elsewhere. ## Sites left - **In comments (src, test, outside the glob): none.** - **String literals: none.** The package's 10 test-string citations all resolve. - **Outside `src` and `test`:** the release-owned `CHANGELOG.md` names objectstack-ai#13112 (line 47) and objectstack-ai#11021 (line 196), both answering 404; left. ## Mechanical guard: no code token moves The guard compares base `0fc80878f` against the tree over all three touched files, with TypeScript 6.0.3, to the earlier stages' two-reading specification. The earlier guard scripts were scratch files, so it was rewritten here to that specification and proven with the controls below. - **Reading 1**: the parser's leaf nodes, from a `forEachChild` walk. Comments are trivia there, and JSDoc is never visited. A leaf that is not itself a token is re-scanned with trivia skipped. - **Reading 2**: the full token stream in parser context, from a `getChildren` walk, with JSDoc nodes skipped. String, template and numeric literals are compared in full on both readings. Results, at `67f182575` (the later commit touches none of the three files): - Real run: 6,075 base tokens (reading 2), **0 files with a token change** (exit 0). - Comment controls: 「awaiting the watcher,」 to 「… the WATCHER,」 (`repository.ts`), 「Best-effort cleanup:」 to 「Best-effort CLEANUP:」 (`sync.ts`) and 「bites on its own.」 to 「bites ON its own.」 (the test file). 0 files changed (exit 0 each). - Positive control, an identifier (`export function createBroker(` to `createBrokerX(`, `sync.ts`): DIFFER on both readings (exit 1). - Positive control, a string literal (the word 「no」 in the 「empty filter, no since」 row label, to 「NO」, the test file): DIFFER on both readings (exit 1). - Positive control, a template literal (the `@` separator in the sweep-failure key template, to `#`, `repository.ts`): DIFFER on both readings (exit 1). - Positive control, a numeric literal (`SETTLE_MS = 2_000` to `2_001`, the test file): DIFFER on both readings (exit 1). Each mutation went through `scripts/ablation-replace.mjs` (wrap mode; the anchor hit 1 before and 0 after, and the blob changed). It ran under a shell trap that restores by absolute path from `HEAD`. Each restore was proven equal to its `HEAD` blob (`888f39203432`, `122a45dcb516`, `0d266189d60c`), and afterwards `git diff HEAD` was empty and the tree clean. ## Changeset: `patch` (`dist` measured) `files[]` is `dist`, `README.md` and `CHANGELOG.md`, and the package is not private. One script ran under the shared verify lock (VERDICT command-exit 0, held 79s, shared-box seconds), at `67f182575`. It built the dependency closure first (`pnpm --workspace-concurrency=2 --filter '@objectstack/metadata-fs^...' build`, exit 0), then ran the package's own `build` (tsup and `check-dts-emitted`) three times, exit 0 each: - **Leg 1**, the head text: 6 `dist` files hashed (`index.js`, `index.cjs`, their sourcemaps, `index.d.ts`, `index.d.cts`). 1 of the 2 rewritten non-test lines appears verbatim in `dist`: the `close()` docblock line (`repository.ts:230`), in `index.d.ts`, `index.d.cts`, `index.js` and `index.cjs` (esbuild keeps that docblock). The other (`sync.ts:41`) sits on an interface that is erased from the JavaScript and never reaches the declarations (grep exit 1). `scripts/ablation-dist-preflight.mjs` finds the head marker 「was measured to be so (commit 7d81c88)」 in those 4 files with a clean tree (exit 0). - **Leg 2**, the base text put back in `repository.ts` and `sync.ts` (proven equal to their base blobs `d551426a7545` and `48798bcf7661`, written to the tree only, 0 paths staged): 4 of the 6 files differ from leg 1 (`index.js`, `index.cjs`, `index.d.ts`, `index.d.cts`); the two sourcemaps do not. The preflight finds the base marker 「was measured to be so (objectstack-ai#11021)」 in the same 4 files (exit 0). - **Leg 3**, after the proven restore (equal to the `HEAD` blobs `888f39203432` and `122a45dcb516`, `git diff HEAD` empty, porcelain empty): all 6 files are byte-identical to leg 1. The preflight's `--absent` reading of the base marker exits 0 with a clean tree. So the build is deterministic, and the difference is the rewrite. So the rewrite ships. `.changeset/20595-metadata-fs-provenance-anchors.md` declares a `patch` for `@objectstack/metadata-fs`, comment text only, with the claim's `Clause-②: no` line. The anchor is a commit, so the changeset names no ADR, repository qualifier or bracketed substitution. It says which published files carry the reworded text, as measured above. The changeset commit touches no file under `packages/metadata-fs`. ## Gates (head `32de59091`) - **Derived gates:** `node scripts/pm/dispatch-gates.mjs --repo objectstack-ai/objectstack --commands` at `32de59091` (4 paths against merge base `0fc80878f`) derived 61 commands. All 61 ran (21:25:07Z to 21:36:22Z, after the workspace build), each exit code captured before any pipe: 61 exit 0. `--ran` reports 「61 derived, 61 run, 0 NOT-MEASURED, 0 UNRUN」 (a derived zero) and exits 0. - The dispatch's lead derivation (47 commands, one path) is a subset. The extra 14 are: - the eight families the `.changeset/` path adds: the ADR-0087 registration and empty-changeset pairs, `check:objectui-changeset`, `check:pm-changeset-deadline-census` and two release self-tests; - `check:type-check-coverage` and `check:type-check-debt`; - four gates whose sources name the touched files: `check:engine-double-contract`, `check:objectql-double-limit`, `check:query-options-erasure` and `check:where-matcher`. - **Named readings:** - `node scripts/check-issue-citations.mjs` exits 0 (1 citation judged across 2 files: the carried-over `objectstack-ai#11127`, which resolves). - `pnpm check:issue-citations` exits 0 (its self-test, 173 cases, 9 batteries). - `pnpm check:doc-authoring` exits 0 (the sibling-package prose-id baseline holds, no growth). - `pnpm check:nul-bytes` exits 0 (10,001 files, no raw control bytes), and a control-byte grep over the 4 changed files finds none (exit 1). - The changeset gates exit 0: `check-adr-0087-registration` (「1 non-breaking changeset(s) seen」), `check-empty-changeset` (「1 declaring changeset(s) added」), `check-changeset-no-major` (「no `major` bump」), and `check:changeset-gate-self-tests`. The Clause-② level axis of `check-changeset-no-major` reads the pull request body, so it does not apply to a local run; that reading is CI's. - **Build, tests and typecheck, under the verify lock**, at `32de59091`: - The workspace build (`turbo run build --filter='./packages/*' --filter='./packages/*/*' --concurrency=2`): VERDICT command-exit 0, held 198s, shared-box seconds; 71 of 71 tasks, 20 cached. - The tests and typecheck: held 33s. `pnpm --filter @objectstack/metadata-fs test`: 10 test files pass, 70 tests pass (exit 0). `pnpm --filter @objectstack/metadata-fs typecheck` (`tsc --noEmit` and `tsc --noEmit -p tsconfig.test.json`) exits 0. - `tsc --listFilesOnly` puts every touched file in a program: `repository.ts` and `sync.ts` in both configs, and `close-terminates-watch.test.ts` in `tsconfig.test.json`, whose program holds all 10 test files. - No importing package owes a run, because the declaration files change only in comment text. - **Lint, as a proven narrowing, at `32de59091`:** - eslint ran with inline config disabled (`--format json`) over the 3 touched files plus `dist/index.js` as the control. - 4 results: 0 errors, and 1 warning, which is the control's ignore notice. No touched file is reported ignored, and `--print-config` resolves a config for each. - `eslint.config.mjs` never enables type-aware linting (its lines 327 and 328 say so; `--print-config` shows no `parserOptions.project` and no `projectService`), so a comment edit cannot move the verdict on an untouched file. - The repo-wide `pnpm lint` is CI's run. ## Acceptance notes - **Base, and no merge.** The dispatch read `origin/main` at `0fc80878f`, and the worktree was cut there. Every reading above is on this branch's own tree. Before this PR was opened, `main` moved 4 commits, to `5b5e83f44` (`objectql`, `driver-sql` and `service-analytics`, `spec`). - None of them touches `packages/metadata-fs`, `check-issue-citations.mjs` or `dispatch-gates.mjs`. - A local `git merge-tree` of the head with `5b5e83f44` is clean (exit 0), and the anchor `7d81c889f` is under it too (`--is-ancestor`, exit 0). - The gate's diff mode, run in a scratch checkout of `5b5e83f44` against `0fc80878f`, judges the 26 citations those 4 commits add: all 26 resolve. So they add no dead citation to the lane's packages. - The branch is not merged with them: the gate derivation reads the three-dot change set against the merge base `0fc80878f`, and CI and the merge queue run on the merged ref. - **History.** The repository is not shallow (`git rev-parse --is-shallow-repository` answers false), so no deepening was needed before the blame, ancestry and history readings. - **The same dead numbers outside this package's comments**, each left to its own carrier: `CHANGELOG.md` (objectstack-ai#13112 and objectstack-ai#11021, release-owned). - **Wording only:** no line without the number was changed. --- _Generated by [Claude Code](https://claude.ai/code/session_017ErfyP2Rx7XWHJA27QjyUi)_ --------- Co-authored-by: Claude <noreply@anthropic.com>
…stored view container never takes a name already served from elsewhere (objectstack-ai#21639, objectstack-ai#21638) (objectstack-ai#21648) Fixes objectstack-ai#21639 Fixes objectstack-ai#21638 Clause-②: no (narrowing) objectstack-ai#21638 carries its own claim on this branch (5975022936), as the Closing-Target Claim Guard requires for every card a PR closes. Triage folded it into objectstack-ai#21639's claim. The runtime save door's accept set narrows: one predicate now refuses a stored view container whose save name, or any name its expansion produces, is a name already served from elsewhere. Nothing widens. A package-less container row stored under the name of a view item a package ships now belongs to no package, as triage's fold of objectstack-ai#21638 rules. Dispatched by `domain:engine` seat 1 under claim 5974259402 (file surface corrected by 5974270195), branch `claude/issue-21639-view-container-collision`. Triage's ruling 5973827435 and its fold 5973838571 are implemented as written. ## What changed All of it is in `packages/metadata-protocol/src/protocol.ts`, the claimed surface. The producer is the save door itself, so nothing moved to another package. - **One predicate replaces the two one-shape checks.** `viewContainerNameCollisionRefusal` replaces objectstack-ai#21558's `containerOwnExpansionNameRefusal` and objectstack-ai#21620's `containerSiblingExpansionNameRefusal` at the same place in `saveMetaItem`: after `savedItemNameRefusal`, before `normalizeViewMetadata`. - **What the container would serve** is its expansion as the readers place it: `expandRuntimeViewContainer` with the request's package binding, the binding the row is stored under. The body judged is the authored one with the door's own `name` stamp applied first. - **Elsewhere (1), another stored container's expansion in the caller's selection, whatever its object.** These are the rows `readActiveOverlayRows` selects through the readers' gate `organizationIdForMetaRead`, with no package filter. Each is parsed by `storedOverlayEntries` and expanded by `expandStoredViewContainers` with its own binding. The row stored under the save name is left out, because it is the row this save replaces. The `same object` qualifier is gone, as ruling (1) B says, and so is the now-unused `deriveViewContainerObject` import. - **Elsewhere (2), a view item a package ships.** `lookupArtifactItem` answers, and the artifact must carry `viewKind` (`isShippedViewItem`, a new module-level predicate). One exception: the views of the shipped container this row overlays by its own name (`overlaidShippedContainerViewNames`). ADR-0005 keys an overlay by its own name, so that container's views are the row's own to replace. - **The cells, in order:** the save name against a sibling's expansion, then against a shipped view item, then against its own expansion (objectstack-ai#21558's shape); then each expansion name against a sibling's expansion, then against a shipped view item. The first collision answers. - **The envelope** is unchanged: `VALIDATION_ERROR` / 400, with no new code. Every message names the other owner (the stored container, the shipping package, or "its own expansion") and gives the family's prescription. That is: add the view as a member of the container that owns the name, or save a view item under the name. For a shipped name: save a view item under it, or a name or key of its own. ⛔ No arm prescribes a save under a name another stored row holds. objectstack-ai#21558's own-expansion arm used to say "Save the container under its object's name" even when a stored container held that name. It now names that container to add the view to. - **Prescription first, explanation last.** A 4xx message crosses the REST boundary bounded at 500 characters with its tail cut (`CLIENT_MESSAGE_MAX`). The first REST probe of this branch received the shipped-arm prescription cut mid-word, so every message now front-loads the owner and the prescription. The pin asserts both inside the first 500 characters (objectstack-ai#17584's ordering rule). - **The attribution half (objectstack-ai#21638), in `runtimeViewContainerPackage`.** A package-less row whose same-named shipped artifact is a view **item** (`viewKind` set) now answers no package: "A container row is not an overlay of the item, so it is attributed to no package." A package-less row under a shipped **container**'s name keeps that container's package, as before. A bound row is unchanged. ## Census, taken first (the ruling's stop conditions) **(2): does a live writer save a second container of one object on purpose?** Readings are at BASE `7b07749f05`, re-read after merging `origin/main` (head `d5101d1831`). objectui was read at the old pin `89cad75d55` and at the new pin `ab1879721595`, which `origin/main` moved to while this ran. | Census input | Evidence | A second container of one object, a container under another container's expanded name, or a container under a shipped view item's name, on purpose? | |---|---|---| | objectstack-ai#13407's authoring path: the platform checklist's live view-authoring item `studio-authoring.view-authoring-live` (P1, revision 2) | Step 1 saves ONE container, `qa_repair_asset_views` = `{ object: 'repair_asset', list, form }`, on a runtime-authored object. No other checklist item stores a container on `repair_asset`. objectstack-ai#13407's own repro (a container bound to `note` under another name, per PR objectstack-ai#21637's census) is one container too. | No. | | objectstack-ai#21412's P2 / P2b (seat answer 5961930912) | One container, `lead_views`, bound to `crm_lead`. Pinned in the `objectstack-ai#21412` block of the same test file, still green. | No. | | objectstack-ai#21334's arm (rulings 5946423948, 5955628428) | It expands under the container's own name, `OBJECT.CONTAINER_NAME` and `OBJECT.CONTAINER_NAME.KEY`, never a name the owning package ships. Pinned as two allowed rows below. | No. | | Studio's metadata editor re-save (objectui at both pins) | **Creators** write view items: the metadata-admin `createBuildBody` (`anchors.ts:291`, "Emit a canonical ViewItem"), the spec create seed for `view` (`metadata-create-seeds.ts:62`, `viewKind: 'list'`), and the flat configs of `data-objectstack` `createView` and `setViewConfig`. **Re-savers** save the loaded body under the name it carries: `ResourceEditPage` (`:1477`), the Interfaces pillar's `StudioDesignSurface` (`:2475`, new at `ab1879721595`), and `updateView`. | No creator writes a container. A re-saver writes a colliding container only when the store already holds the collision, and that re-save is now refused until its body stops colliding. | | Package duplication (`duplicatePackage`, a writer through this door, outside the ruled set) | Throwaway probe, deleted afterwards. A container `pone_extra_views` in `com.example.pone`, bound to `crm_lead` (outside the package, shipped by no code package), duplicated into `com.example.ptwo`. **At BASE:** copied, and the object door's `crm_lead.default` became the copy's, wearing `_packageId: com.example.ptwo`. The source package's view was silently replaced. **At HEAD:** `failed[]` carries this refusal, naming `pone_extra_views`, and the source's view stays. | Yes, as a byproduct; not on purpose, as this dev reads it. The copy is meant to be an independent base, and the collision is the defect itself. Raised as an open question in the report. | | `migrateStoredMetadata` | It re-saves rows already stored, inside a `try` that records `outcome: 'failed'`. | Not a creator. | | The in-repo AI author | The MCP tools in `packages/mcp/src/mcp-http-tools.ts` have no metadata write. `skills/objectstack-ui` teaches `defineView` in source. | No. The cloud AI author is outside this repository and the ruled set: **NOT MEASURED**. | | Packaged containers and stored rows | Source registrars never reach this door. The example apps seed no `sys_metadata` view rows. Hosted tenants: **NOT MEASURED**. | n/a | **The attribution half: does a live overlay path depend on a package-less container row taking a shipped item's package?** - **Callers.** `runtimeViewContainerPackage` is called by `expandRuntimeViewContainer` (and by the new `overlaidShippedContainerViewNames`). `expandRuntimeViewContainer` is called by `expandStoredViewContainers` (the list read, the by-name read's `resolveRowlessExpandedView`, and this predicate), by `hydrateExpandedViewItems` (the registry), and by the predicate itself. - **The overlay that does take a package is unchanged and pinned (CONTROL):** a package-less row under the package's own container name. That is the path behind the checklist's `packaged-display-class-direct-edit` designer overlay. - **No writer stores a package-less container under a view item's name.** Studio's creators write view items, the save door now refuses the shape, and the restore doors and draft promotion re-write only bodies already stored. - **Verdict:** no live overlay path depends on it, so the ruling's attribution lands. ## Every accept-set change at `saveMetaItem`, type `view` Each row covers publish and draft mode, both scopes and both kernels. "Stored container" means one in the caller's selection. | Input | Before (BASE `7b07749f05`) | After | |---|---|---| | A container bound to **another object**, under a name a stored container expands | Accepted: stored, and registered on an unscoped kernel. The sibling's view under that name was served by neither door, and the by-name read answered the raw container. | **Refused** `VALIDATION_ERROR` / 400, naming the stored container. Nothing is stored or registered. | | An **unbound** container under such a name | Same as above. | Same as above. | | A container whose expansion takes a name a stored container already expands: a second container of one object whose bare `list` takes `OBJECT.default`, under a free name or under the object's name | Accepted. The one read last replaced the other's view on both doors. | **Refused**, naming the stored container. | | A container under the name of a **view item a package ships**: package-less, organization-scoped, or bound to a writable package | Accepted. The packaged view was no longer listed on the object door, and by-name answered the raw container. Package-less, the row also took the shipping package, so its bare `list` replaced `OBJECT.default` on both doors with that package's `_packageId`. | **Refused**, naming the package. | | An overlay of a package's own container whose member takes the name of a view item **the package ships on its own** | Accepted. The member replaced that packaged view on both doors. | **Refused**, naming the package. | | A container under its own expanded name (objectstack-ai#21558), or under a name another stored container of the same object expands (objectstack-ai#21620) | Refused `VALIDATION_ERROR` / 400. | Refused, with the same envelope. The prescription now comes first, and the own-expansion arm no longer prescribes a save under a name a stored container holds. | | A `form`-only container under a registered view item's name | Refused `VALIDATION_ERROR` / 400 under objectstack-ai#21558 or objectstack-ai#21620. Under any other registered name: 422 from the identity stamp. | Every shape this predicate covers is refused `VALIDATION_ERROR` / 400 first, before the stamp. | | Everything else | Unchanged. | Unchanged. | **Rows already stored.** They keep their bytes, and no row is re-saved. A package-less container row stored under a shipped view item's name now reads as belonging to no package: - On that package's object it expands under its own name (`showcase_task.showcase_task.in_progress`), with no `_packageId` and no default. - The packaged views it used to replace (`showcase_task.default`, or `showcase_task.edit` for a `listViews.edit` member) are served again on both doors (pinned). - The row still takes its own name's slot on both doors. That is the read doors' name-keyed overlay, out of surface and unchanged. A new save of a row in a refused shape, a re-save included, is refused until its body stops colliding. Delete stays open. ## The enumeration pin (the card's acceptance) `view-container-runtime-expansion.test.ts`, block `objectstack-ai#21639`. Each row runs on both kernels (`env_local` and unscoped) and both scopes, unless the row names one scope. - **A refused row asserts:** - `code` and `status`; - the save name, the colliding name and the owner; - the owner and the view-item prescription inside the first 500 characters; - that no stored row's name is ever prescribed as a name to save under; - in publish and in draft mode, that nothing is stored or registered; - that the owner's view still answers on both doors. - **An allowed row asserts** that it saves, and that each named view answers on both doors. - **The structural tests fail when:** - a row is neither refused nor allowed, or is both; - a ruled shape has no row; - a cell of the predicate has no refused row. | # | Shape | Verdict | Owner named / reason | |---|---|---|---| | 1 | A container under a name its own expansion produces (objectstack-ai#21558's own-expansion name) | REFUSED | its own expansion | | 2 | The same, while a stored container holds its object's name | REFUSED | its own expansion; the prescription names that container | | 3 | A container of the same object under a name a stored container expands (objectstack-ai#21620's sibling) | REFUSED | the stored container `crm_lead` | | 4 | A container bound to **another object** under that name ((1)'s other-object container) | REFUSED | the stored container `crm_lead` | | 5 | An **unbound** container under that name ((1)'s unbound container) | REFUSED | the stored container `crm_lead` | | 6 | A second container of one object, free name, bare `list` on `OBJECT.default` ((2)'s second container default) | REFUSED | the stored container `crm_lead` | | 7 | A container under its object's name, after a free-named container took `OBJECT.default` | REFUSED | the stored container `lead_other_views` | | 8 | A package-less container under a shipped view item's name (objectstack-ai#21638's shipped item name) | REFUSED | the package `com.example.showcase` | | 9 | A writable-package container under a shipped view item's name | REFUSED | the package `com.example.showcase` | | 10 | An overlay of the package's container whose new member takes a view item the package ships on its own | REFUSED | the package `com.example.showcase` | | 11 | A view item under a stored container's expanded name (allowed: objectstack-ai#21510's sanctioned override) | ALLOWED | a view item is not a container: it is that name's sanctioned override | | 12 | A view item under a shipped view item's name | ALLOWED | the sanctioned override of the packaged view by name | | 13 | A container under its object's name (allowed) | ALLOWED | the container contract's own name (ADR-0017 §3.2), and nothing it expands is served elsewhere | | 14 | A container's own re-save | ALLOWED | the row under the save name is the row this save replaces | | 15 | A container under a name of its own beside a sibling, with names the sibling does not expand | ALLOWED | the census writers' shape, colliding with nothing | | 16 | An overlay of the package's own container, by its own name | ALLOWED | ADR-0005: the row stands in for the shipped container and its views | | 17 | A package-less container on another package's object | ALLOWED | objectstack-ai#21334's arm: its names derive from its own name | | 18 | The same, in a writable package | ALLOWED | objectstack-ai#21334's arm, bound to its own package | | 19 | Under another organization's container's expanded name (organization scope) | ALLOWED | the caller's selection decides, as it does for the readers | | 20 | An environment-wide container under an organization's container's expanded name (environment scope) | ALLOWED | the caller's selection decides; reading every organization's rows at an environment-wide save would be a cross-tenant read | ## The PM's mechanism hypotheses - **H1, confirmed** at `7b07749f05`. `saveMetaItem` called `containerOwnExpansionNameRefusal` and then `containerSiblingExpansionNameRefusal`, both before `normalizeViewMetadata` and both `VALIDATION_ERROR` / 400. Both are replaced by the one predicate. - Every objectstack-ai#21558 and objectstack-ai#21620 pin keeps its envelope and its intent: the file is green, and leg 1 below turns all of them red. - objectstack-ai#21558's showcase pins now also assert the owner the predicate names. Every name they save under is one the showcase ships, so the shipped-item arm answers there. The objectstack-ai#21620 block gains a one-paragraph note. - **H2, measured.** - The allowed shapes collide as follows. A container's own re-save collides with nothing once its row is left out. An overlay of its own package's container collides with every packaged name it re-expands; the overlaid container's views are excluded, as the ruling's ADR-0005 reading requires. objectstack-ai#21334's own-name arm collides with nothing. - **The line drawn:** a container under its object's name is allowed when it expands no name served elsewhere. Saved after a free-named sibling of that object took `OBJECT.default`, it is (2)'s shape and refused (row 7). - **H3, confirmed.** "A view item a package ships" is `lookupArtifactItem`, the registry's artifact read, which never answers a tenant-authored row, holding an artifact with `viewKind` set. - The first spelling ("not a container") refused `sys-metadata-repository.package-writability.test.ts`'s ADR-0005 overlay preservation pin. That fixture's artifact stub is neither a container nor a view item. The predicate is now positive, and that pin is green. - objectstack-ai#21510's sanctioned override stays allowed (rows 11 and 12). - **H4, confirmed.** The callers and the live overlay path are listed above. Rows stored before this change get the reading named above. - **H5, kept by construction.** The predicate is not gated on `source` or `writeFace`, so `migrateStoredMetadata` and `duplicatePackage` record the refusal as the row's failure. Duplication was measured (the census row above). ## Tests All readings are at HEAD `d5101d1831` unless named otherwise. - **Premise.** - **Method:** the new pins, run against BASE's `protocol.ts` (blob `56bc12dce760`), restored by a trap-guarded script. Restore proof: blob `e5765e5ba0f9` equal to HEAD at `0af0f28e49`, and `git diff HEAD` empty. The command: `vitest run src/view-container-runtime-expansion.test.ts -t 'objectstack-ai#21639|objectstack-ai#21638'`. - **Result: 40 failed, 50 passed** (231 skipped). - **Red:** - the 7 newly refused shapes × 2 scopes × 2 kernels (28), each failing on `the save is refused`; - row 2 × 4, where BASE's arm reads "Save the container under its object's name, 'crm_lead'" while a stored container holds `crm_lead`; - the 8 attribution pins, where the packaged label and config were replaced. - **Green:** rows 1 and 3, every allowed row, the 2 structural tests, and the 4 attribution controls. - **New pins: 90.** - The enumeration block: 2 structural tests + 76 row cells. - The `objectstack-ai#21638` attribution block: 2 at-rest cases + 1 control, × 2 scopes × 2 kernels. - **The file:** 321 passed (231 pre-existing + 90). - **The package:** `pnpm --filter @objectstack/metadata-protocol exec vitest run --maxWorkers=2` gives Test Files 209 passed, 3 skipped (212); Tests 3463 passed, 19 skipped (3482); `VERDICT command-exit 0`. - **Typecheck:** `pnpm --filter @objectstack/metadata-protocol typecheck` (`tsc --noEmit`) exits 0, and `tsc --noEmit --listFiles` includes the test file. - **Downstream sample.** - **Direction:** consumers (downstream) of `@objectstack/metadata-protocol`. - **Build:** against `dist/` rebuilt at `d5101d1831` by `turbo run build --filter='@objectstack/dogfood^...' --filter='@objectstack/metadata-protocol...' --concurrency=2`: 63 of 63 tasks. The built `dist/index.js` carries the new predicate, and the old method names are gone from it. - **`objectql`, 11 files, 229 tests:** `protocol-meta`, `protocol-view-identity-overlay`, `protocol-org-overlay-registry-gate`, `protocol-commit-history`, `protocol-packaged-view-base`, `protocol-save-meta-repo-path`, `protocol-save-meta-repo-path-real-engine`, `view-container-divergent-name-registrars`, `view-container-name-refusal`, `engine-nested-plugin-view-expansion`, `metadata-validation-sweep`. - **`rest`, 1 file, 7 tests:** `public-form-routes.stored-row`. - **`dogfood`, 2 files, 7 tests:** `view-container-cross-package-default` (PR objectstack-ai#21430's pin over REST) and `view-container-default-form`. - All pass. The rest of the downstream run is CI's. - **Over REST**, measured with a throwaway dogfood probe on the booted showcase, deleted afterwards: - `PUT /api/v1/meta/view/showcase_task.in_progress` with a container answers 400 `VALIDATION_ERROR`, and the object door still serves `showcase_task.in_progress` as "In Progress" from `com.example.showcase`; - a second container on one runtime object answers 400; - a view item under the shipped name answers 200. ## Reverse verification The change was committed first. Both legs ran from committed `e5ac5cf14a`, the same `protocol.ts` blob as HEAD, since the later merge touched nothing under `metadata-protocol`. Each leg was a trap-guarded script around `scripts/ablation-replace.mjs --delete`. - **Leg 1, the predicate's throw**, anchor `if (containerCollision) throw containerCollision;`. - **Mutation:** the anchor went from 1 occurrence to 0, and the blob from `f853b383e1b2` to `be22198e5e1f`. Predicted direction: red. - **Result: 104 failed, 217 passed.** That is every refusal pin in the file: the objectstack-ai#21639 refused rows (40), objectstack-ai#21558's showcase block (24), objectstack-ai#21620's block (36) and objectstack-ai#21558's runtime-object block (4). - **Green:** every allowed row, every control and the attribution block. - **Restore:** blob `f853b383e1b2`, equal to HEAD, and `git diff HEAD` empty. Both the tool and the script's trap proved it. - **Leg 2, the attribution guard**, anchor `if (isShippedViewItem(overlaid)) return undefined;`. - **Mutation:** the anchor went from 1 occurrence to 0, and the blob from `f853b383e1b2` to `55cc79455d20`. Predicted direction: only the at-rest pins turn red. - **Result: 8 failed, 313 passed.** Exactly the 8 at-rest attribution pins turned red. The 4 controls and every save-door pin stayed green. - **Restore** proven the same way. - **No dist leg.** The subject is imported through `./index.js`, the source. ## Gates `node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack`, with no paths, at `d5101d1831` derives **64** families. That is the dispatch lead's 56 plus the 8 the changeset adds: - `check-adr-0087-registration` ×2; - `check-empty-changeset` ×2; - `release-rehearsal-clone --self-test` and `release-pending-publish --self-test`; - `check:objectui-changeset` and `check:pm-changeset-deadline-census`. - **All 64 exited 0.** `pnpm check:dual-build-cjs-loads` first exited 3: PREREQUISITE NOT MET, because 8 packages had no `dist/`. It exited 0 after those were built through the lock. - `check:dual-build-cjs-loads` and `check:type-check-debt` ran through the verify lock. - **`--ran`:** "64 derived, 64 run, 0 NOT-MEASURED, 0 UNRUN". - `check-adr-0087-registration` accepts the changeset's `not-required (no-migration-prescription)` disposition. - **Lint, a declared narrowing.** - **Measured:** `eslint --no-inline-config --format json` over the 2 changed `.ts` files reports 2 files, 0 errors and 0 warnings, with no "file ignored" message. The changeset `.md` has no matching ESLint configuration. - **No untouched file can change verdict:** type-aware linting is off. `eslint.config.mjs:328` says so, and `--print-config` shows `parserOptions.project` and `projectService` both null. - Repo-wide `pnpm lint` is CI's. - **Branch state:** `origin/main` was merged twice, `f30588ceb7` and then `d5101d1831`. Neither moved a byte under `packages/metadata-protocol`. ## Acceptance notes - **Rows of one name in two bindings.** "The row under the save name" excludes every row of that name in the selection, as objectstack-ai#21620's check did. Two containers sharing one name in two bindings are therefore not judged against each other: a package-less row and a writable package's row, or a duplicate whose name carries no namespace prefix. Read, not measured. - **An environment-wide save, an organization's sibling (row 20).** The save is allowed by the ruling's "in the caller's selection", and for that organization the sibling's view is gone. Noted, not filed. - **Restore and publish doors.** `rollbackMetaItem`, `revertCommit` and the draft promotion do not run the predicate, as for objectstack-ai#21558 and objectstack-ai#21620. A draft saved before its sibling existed can be promoted into a collision. - **A disabled package's shipped view item still counts as served,** because the registry's artifact read does not ask whether the package is enabled. - **A stored row's own name is not "elsewhere"** in the ruling. A container stored at a name before a sibling gains a member of that name keeps the name, as PR objectstack-ai#21637 noted. - **The at-rest objectstack-ai#21638 row still takes its own name's slot on both doors.** That is the read doors' name-keyed overlay, out of the claimed surface. - **Cost.** A container save reads the caller's active view rows once, through the readers' row cache, as objectstack-ai#21620's check did. It also asks the registry's artifact read once per name it would serve. A view item pays nothing. - **Declaration bytes.** `dist/index.d.ts` swaps two private member lines for two: `viewContainerNameCollisionRefusal` and `overlaidShippedContainerViewNames`. No public member or exported type changes. - **The changeset** is `.changeset/21639-view-container-name-collision.md`: `'@objectstack/metadata-protocol': minor`, `Clause-②: no (narrowing)`, the **BREAKING** banner, the ADR-0087 disposition `not-required (no-migration-prescription)` written from this census, and a before/after per shape. --- _Generated by [Claude Code](https://claude.ai/code/session_017ErfyP2Rx7XWHJA27QjyUi)_ --------- Co-authored-by: Claude <noreply@anthropic.com>
Fixes #21620
Clause-②: no (narrowing)
The runtime save door's accept set narrows: a view container saved under a name that another stored container of the same object expands to is refused with
VALIDATION_ERROR/ 400. Nothing widens. Dispatched bydomain:engineseat 1 under claim 5973165628 (branchclaude/issue-21620-container-named-after-object).What changed
saveMetaItem(packages/metadata-protocol/src/protocol.ts), the method behindPUT /api/v1/meta/view/NAMEand the dispatcher's metadata save, gains one check:containerSiblingExpansionNameRefusal. It runs right after #21558'scontainerOwnExpansionNameRefusaland before the view identity stamp (normalizeViewMetadata). This is triage's pre-named fallback, the narrower check, not the broad one. The census below hit, so the broad check ("a container's name must equal its object's") was not written.viewrows thatreadActiveOverlayRowsselects for this caller, through the readers' gateorganizationIdForMetaReadand with no package filter. That is environment-wide rows plus the caller's organization's.storedOverlayEntriesand expanded byexpandStoredViewContainerswith its own package binding. So every member kind (a bare or namedlist,listViews,form,formViews), the expander's de-duplication, and metadata: a view container with a bare list on another package's object silently replaces that object's packaged default view on GET /meta/view?object= — while the by-name read still serves the original #21334's own-name arm on another package's object are judged where the readers place them.objectagainstderiveViewContainerObjectof the body. That is the one derivation the source registrars file a container under, newly imported from@objectstack/metadata/view-container.namestamp applied first (H3), before the identity patch. On an unscoped kernel the sibling's expansion is registered under the name, and aform-only container would otherwise take itsviewKindand reach the schema as a malformed view item.VALIDATION_ERROR/ 400, the same as the two name checks beside it. No new code, and the error-code ledger is untouched.saveMetaItem's view save door only.The census, taken first (the ruling's stop condition)
The ruling, as the seat reads it: if any writer or packaged container names a container other than after its object, do not write the broad check; record the hit; implement the narrower check. The census hit, decidably.
Readings at BASE
045b946256, with objectui at its pin89cad75d55:studio-authoring.view-authoring-live(P1, active, revision 2 of 2026-10-02)PUT /api/v1/meta/view/qa_repair_asset_views?mode=draftwith{ object: 'repair_asset', list, form }, on a runtime-authored object.PUT /api/v1/meta/view/NAMEof a container bound tonoteunder another name. #13407's repair taught the readers the container's ownobjectso that this shape serves.os_qa_shadow_probesaved onshowcase_task. Ruling 5946423948 allowed "expands under the container's own name". Seat answer 5955628428 rejected refusal at save because it "blocks a legitimate 'add views to a shipped object' path". PR #21430 pins it (46 cases plus a REST dogfood pin).packages/metadata/src/view-container-name.test.ts.buildViewConfigSaveBodyandviewEnvelope, ObjectDataPage throughcreateRuntimeMetadata, the metadata-admincreateBuildBody, and the flat configs ofdata-objectstacksetViewConfigandcreateView. Re-savers: the metadata-adminResourceEditPagesaves a body under the name it carries, anddata-objectstackupdateView's draft path merges onto the stored draft without reducing a container to itslist. Both re-save a container stored under a non-object name, under that name.packages/mcp/src/mcp-http-tools.tsare object, record and action tools: no metadata write. The publishedskills/objectstack-uiteachesdefineViewcontainers in source, with no top-levelname.defineView(call sites with an object-literal argument, outsidepackages/spec/srcand tests, and 0 with a top-levelname. The source registrars refuse a setnamethat disagrees with the derived object: the boot loop (engine.ts:7024), the artifact/HMR loader (plugin.ts:1192) andos validate(view-container-names.ts:101).sys_metadataview rows; the onesys_metadatamention is a comment in the showcase connectors. Hosted tenants: NOT MEASURED.H2, measured: what the broad check would have broken. A throwaway, trap-guarded probe planted the broad predicate at the save door at BASE, ran the full
metadata-protocolsuite, and was restored (blob8a8053c40c94equal to HEAD,git diff HEADempty). It gave 127 of 3342 tests red, every one carrying the probe's own message:resettable: trueand its layeredcodeis the hydrated expansion #21511 block (14), which reuse that harness's container.namecontradicts its row name and registers it under both keys; the two source registrars refuse the same document #21412's P2 and P2b (2).protocol.graft-folded-form-sections.test.ts(2,lead_viewsonlead) andsys-metadata-repository.package-writability.test.ts(1,case_grid).PR #21430's REST dogfood pin was not run under the probe (NOT MEASURED). With this PR it passes, 4 of 4. The pins that encode a ruled arm (#13407, #21334, #21412) are evidence for the stop condition, alongside the writers above. The probe's first attempt was refused by
ablation-replacebecause its replacement re-contained the anchor. Nothing ran, the tool restored, and the probe was re-spelled.Every accept-set change at
saveMetaItem, typeviewVALIDATION_ERROR/ 400. Nothing is stored or registered.name(the door stamps the save name).form-only container under a sibling's form-expanded name, on an unscoped kernel with an environment-wide sibling (the registry holds the sibling's expanded item under the name).INVALID_METADATA/ 422: the identity stamp copied that item'sviewKindonto the body.VALIDATION_ERROR/ 400 by this check, which now runs first.What still saves (pinned on both kernels and in both scopes):
Rows already stored in this shape keep their bytes and read as they do today. Measured with the check ablated, on both kernels and in both scopes:
crm_lead.defaulton both doors.A new save of such a row is refused, and delete stays open.
migrateStoredMetadataandduplicatePackagere-save stored rows through this door inside atrywhosecatchrecords the row:outcome: 'failed'with the refusal's text, or afailed[]entry. So they report such a row and never re-save it (H5, by construction: the check is not gated onsourceorwriteFace).The PM's mechanism hypotheses
045b946256:savedItemNameRefusal, thencontainerOwnExpansionNameRefusal, thennormalizeViewMetadata, allVALIDATION_ERROR/ 400. finding(metadata-protocol): the runtime save door accepts a view container saved under one of its own expanded names, and after #21510's rule no door answers a view item for that name #21558's check is kept as it is, and the new check sits after it. Every finding(metadata-protocol): the runtime save door accepts a view container saved under one of its own expanded names, and after #21510's rule no door answers a view item for that name #21558 pin holds its envelope and intent (the file is green).expandUnderOwnName's arm is a ruled writer path, so the broad check would have refused it.The foreseen follow-up: a container saved under the name of a view item a package ships
This was measured in-process on both kernels with a throwaway test, deleted afterwards. It is a different mechanism, so it is reported to the seat as a finding and not changed here. The save was
{ name: 'showcase_task.in_progress', object: 'showcase_task', list }asshowcase_task.in_progress: package-less and environment-wide, package-less and organization-scoped, and in a writable package.showcase_task.in_progress, and the by-name read answers the raw container.showcase_task.formreads the same.showcase_task.defaultreads the same from a writable package; package-less, finding(metadata-protocol): the runtime save door accepts a view container saved under one of its own expanded names, and after #21510's rule no door answers a view item for that name #21558's check refuses it.listthen expands toshowcase_task.defaultand replaces the packaged default on both doors, stamped_packageId: com.example.showcase.runtimeViewContainerPackage.Tests
Premise, measured at the fix's own pins with the new throw ablated (the measurement half of the reverse verification below), and confirmed by the throwaway door probe on both kernels and both scopes:
crm_lead.pipeline;crm_lead.defaultanswers the second container's list on both doors.With the fix: refused
VALIDATION_ERROR/ 400, and both doors answer the first container's views.New pins: 50, in a
#21620block inview-container-runtime-expansion.test.ts, inside metadata: a view container with a bare list on another package's object silently replaces that object's packaged default view on GET /meta/view?object= — while the by-name read still serves the original #21334's faithful-registry harness.env_localand unscoped) and per scope (environment-wide and organization-scoped):list,listViews,form,formViews);name, and in draft mode;form-only body;codeandstatus) and the two subjects it names. It also asserts that no row or draft is stored, that no container is registered under the name, and that the sibling's view still answers on both doors as the same item.The file: 231 passed (181 pre-existing plus 50), at
13736a50f6.The package, at
13736a50f6(patch round 1; round 0 read 3371 passed at5573152989):pnpm --filter @objectstack/metadata-protocol exec vitest run --maxWorkers=2: Test Files 209 passed, 3 skipped (212); Tests 3373 passed, 19 skipped (3392); exit 0.typecheck: exit 0.tsc --noEmit --listFilesincludes the test file.Downstream sample. Direction: consumers of
@objectstack/metadata-protocol, againstdist/rebuilt byturbo run build --filter='./packages/*' --filter='./packages/*/*' --concurrency=2(71 of 71 tasks). All pass; the rest of the downstream run is CI's.objectql:protocol-meta,protocol-view-identity-overlay,protocol-org-overlay-registry-gate,protocol-commit-history,view-container-divergent-name-registrars,engine-nested-plugin-view-expansionandmetadata-validation-sweep: 7 files, 189 tests.rest:public-form-routes.stored-row, 7 tests.dogfood:view-container-cross-package-default(PR fix(metadata-protocol): a bare-list view container on another package's object expands under its own name #21430's pin over REST on the real showcase), 4 tests.The merge of
origin/main(719644794c) moves no byte underpackages/metadata-protocolor its dependency closure. So the suite, typecheck and ablation readings taken at5573152989read the same bytes.Reverse verification
The fix was committed first (
5573152989). A trap-guarded script then ranscripts/ablation-replace.mjs --deleteon the anchorif (siblingExpansionRefusal) throw siblingExpansionRefusal;.771b82e97372to1cb3741ebb3a.expected null to be an instance of Error(the save accepted). 1 answeredINVALID_METADATAinstead ofVALIDATION_ERROR(theform-only cell on the unscoped environment-wide kernel, the identity-stamp row in the table).git checkout HEAD -- ABS_PATHbrought the blob back to771b82e97372, equal to HEAD, andgit diff HEADwas empty. Both the tool and the script's own trap proved this.13736a50f6, two legs:56bc12dce760, equal to HEAD, withgit diff HEADempty../index.js, the source.Gates
node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack, with no paths, derived 64 families at719644794c. That is the dispatch lead's 56 plus the 8 the changeset adds:check-adr-0087-registration×2,check-empty-changeset×2,release-rehearsal-clone --self-test,release-pending-publish --self-test,check:objectui-changesetandcheck:pm-changeset-deadline-census.pnpm check:lean-entry-closurefirst exited 3 (PREREQUISITE NOT MET:objectql'sdist/was absent). It exited 0 after the workspace build.check:dual-build-cjs-loadsandcheck:type-check-debtran through the verify lock, after the build.--ran: 64 derived, 64 run, 0 NOT-MEASURED, 0 UNRUN.13736a50f6: the same 64 families, all exit 0;--ran64 derived, 64 run, 0 NOT-MEASURED, 0 UNRUN.check-adr-0087-registrationaccepts the changeset'snot-required (no-migration-prescription)disposition.eslint --no-inline-config --format jsonover the 2 changed.tsfiles reports 2 files, 0 errors and 0 warnings (no "file ignored" message). Type-aware linting is never enabled (eslint.config.mjs:327-328;--print-configshowsparserOptions.projectandprojectServiceboth null), so files this diff does not touch cannot change verdict. Repo-widepnpm lintis CI's.PUT /api/v1/meta/view/NAMEon a booted stack) is NOT MEASURED. The pins are in-process at the method that door calls, on both kernels, and the envelope is the one the same door's name refusals already carry through REST.Acceptance notes
The ruled predicate's "same object", read literally, leaves two measured shapes open. Both are accepted on both kernels and in both scopes, and the sibling's view is gone from both doors:
{ object: 'crm_account', list }saved ascrm_lead.pipeline);{ list }, whose derived object is its own name).Both are refused if the check drops "of the same object" and keys on the name alone. No writer in the census saves either shape, so that change would refuse nothing legitimate. It is raised to the seat as an open question, not taken here, because the ruling's words name the same object.
A second container under a free name still takes a sibling's expanded name. Two containers of one object whose expansions share a name (both bare
lists givecrm_lead.default) are both accepted, and the later one's view answers that name on both doors. This is the card's step-3 symptom without this save, measured on both kernels and in both scopes. It is reported to the seat as a finding.Scope and order:
Both are measured, and both are noted rather than filed.
Restore and publish doors.
rollbackMetaItem,revertCommitand the draft promotion do not run this check, as for finding(metadata-protocol): the runtime save door accepts a view container saved under one of its own expanded names, and after #21510's rule no door answers a view item for that name #21558. A draft or version stored before this change, or a draft stored before its sibling existed, can still be written back in this shape. Kept to the claimed surface.Cost. A save of a view container (only a container) reads the caller's active view rows once more, through the same overlay row cache the readers use. A view item pays nothing.
Declaration bytes.
dist/index.d.tsgains one private member line. No public member or exported type changes..changeset/21620-container-sibling-expansion-name.md:'@objectstack/metadata-protocol': minor,Clause-②: no (narrowing), the BREAKING banner, and the ADR-0087 dispositionnot-required (no-migration-prescription).Generated by Claude Code