Repository navigation
Commit 3269cab
fix(metadata-protocol)!: the metadata lists serve nothing a disabled package's customization pair or a dependent's added bundle member carries for it (ADR-0150 D3) (#33405)
<!-- claude-projects-attribution: {"github_login":"os-elon-musk"} -->
_Requested by **Elon** · [project
thread](https://claude.ai/code/project/chan_01WedDzV26nniwxv7jC88B9D?thread=cmsg_01WedDzV26nniwxv7jC88B9D75mRNRrsy6GfiJD9q7La4j)_
Fixes #32354
Clause-②: no (narrowing)
Metadata-protocol: none
Skills-docs: none — `skills/**` and `content/docs/**` teach that a
disabled module is hidden
(`content/docs/deployment/marketplace-handbook.mdx`) and never teach a
list serving a disabled package's customization or a dependent's
addition to its bundle, so no taught sentence moves.
> **BREAKING** (ADR-0087 `not-required (no-migration-prescription)`):
while a package is disabled, the metadata lists no longer serve the rows
its customization pair stores for its names, nor a dependent's added
bundle member of them. Area-lease pilot #33059, area E1. The list-door
remainder of this card: PR #33130 (merged) did the bare, exact and
layered reads.
## 维护者速读
-
改了什么:某个包停用后,元数据列表不再列出它的定制包(`包名.custom`)为它的名字存的行,也不再列出依赖它的包给它的邮件模板追加的语言版本。涉及:不指名包的列表及其执行列表、指名停用包的列表、指名其定制包的列表。不指名包的发信读的就是这个执行列表,所以也不再发出这两类内容。
- 为什么改:专题 ADR-0150 D3「停用的包不持有任何名字」。按名读取早已对这些地址答
404,列表却还按注册和保存顺序列出它们;停用一个包应在每个读门上都消失(epic note 6820147040)。
-
风险与回滚:只在有包被停用时生效,没有包停用时所有列表与之前完全相同;依赖包自己的地址(`?package=DEP`)仍列出它追加的语言。过渡期内从依赖包本身发信(读不指名列表)在基础包停用时找不到该语言,等
#32670 让发信按在用持有者判定后恢复。回滚即 revert 本 PR,不改任何存储数据。
- 先看:`packages/metadata-protocol/src/protocol-meta-list-reads.ts` 的
`disabledHolderListing`(新增谓词,`'unscoped'` 分支里依赖包追加的判定)以及它在停用过滤处的调用。
- 两分钟验证:`pnpm --filter @objectstack/objectql exec vitest run
src/package-scoped-exact-qualifier.test.ts -t 32354`,预期 14 例全过。
- 需要你做的:无,席位落地
## What changes
One function, in `@objectstack/metadata-protocol`'s list read
(`readFlattenedMetaItems`), next to the existing disabled-package
filter, on the effective and execution faces only (the per-package
layer, which the package export reads, keeps a disabled package's items
as before):
- `disabledHolderListing(host, type)` answers whether an item the list
serves at a package is a disabled holder's. It is `undefined` (nothing
moves) for a type the registry does not read by package and while no
installed package is disabled.
- **A list scoped to a package** serves no name whose exact read at that
package is a disabled package's withheld item. The predicate is the
exact read's own, `disabledExactAddressHolder`
(`protocol-exact-qualifier.ts`, unchanged): the package is disabled, or
it is a customization pair whose every base holding the name is.
- **The list naming no package** leaves out an item whose own package's
address is withheld that way (a disabled holder's pair row), and, for a
bundle (`ITEM_KEY_DISCRIMINATORS`), an addition to a disabled holder's
bundle: the item's package holds the name only as an addition (the
registry's holders read as any other caller leave it out, read as itself
keep it) and every holder in its declared dependency closure is
disabled. Every holder is read with `includeDisabledPackages`, so a
disable never promotes an addition to a holder.
## Moved answers
Measured over a real `SchemaRegistry` and
`ObjectStackProtocolImplementation`, on `2b2e5b41` (FROM: #33251's head,
`main` plus #32606) and on this branch: A ships `welcome` in `en-US`;
A's pair `A.custom` stores a `fr-FR` row of it, or DEP (depends on A)
ships a `fr-FR` addition; with one holder, or beside B, an enabled
second holder of `welcome`. Both registration orders, the pair row
stored before and after the registrations. A disabled:
| read | FROM | TO |
|:--|:--|:--|
| `getMetaItems` / `getMetaItemsForExecution`, no package (`GET
/meta/email_template`) | the pair's `fr-FR` row, or DEP's `fr-FR`
(beside B's `en-US` with two holders) | neither (B's `en-US` only with
two holders, else nothing) |
| the same, `?package=A` | the pair's `fr-FR` row | `[]` |
| `?package=A.custom` | the pair's `fr-FR` row | not listed |
| a send naming no package, `fr-FR` (`createRegistryEmailTemplateLoader`
over the protocol) | the pair's row, or DEP's member | no template |
| a send from DEP, `fr-FR` | DEP's member | no template (declared; see
below) |
**Not moved.** With nothing disabled every list answers as on FROM
(CONTROL in every pin). `?package=DEP` keeps DEP's `fr-FR`, as
`?package=DEP&member=fr-FR` serves it. `?package=B` and B's items, the
pair's own item of a name A ships nothing of (CONTROL, both orders), the
per-package layer, and every by-name read answer as before. Re-enabling
A restores every list (asserted in every pin).
**Declared interim move.** A send from DEP itself resolves to the list
naming no package for this name (`bundleAddressOf` finds one holder), so
it no longer finds DEP's `fr-FR` while A is disabled. #32670 (the send
judges the served holders, nested under this card and landing after it)
reads such a send at DEP's own address, which keeps the member.
## Red lines
1. **Resolution never loosened.** Only items leave lists, and only items
the by-name read of the same address already withholds. Nothing refused
or absent is now served.
2. **Ambiguity reported, never guessed.** The answer no longer depends
on registration or save order: every pin runs both orders and both save
orders, and reads twice after the first read hydrated the stored row.
3. **Independently releasable.** No stored row, key or export changes;
it moves nothing while no package is disabled, and re-enabling restores
every answer.
## Tests
- `packages/objectql/src/package-scoped-exact-qualifier.test.ts`,
top-level `[#32354] the list doors serve nothing a disabled holder's
pair or dependent carries for it` (real registry and protocol,
`environmentId` unset so the list hydrates rows): 12 cases (four states
× both registration orders × both save orders for the pair row)
asserting seven lists with nothing disabled, A disabled (read twice),
and A re-enabled; plus 2 CONTROLs for the pair's own item.
- `packages/rest/src/meta-disabled-package-doors.test.ts`, `[#32354]
RestServer: the list doors and the send naming no package beside a
disabled holder` (an environment-scoped protocol): `GET
/meta/email_template` unscoped and with `package=` A, A.custom, DEP
through the `RestServer` route, and the email loader's send with no
package and from DEP; 6 cases.
## Acceptance notes
- The bare by-name read is not this PR's: measured through the
`RestServer` route on this branch, with A the sole holder and disabled,
`GET /meta/email_template/welcome?member=fr-FR` (no package) answers 200
with the pair's `fr-FR` row, and 200 with DEP's `fr-FR` in the addition
state. With two holders (B enabled) it answers 404 in both states. That
path is `protocol-meta-item-face.ts`, held by #32814's work, so it is
reported for a card, not changed here.
- Stacked on #33251 while it was open; it has merged (`51ceb433`), and
this branch merged `origin/main` `87330e8959` once (no rebase). The diff
against `main` is this card's four files: the list read, two test files
and one changeset.
- The send door's own rule (a send returns only members of the resolved
holder, its pair, its dependents, or no package) stays #32670's.
## Verification
Head `333edb0868` (this branch with `origin/main` `87330e8959` merged).
<details><summary>Pins and ablations</summary>
- objectql `src/package-scoped-exact-qualifier.test.ts -t 32354`: 14
passed. REST `src/meta-disabled-package-doors.test.ts`: 47 passed (the 6
new cases among them).
- Ablations (source changed with `scripts/ablation-replace.mjs`,
`@objectstack/metadata-protocol` rebuilt under the verify lock,
`ablation-dist-preflight` saw the marker in `dist/`, then restored: `git
diff HEAD` empty, rebuilt, marker `--absent` exit 0):
- A1, the exact-address arm off (`disabledExactAddressHolder` never
withholds): objectql 8 failed (every pair-row case: one and two holders,
both orders, both save orders), 6 passed (the four addition cases and
both CONTROLs); REST 4 failed (every pair-row case), 43 passed.
- A2, the addition arm off (`bases.every(disabled)` never true):
objectql 4 failed (every addition case), 10 passed; REST 2 failed (both
addition cases), 45 passed.
- A first A2 attempt never reached the lock (queue-timeout), so the
preflight refused (marker absent from `dist/`) and its green run was
discarded; the rerun above is the leg.
</details>
<details><summary>Package tests, typecheck, lint</summary>
- `turbo run test --concurrency=2 --continue` over the affected set
against `main` (82 packages, `@objectstack/dogfood` left to its own
battery), under the verify lock: stopped on the area lead's order once
it held the lock too long, after 68 packages had finished, with 0 failed
test files. Among them `@objectstack/metadata-protocol` 339 files passed
(9 skipped), `@objectstack/objectql` 595, `@objectstack/rest` 410,
`@objectstack/runtime` 599, `@objectstack/cli` 637 (2 skipped),
`@objectstack/plugin-email` 53. The rest of the set (UI packages) is
CI's Test Core.
- `pnpm --filter` metadata-protocol, objectql, rest `run typecheck`:
exit 0 (VERDICT command-exit 0).
- `pnpm lint`: exit 0.
- NOT MEASURED locally: the full dogfood battery (owed by the
`(narrowing)` arm; not run, because the shared lock was the bottleneck
and the area lead asked for the narrowed pre-push set; the queue's
`Dogfood Regression Gate` runs it), and the derived gate families (CI's
`Lint & Repo Gates`).
</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 b5f2f51 commit 3269cab
4 files changed
Lines changed: 291 additions & 2 deletions
File tree
- .changeset
- packages
- metadata-protocol/src
- objectql/src
- rest/src
| 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 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
| 21 | + | |
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
52 | | - | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
53 | 59 | | |
54 | 60 | | |
55 | 61 | | |
| |||
92 | 98 | | |
93 | 99 | | |
94 | 100 | | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 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 | + | |
95 | 163 | | |
96 | 164 | | |
97 | 165 | | |
| |||
870 | 938 | | |
871 | 939 | | |
872 | 940 | | |
| 941 | + | |
| 942 | + | |
| 943 | + | |
| 944 | + | |
| 945 | + | |
| 946 | + | |
| 947 | + | |
| 948 | + | |
| 949 | + | |
| 950 | + | |
| 951 | + | |
| 952 | + | |
| 953 | + | |
| 954 | + | |
| 955 | + | |
873 | 956 | | |
874 | 957 | | |
875 | 958 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2529 | 2529 | | |
2530 | 2530 | | |
2531 | 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 | + | |
| 2623 | + | |
2532 | 2624 | | |
2533 | 2625 | | |
2534 | 2626 | | |
| |||
0 commit comments