Repository navigation
Commit 9673030
fix(metadata-protocol)!: the read naming no package withholds a customization pair's row of a name every holder of which is disabled (ADR-0150 D3) (#33383)
<!-- claude-projects-attribution: {"github_login":"os-elon-musk"} -->
_Requested by **Elon** · [project
thread](https://claude.ai/code/project/chan_01WedDzV26nniwxv7jC88B9D?thread=cmsg_01WedDzV26nniwxv7jC88B9D75mRNRrsy6GfiJD9q7La4j)_
Fixes #32814
Clause-②: no (narrowing)
Metadata-protocol: none
Skills-docs: none — no skill and no doc teaches what the read naming no
package answers at a member only a customization pair stores
(`skills/**` and `content/docs/**` grepped for disabled packages: the
hits are action and component `disabled` predicates, package lifecycle
references and a release page);
`content/docs/deployment/marketplace-handbook.mdx` already says a
disabled module is hidden.
> **BREAKING** (ADR-0087 `registered`, semantic entry
`disabled-holder-pair-row-bare-read-withheld`): the read naming no
package, at a member only a customization pair (an App's
`PACKAGE.custom`) stores, for a name every installed package holding it
has disabled, answers the holder's withheld item (404
`RESOURCE_NOT_FOUND`) where it served the pair's row. First-party count:
0. Remedy: re-enable a holder.
## 维护者速读
- 改了什么:某个名字(如 email_template `welcome`)的所有持有包都被停用、而某个语言成员(如 `fr-FR`)只存在于
App 定制配对包(`APP.custom`)的存储行里时,不带 `?package=` 的裸读(`GET
/meta/TYPE/NAME?member=`、`/layers`、执行读)现在答
404(停用持有者的“已隐藏”条目),以前会把那行配对定制返回出来。
- 为什么改:停用包的内容不应再被服务(专题红线 1,ADR-0150 D3);带 `?package=APP.custom` 的精确读早已答
404,裸读却还漏出这一行。裸读以前只在“什么都没读到”时才判断持有者是否全部停用,读到配对行就直接返回了。
- 风险与回滚:收紧(narrowing,BREAKING,metadata-protocol patch,Metadata-protocol:
none——作者能写的东西没有变),第一方 0 处。重新启用持有者、同一配对另有启用的持有者、持有者自己的行、无包行、精确读,答案都不变。回滚
= revert 本 PR。
- 先看:`packages/metadata-protocol/src/protocol-meta-item-face.ts` 的
`isHoldersPairRow` 与 `readMetaItemFace` 里 `withheldHolder` 的三元判断(风险
hunk:裸读分支新增的判定);`packages/objectql/src/package-scoped-exact-qualifier.test.ts`
末尾的 `[#32814]` 组;`packages/rest/src/meta-disabled-package-doors.test.ts`
末尾的 `[#32814]` 组。
- 两分钟验证:`pnpm --filter @objectstack/objectql exec vitest run
--maxWorkers=2 src/package-scoped-exact-qualifier.test.ts -t 32814`,预期
12 个全部通过:两种保存顺序 × 是否水合 × 模块/App 自身作持有者,裸读都答 404;重新启用后与两持有者 CONTROL
仍返回配对行。
- 需要你做的:无,席位落地。
## What changes
`readMetaItemFace` (`@objectstack/metadata-protocol`, the body behind
`getMetaItem` and `getMetaItemForExecution`) judges whether every
package holding the name is disabled (`disabledOnlyHolderOf`, #32183)
only when the read reached nothing, or, on an exact read, when it
reached a row not stored under the named package (epic ruling R4-B). On
the read naming no package, a row it did reach was returned unjudged.
For a bundled type such as `email_template`, the member a customization
pair adds (an App pair's `fr-FR` row beside a module's shipped `en-US`)
is reached that way, so with the module disabled the bare read served
the pair's row, while `?package=APP.custom` at the same member already
answered the withheld item (ruling R4-C, `disabledExactAddressHolder`).
Now, on the read naming no package, a row stamped with a customization
pair (`pairsOf`) of a package holding the name (`isHoldersPairRow`) is
judged the same way: when every holder is disabled, the answer is the
holder's withheld item, the answer the same read gives with no row
stored. A pair row is bound over the holders it is a pair of and is
never a holder of its own (#32354 contract review N2, #32408), so it is
withheld with them.
| state (member `fr-FR` stored only under `APP.custom`) | door, naming
no package | FROM `main` e540baf | TO this head | arm |
|:--|:--|:--|:--|:--|
| the only holder (a module of the App, or the App itself) disabled; row
saved before or after the disable; hydrated or not | plain read
`?member=fr-FR` | 200, the pair's row | 404 `RESOURCE_NOT_FOUND`
(protocol: no item, `packageId` = the holder) | narrowing |
| the same | `/layers?member=fr-FR` (`RestServer`) | 200, the pair's row
as the effective layer | 404 `RESOURCE_NOT_FOUND` | narrowing |
| the same | execution face (`getMetaItemForExecution`) | the pair's row
| no item | narrowing |
| the holder enabled again | all of the above | the pair's row | the
pair's row | none (CONTROL) |
| two modules of the App hold the name, one disabled, either
registration order | plain read | the pair's row | the pair's row | none
(CONTROL) |
| both modules disabled | plain read | 404 | 404 | none |
| no row stored, holder disabled | plain read | 404 | 404 | none
(CONTROL) |
| a package-less row, a row of a package outside the App, the holder's
own row | plain read | as before | as before | none (not judged here,
measured) |
The other doors of the same name were measured but are outside this
card: the list reads (`getMetaItems`, `getMetaItemsForExecution`) still
list the pair's row while every holder is disabled
(`protocol-meta-list-reads.ts`, an E1 hot file this order may not edit;
see Acceptance notes).
## Tests
- `packages/objectql/src/package-scoped-exact-qualifier.test.ts`, new
top-level `describe` `[#32814]` at the end of the file (no overlap with
the `[#32561]` block #33251 edits): 8 negative pins (module of the App /
the App itself × row before / after the disable × hydrated or not)
asserting no item, `packageId` = the holder, no byte of the pair's row,
and no item on the execution face, each followed by a re-enable CONTROL;
2 pins that the answer with the pair's row stored equals the answer with
none (the envelope's `version` left out, see Acceptance notes); 2
CONTROLs (two modules of the App, both registration orders: one enabled
serves the pair's row, both disabled withhold it).
- `packages/rest/src/meta-disabled-package-doors.test.ts`, new top-level
`describe` `[#32814]` at the end: the plain read and `/layers` at the
member answer 404 `RESOURCE_NOT_FOUND` in both save orders, then the
pair's row once re-enabled; CONTROL: no row stored answers the same 404.
## Acceptance notes
- **Metadata-protocol: none, by measurement.** The card expected
`narrowed`. Nothing an author can write is refused, re-shaped or changes
meaning: the pair row is still accepted on save and served again on
re-enable. Only what a read serves while every holder is disabled moves,
the same classification #33130 (the served-set sibling) declared. The
narrowing is carried by `Clause-②: no (narrowing)`, the BREAKING banner
and the registered semantic entry.
- **Not moved on purpose: a package-less row.** With the only holder
disabled, a package-less `fr-FR` row is still served by the bare read
(measured on `main` and on this head). `servedRowHolderOf` documents
that a name with a package-less row is "judged as before" (a
customization of no one holder); whether it is the disabled holder's
customization is not ruled, so it is reported, not guessed.
- **List reads.** `getMetaItems` / `getMetaItemsForExecution` with no
package list the pair's row while every holder is disabled (measured on
`main` e540baf, both save orders). Reported for a separate card;
`protocol-meta-list-reads.ts` is a hot file for this order.
- **Envelope `version`.** The protocol's withheld envelope keeps the
`version` of what the read reached on every withheld arm (a disabled
holder's own stored row keeps its row's version, measured), so the
no-row equality pin compares everything else. No door serves it: both
REST doors answer 404.
- **`/published`** takes no member, and the bare read at the canonical
member was already withheld on `main`; not moved.
## Verification
Premise, on `origin/main` e540baf (a probe over the same fixtures, not
committed): with the only holder disabled, the bare read at `fr-FR`
served the pair's row in all four save/hydration orders, for a module of
the App and for the App itself; with no row stored it answered the
holder's withheld item. Every other probed state (holder enabled, two
holders, a package outside the App, a package-less row, the holder's own
row) answered the same on this head as on `main`.
<details><summary>Pins and ablation (one mutation: the bare-read arm of
the new judgment replaced with a constant false)</summary>
- Fix head 51b589e, `pnpm --filter @objectstack/objectql exec vitest
run --maxWorkers=2 src/package-scoped-exact-qualifier.test.ts -t 32814`:
`Tests 12 passed`.
- Ablated (`scripts/ablation-replace.mjs`, then `pnpm --filter
@objectstack/metadata-protocol build`, `ablation-dist-preflight.mjs`
marker present in `dist/index.js` and `dist/index.cjs`): `Tests 10
failed | 2 passed` — the 8 withheld pins and the 2 no-row equality pins
red, the 2 two-module CONTROLs green.
- Restored (blob == HEAD, `git diff HEAD` empty, rebuilt, preflight
`--absent` and whole-tree clean): `Tests 12 passed`.
- REST, `pnpm --filter @objectstack/rest exec vitest run --maxWorkers=2
src/meta-disabled-package-doors.test.ts`: `Tests 44 passed (44)`.
Ablated: `-t 32814` `Tests 2 failed | 1 passed` (both save orders red,
the no-row CONTROL green). Restored: `Tests 3 passed`.
</details>
<details><summary>Local gates and type checks (head 28c3513, after
merging origin/main 199e362)</summary>
- `pnpm --filter @objectstack/metadata-protocol typecheck`,
`@objectstack/objectql typecheck`, `@objectstack/rest typecheck`:
`VERDICT command-exit 0` each.
- `node scripts/pm/dispatch-gates.mjs --commands` (86 families) run
locally, reconciled with `--ran`: `86 derived, 84 run, 2 NOT-MEASURED, 0
UNRUN`. The two exit 3 (prerequisite: a full workspace build):
`check:dual-build-cjs-loads`, `check:type-check-debt`. Every other
family exit 0.
- NOT MEASURED locally, reason: the shared verify lock was held for 88+
minutes by another session's full affected-set test run while this was
written: `@objectstack/spec` typecheck (queue-timeout), the full
`@objectstack/metadata-protocol`, `@objectstack/objectql`,
`@objectstack/rest` suites on the merged head, `pnpm lint`. CI runs them
on this PR.
</details>
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_016WV4cy1y7UNVbT2QAdmgdn
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent 6859b2f commit 9673030
6 files changed
Lines changed: 248 additions & 1 deletion
File tree
- .changeset
- packages
- metadata-protocol/src
- objectql/src
- rest/src
- 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 | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
97 | 121 | | |
98 | 122 | | |
99 | 123 | | |
| |||
419 | 443 | | |
420 | 444 | | |
421 | 445 | | |
| 446 | + | |
| 447 | + | |
| 448 | + | |
| 449 | + | |
| 450 | + | |
422 | 451 | | |
423 | 452 | | |
424 | 453 | | |
425 | | - | |
| 454 | + | |
| 455 | + | |
| 456 | + | |
| 457 | + | |
426 | 458 | | |
427 | 459 | | |
428 | 460 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2528 | 2528 | | |
2529 | 2529 | | |
2530 | 2530 | | |
| 2531 | + | |
| 2532 | + | |
| 2533 | + | |
| 2534 | + | |
| 2535 | + | |
| 2536 | + | |
| 2537 | + | |
| 2538 | + | |
| 2539 | + | |
| 2540 | + | |
| 2541 | + | |
| 2542 | + | |
| 2543 | + | |
| 2544 | + | |
| 2545 | + | |
| 2546 | + | |
| 2547 | + | |
| 2548 | + | |
| 2549 | + | |
| 2550 | + | |
| 2551 | + | |
| 2552 | + | |
| 2553 | + | |
| 2554 | + | |
| 2555 | + | |
| 2556 | + | |
| 2557 | + | |
| 2558 | + | |
| 2559 | + | |
| 2560 | + | |
| 2561 | + | |
| 2562 | + | |
| 2563 | + | |
| 2564 | + | |
| 2565 | + | |
| 2566 | + | |
| 2567 | + | |
| 2568 | + | |
| 2569 | + | |
| 2570 | + | |
| 2571 | + | |
| 2572 | + | |
| 2573 | + | |
| 2574 | + | |
| 2575 | + | |
| 2576 | + | |
| 2577 | + | |
| 2578 | + | |
| 2579 | + | |
| 2580 | + | |
| 2581 | + | |
| 2582 | + | |
| 2583 | + | |
| 2584 | + | |
| 2585 | + | |
| 2586 | + | |
| 2587 | + | |
| 2588 | + | |
| 2589 | + | |
| 2590 | + | |
| 2591 | + | |
| 2592 | + | |
| 2593 | + | |
| 2594 | + | |
| 2595 | + | |
| 2596 | + | |
| 2597 | + | |
| 2598 | + | |
| 2599 | + | |
| 2600 | + | |
| 2601 | + | |
| 2602 | + | |
| 2603 | + | |
| 2604 | + | |
| 2605 | + | |
| 2606 | + | |
| 2607 | + | |
| 2608 | + | |
| 2609 | + | |
| 2610 | + | |
| 2611 | + | |
| 2612 | + | |
| 2613 | + | |
| 2614 | + | |
| 2615 | + | |
| 2616 | + | |
| 2617 | + | |
| 2618 | + | |
| 2619 | + | |
| 2620 | + | |
| 2621 | + | |
| 2622 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
882 | 882 | | |
883 | 883 | | |
884 | 884 | | |
| 885 | + | |
| 886 | + | |
| 887 | + | |
| 888 | + | |
| 889 | + | |
| 890 | + | |
| 891 | + | |
| 892 | + | |
| 893 | + | |
| 894 | + | |
| 895 | + | |
| 896 | + | |
| 897 | + | |
| 898 | + | |
| 899 | + | |
| 900 | + | |
| 901 | + | |
| 902 | + | |
| 903 | + | |
| 904 | + | |
| 905 | + | |
| 906 | + | |
| 907 | + | |
| 908 | + | |
| 909 | + | |
| 910 | + | |
| 911 | + | |
| 912 | + | |
| 913 | + | |
| 914 | + | |
| 915 | + | |
| 916 | + | |
| 917 | + | |
| 918 | + | |
| 919 | + | |
| 920 | + | |
| 921 | + | |
| 922 | + | |
| 923 | + | |
| 924 | + | |
| 925 | + | |
| 926 | + | |
| 927 | + | |
| 928 | + | |
| 929 | + | |
| 930 | + | |
| 931 | + | |
| 932 | + | |
| 933 | + | |
| 934 | + | |
| 935 | + | |
| 936 | + | |
| 937 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
0 commit comments