Repository navigation
Commit 89d7bef
fix(metadata-protocol)!: the exact read no longer serves an undeclared App-pair row the registry binds to no package; it adopts SchemaRegistry#overlayRowBinding over the served holders (ADR-0150 D4) (#33148)
<!-- claude-projects-attribution: {"github_login":"os-elon-musk"} -->
_Requested by **Elon** · [project
thread](https://claude.ai/code/project/chan_01WedDzV26nniwxv7jC88B9D?thread=cmsg_01WedDzV26nniwxv7jC88B9DXz8JJapH4ybVrJL1L6Fv5X)_
Fixes #32561
Clause-②: yes (narrowing)
Metadata-protocol: narrowed
Skills-docs: none — `skills/objectstack-platform/SKILL.md` teaches the
declared form (`overrides: { package }`) and an undeclared pair row only
at a locale the base does not ship, the path the save door accepts;
nothing in `skills/**` teaches the exact read of an undeclared pair row
whose locale a later bundle addition also ships, or of a row beside
another App's shared pair, the two reads this narrows (grep of
`skills/**` for `overrides.package`, `.custom`, `?package=` and
`email_template` at head `dd283faf40`).
> **BREAKING** (ADR-0087 `registered`, semantic entry
`pair-row-exact-read-no-owner`): two exact reads of an undeclared row of
an App's customization pair stop serving a row the registry binds to no
package. First-party packages in either position: 0. Remedy the save
door already accepts: declare the base with `overrides.package`.
## 维护者速读
- 改了什么:App 的定制配对(`<app>.custom`)里一条**未声明基准包**的行(没有
`overrides.package`),如果注册表判定它“不属于任何包”(因为同 App 的另一个包作为附加包也出货了同一个语言成员,或另一个
App 的共享配对也存了同名未声明行),按包精确读(`?package=X`)以前仍把它当 X
的定制返回;现在精确读采用注册表的判定,`?package=X` 只回答 X 自己出货的成员(没有就
404),`?package=<app>.custom` 仍能读到这条行。
- 为什么改:两个读取口对同一条行给出不同归属,精确读等于替作者猜了一个包(违反史诗红线 2:歧义要报告,不能猜)。新增一个只读公开方法
`SchemaRegistry#overlayRowBinding`,让精确读直接问注册表,不再自己另数一遍。
- 风险与回滚:收紧(narrowing,BREAKING,minor)。只影响“未声明 + 有歧义”的配对行,第一方包为 0;声明了
`overrides.package` 的行、单一归属的行、两个持有包可归属时的 409
都不变;一个持有包被禁用时,启用那个包的地址仍保有该行(R4-A 裁决)。回滚 = revert 本 PR。
- 先看:`packages/metadata-protocol/src/protocol-exact-qualifier.ts` 的
`pairRowOnAddress` 新增一行判定;`packages/objectql/src/registry.ts` 新增的
`overlayRowBinding`(只数被服务的持有包);`packages/objectql/src/package-scoped-exact-qualifier.test.ts`
的 `[#32561]` 组。
- 两分钟验证:`pnpm --filter @objectstack/objectql exec vitest run
src/package-scoped-exact-qualifier.test.ts`,预期全部通过;其中 `[#32561]` 组的
NARROWING(两种安装顺序 + 跨 App 配对)与 CONTROL(声明行、禁用一个持有包两种顺序)全绿。
- 需要你做的:无,席位落地。
## What changes
The exact read's owner check (`pairRowOnAddress`,
`@objectstack/metadata-protocol`) counted holders after the registry had
bound the row: a bundle addition was no holder there, and another App's
shared pair was never read. The registry
(`SchemaRegistry#pairRowBinding`, since #32408 / PR #32815) counts an
addition that ships the row's member as a second owner, and binds a row
whose count would read another shared pair's undeclared row to no
package. The two readers had no common answer (the card's divergence).
Now the exact read adopts the registry's binding instead of counting
again:
- `SchemaRegistry#overlayRowBinding(type, name, item)` (new, public,
read-only, `packages/objectql/src/registry.ts`): the binding
`overlaySlotBinding` answers, counted over the **served** holders (a
disabled package holds no name, ADR-0150 D3), in the order
`packageScopedHoldersOf` counts the exact read's owner: the pair's
owners are the served holders it customizes, and the bundle-addition
rule is settled over **every** holder, the disabled ones left out
afterwards, so a disable never promotes a dependent's addition to an
owner (contract review M1). The holders are the ones
`packageScopedHoldersOf` counts: every composite slot, then the package
each bare-slot entry binds to, so a package holding the name only
through its own stored row is an owner here too (contract review n1).
The registry's own readers keep counting every holder, so a disable
never moves their binding.
- `pairRowOnAddress` takes the binding lazily (`registryBinding`) and
treats an undeclared pair row as not this address's member when its one
owner is not the one the registry binds it to. Both callers
(`exactQualifierItem`, `pairMemberWithheldAt`) pass it; a registry
without `overlayRowBinding` keeps the exact read's own count.
| Read (App A; X holds the email template; Z, on X, ships only `fr-FR`
as an addition; `A.custom` stores an undeclared `fr-FR` row) | Before |
Now |
|:--|:--|:--|
| `?package=X&member=fr-FR` (Z installed before the row, or after it) |
the row | X's own `fr-FR`: none, `404` |
| X's list and execution list | carry the row | leave it out |
| `?package=Z&member=fr-FR` | Z's own `fr-FR` | unchanged |
| `?package=A.custom&member=fr-FR` | the row | unchanged |
| `?package=Y` / `?package=P` when App A's pair and App B's pair each
store an undeclared row of the name (registry binds neither) | the
pair's row | the package's own item of that member (none) |
Unchanged (CONTROL pins): a row declaring its base (`overrides.package`)
binds and serves as declared; two holders that could own a row still
refuse `409` naming both; a row whose one owner the registry binds it to
is served as before; with one of two holders disabled, the enabled
holder's address, list and execution list keep the undeclared row
(residual (3), ruled C in 6837007729, keeping #32183 R4-A), re-enabled
it is refused naming both; and the same when the disabled holder is the
base of a bundle addition (Z on the App and on Y ships only `fr-FR`, Y
disabled): Z stays an addition, X keeps the row; and when X holds the
name only through its own stored row in the bare slot, X's address keeps
the undeclared pair row as on `main`.
Files: `protocol-exact-qualifier.ts`, `registry.ts`, the pins in
`package-scoped-exact-qualifier.test.ts` (and one comment line in
`package-scoped-resolver.test.ts`), the semantic entry
`packages/spec/src/migrations/entries/semantic/18.pair-row-exact-read-no-owner.ts`,
and two changesets (`metadata-protocol` + `objectql` minor, BREAKING,
`adr-0087: registered`; `spec` patch for the entry).
## Tests
`packages/objectql/src/package-scoped-exact-qualifier.test.ts`, describe
`[#32561] …`:
- NARROWING, residual 1: an undeclared row of the very locale a bundle
addition of another package of the App ships, addition installed first;
and the other order (row stored while X alone held the name, CONTROL
that X served it, then Z installed). Each asserts the registry binds it
to no package, `?package=X` answers nothing, `?package=Z` Z's own,
`?package=A.custom` the row, X's list and X's execution list leave it
out (contract review S1), and X's own `en-US` stays X's.
- CONTROL: a row declaring X keeps X's address beside the addition.
- NARROWING, residual 2 (contract review F6 of #32408): two Apps' pairs
each storing an undeclared row of the name; neither package address
serves either row, each pair's own address does.
- CONTROL, residual 3, both registration orders: one of two holders
disabled keeps the row on the enabled holder's address, list and
execution list; re-enabled, refused naming both.
- CONTROL, contract review M1, both registration orders: X and Y ship
`en-US`, Z (on the App and on Y) ships only `fr-FR`, an undeclared
`de-DE` pair row, Y disabled: the owner count is `[X]`, the adoption
binds the row to X, `?package=X&member=de-DE` serves it and both of X's
lists keep it, Z keeps its own `fr-FR`; re-enabled, refused naming X and
Y. **Red on `72c8a9c8ef`** (2 failed / 249 passed in the file:
`AssertionError: the adoption counts as the exact read does: expected
undefined to be 'com.acme.suitex'`), green at `5a9d589a80`.
- UNCHANGED, contract review n1, both registration orders (X's holding
first, the pair row first): X holds the name only through its own stored
row in the bare slot (a row with `package_id` X hydrated, no composite
slot) and the App's pair stores an undeclared `de-DE` row: the adoption
binds the row to X, `?package=X&member=de-DE` serves it, X's own `en-US`
stays X's. **Red on `5a9d589a80`** (2 failed: ``AssertionError: the
adoption counts X as the exact read does: expected
'com.acme.suite.custom' to be 'com.acme.suitex'``), green at
`dd283faf40`. Beside it, the CONTROL with X's item in its composite
slot, both orders, also pins X's list and execution list.
Ablations on head `dd283faf40` (each through
`scripts/ablation-replace.mjs`, landing proved, restored to the HEAD
blob with `git diff HEAD` empty):
| Ablation | Red / green of 375 (the two harness files) |
|:--|:--|
| A1: `pairRowOnAddress`'s new line guarded off; `metadata-protocol`
rebuilt, `ablation-dist-preflight` marker present in 2 built files
(restore: rebuilt, absent from all 24) | **3 / 372**: the three
NARROWING pins. ``AssertionError: `?package=X`: X ships no fr-FR:
expected { name: 'welcome', …(6) } to be undefined`` |
| A2: `overlayRowBinding` keeps every holder, a disabled one included
(`registry.ts` is imported relatively by the suite, no build) | **7 /
368**: the two residual-3 CONTROLs, the two M1 CONTROLs, the three
#32183 / #32408 disable pins. `AssertionError: the adoption counts the
served holders: expected undefined to be 'com.acme.suitex'` |
| A3: the addition rule settled over the served holders only (round 1's
shape) | **2 / 373**: the two M1 CONTROLs. `AssertionError: the adoption
counts as the exact read does: expected undefined to be
'com.acme.suitex'` |
| A4: the adoption counts composite slots only (round 1's holder set) |
**2 / 373**: the two n1 pins. ``AssertionError: the adoption counts X as
the exact read does: expected 'com.acme.suite.custom' to be
'com.acme.suitex'`` |
| restored | 375 / 375 |
## Acceptance notes
- This branch resumes `claude/project-thread-04ua2f@c233053` and
merges `origin/main` once (`bf02d33bd`, merge commit `72c8a9c8ef`). The
branch had carried PR #32815's round-3 head; the four conflicts
(`objectql/src/registry.ts`, the two `package-scoped-*` test files,
`18.pair-row-locale-addition-refused.ts`) each take main's landed copy
(`e336a33eb`) with the card's own four commits replayed onto it, and the
two `32408-*` changesets stay deleted (consumed by version packages
#29963). Measured: the card's `+/-` lines vs main equal the branch's
delta over PR #32815's head `c3cc324b1` line for line, apart from main's
own permission-set lines. The diff against `main` is the card's seven
files only. Main's #33130 (#32354) and #33126 (#32613) are in the merged
head; `protocol-exact-qualifier.ts` merged without conflict.
- Residual shape from the epic red-line read 6841098779 (card comment
6841146506): measured in 6863197549, `main`'s and not moved here (W's
exact address, list and execution list serve a row **declared** for X
when X holds nothing, on `main` and at this head alike); the seat routes
it.
- Contract review n1, answered: reachable with the harness double (X
holding the name only through its own stored row in the bare slot),
where round 1's adoption withheld the App's undeclared pair row at
`?package=X` while `main` served it. Fixed here (the adoption counts the
holders as `packageScopedHoldersOf` does) and pinned; no second move to
declare. Observed beside it and not moved: in that state X's list and
execution list leave the row out, on `main` and at this head alike (the
list door's own count), while X's exact address serves it; outside this
card, left for the seat to route.
- The bare member read ignoring a declared pair override stays with the
follow-up card (sub-issue of this card, blocked by it); this PR does not
touch it.
- #32607 shares `protocol-exact-qualifier.ts` and runs after this card
lands.
## Verification
All local readings on head `dd283faf40` (round 2: `5a9d589a80` for M1
and S1, then `dd283faf40` for n1; no commit after it).
<details><summary>Affected suites and typecheck</summary>
- `pnpm --filter @objectstack/metadata-protocol test`: Test Files 337
passed, 7 skipped (344); Tests 22803 passed, 36 skipped (22839).
`typecheck` exit 0. Lock `VERDICT command-exit 0`.
- `pnpm --filter @objectstack/objectql test`: Test Files 595 passed
(595); Tests 12843 passed (12843). `typecheck` exit 0. Lock `VERDICT
command-exit 0`.
- Focused files (`package-scoped-exact-qualifier.test.ts`,
`package-scoped-resolver.test.ts`): 375/375 (369 at `72c8a9c8ef`, plus
the two M1 CONTROLs and the four n1 pins).
</details>
<details><summary>dispatch-gates</summary>
`node scripts/pm/dispatch-gates.mjs --commands` derived the same 94
commands from the same 7 paths vs merge base `bf02d33bd`. All 94 exit 0
(`check:dual-build-cjs-loads` measured this round: the dogfood closure
build gave it its prerequisite). `check:type-check-debt` first answered
exit 3 `PREREQUISITE NOT MET` (its closure build never got the verify
lock while the dogfood battery held it); re-run under the lock: exit 0,
"0 ledger entr(ies) re-measured … none above its recorded number".
`dispatch-gates --ran`: "94 derived famil(ies) accounted for — 94 run, 0
NOT-MEASURED".
```text
node scripts/check-adr-0087-registration.mjs --base origin/main :: exit 0
node scripts/check-adr-0087-registration.mjs --self-test :: exit 0
node scripts/check-changeset-no-major.mjs --base origin/main :: exit 0
node scripts/check-closing-keyword-parity.mjs :: exit 0
node scripts/check-closing-keyword-parity.mjs --self-test :: exit 0
node scripts/check-comment-mask-adoption.mjs :: exit 0
node scripts/check-comment-mask-adoption.mjs --self-test :: exit 0
node scripts/check-comment-mask-corpus.mjs :: exit 0
node scripts/check-dev-prereqs.mjs --self-test :: exit 0
node scripts/check-dts-emitted.mjs --self-test :: exit 0
node scripts/check-empty-changeset.mjs --base origin/main :: exit 0
node scripts/check-empty-changeset.mjs --self-test :: exit 0
node scripts/check-engine-split-ratio.mjs --self-test :: exit 0
node scripts/check-issue-citations.mjs :: exit 0
node scripts/check-plugin-teardown-shape.mjs :: exit 0
node scripts/check-plugin-teardown-shape.mjs --self-test :: exit 0
node scripts/ci/assert-turbo-remote-cache.mjs --self-test :: exit 0
node scripts/ci/plan-test-core-shards.mjs --self-test :: exit 0
node scripts/ci/prune-turbo-cache.mjs --self-test :: exit 0
node scripts/ci/snapshot-next.mjs --self-test :: exit 0
node scripts/docs-audit/check-affected-docs.mjs :: exit 0
node scripts/docs-audit/check-drift-comment.mjs :: exit 0
node scripts/pm/release-rehearsal-clone.mjs --self-test :: exit 0
node scripts/release-pending-publish.mjs --self-test :: exit 0
pnpm --filter @objectstack/lint run check:doc-formula-expressions :: exit 0
pnpm --filter @objectstack/spec run check:api-surface :: exit 0
pnpm --filter @objectstack/spec run check:authorable-surface :: exit 0
pnpm --filter @objectstack/spec run check:browser-reachable-entries :: exit 0
pnpm --filter @objectstack/spec run check:docs :: exit 0
pnpm --filter @objectstack/spec run check:dual-source-exports :: exit 0
pnpm --filter @objectstack/spec run check:duration-unit-keys :: exit 0
pnpm --filter @objectstack/spec run check:empty-state :: exit 0
pnpm --filter @objectstack/spec run check:entry-nameability :: exit 0
pnpm --filter @objectstack/spec run check:error-code-provenance :: exit 0
pnpm --filter @objectstack/spec run check:export-origins :: exit 0
pnpm --filter @objectstack/spec run check:exported-any :: exit 0
pnpm --filter @objectstack/spec run check:liveness :: exit 0
pnpm --filter @objectstack/spec run check:llms-txt :: exit 0
pnpm --filter @objectstack/spec run check:skill-refs :: exit 0
pnpm --filter @objectstack/spec run check:spec-changes :: exit 0
pnpm --filter @objectstack/spec run check:strictness-ledger :: exit 0
pnpm --filter @objectstack/spec run check:upgrade-guide :: exit 0
pnpm --filter @objectstack/spec run check:variant-docs :: exit 0
pnpm check:adr-symbol-anchors :: exit 0
pnpm check:changeset-gate-self-tests :: exit 0
pnpm check:ci-filter-parity :: exit 0
pnpm check:cli-command-ids :: exit 0
pnpm check:closed-ceremony-text :: exit 0
pnpm check:cross-package-test-inputs :: exit 0
pnpm check:dispatcher-error-vocabulary :: exit 0
pnpm check:doc-authoring :: exit 0
pnpm check:driver-memory-census :: exit 0
pnpm check:dts-closure :: exit 0
pnpm check:dual-build-cjs-loads :: exit 0
pnpm check:durability-log-level :: exit 0
pnpm check:engine-double-contract :: exit 0
pnpm check:error-status-conformance :: exit 0
pnpm check:gitlink-declared :: exit 0
pnpm check:init-service-contract :: exit 0
pnpm check:issue-citations :: exit 0
pnpm check:keyed-text-bounds :: exit 0
pnpm check:lean-entry-closure :: exit 0
pnpm check:logger-receiver-detach :: exit 0
pnpm check:merge-driver :: exit 0
pnpm check:nul-bytes :: exit 0
pnpm check:object-def-param-keys :: exit 0
pnpm check:objectql-double-limit :: exit 0
pnpm check:optional-error-sink :: exit 0
pnpm check:org-identifier :: exit 0
pnpm check:page-declaration-shape :: exit 0
pnpm check:platform-object-tenancy-census :: exit 0
pnpm check:pm-prior-rulings :: exit 0
pnpm check:published-files :: exit 0
pnpm check:query-options-erasure :: exit 0
pnpm check:refd-timer-probe :: exit 0
pnpm check:registry-log-declared :: exit 0
pnpm check:rest-log-declared :: exit 0
pnpm check:rest-log-spy-declared :: exit 0
pnpm check:role-word :: exit 0
pnpm check:settings-bind-window :: exit 0
pnpm check:slot-lookup :: exit 0
pnpm check:sourcemap-no-sources-content :: exit 0
pnpm check:spec-docblock-symbol-anchors :: exit 0
pnpm check:spec-parsed-alias :: exit 0
pnpm check:startup-registry-verdict :: exit 0
pnpm check:system-context-census :: exit 0
pnpm check:test-source-alias :: exit 0
pnpm check:tier-file-adoption :: exit 0
pnpm check:type-check-coverage :: exit 0
pnpm check:type-check-debt :: exit 0
pnpm check:undeclared-dep-imports :: exit 0
pnpm check:vouch-for-reference-callers :: exit 0
pnpm check:watch-hint-literal :: exit 0
pnpm check:where-matcher :: exit 0
```
</details>
<details><summary>Lint and dogfood</summary>
`pnpm lint` (eslint, whole repo) on `dd283faf40`: exit 0.
Full dogfood battery once on the final head `dd283faf40` (`Clause-②: yes
(narrowing)`): closure `pnpm --filter '@objectstack/dogfood^...' build`
(lock `VERDICT command-exit 0`), then `pnpm --filter
@objectstack/dogfood test` under the lock, no shard, no path: `VERDICT
command-exit 0` · Test Files 460 passed, 3 skipped (463) · Tests 3886
passed, 42 skipped (3928) · no failure. (Round 1's run on `72c8a9c8ef`
read the same counts.)
</details>
---
_Generated by [Claude
Code](https://claude.ai/code/session_016WV4cwzajrQVjjx4Dh1CA5)_
<!-- 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 3eac63a commit 89d7bef
7 files changed
Lines changed: 350 additions & 9 deletions
File tree
- .changeset
- packages
- metadata-protocol/src
- objectql/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 | + | |
| 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 | |
|---|---|---|---|
| |||
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
88 | 98 | | |
89 | 99 | | |
90 | 100 | | |
| |||
422 | 432 | | |
423 | 433 | | |
424 | 434 | | |
425 | | - | |
| 435 | + | |
| 436 | + | |
426 | 437 | | |
427 | 438 | | |
428 | 439 | | |
| |||
716 | 727 | | |
717 | 728 | | |
718 | 729 | | |
719 | | - | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
| 733 | + | |
| 734 | + | |
| 735 | + | |
| 736 | + | |
| 737 | + | |
| 738 | + | |
| 739 | + | |
| 740 | + | |
| 741 | + | |
| 742 | + | |
| 743 | + | |
| 744 | + | |
| 745 | + | |
720 | 746 | | |
721 | 747 | | |
722 | 748 | | |
| |||
735 | 761 | | |
736 | 762 | | |
737 | 763 | | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
| 767 | + | |
| 768 | + | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
| 772 | + | |
| 773 | + | |
738 | 774 | | |
739 | 775 | | |
740 | 776 | | |
| |||
744 | 780 | | |
745 | 781 | | |
746 | 782 | | |
| 783 | + | |
747 | 784 | | |
748 | 785 | | |
749 | 786 | | |
750 | 787 | | |
751 | 788 | | |
752 | 789 | | |
753 | 790 | | |
| 791 | + | |
754 | 792 | | |
755 | 793 | | |
756 | 794 | | |
| |||
0 commit comments