Repository navigation
Commit 02f55c5
fix(metadata-protocol)!: a name a disabled package holds through a stored row is judged over the served set, never by save order (ADR-0150 D3) (#33130)
<!-- claude-projects-attribution: {"github_login":"os-elon-musk"} -->
_Requested by **Elon** · [project
thread](https://claude.ai/code/project/chan_01WedDzV26nniwxv7jC88B9D?thread=cmsg_01WedDzV26nniwxv7jC88B9DJY4PjkLW3oxuaYHFL3pHBd)_
Part of #32354
Clause-②: yes (narrowing) — on both transports, a bare read (plain and
`/published`) of a name held by the stored rows of two or more enabled
packages beside a disabled one is refused `409 RESOURCE_CONFLICT` naming
only the enabled holders, where it answered by save order; on
`RestServer`, `?package=PAIR` of a disabled customization pair whose
base is enabled answers 404 where it served the base's item. Three bare
reads widen from 404 or 409 to 200 with the one enabled holder's row
(table below). `?package=DISABLED` (case 3) is not a move: 18.4.0
already answers 404.
Metadata-protocol: none — no key, value or metadata type an author
writes changes; what moves is which stored row a by-name read answers
while a package is disabled.
Skills-docs: none — no skill or doc teaches the by-name answer for a
name a disabled package holds through a stored row;
`content/docs/deployment/marketplace-handbook.mdx` already says a
disabled module is hidden.
Supersedes #32811 (same work: that PR's head branch belongs to an
earlier card thread, which this thread cannot push; this branch resumes
from its head `cd1143c19` and merges `main` once).
## 维护者速读
- **改了什么:**
不指名包读取一个元数据名时,如果某个包已停用、而这个名字由多个包的存储行持有,现在按「在用的持有者」判定:只剩一个在用包就答它的行,两个以上就
409 且只点名在用包,不再按保存顺序答,也不再点名停用包。另外 `?package=停用的定制包` 现在答 404,不再透出它基础包的内容。
- **为什么改:** 专题 ADR-0150 D3:停用一个包,它在每个读门上都应消失,结果不随保存顺序变化。本轮同时落实了契约复审
6856157850 的 S1–S4。
- **风险与回滚:** 第一方 0 处(没有第一方应用在启动时停用包)。收窄两处(三包存储行同名且其一停用 → 409;停用定制包的地址 →
404);进程内的分层读取(安全目录回显、打包权限集锁)保持原答案、不会抛错。回滚即 revert 本 PR。
- **先看:** `packages/metadata-protocol/src/protocol-meta-item-face.ts` 的
`servedRowHolderOf` 与
`servedAddressJudgment`;`protocol-meta-layered-reads.ts`
的两处调用(只改址、不拒绝);`protocol-exact-qualifier.ts` 新增的一行。
- **两分钟验证:** `pnpm --filter @objectstack/rest exec vitest run
src/meta-disabled-package-doors.test.ts`,预期 27 例全过(`main` 上其中 9 例红)。
- **需要你做的:** 无,席位落地。
## What changes
Head `5c37471ba5`, on `main` `2c98485db5` (merged once). The diff
against `main` is this card's 7 files, +619 / −11. #32808 (#32501) has
landed, so nothing of it rides here any more.
**The fix**, three hunks in `@objectstack/metadata-protocol`:
1. **Row holders judged over the served set**
(`protocol-meta-item-face.ts`: `servedRowHolderOf`,
`servedAddressJudgment`, `servedAddressOf`). A read naming no package,
of a name a disabled package holds, takes the registry's served holder
as before (#32183), else the stored rows' one served holder: the
registry's served holders together with the packages the active rows are
bound to, less every disabled package. One → read at its address; two or
more → the by-name read's own refusal (`ambiguous-in-environment`)
naming only those (seat ruling 6817756360 Q2); none → the read as
before. Asked only while some installed package is disabled, of a type
the registry reads by package, when no enabled package ships the name in
code and no package-less row or environment item is stored. The item's
active rows are read once (`readItemActiveRows`), and two kinds of row
hold nothing: a row the reads decline (`declinesStoredRow`, review S4)
and a row bound to a customization pair of any holder of the name
(`pairsOf`, review N2 widened by `5c37471b`): a pair row is bound over
every holder it is a pair of (#32408), never a holder of its own.
2. **Who refuses** (review S1). `servedAddressJudgment` answers the
refusal, never throws it. The plain read (`readMetaItemFace`) throws it
through `servedAddressOf`. `getMetaItemLayered` only re-addresses to a
served holder and otherwise leaves the read as it was, so its in-process
resolution readers (the security catalog echo, the
packaged-permission-set lock gate) keep the answer they had, as the
`packagelessLayeredReadRefusal` docblock requires; that method returns
the refusal to the `/layers` door's step 1c. The docblock gains one
paragraph saying so.
3. **A disabled package's own address** (`protocol-exact-qualifier.ts`
`disabledExactAddressHolder`, one line): an address naming a disabled
package is its withheld item whether it holds the name in the registry,
only as a stored row, or not at all (a customization pair: review S2).
Review N1: the plain read resolves the member selector once
(`resolveBundleMemberSelector`), as the layered read does.
**Moved answers.** FROM = `main` `2c98485db5` (18.4.0 plus later merges)
with this change's four source files put back; TO = this head. D
disabled, E (and F) enabled. Both transports, both registration orders,
the save orders as listed, unless a row names one transport.
| # | state | door | FROM `main` | TO this head | arm |
|:--|:--|:--|:--|:--|:--|
| C1a | rows of E and D only, no shipper, D's row saved first | bare
plain read, `/layers`, `/published` | 404 | 200, E's row | widening |
| C1b | the same, E's row saved first | bare `/layers` | 409 naming E
and D | 200, E's layers | widening |
| C1b′ | the same | bare plain read, `/published` | 200, E's row | the
same | none |
| C1c | D ships the name in code, E holds it only as a row | bare plain
read, `/layers`, `/published` | 404 | 200, E's row | widening |
| N2 | D ships it, D's pair holds D's declared override row, E holds a
row (`RestServer`) | bare plain read, `/layers`, `/published` | 404 |
200, E's row | widening (C1c's) |
| N2′ | the same without E's row (`RestServer`) | the same | 404 | 404 |
none |
| Q2 | rows of D, E, F, no shipper | bare plain read | 404 (D saved
first) † | 409 `RESOURCE_CONFLICT` naming E and F, `details.candidates`
| narrowing |
| Q2 | the same | bare `/published` | as the plain read † | 409 naming E
and F | narrowing |
| Q2′ | the same | bare `/layers` | 409 naming D, E and F † | 409 naming
E and F | same status, D unnamed |
| S2 | PAIR disabled, its base enabled and shipping the name
(`RestServer`) | `?package=PAIR`, with PAIR's declared override row |
200, the override (stamped with the base) | 404 | narrowing |
| S2′ | the same, no override row (`RestServer`) | `?package=PAIR` |
200, the base's item | 404 | narrowing |
| S4 | D ships a flow name, E and F hold undeclared (declined) rows
(`RestServer`) | bare plain read, `/layers`, `/published` | 404 | 404 |
none |
| C3 | E ships the name in code, D holds it only as a row | `?package=D`
| 404 | 404 | none (second guard; review S3) |
| C2 | the environment's package-less row beside E and D both shipping |
bare `/layers` code layer | E's | E's | none (CONTROL) |
† A pin stops at its first failing assertion, so on the FROM leg the Q2
pins stop at the plain read. The plain read's FROM is the card's
development-round reading (D saved first: 404; an enabled row saved
first: 200 with it); `/published` asks the plain read first and answers
its answer; `/layers` is the development-round reading.
Every case re-enabled: the answers go back (the C1 pins re-enable D and
see `/layers` refuse naming both).
## Merge
- `6abfd47e0a` merges `origin/main` `2c98485db5` into `cd1143c19` once.
#32808 landed squashed (`c50d10c0`), so two files conflicted on its own
hunks: the `getMetaItemLayered` host `Pick` list takes the union of both
sides (`main` added `isStoredEntryOfDeclinedName`, this card
`packagelessAddress` and `shippedArtifactsOf`), and
`packages/runtime/src/domains/meta-legacy-pair-served.test.ts` takes
`main`'s landed version (this branch never touched it past #32501's
head).
- `.changeset/32501-pair-address-reads-its-package.md`, which this
branch carried from #32501's head, was consumed by Version Packages
#29963 on `main`; the merge would have re-added it, so it is dropped.
## Tests
Pins (`packages/rest/src/meta-disabled-package-doors.test.ts`, the two
`[#32354]` describes;
`packages/runtime/src/domains/meta-disabled-holder-served-stack.test.ts`,
the `[#32354]` describe, real ObjectQL engine with an SQL store, reboot
included). New in this round: Q2's bare `/published` on both transports
(S3), the in-process layered read and `packagelessLayeredReadRefusal` in
the Q2 state (S1), the shipped flow name with declined rows (S4), the
disabled pair address with and without its override row (S2), and the
disabled base's pair override row alone and beside an enabled row (N2).
Legs, each through `scripts/ablation-replace.mjs --hold` with a
string-literal marker (MAIN: the four source files put back at
`origin/main`), each rebuilding `@objectstack/metadata-protocol` (both
suites read its `dist/`) and proving the marker reached `dist/` with
`scripts/ablation-dist-preflight.mjs` (MAIN: `servedRowHolderOf`
absent), each restored with `git checkout HEAD --` and `git diff HEAD`
empty; the final rebuild carries none of the four markers (`--absent`,
exit 0 each). Cells: cases failed / cases in the file.
| leg | REST (27) | runtime (16) | red cases |
|:--|:--|:--|:--|
| head | 0 | 0 | — |
| MAIN | 9 | 8 | C1 (4 + 4 with reboot), C1c (2, runtime), Q2 (2 + 2),
S2 (2), N2 beside E (1); C3, S4, N2 alone and C2 green, as declared |
| S1 off (the layered read throws the refusal again) | 2 | 0 | Q2 (2):
`promise rejected "PackageScopedNameRefusedError: … held by 2 packages
…" instead of resolving` |
| S4 off (declined rows counted) | 2 | 0 | S4 (2): `The flow
"shipped_flow" is held by 2 packages … package "app.healthy_demo";
package "app.third_demo"` |
| N2 off (a disabled base's pair override counted for the pair) | 1 | 0
| N2 beside E: `The dashboard "pair_dash" is held by 2 packages …
package "com.qa.other"; package "com.qa.pair-base.custom"` |
| H2 off (the new `disabledExactAddressHolder` line) | 2 | 0 | S2 (2):
200 with the base's item / the override |
| PAIR off (pair rows counted as holders of their own, on `5c37471ba5`)
| 1 | 0 | N2 beside E; and `packages/objectql`
`package-scoped-exact-qualifier.test.ts` 2/230 red (the two `[#32408]`
pins: the bare read served the pair row with every holder disabled) |
The previous round's legs on `cd1143c19` (ROWS, FACE, LREF, LADDR, F1,
F1+H2 off; the #32811 body) cover the C1/Q2 hunks, which this round does
not change.
## Verification
All on head `5c37471ba5` unless stated, under
`scripts/pm/os-verify-lock.sh` where it builds or tests.
- `packages/objectql` `package-scoped-exact-qualifier.test.ts` (the
`[#32408]` pins that went red in Test Core (4/8) on `032a1edad8`):
230/230.
- `pnpm --filter @objectstack/metadata-protocol test`: Test Files 337
passed, 7 skipped (344); Tests 22799 passed, 36 skipped (22835); lock
VERDICT command-exit 0.
- `pnpm --filter @objectstack/metadata-protocol typecheck`, and
`typecheck` of `rest` and `runtime`: exit 0 each.
- The pin files: `rest` `meta-disabled-package-doors.test.ts` 27/27;
`runtime` `meta-disabled-holder-served-stack.test.ts` +
`meta-legacy-pair-served.test.ts` 35/35.
- `pnpm lint` (eslint over the whole tree, `--no-inline-config`): exit
0.
- `node scripts/pm/dispatch-gates.mjs --commands`: 72 families derived
for this diff, all run on `5c37471ba5` (and before on `032a1edad8`,
after a full `pnpm -r build`, exit 0), 72 exit 0; `--ran` reconciliation
exit 0, 0 NOT-MEASURED. Among them `check-adr-0087-registration --base
origin/main`, `check-changeset-no-major`, `check-empty-changeset`,
`check:type-check-debt` and `check:dual-build-cjs-loads` (both under the
lock).
- Dogfood battery (owed: the title carries `!`, `Clause-②:` carries
`(narrowing)`), `pnpm --filter @objectstack/dogfood test` on
`5c37471ba5` after the full build: Test Files 460 passed, 3 skipped
(463); Tests 3874 passed, 42 skipped (3916); lock VERDICT command-exit
0. (On `032a1edad8`: the same counts.)
## Acceptance notes
- **`Part of`, not `Fixes`.** Epic note 6820147040 carried list cases
here (a disabled sole holder's pair member row and a dependent's added
locale listed by the unscoped list; the list scoped to a disabled base
lists its pair's member row), and #32670 says this card owns them. No
list door is touched here, so merging should not close the card; the
seat routes those cases (review ③).
- **Review dispositions (6856157850):** S1 option one (keep the ⛔: the
layered read never refuses in process). S2 declared and pinned
(`RestServer`). S3 done: C3 restated as no move, out of the BREAKING
headline; bare `/published` added to Q2 and pinned on both transports.
S4: declined rows hold nothing, pinned. N1 done. N2 measured: the pair
override of a disabled base was already withheld by its stamp alone, but
counted for the enabled pair it turned a C1c read beside another enabled
row into a 409 naming the pair; it now holds nothing, pinned. N3 (the
bare read reads the active rows twice while a package is disabled) left
as is: one extra read only in that state.
- **Delta review 6859717745 (review#1, head `5c37471ba5`): PASS**, no
must-fix or should-fix; nits n1 (the pair describe's docblock still says
nothing moves on `main`; the pins and the changeset are right) and n2
(`pairRow` asks the registry's holders, not also `rows.candidates`;
derived, not shown reachable) left for a later push, as the record
allows.
- **Fix round `5c37471ba5`:** `Test Core (4/8)` was red on `032a1edad8`
on two `[#32408]` pins in `packages/objectql`; the pair-row exclusion
now covers every pair of a holder (`pairsOf`). CI on `5c37471ba5`: 35
success, 16 skipped, none failed.
- **Case 2:** premise unreachable (`overlaySlotBinding` answers the
environment's item only when no package ships the name); one CONTROL pin
per registration order (seat ruling 6817756360 Q3).
- **Not here:** the save door (#32605); two enabled packages' stored
rows with no package disabled (#32607, which merges this after it
lands).
- **Branch:** `claude/project-thread-saq29l`, this card thread's
harness-pinned branch, resumed from
`claude/project-thread-pv4nip@cd1143c` (#32811).
## Human Minimum
- [x] 1. Schemas start as Zod; `packages/spec` holds no runtime logic.
(`packages/spec` untouched.)
- [x] 2. Every name I added uses the casing for its kind.
- [x] 3. No formatter ran; `pnpm lint` passes.
- [x] 4. One issue, one branch off an up-to-date `main`, one pull
request. (Supersedes #32811, see above.)
- [x] 5. A change that publishes carries a changeset, and both
declaration lines are filled in here and in the changeset.
- [x] 6. `packages/spec` touched: n/a.
- [x] 7. No hand edits to `content/docs/references/`,
`packages/*/CHANGELOG.md` or `content/docs/releases/`.
- [x] 8. Title, body and comments are in English.
- [x] The *Before Submitting* list in CONTRIBUTING.md is done.
---
_Generated by [Claude
Code](https://claude.ai/code/session_016WV4d1FGsHCVfNAwXgN9sE)_
<!-- signed: epic:#31527#2 · os-elon-musk ·
session_016WV4czFhtRVZNBeHdQA6PW -->
---------
Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: objectstack-fleet[bot] <332303061+objectstack-fleet[bot]@users.noreply.github.com>1 parent 6482c08 commit 02f55c5
7 files changed
Lines changed: 621 additions & 11 deletions
File tree
- .changeset
- packages
- metadata-protocol/src
- rest/src
- runtime/src/domains
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
322 | 322 | | |
323 | 323 | | |
324 | 324 | | |
325 | | - | |
326 | | - | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
327 | 328 | | |
328 | 329 | | |
329 | 330 | | |
| |||
339 | 340 | | |
340 | 341 | | |
341 | 342 | | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
342 | 349 | | |
343 | | - | |
| 350 | + | |
344 | 351 | | |
345 | 352 | | |
346 | 353 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
37 | 42 | | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
38 | 47 | | |
39 | 48 | | |
40 | 49 | | |
| |||
53 | 62 | | |
54 | 63 | | |
55 | 64 | | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
56 | 70 | | |
57 | 71 | | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
58 | 76 | | |
59 | 77 | | |
60 | 78 | | |
| |||
104 | 122 | | |
105 | 123 | | |
106 | 124 | | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
107 | 255 | | |
108 | 256 | | |
109 | 257 | | |
| |||
127 | 275 | | |
128 | 276 | | |
129 | 277 | | |
130 | | - | |
| 278 | + | |
131 | 279 | | |
132 | 280 | | |
133 | 281 | | |
| |||
139 | 287 | | |
140 | 288 | | |
141 | 289 | | |
142 | | - | |
143 | | - | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
144 | 298 | | |
145 | 299 | | |
146 | 300 | | |
| |||
0 commit comments