You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 128b657
Browse filesBrowse the repository at this point in the historyBrowse files
fix(metadata-protocol): a customization pair's row of a name two namespaces hold is judged against its own base, whichever package registered first (ADR-0150 D4) (#33129)
<!-- claude-projects-attribution: {"github_login":"os-elon-musk"} -->
_Requested by **Elon** · [project
thread](https://claude.ai/code/project/chan_01WedDzV26nniwxv7jC88B9D?thread=cmsg_01WedDzV26nniwxv7jC88B9DTWMrxHhXGd1ihAZkAUVAex)_Fixes#32552
Clause-②: yes (widening)
Metadata-protocol: none
## 维护者速读
- 改了什么:两个不同命名空间的包都出货同名条目(例如 flow `f`),各自带一个声明过的 `.custom`
覆盖时,删除覆盖、回滚提交、启动普查这三处原来只拿“先注册的那个包”当基准判断;现在对每个出货包分别判断,后注册那个包的覆盖也能正常删除、回滚。启动普查与读取保持一致:flow
和 action
不再把第二个包正在生效的覆盖报成“无人服务、请删除”;页面、应用、数据集、文档、手册、映射这六类读取仍只认先注册的包(#33131
再改),普查也照旧。
- 为什么改:结果原本取决于包的注册顺序(ADR-0150 D4 要求每个持有包的声明覆盖各自成立);后注册的包删自己的覆盖会被 `403
NOT_OVERRIDABLE` 拒掉,回滚失败,普查还会建议删掉一个正在生效的定制。
- 风险与回滚:只放宽(widening),不收紧任何已有答案;单一持有包的行为逐条不变(CONTROL 钉住)。不是任何持有包的配对行仍然
403。回滚 = revert 本 PR,只动 `metadata-protocol` 三个源文件。本轮(复审 s1)把普查收窄到与
#32613 的读取一致。
- 先看:`packages/metadata-protocol/src/protocol-environment-rows.ts` 新增的
`someShipperOf`(判定核心);`protocol-diff-delete-load.ts` 的删除判定与启动普查两处
hunk;`protocol-class-head.ts` 的 `restoreWriteFor`。
- 两分钟验证:`pnpm --filter @objectstack/objectql exec vitest run
src/protocol-flow-custom-override.test.ts`,预期 45/45 通过;其中 `[#32552]`
组两种注册顺序、各禁用一个持有包、映射类 CONTROL 以及单持有包 CONTROL 全绿。
- 需要你做的:无,席位落地。
## What changes
For a name two packages of two namespaces ship, each with its paired
`.custom` holding a declared override (ADR-0146 D2), three answers
judged the pair's row against the one package the bare-name artifact
lookup (`packagedArtifactOwner`) answers, so they depended on which
package registered first. Each now asks `someShipperOf` (new,
`protocol-environment-rows.ts`): the bare-name owner first and alone
while it holds (a one-holder name answers exactly as before), then every
package that ships the name (`shippingPackageIds` over
`shippedArtifactsOf`). No shipper is picked: the row judged is always
the one its own `package_id` names.
| Door | Second-registered holder B, before | Now | One holder (CONTROL)
|
|:--|:--|:--|:--|
| `DELETE /meta/TYPE/NAME?package=B.custom` (`deleteMetaItem`); pinned
for a flow, and an action in the condition-1 probe | `403
NOT_OVERRIDABLE`; B's override stays | `200`, B's override removed
(runtime-only), A's untouched; every listed and execution-view entry of
the name is its own package's | unchanged: `200`, removed |
| `revertCommit` of a commit into `B.custom` (restore limb; the per-item
rollback shares `restoreWriteFor`); pinned for a flow | item in
`failed[]`, `NOT_OVERRIDABLE`; nothing restored | restored as the pair's
declared override | unchanged: restored |
| boot census `metadata_sealed_overlay_unserved` (`loadMetaFromDb`), a
flow or an action only | named B's live declared override as unserved,
to delete | not named | unchanged: not named |
Every row is the `widening` arm (epic ruling 6819293900 condition 2).
With one of the two holders disabled (ADR-0150 D3) the bare-name answer
is still the first-registered holder, so the same three answers moved
the same way whichever holder is disabled; a binding never moves with a
reversible disable. Unchanged in both: a row of a package that is no
shipper's pair keeps its removal `403` and is still named by the census.
The census judges a row as the reads serve it (`declinesStoredRow`).
Since #32613 (#33126) the reads serve a second holder's declared
override per shipper for a flow and an action only, so the census moves
for those two types alone. A page, app, dataset, doc, book or mapping
keeps the name's first-registered shipper in the census, as in the
reads, until #33131 moves them: the second holder's override of such a
name is still named (review 6859128505 s1).
Files: `protocol-environment-rows.ts` (+`someShipperOf`),
`protocol-diff-delete-load.ts` (removal judgement; census, per shipper
for a flow and an action), `protocol-class-head.ts` (`restoreWriteFor`),
the changeset, and the pins in
`packages/objectql/src/protocol-flow-custom-override.test.ts`.
## Tests
`packages/objectql/src/protocol-flow-custom-override.test.ts`, describe
`[#32552]`, each in both registration orders:
- `?package=B.custom` removes B's override, never A's (and the mirror
order).
- CONTROL: removing a row of a package that is neither holder's pair
keeps its refusal.
- each holder's commit into its own pair reverts.
- the boot census names no holder's declared override as unserved, and
still names a stranger's row.
- epic ruling 6819293900 condition 1 probe: after the second holder's
override is removed, every listed flow and action is its own package's,
beside a package-less row of the name.
- with each holder disabled in turn: each holder's pair removal and
commit revert are admitted, and the census names neither.
- CONTROL (new this round): two holders' declared mapping overrides; the
census still names the second-registered holder's, `mapping×1`, in both
orders.
- CONTROL, one holder disabled, and CONTROL, one holder: removal, revert
and census answer as before.
Ablation, two legs on head `d311b66322`, each rebuilt with
`ablation-dist-preflight` proving the mutation reached `dist/`, restored
by `git checkout HEAD` with HEAD blob hashes matched and a clean
whole-tree `git status`:
- Leg A, the census type restriction removed (`perShipperType = true`,
marker present in 2 built files): **2 failed / 43 passed of 45**,
exactly the two mapping CONTROLs: `AssertionError: expected [] to have a
length of 1 but got +0`.
- Leg B, the fix's three source files put back to `origin/main`
(`someShipperOf` absent from all 24 built files): **12 failed / 33
passed of 45**, every two-holder pin red, every CONTROL green; quoted
`Serialized Error: { code: 'NOT_OVERRIDABLE', status: 403 }`.
- Restore: rebuilt, `someShipperOf` present and the leg-A marker absent
in `dist/`, 45/45.
## Acceptance notes
- This branch resumes `claude/project-thread-31hd5y@d4d3241` and merges
`origin/main` at `c35a911b30`, and again at `ae11537eae` after #33126
landed (no conflict). 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`), and the two `32408-*`
changesets stay deleted (consumed by version packages #29963). The diff
against `main` is the card's five files only.
- The census row overlaps #32859 (blocked by this card): after this
lands, the census no longer names a second holder's served declared flow
or action override. The seat judges whether #32859's remainder still
stands; this PR does not close it.
- Epic ruling 6819293900 condition 3: #32613 has landed (#33126) and is
in this head; #32568 is closed.
- Round 2 answers contract review 6859128505: s1 (census in step with
#33126's served set, table names the census row's types) and n1 (each
row names what it is pinned on).
- #32561 shares `objectql/src/registry.ts` and the migration entry and
waits for this card; this PR no longer touches either.
## Verification
All local readings on head `d311b66322`.
<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. `typecheck`
exit 0. Lock `VERDICT command-exit 0`.
- `pnpm --filter @objectstack/objectql test`: Test Files 595 passed
(595); Tests 12851 passed (12851). `typecheck` exit 0. Lock `VERDICT
command-exit 0`.
- Focused file: 45/45.
</details>
<details><summary>dispatch-gates</summary>
`node scripts/pm/dispatch-gates.mjs --commands` derived 69 commands from
5 paths vs merge base `bf02d33bd`, all 69 exit 0
(`check:dual-build-cjs-loads` measured this round: 123 require entry
points across 72 packages load). `dispatch-gates --ran`: "69 derived
famil(ies) accounted for — 69 run, 0 NOT-MEASURED (a DERIVED zero — all
69 recorded an exit code and none of them is 3)".
```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-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/spec run check:duration-unit-keys :: exit 0
pnpm --filter @objectstack/spec run check:error-code-provenance :: 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: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: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: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-spy-declared :: 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: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>
- `eslint --no-inline-config` on the two TS files changed this round:
exit 0. Round 1 `pnpm lint` on `c35a911b30`: exit 0.
- Full dogfood, round 1 on `c35a911b30` (not owed: no `!`, no
`(narrowing)` arm): Test Files 460 passed, 3 skipped (463); Tests 3874
passed, 42 skipped (3916); lock `VERDICT command-exit 0`. Not re-run for
the census-only delta.
</details>
---
_Generated by [Claude
Code](https://claude.ai/code/session_016WV4cyN75XjF6J8fLtD21r)_
<!-- 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>
fix(metadata-protocol): a customization pair's row of a name two namespaces hold is judged against its own base, whichever package registered first — its removal, its commit revert and the boot census (ADR-0150 D4)
6
+
7
+
Clause-②: yes (widening) — answers that refused or misreported the second-registered holder's declared override now admit or leave it, as they already did for the first. For a name two packages of two namespaces ship, each with its paired `.custom` holding a declared override (ADR-0146 D2), three answers depended on which package registered first, because each judged the pair's row against the one package the bare-name artifact lookup answers. Each is now judged against every package that ships the name. First-party callers in any of these positions: 0.
8
+
Metadata-protocol: none
9
+
10
+
Every row below is the `widening` arm, is pinned in both registration orders in `@objectstack/objectql`'s `protocol-flow-custom-override.test.ts`, and keeps its one-holder answer (the one-holder CONTROL there):
11
+
12
+
| Door | Second-registered holder B, before | Now | One holder (CONTROL) |
13
+
|:--|:--|:--|:--|
14
+
|`DELETE /meta/TYPE/NAME?package=<B>.custom` (`deleteMetaItem`); pinned for a flow, and for an action in the list probe below |`403 NOT_OVERRIDABLE` "sealed against removal"; B's override stays |`200`: B's override row removed (runtime-only), A's untouched; afterwards every listed and execution-view entry of the name is its own package's | unchanged: `200`, removed |
15
+
|`revertCommit` of a commit into `<B>.custom` (the restore limb; the per-item rollback shares the derivation); pinned for a flow | the item in `failed[]`, `NOT_OVERRIDABLE` "sealed against in-place edits"; nothing restored | restored, judged by the override write gate as the pair's declared override | unchanged: restored |
16
+
| boot census `[metadata_sealed_overlay_unserved]` (`loadMetaFromDb`), a flow or an action only | named B's live declared override as an unserved row to delete | not named | unchanged: the override not named |
17
+
18
+
With one of the two holders disabled (ADR-0150 D3), the bare-name answer is still the first-registered holder, disabled or not, so the same three answers moved the same way whichever holder is disabled: each holder's pair removal and commit revert are admitted now, the disabled holder's pair included, and the census names neither override. A binding never moves with a reversible disable. Pinned in both registration orders with each holder disabled in turn, beside a one-holder disabled CONTROL (its removal and revert admitted, as before).
19
+
20
+
Unchanged in both: a row of a package that is no shipper's pair keeps its removal `403` and is still named by the census.
21
+
22
+
The census judges a row as the reads serve it (`declinesStoredRow`). The reads serve a second holder's declared override per shipper for a flow and an action only (#32613), so only those two types move here. A page, app, dataset, doc, book or mapping keeps the name's first-registered shipper in the census, as in the reads, until #33131 moves them: the second holder's override of such a name is still named, pinned for a mapping in both registration orders.
23
+
24
+
No shipper is picked: the row judged is always the one its own `package_id` names, and the judgement asks only whether that package is a pair of SOME package that ships the name. A name one package ships answers exactly as before (the bare-name answer is read first and alone while it holds).
0 commit comments