Repository navigation
Commit 69783b7
fix(metadata-protocol,spec)!: the bare item read refuses a package-less row beside two row holders, and reads a row-held base at its dependent's added member (ADR-0150 D3) (#34355)
<!-- claude-projects-attribution: {"github_login":"zhuangjianguo"} -->
_Requested by **Steedos** · [project
thread](https://claude.ai/code/project/chan_018ETKaNwMZCNRYD7D8Q9Ubb?thread=cmsg_018ETKaNwMZCNRYD7D8Q9UbbBePzY6g11h3hyWk5ud4vWy)_
Fixes #33210
Clause-②: no (narrowing)
Metadata-protocol: none
Skills-docs: none — `skills/objectstack-platform/SKILL.md` (the ADR-0146
paragraph) and `content/docs/concepts/metadata-lifecycle.mdx` teach that
a locale a dependent adds under a base's name is served only under its
own `?package=`, and that the read naming no package answers `404` for
it. Both sentences were true only for a base that ships the name, and
are now true for a row-held base too, at a dependent's named locale
other than the canonical one, however many dependents each add one.
Nothing in `skills/**` or `content/docs/**` teaches what the read naming
no package answers for a package-less row beside two packages' rows.
> **BREAKING**: two answers of the `/meta` item read that names no
package move from served to refused (table below). Name the package
(`?package=`) to read the row, as before. ADR-0087: `registered
row-held-base-addition-bare-read-at-base,
two-row-holders-bare-read-refused`.
**Clause-② arm.** `no (narrowing)`, as contract review record 6915442261
② confirmed: nothing moves from refused to served.
**Round 2 (contract review record 6915442261, VERDICT FAIL at
b959edb; delta record 6922561329, PASS at 2b9293e with S2 and N3
open).** M1, S1, N1 and N2 are addressed below and closed by 6922561329.
S2 is fixed at 5e2b663 (below). N3 is this body. The earlier body
called `protocol-meta-layered-reads.ts` "area-approved" and the new spec
entry "seat-approved". No record of either approval is on #33210 or this
thread, so both attributions are withdrawn. Both files are declared here
as extensions of the claim's file surface: one call site in the layered
read, and the ADR-0087 entry the (c) move needs.
**Round 3 (L1-b 6925025713, REWORK R1 to R3; delta record 6931462446,
PASS at 4542737 with S3, N5 and N6 open).** R1 and R2 (body half) are
this body; R3 is `6f4fdf19` (the RestServer `[#33210]` refusals pinned
by `[status, code]`). S3 and N5 are `891338265`: the changeset's last
"Not moved" sentence said the package-less save beside two holders still
edits the row; measured on the bare-save harness, that save is refused
`409 RESOURCE_CONFLICT` naming E and F and writes nothing, before and
after this change, so the note now says so and cites #34348 only for its
own shape. The S2 pin now reads the shared member `?member=en-US`. N6 is
this body. `origin/main` merged at `3bbce494e` (merge only, no
conflict).
## 维护者速读
- 改了什么:不带 `?package=` 的元数据按名读取有两处改为拒绝/404。(a)
同名项只有两个包的存储行加一条无包行、且没有包在代码中发布时,普通读取、`/published` 与执行读取一律 409 点名两个包(与
`/layers` 一致),不再按保存顺序挑一行;(c) 基础包只以存储行持有某名、依赖包在另一非规范成员(如
`fr-FR`)加了一行时,不带包的读取在该成员上答 404,与基础包在代码中发布时一致;多个依赖包各加一个成员时同样成立。
- 为什么改:ADR-0150 红线 2(歧义只报告、不猜),卡片 #33210 的 (a)(c) 两项;(d) 修正 ADR-0087 条目
`two-row-holders-bare-read-refused` 的 `reason` 文字。第二轮按合同复审 6915442261 修
M1(两个依赖包时第一轮仍按 200 返回)与 S1(规范成员镜像不再被挪动),并按 6922561329 修
S2(依赖包同时存了基础包的成员时,按注册表规则仍算追加)。
- 风险与回滚:收窄:上述两种形态的裸读从 200 变为 409/404;精确地址 `?package=`
不变,写入不变,不点名成员的读取(规范成员与 `/published`)不变。首方应用无此形态(计数 0)。回滚即还原本 PR。
- 先看:`packages/metadata-protocol/src/protocol-meta-item-face.ts` 的
`rowHeldBaseAddressOf`(每个包按自己的依赖闭包判定是否为追加;只对点名的非规范成员生效),以及
`servedRowHolderOf` / `storedRowHoldersRefusal` 的无包行分支。
- 两分钟验证:`pnpm --filter @objectstack/runtime exec vitest run
--maxWorkers=2 src/domains/meta-disabled-holder-served-stack.test.ts -t
"M1 two dependents|S1|S2"`,预期 10 个用例全部通过(两个依赖包 4 个、共享成员 4 个、规范成员镜像 2 个)。
- 需要你做的:无,席位落地(需一次覆盖 spec 面的 L2 合同复审,针对本轮新 head)。
## What changes
- `packages/metadata-protocol/src/protocol-meta-item-face.ts`
- (a) `storedRowHoldersRefusal` (the no-disabled arm of the item face's
served-holder judgment) refuses naming the holders when a package-less
row sits beside two or more of them, as `/layers` does. Beside one
holder or none, the package-less row still leaves the read as it was
(CONTROL).
- (a) `servedRowHolderOf` reads the rows before honouring the registry's
environment item on the item face. After a reboot that item is the bare
slot's entry, the row hydrated last, so it was the package-less row
whenever that row was saved last. With rows bound to two or more
packages beside it, it is judged with them. Beside a disabled holder the
read is left as it was. (N2) Its docblock now says so.
- (c) `rowHeldBaseAddressOf`. The read naming no package, at a named
non-canonical bundle member that only dependents' additions hold over a
base holding the name only as stored rows, takes the base's address, as
it does when the base ships the name. (M1) Each row-holding package is
judged against its own declared dependency closure, as the registry's
`isBundleAddition` judges it. A package is an addition when some other
row holder is in its closure and it is not in that holder's. The base is
the one row holder that is no addition. So a second dependent (D1
`fr-FR`, D2 `de-DE` over A's `en-US`) leaves A the base at both members,
in either registration order. At b959edb the rule was "exactly one
row holder without a row at the member", which found A and D2 at `fr-FR`
and served D1's row. (S1) The arm moves only a named member other than
the canonical one; the canonical-member mirror is left as it was
(below). (S2) No member clashes on this arm: the registry counts a clash
only at a member shipped in code (`codeMembersOf`), and the arm runs
only for a name no package ships. So a dependent that also stores a
member the base stores (D's `en-US` and `fr-FR` over A's `en-US`) stays
an addition. At 2b9293e any shared member was a clash, which gave two
bases and served D's `fr-FR` (200).
- `packages/metadata-protocol/src/protocol-meta-layered-reads.ts`: one
call to `rowHeldBaseAddressOf` beside `declaredMemberOverrideAddressOf`,
so `/layers` agrees with the plain read.
-
`packages/spec/src/migrations/entries/semantic/18.two-row-holders-bare-read-refused.ts`
(d): only the `reason` text changes.
-
`packages/spec/src/migrations/entries/semantic/18.row-held-base-addition-bare-read-at-base.ts`:
the ADR-0087 semantic entry for (c). Round 2: the `surface` and
`acceptanceCriteria` say "named member other than the canonical one" and
"one or more dependents", and the surface says the read naming no member
and `/published` do not move. (N1) The `reason` no longer attributes "a
bundle addition holds no name" to ADR-0150 D3; the header comment cites
the rule's source (the `packageScopedHoldersOf` docblock, epic child
R2).
- `.changeset/33210-packageless-row-two-holders.md`: `patch` on
`@objectstack/metadata-protocol` and `@objectstack/spec`. Its second
bullet and `Skills-docs:` sentence now say what the code does (M1, S1).
### FROM → TO (every moved answer)
| Shape | Door (naming no package) | FROM (`main`) | TO |
|:---|:---|:---|:---|
| (a) E's row + F's row + a package-less row, no shipper | plain read,
`/published`, execution read | 200, the row stored first (package-less,
E's or F's, by save order) | 409 `RESOURCE_CONFLICT`,
`details.candidates` = E, F |
| (a) same | `/layers` | 409 naming E, F | unchanged |
| (a) same, package-less row saved last, after a reboot | plain read |
200, E's row | 409 naming E, F |
| (c) base A's `en-US` row, dependent D's `fr-FR` row, no shipper |
plain read, `/layers`, execution read at `?member=fr-FR` | 200, D's row
| 404 `RESOURCE_NOT_FOUND` |
| (c) same with a second dependent D2's `de-DE` row (M1) | same, at
`fr-FR` and at `de-DE` | 200, each dependent's row | 404 |
| (c) D also stores `en-US` beside its `fr-FR` (S2) | same, at `fr-FR` |
200, D's row | 404 |
| (c) A ships `en-US` (CONTROL) | same | 404 | unchanged |
| CONTROL: E's row + a package-less row | every bare door | 200, E's row
| unchanged |
| CONTROL (S1): A's `fr-FR` row, D's canonical `en-US` row | the read
naming no member, `?member=en-US`, `/published`, `/layers`, execution
read | 200, D's row | unchanged |
| any | `?package=E` / `?package=F` / `?package=D&member=fr-FR` | own
row | unchanged |
**S1, which option and why.** The arm is guarded to a named
non-canonical member rather than pinned beside a shipped CONTROL.
Measured on a booted kernel: with A shipping only `fr-FR` and D storing
the canonical `en-US`, the read naming no member serves A's `fr-FR`, and
`/published` and `/layers` move across a reboot (200 D's row, then 404).
There is no single shipped answer to align the row-held cell with.
Unguarded (b959edb), the row-held cell answered 404 before a reboot
and A's `fr-FR` after it. Guarded, it serves D's row on every door in
both save orders, before and after a reboot, as on `main`. The shipped
cell's own movement is reported to the seat as a separate finding, not
fixed here.
## Tests
- `packages/rest/src/meta-disabled-package-doors.test.ts`: describe
`[#33210]`, all 6 save orders of the three rows on every door plus each
exact address, and a one-holder CONTROL in both save orders.
-
`packages/runtime/src/domains/meta-disabled-holder-served-stack.test.ts`:
- (a) Three save orders × two registration orders, before and after a
reboot, plus the CONTROL.
- (c) M2: the row-held base in both save orders, and the shipped base as
CONTROL, before and after a reboot.
- (c) M1, new: two dependents (D1 `fr-FR`, D2 `de-DE`) registered and
saved A, D1, D2 and D2, D1, A, row-held and shipped (CONTROL), before
and after a reboot. Each member answers 404 on the plain read, `/layers`
and the execution read, and is served at its own address. The base's
`en-US` stays the base's.
- S2, new: D storing `en-US` and `fr-FR` over A's `en-US`, registered
and saved A, D and D, A, row-held and shipped (CONTROL), before and
after a reboot. `fr-FR` answers 404 on the plain read, `/layers` and the
execution read, and `?package=D` serves it. (N5) The shared member
`?member=en-US` naming no package is not moved: the shipped base serves
its own row (200), and over a row-held base A's and D's rows of it are
refused `409 RESOURCE_CONFLICT` naming both.
- S1, new: the canonical-member mirror in both save orders, before and
after a reboot. Every door naming no package serves D's row, and the
base's `fr-FR` stays the base's (CONTROL).
## Acceptance notes
- Out of scope, carried by #34440: a package-less row beside a disabled
holder and served holders. The plain read follows save order,
`/published` serves the package-less row, and `/layers` refuses naming
the disabled package. This was measured, and the disabled arm is
unchanged from `main`.
- Out of scope, carried by #34441: with a shipped base holding only a
non-canonical member and a dependent's canonical row, the read naming no
member serves the base's other member, and `/published` and `/layers`
move across a reboot.
- Writes, not moved: in shape (a) the save naming no package is refused
`409 RESOURCE_CONFLICT` naming E and F and writes nothing, on both
transports and in both save orders, measured before this change (where
the plain read served a row by save order) and after it (where the read
refuses as well). A save that edits a package-unbound row while the read
refuses is another shape, two enabled packages that ship the name with
no package's row stored, and is #34348 (decision open).
- Out of scope, carried by #34441 (folded there as its second cell,
6933869894): in the S2 shape the shared canonical member `?member=en-US`
answers differently by how the base holds the name: a shipped base's row
(200), or over a row-held base `409` naming A and D. This change does
not move it (measured before it, before a reboot, on the same harness).
## Verification
Final head `3bbce494e` (`origin/main` merged at that commit). Each step
below ran as its own call under the shared verify lock, after `pnpm
install --frozen-lockfile` and the closure build `pnpm --filter
'@objectstack/dogfood^...' build` (exit 0) at that head.
<details><summary>Suites and typecheck at 3bbce49</summary>
- runtime `meta-disabled-holder-served-stack.test.ts`: 157/157. rest
`meta-disabled-package-doors.test.ts`: 58/58.
- `typecheck` of runtime, rest, metadata-protocol and spec: exit 0 each.
- At `5e2b66314c` (metadata-protocol source unchanged since): `pnpm
--filter @objectstack/metadata-protocol test` 346 files passed, 9
skipped; 22968 tests passed, 45 skipped. `pnpm --filter
@objectstack/spec test` ran at 2b9293e.
</details>
<details><summary>Save measurement (S3) and the shared-member read
(N5)</summary>
One-off probe on the existing bare-save harness (`[#32605]` describe,
both transports, both registration orders), not kept as a test: authored
packages E and F each store a row and a package-less row is stored, in
two save orders (package-less first, package-less last).
- This branch (`45427375`): bare read `409 RESOURCE_CONFLICT`; bare save
`409 RESOURCE_CONFLICT` naming both packages; the stored rows are
unchanged.
- Without this change (the two metadata-protocol sources restored from
`152cd1fa6`, the package rebuilt, `rowHeldBaseAddressOf` proved absent
from `dist/`): bare read 200; bare save `409 RESOURCE_CONFLICT` naming
both; the stored rows are unchanged. The sources were then restored from
HEAD (blob hashes matched) and the package rebuilt.
- N5, the S2 shape at `?member=en-US` naming no package: shipped base
200 with the base's row; row-held base `409 RESOURCE_CONFLICT` naming A
and D on the plain read, `/layers` and the execution read, before and
after a reboot. Without this change, row-held, before a reboot: the same
`409`.
</details>
<details><summary>Ablations (rounds 1 and 2; code unchanged
since)</summary>
At 2b9293e:
- A1, the unbound refusal off: REST `[#33210]` 6 failed, 2 CONTROL
passed; runtime `[#33210] saved` 6 failed.
- A2, the environment-item hunk off: runtime 2 failed ('E, F,
package-less' after a reboot, one per registration order).
At 5e2b663, over the `[#32607 M1, M2]` describe (14 tests):
- A3, `rowHeldBaseAddressOf` off: 6 failed (M2, M1 two dependents and
S2, the row-held cells); every shipped CONTROL passed.
- A4, M1 off (one base beside the member's holders): 4 failed: M1 two
dependents (2), and S1's `?member=fr-FR` CONTROL (2), where without the
per-package closure the base itself reads as an addition. Observed
direction: more diagnostics than the two pins targeted.
- A5, the S1 guard off: S1 2 failed.
- A6, S2 off (a shared stored member is a clash): S2 row-held 2 failed;
the shipped CONTROLs passed.
</details>
<details><summary>Dogfood battery and derived gates at
3bbce49</summary>
- Dogfood battery: `pnpm --filter @objectstack/dogfood test`, lock
VERDICT command-exit 0; 478 test files passed, 3 skipped; 4030 tests
passed, 44 skipped.
- `dispatch-gates --commands` (change set from merge base `bdd51769e`, 7
paths): 93 derived; 91 exit 0; 2 NOT MEASURED, both exit 3 before
reaching the gate body: `check:dual-build-cjs-loads` (PREREQUISITE NOT
MET, it needs a full `pnpm build`; only the dogfood closure was built)
and `check:type-check-debt` (its own lock wait timed out behind the
battery). `--ran` reconciliation: 93 derived, 91 run, 2 NOT-MEASURED, 0
UNRUN. CI runs both.
- CI check-runs at this head: not read here; for the seat.
</details>
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01FEkQ5obaLbqgzRUR9xXfft
<!-- signed: repo:objectstack#2 · os-steve ·
session_01ADHkmRPxhTmqbUbMrqygh4 -->
---------
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: objectstack-fleet[bot] <332303061+objectstack-fleet[bot]@users.noreply.github.com>1 parent b1efa37 commit 69783b7
7 files changed
Lines changed: 560 additions & 24 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 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
46 | | - | |
| 46 | + | |
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
50 | | - | |
| 50 | + | |
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
| |||
274 | 274 | | |
275 | 275 | | |
276 | 276 | | |
277 | | - | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
278 | 283 | | |
279 | 284 | | |
280 | 285 | | |
| |||
332 | 337 | | |
333 | 338 | | |
334 | 339 | | |
335 | | - | |
336 | | - | |
337 | | - | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
338 | 343 | | |
339 | 344 | | |
340 | 345 | | |
| |||
346 | 351 | | |
347 | 352 | | |
348 | 353 | | |
349 | | - | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
350 | 362 | | |
351 | 363 | | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
352 | 367 | | |
| 368 | + | |
353 | 369 | | |
354 | 370 | | |
355 | 371 | | |
| |||
406 | 422 | | |
407 | 423 | | |
408 | 424 | | |
409 | | - | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
410 | 432 | | |
411 | 433 | | |
412 | 434 | | |
| |||
423 | 445 | | |
424 | 446 | | |
425 | 447 | | |
426 | | - | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
| 451 | + | |
| 452 | + | |
| 453 | + | |
| 454 | + | |
427 | 455 | | |
428 | 456 | | |
429 | 457 | | |
| |||
572 | 600 | | |
573 | 601 | | |
574 | 602 | | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
575 | 708 | | |
576 | 709 | | |
577 | 710 | | |
| |||
612 | 745 | | |
613 | 746 | | |
614 | 747 | | |
| 748 | + | |
| 749 | + | |
| 750 | + | |
615 | 751 | | |
616 | 752 | | |
617 | 753 | | |
618 | | - | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
619 | 758 | | |
620 | 759 | | |
621 | 760 | | |
| |||
0 commit comments