Repository navigation
Commit 9670e99
fix(metadata-protocol)!: same-name reads that name no package answer the environment's doc first and read a disabled holder as absent (#38640)
<!-- claude-projects-attribution: {"github_login":"os-steve"} -->
_Requested by **Steve** · [project
thread](https://claude.ai/code/project/chan_01FdL1XeUyvVNxLreh3F4Qi9?thread=cmsg_01FdL1XeUyvVNxLreh3F4Qi9BzWvmsAKskRGFXQ4iwDJDW)_
Fixes #34452
Fixes #34190
Fixes #34440
Clause-②: no (narrowing)
Metadata-protocol: none
Skills-docs: none — no key an author writes changes; the moved answers
are reads that name no package, which the skills teach as "name the
package" already
## 维护者速读
- 用户能看到什么变化:同名元数据在不点名包的读取下只给一个答案;环境自己的文档先答,停用包当作不存在,过去随保存或注册顺序变的答案不再变。
- 为什么做:同名读取折叠组的读门半边(共八张卡,本 PR 收其中三张),写门与水合的半边另开第二个 PR。
- 出错会怎样:依赖旧答案、不点名包去读共享名字的调用方会改拿环境条目或 409 冲突;点名包即可读回原来那份,改动可整体撤回。
- 要你做什么:无(契约复审由席位送审)。
## What changes
Three criteria, one commit each:
1. **#34452** (04e0ebc, ruling 6942962369): beside ONE enabled holder
of a doc name, a package-less entry in the registry's bare slot (a
stamp-less registration, or the hydrated package-less row) is the
environment's own item and answers first on the bare plain read,
`/layers` and both `/published` doors, as it already did beside two
holders, agreeing with the registry and `MetadataFacade`. The holder's
address still reads its own doc. `refuseAmbiguousBareDocRead`
(packages/metadata-protocol/src/protocol-meta-item-reads.ts) now answers
the entry beside one or more enabled holders.
2. **#34190** (4bd9450): the in-process `getMetaItemLayered` naming no
package, of a doc two or more enabled packages hold with no package-less
entry, refuses 409 `RESOURCE_CONFLICT` naming each holder, as
`getMetaItem` does; it swallowed the refusal and read the layers of the
holder registered last. The HTTP transports already refused through
their own step.
3. **#34440** (586b7ed, seat choice A on the card's own acceptance): a
package-less row beside a disabled holder's row and enabled holders'
rows of a name no enabled package ships is judged over the served set
(`servedRowHolderOf`,
packages/metadata-protocol/src/protocol-meta-item-face.ts), giving the
answer the doors give when the disabled holder is absent (#33210 pins):
two or more enabled holders are refused naming exactly them, one is
served. The judgment had left such a row "as it was", so the read
followed save order (D, package-less, E answered 404) and `/layers`
named the disabled package. The disabled holder may hold the name as a
stored row, or in code alone beside two or more enabled packages' rows
(on `main` every bare door answered 404 in that form; contract review
S4, 2aa6a1c). Beside rows bound to ONE package the read is left as it
was (contract review S2, 65e2140).
Plus (ef33907) two ADR-0087 semantic entries under step 19,
`doc-bare-read-environment-entry-first` and
`disabled-holder-package-less-row-bare-read-judged-as-absent`, and the
changeset `.changeset/34452-same-name-bare-reads.md` (BREAKING banner,
FROM and TO per criterion).
Contract review 7265093897 (PASS, three should-fix), fixed in four
commits:
- **S1, N1** (e10d0b2): the entry and the changeset said the #34190
layered read served the holder registered FIRST; it served the one
registered LAST, as the card's reading, the code comment and the pin
say. The entry's surface now says a package-less row counts as the
environment's entry once it is in the registry's bare slot.
- **S2** (65e2140): with `if (rows.unbound) return undefined` removed,
a package-less row beside rows bound to ONE enabled package, the
disabled package holding the name only as code, was re-addressed to that
package: measured on `RestServer`, every bare door moved from 404 to 200
serving the enabled package's row, outside the declared surface. The
guard its twin `storedRowHoldersRefusal` keeps (unbound, fewer than two
bound packages) is restored, so the cell answers 404 as on `main` (the
same early return there), with or without an environment item in the
bare slot. Whether that 404 is right is outside this PR; the seat
carries it.
- **S3** (db57853): beside one holder the plain read serves the
environment's entry under the holder's envelope. It did the same beside
two or more holders before this PR, and PR 2's #34417 hydration fix does
not reach it (measured with PR 2's build: the read grafts the envelope
from the artifact the name lookup answers). The entry's acceptance and
the changeset name it as a known deviation, tracked in #38659.
- (9a03d07) the CLI pin that no semantic entry's printed guidance cites
a tracker id (`migrate-meta-engine-guidance`, Test Core 2/12 on
db57853) read `#38659` in that acceptance; the acceptance now says a
follow-up card carries it, and the entry's header comment names #38659.
Delta contract review 7266936020 (PASS, S1 to S3 and N1 closed, one new
should-fix), fixed in one commit:
- **S4, N3** (2aa6a1c): the second entry's surface and the
`servedRowHolderOf` jsdoc said the disabled package holds the name as a
stored row; the judgment asks whether any holder of the name is
disabled, the registry's holders and the rows together. Measured on
`RestServer` with the face's judgment as on `main` (merge-base
7213177): with two enabled packages' rows, a package-less row and a
disabled package holding the name in code alone, the plain read,
`/layers` and `/published` answered 404 in both registration orders and
both save orders; at this head they refuse 409 naming exactly the two
enabled packages. The surface, the reason, the jsdoc and the changeset's
FROM now name that holder form, and four RestServer pins hold the cell.
The changeset's deviation sentence names the lock (`full`) too.
## Tests
-
packages/runtime/src/domains/meta-disabled-holder-artifact-door.test.ts:
the `[measured, unresolved]` pin for #34452 is replaced (forced change:
it pinned the FROM) by two `[#34452]` pins (a stamp-less bare entry, and
a hydrated package-less row, beside one holder: every bare door and both
registry readers answer the entry, the holder's address its own doc),
and one `[#34190]` pin (in process, the layered read naming no package
refuses 409 naming both; each holder's address reads its own layers).
-
packages/runtime/src/domains/meta-disabled-holder-served-stack.test.ts:
`[#34440]` describe, booted kernel with sqlite, both registration
orders, three save orders each for two enabled holders (409 naming
exactly E and F on the plain read, `/layers`, `/published` and the
execution read; each exact address its own row; `?package=D` 404) and
for one enabled holder (E's row on every bare door), before and after a
reboot. 12 tests.
- packages/rest/src/meta-disabled-package-doors.test.ts: `[#34440]`
describe on `RestServer` with the real protocol and registry, same
matrix without a reboot. 12 tests, plus four S4 pins (both registration
orders, two save orders: two enabled rows and a package-less row beside
a disabled code holder are refused 409 naming exactly the two enabled
packages on the plain read, `/layers` and `/published`) and the S2
CONTROL (2 tests, both registration orders): an enabled package's row
and a package-less row beside a disabled code holder answer 404 on the
plain read, `/layers` and `/published`, with and without an environment
item in the bare slot.
## Acceptance notes
- #34452: beside one holder the served entry wears the holder's envelope
(`_packageId`, `_provenance: package`, lock `full`) on the plain read;
the pins check labels. Known deviation, tracked in #38659 (contract
review S3).
- #34190 addendum (REST `/diff` with `?package=`) is outside this PR's
file surface: `fetchCurrentMetaDocument` in
packages/rest/src/rest-server.ts reads by name and ignores `?package=`.
Reported to the seat.
- #34440: the no-package-less-row CONTROL (E, F, D rows) is the existing
ruling-Q2 test (409 naming E and F), unchanged.
- The save door also reads this judgment
(`servedPackagelessSaveAddress`); for the two cell shapes it answered
the same before and after (two enabled holders: 409 naming them; one:
that holder's address). The write-door cells (#34346, #34417) are PR 2.
## Verification
The details below were measured on head `ef33907bdf` (or its parent for
runs made before the changeset commit, which touches no code); the
contract review delta is measured on the new head (last block). All in
this container, heavy runs under `scripts/pm/os-verify-lock.sh` (shared
box).
<details><summary>Suites</summary>
- `pnpm --filter @objectstack/metadata-protocol test`: Test Files 372
passed, 9 skipped; Tests 23649 passed, 45 skipped.
- `pnpm --filter @objectstack/runtime exec vitest run --maxWorkers=2
src/domains`: Test Files 244 passed; Tests 7447 passed, 6 skipped.
- `pnpm --filter @objectstack/rest test`: Test Files 441 passed; Tests
9065 passed, 351 skipped.
- Full dogfood, `pnpm build` (123/123 tasks) then `pnpm --filter
@objectstack/dogfood test`: lock VERDICT command-exit 0; Test Files 495
passed, 3 skipped (498); Tests 4187 passed, 68 skipped (4255); no
failure.
- Typecheck of metadata-protocol, runtime, rest and spec: exit 0 each.
</details>
<details><summary>FROM, then TO (#34440)</summary>
The new `[#34440]` RestServer pins against the pre-fix `dist/` (head
4bd9450): 12 of 12 red, for example "expected [ 'plain', 200, undefined
] to deeply equal [ 'plain', 409, 'RESOURCE_CONFLICT' ]" with the body
serving `healthy row` or `package-less row` by save order; "expected [
'plain', 404, 'RESOURCE_NOT_FOUND' ] …" for one order; `/layers` 409
naming `app.disabled_demo` beside one enabled holder. After the fix and
a rebuild: the file's 75 tests pass, and the 12 runtime `[#34440]` pins
pass (193 in the file).
</details>
<details><summary>Ablation (dev-ablation.md: commit first, mutate with
ablation-replace, rebuild, dist preflight, run, restore from HEAD, prove
an empty git diff HEAD, rebuild, preflight --absent)</summary>
| arm | mutation | pins red | restored |
|:--|:--|:--|:--|
| #34452 | the doc entry answers beside two or more holders again (`>=
2`) | artifact-door `[#34452]`: 4 of 4 | diff empty, marker absent |
| #34190 | the layered read swallows the refusal again (try/catch) |
artifact-door `[#34190]`: 2 of 2 | diff empty, marker absent |
| #34440 (a) | `if (rows.unbound) return undefined;` put back | rest
`[#34440]` 12 of 12, runtime `[#34440]` 12 of 12 | diff empty, marker
absent |
| #34440 (b) | the environment-item shortcut for callers off the item
face put back | runtime `[#34440]` 2 of 12 (one holder, saved E, D,
package-less, both registration orders: the hydrated package-less row is
the registry's environment item, and `/layers` named D); rest 0 of 12
(its store double hydrates no registry item) | diff empty, marker absent
|
After every leg was restored: artifact-door 49 passed (6 skipped),
runtime `[#34440]` 12 passed, rest `[#34440]` 12 passed. The first
attempt at leg (a) was a no-op: `ablation-replace` refused it because
the replacement contained its anchor and restored the file itself, so
the script stopped; both #34440 legs then ran with a changed anchor
text.
</details>
<details><summary>Gates</summary>
`node scripts/pm/dispatch-gates.mjs --commands --repo
objectstack-ai/objectstack` after the last commit: 192 commands, plus
the four package typechecks, each run with `< /dev/null`. Reconciled
with `--ran`: "100 derived, 100 run, 0 NOT-MEASURED, 0 UNRUN". Eleven
first failed for a missing prerequisite (ten exit 3 for an unbuilt
package or the shallow clone; the CLI test exit 1 for
create-objectstack's missing `dist/`), and all eleven passed once `pnpm
build` ran and the pinned fixture commit was fetched. `pnpm
check:type-check-debt` passed under the lock. `node
scripts/pm/overlap-check.mjs`: clean against origin/main 1d19acf. The
CI-only families (Build Core, the dogfood shards, Temporal Conformance)
are read from this PR's check-runs.
</details>
<details><summary>Contract review deltas (heads 9a03d07 and
2aa6a1c)</summary>
- `pnpm --filter @objectstack/metadata-protocol test`: Tests 23649
passed, 45 skipped. `pnpm --filter @objectstack/rest test`: Tests 9067
passed, 351 skipped. `pnpm --filter @objectstack/runtime exec vitest run
--maxWorkers=2 src/domains`: Tests 7447 passed, 6 skipped (these three
at 65e2140; the two later commits change ledger and changeset text
only). Spec migrations 209 passed and the CLI
`migrate-meta-engine-guidance` test 3 passed on 9a03d07, against a
rebuilt spec `dist/`; `check-adr-0087-registration` OK;
metadata-protocol and spec typecheck exit 0.
- Ablation of S2: the restored guard made conditional on a marker,
rebuilt, dist preflight saw the marker; the S2 CONTROL went red (2 of 2:
the doors served `healthy row`), the 12 other `[#34440]` RestServer
tests and the two `contract review S4` tests the filter also ran stayed
green; restored from HEAD, empty diff, rebuilt, preflight `--absent`
clean.
- S3 measurement: the stamp-less `[#34452]` and `[#34248]` pins run
against PR 2's build with a temporary probe (removed): the plain read on
both transports answered `_packageId` a holder and `_provenance:
package` in the one-holder and the two-holder cell.
- Gates: `node scripts/pm/dispatch-gates.mjs --commands` on 9a03d07,
100 commands each with `< /dev/null`, run after `pnpm --filter
@objectstack/spec build` (an earlier run on db57853 read a spec `dist/`
older than the entry edit, which is how the CLI pin passed locally and
failed in CI). Reconciled with `--ran`: "100 derived, 100 run, 0
NOT-MEASURED, 0 UNRUN". `node scripts/pm/overlap-check.mjs`: clean
against origin/main. Check-runs on 9a03d07: 60 success, 11 skipped,
none failed.
- S4 (2aa6a1c): the four new pins, with `protocol-meta-item-face.ts`
swapped for its merge-base copy and metadata-protocol rebuilt, went 4 of
4 red (`[ 'plain', 404, 'RESOURCE_NOT_FOUND' ]`; a probe read 404 on
`/layers` and `/published` too); with the file restored from HEAD (empty
diff) and rebuilt, 4 of 4 green. `pnpm --filter @objectstack/rest test`:
Tests 9071 passed, 351 skipped. Spec migrations 209, CLI
`migrate-meta-engine-guidance` 3, `check-adr-0087-registration` OK,
metadata-protocol and spec typecheck exit 0, after a spec and
metadata-protocol rebuild. Gates on 2aa6a1c: 100 commands, `--ran` "100
derived, 100 run, 0 NOT-MEASURED, 0 UNRUN"; overlap-check clean.
Check-runs on 2aa6a1c: 60 success, 11 skipped, none failed.
</details>
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01ADHkmQmQ1jpFsNcARMbY56
<!-- signed: repo:objectstack#3 · os-steve ·
session_01ADHkmQmQ1jpFsNcARMbY56 -->
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 9cbb41b commit 9670e99
11 files changed
Lines changed: 523 additions & 50 deletions
File tree
- .changeset
- packages
- metadata-protocol/src
- rest/src
- runtime/src/domains
- spec/src/migrations/entries/semantic
| 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 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
273 | 273 | | |
274 | 274 | | |
275 | 275 | | |
276 | | - | |
277 | | - | |
278 | | - | |
| 276 | + | |
279 | 277 | | |
280 | 278 | | |
281 | 279 | | |
282 | | - | |
283 | | - | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
284 | 288 | | |
285 | 289 | | |
286 | 290 | | |
| |||
306 | 310 | | |
307 | 311 | | |
308 | 312 | | |
309 | | - | |
310 | | - | |
| 313 | + | |
311 | 314 | | |
312 | 315 | | |
313 | 316 | | |
| |||
340 | 343 | | |
341 | 344 | | |
342 | 345 | | |
343 | | - | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
344 | 351 | | |
345 | 352 | | |
346 | 353 | | |
| |||
363 | 370 | | |
364 | 371 | | |
365 | 372 | | |
366 | | - | |
367 | | - | |
| 373 | + | |
368 | 374 | | |
369 | | - | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
370 | 387 | | |
371 | 388 | | |
372 | 389 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
340 | 340 | | |
341 | 341 | | |
342 | 342 | | |
343 | | - | |
| 343 | + | |
344 | 344 | | |
345 | | - | |
346 | | - | |
| 345 | + | |
| 346 | + | |
347 | 347 | | |
348 | | - | |
349 | | - | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
350 | 355 | | |
351 | 356 | | |
352 | 357 | | |
| |||
357 | 362 | | |
358 | 363 | | |
359 | 364 | | |
360 | | - | |
| 365 | + | |
361 | 366 | | |
362 | | - | |
| 367 | + | |
363 | 368 | | |
364 | 369 | | |
365 | 370 | | |
| |||
1372 | 1377 | | |
1373 | 1378 | | |
1374 | 1379 | | |
1375 | | - | |
1376 | | - | |
| 1380 | + | |
| 1381 | + | |
1377 | 1382 | | |
1378 | 1383 | | |
1379 | 1384 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
316 | 316 | | |
317 | 317 | | |
318 | 318 | | |
319 | | - | |
320 | | - | |
| 319 | + | |
| 320 | + | |
321 | 321 | | |
322 | | - | |
323 | | - | |
324 | | - | |
325 | | - | |
326 | | - | |
327 | | - | |
328 | | - | |
329 | | - | |
330 | | - | |
331 | | - | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
332 | 332 | | |
333 | 333 | | |
334 | 334 | | |
| |||
903 | 903 | | |
904 | 904 | | |
905 | 905 | | |
906 | | - | |
| 906 | + | |
907 | 907 | | |
908 | 908 | | |
909 | 909 | | |
| |||
0 commit comments