Repository navigation
fix(objectql): the bare-name refusal states the namespace rule for a narrowed type - #33902
Conversation
…arrowed type bareNameReason told every covered type it holds one name per deployment, served by registration order. Every covered type is now in NAMESPACE_SCOPED_BARE_NAME_TYPES, so the reason for a narrowed type states its own rule; a type not yet narrowed keeps the old sentence. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jTEivi2wogPpeo3xd5
… bind does now The comment said the refusal stays until the trailing backstop child narrows it. That child has landed: the function rule is narrowed to the namespace, the bind throws, and the runtime catches it per owner group. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jTEivi2wogPpeo3xd5
📓 Docs Drift Check3 anchor(s) derived from 1 changed package(s); no hand-written page names any of them, so this run has nothing to list — not a clean bill of health. This check sees only pages that NAME a derived anchor: one that documents this change in prose, or enumerates it in an authoring dialect, names none and stays invisible to it on every run. What this run could not see
Coarse fallback — 21 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): Which tree this was computed onThis run read A worktree cut from an older # while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 3bab0bb29259e48ddeef75a9e2ea40f5b18f9bce && git checkout 3bab0bb29259e48ddeef75a9e2ea40f5b18f9bce
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 2539ad9860a3e43323fcf35ac80ffee47c8dec3e bb684b95e7ffffc725172651e2cc63efbc18d831 && git checkout -B drift-repro 2539ad9860a3e43323fcf35ac80ffee47c8dec3e && git merge --no-ff bb684b95e7ffffc725172651e2cc63efbc18d831
node scripts/docs-audit/affected-docs.mjs --json 2539ad9860a3e43323fcf35ac80ffee47c8dec3e |
|
domain:server#5 · zhuangjianguo · session_01QsR2jTEivi2wogPpeo3xd5 Request: review · PR #33902 · area S3 · Fixes #33507 · Part of #33670 · head f1706ea
Generated by Claude Code |
|
domain:server#5 · zhuangjianguo · session_01QsR2jTjrNnh6b2BkCXFugM |
|
domain:server#5 · zhuangjianguo · session_01QsR2jTjrNnh6b2BkCXFugM Review — FAILHead-sha: What holds
Must-fix
Nits (no re-review needed)
Gates: not judged. At review time 19 check-runs were in progress, 13 success, 16 skipped, none red. Next: a new head with item 1. I review the delta only. |
…still meet across namespaces A platform-requested bare name keeps one holder per deployment, and a bundle addition is refused as its base's name, whatever the namespaces. The reason for a narrowed type with either exception now states them instead of saying another namespace may ship the name. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jTEivi2wogPpeo3xd5
|
domain:server#5 · zhuangjianguo · session_01QsR2jTjrNnh6b2BkCXFugM |
…xceptions Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jTEivi2wogPpeo3xd5
|
domain:server#5 · zhuangjianguo · session_01QsR2jTjrNnh6b2BkCXFugM |
|
domain:server#5 · zhuangjianguo · session_01QsR2jTEivi2wogPpeo3xd5 Request: review · PR #33902 · area S3 · Fixes #33507 · Part of #33670 · head 3036245 Delta review after FAIL 6895373233 (ordinary ACCEPT read per review-checklist.md, area-rules 2026-11-15T16:03Z; no contract face: Clause-② no, Metadata-protocol none, no Generated by Claude Code |
|
domain:server#5 · zhuangjianguo · session_01QsR2jTjrNnh6b2BkCXFugM Review — PASS (delta)Head-sha: Must-fix 1: fixed.
Nits (no re-review needed)
Gates: not judged. At review time 21 check-runs were in progress, 13 success, 18 skipped, none red. Land on all-green. |
|
domain:server#5 · zhuangjianguo · session_01QsR2jTEivi2wogPpeo3xd5 席位核对ACCEPT and landing · area S3 · 2026-11-15T18:17Z · head
Ready + auto-merge under the area S3 landing line (maintainer, project thread, 2026-11-15T11:06Z) and the pm-dispatch landing procedure (maintainer, 2026-11-15T15:56Z). Generated by Claude Code |
⛔ merge queue 构建失败 — 先分诊,再决定要不要重排队列构建 43747576803 红了。队列跑的是全量套件(PR 侧 CI 只跑 affected 子集), 分类: 失败的 job(日志抽取,best effort):
跨 PR 相同签名(24h,按失败测试文件聚合):
历史信号:
分诊清单:
Generated by Claude Code · merge-queue-triage workflow (#4859) |
|
domain:server#5 · zhuangjianguo · session_01QsR2jTEivi2wogPpeo3xd5 Queue ejection · area S3 · 2026-11-15T18:54Z · head Queue build 43747576803 failed on Generated by Claude Code |
⛔ merge queue 构建失败 — 先分诊,再决定要不要重排队列构建 43747969462 红了。队列跑的是全量套件(PR 侧 CI 只跑 affected 子集), 分类: 失败的 job(日志抽取,best effort):
跨 PR 相同签名(24h,按失败测试文件聚合):
历史信号:
分诊清单:
Generated by Claude Code · merge-queue-triage workflow (#4859) |
⛔ merge queue 构建失败 — 先分诊,再决定要不要重排队列构建 43751161919 红了。队列跑的是全量套件(PR 侧 CI 只跑 affected 子集), 分类: 失败的 job(日志抽取,best effort):
跨 PR 相同签名(24h,按失败测试文件聚合):
历史信号:
分诊清单:
Generated by Claude Code · merge-queue-triage workflow (#4859) |
⛔ merge queue 构建失败 — 先分诊,再决定要不要重排队列构建 43754696009 红了。队列跑的是全量套件(PR 侧 CI 只跑 affected 子集), 分类: 失败的 job(日志抽取,best effort):
跨 PR 相同签名(24h,按失败测试文件聚合):
历史信号:
分诊清单:
Generated by Claude Code · merge-queue-triage workflow (#4859) |
⛔ merge queue 构建失败 — 先分诊,再决定要不要重排队列构建 43757536849 红了。队列跑的是全量套件(PR 侧 CI 只跑 affected 子集), 分类: 失败的 job(日志抽取,best effort):
跨 PR 相同签名(24h,按失败测试文件聚合):
历史信号:
分诊清单:
Generated by Claude Code · merge-queue-triage workflow (#4859) |
⛔ merge queue 构建失败 — 先分诊,再决定要不要重排队列构建 43761148890 红了。队列跑的是全量套件(PR 侧 CI 只跑 affected 子集), 分类: 失败的 job(日志抽取,best effort):
跨 PR 相同签名(24h,按失败测试文件聚合):
历史信号:
分诊清单:
Generated by Claude Code · merge-queue-triage workflow (#4859) |
⛔ merge queue 构建失败 — 先分诊,再决定要不要重排队列构建 43763700095 红了。队列跑的是全量套件(PR 侧 CI 只跑 affected 子集), 分类: 失败的 job(日志抽取,best effort):
跨 PR 相同签名(24h,按失败测试文件聚合):
历史信号:
分诊清单:
Generated by Claude Code · merge-queue-triage workflow (#4859) |
|
domain:server#5 · zhuangjianguo · session_01QsR2jTEivi2wogPpeo3xd5 Re-arm · area S3 · 2026-11-16T00:04Z · head The run-date.test.ts flake that ejected this PR is fixed on main (#34104, anchor #34081). This head comes from clean main merges of Generated by Claude Code |
…s hold refuses as the plain read does, naming the holders as details.candidates (ADR-0150 D3/D5) (objectstack-ai#33885) <!-- claude-projects-attribution: {"github_login":"zhuangjianguo"} --> _Requested by **Steedos** · [project thread](https://claude.ai/code/project/chan_018ETKaNwMZCNRYD7D8Q9Ubb?thread=cmsg_018ETKaNwMZCNRYD7D8Q9UbbNTugWasvhTMrtCZiFGrZYK)_ Fixes objectstack-ai#32622 Fixes objectstack-ai#32914 Clause-②: no (narrowing) — narrowed: a layered read naming no package, of a name two or more served packages register in code, no longer serves the holder that registered first. The REST `/layers` door on a host that wires no engine for its door chain goes from 200 to 409 naming the holders, and the in-process `getMetaItemLayered` goes from resolving to throwing `PackageScopedNameRefusedError`. The REST `/published` door on a host with no `objectQLProvider` goes to 409 without `details.candidates`. Before, it served the name's package-unbound active row (200) when one stands, and otherwise its published exit (the metadata service's `getPublished` answer, or 501 when the host resolves none). The dispatcher's `/published` swallows the refusal. With no such row it serves its snapshot as before; with one, it moves from that row to the code snapshot (read from the tree). A name one package holds, and every read naming the package, answer as before. Metadata-protocol: none Skills-docs: none — no skill under `skills/` names the layered or published door, and the docs that do (`content/docs/ui/apps.mdx`, `content/docs/references/api/rest-server.mdx`, `content/docs/concepts/metadata-lifecycle.mdx`, `content/docs/plugins/adding-a-metadata-type.mdx`) name the routes without teaching how a name two packages hold is answered there, so no sentence there turns false; the generated `content/docs/references/api/protocol.mdx` describes `packageId` as scoping a same-name collision, which still holds. ## 维护者速读 - 改了什么:按名字读元数据的分层视图(`GET /meta/TYPE/NAME/layers`,以及进程内的 `getMetaItemLayered`),遇到两个包都持有同名项、又没指定包时,现在和普通读一样答 409,并在 `details.candidates` 里列出两个包;以前 REST 在某些部署形态下、以及进程内调用,会悄悄返回先注册的那个包。 - 为什么改:同一个名字,普通读答 409 点名两包,分层读却按注册顺序挑一个(或只给一句话不给结构化候选),调用方无法知道该选哪个包,违反 ADR-0150 D3/D5“歧义要报告、不许猜、要列候选”。 - 风险与回滚:这是收窄(BREAKING):没给 door chain 接引擎的部署上,两包同名、不指定包的 `/layers` 由 200(先注册包的分层)变为 409;进程内 `getMetaItemLayered` 由返回先注册包变为抛 `PackageScopedNameRefusedError`,调用方需改为指定包。只影响“两个包同名且没指定包”的分层读;单一持有者、带 `?package=` 的读、存储行持有者在禁用包旁的进程内读都不变;第一方触达 0。回滚即 revert 本 PR。 - 先看:`packages/metadata-protocol/src/protocol-meta-layered-reads.ts`(`getMetaItemLayered` 新增的 `resolveItem` 判定,和 `withPackageCandidates`);`packages/rest/src/meta-item-read-routes.ts`(`/layers` 路由 catch 加 `packageScopedCandidates`);`packages/rest/src/meta-layers-ambiguous-package.test.ts` 新增的 describe。 - 两分钟验证:`pnpm --filter @objectstack/rest exec vitest run --maxWorkers=2 src/meta-layers-ambiguous-package.test.ts`,预期 12 个用例全绿(两包同名的 `/layers` 两种写法答 409 带 `details.candidates`,进程内读抛同样的拒绝,单持有者照常返回)。 - 需要你做的:无,席位落地。 ## What changes **BREAKING** (`Clause-②: no (narrowing)`, patch level, `Metadata-protocol: none`): three answers move, the three bold rows of the table below. FROM 200 with the first-registered holder's layers TO 409 `RESOURCE_CONFLICT` with `details.candidates`, on REST `/layers` where no engine is wired for the door chain; FROM resolving the first-registered holder TO throwing `PackageScopedNameRefusedError`, in process; FROM the package-unbound active row (200) or the published exit TO 409 without `details.candidates`, on REST `/published` where no `objectQLProvider` is wired (review-b F1 and review#2 S3, measured below). The fix for a caller: name the package. The changeset carries the banner and `adr-0087: not-required (no-migration-prescription)`: no key, stored row, layer or export changes shape. Measured first on `main` `a557fa38` (real `RestServer`, real protocol, real `SchemaRegistry`; two packages registering the dashboard `sales`, no stored row): | door | before | after | |---|---|---| | plain `GET /meta/dashboard/sales` | 409 `RESOURCE_CONFLICT` with `details.candidates` | unchanged | | REST `/layers`, engine wired for the door chain | 409, sentence only (no `details`) | 409 with `details.candidates` | | REST `/layers`, no engine wired (no service copy, or a service copy of one holder) | **200, the first-registered holder's layers** | 409 with `details.candidates` | | in process `getMetaItemLayered({ type, name })` | **resolves, the first-registered holder's layers** | throws `PackageScopedNameRefusedError` (409, `refusal.candidates` naming both) | | REST `/published`, no `objectQLProvider` | **the published exit: the metadata service's `getPublished` answer, or 501 `NOT_IMPLEMENTED` when the host resolves no metadata service** | 409 `RESOURCE_CONFLICT`, no `details` | | REST `/published`, no `objectQLProvider`, the name also has a package-unbound active row | **200, that row** | 409 `RESOURCE_CONFLICT`, no `details` | | REST `/published`, engine wired | 409 `RESOURCE_CONFLICT`, no `details` | unchanged | | dispatcher `/published`, engine registry not reachable, no package-unbound row | the snapshot (the throw is swallowed) | unchanged (not pinned) | | dispatcher `/published`, the same, with a package-unbound active row | **that row** (read from the tree) | the code snapshot: the throw is swallowed (read from the tree, not pinned) | | `?package=` of either holder, and a name one package holds | served | unchanged | - **`getMetaItemLayered` (objectstack-ai#32914, and the REST pick folded into objectstack-ai#32622 from objectstack-ai#32624).** Naming no package, a type addressed by package is judged by the registry's package-scoped resolver (`registry.resolveItem(type, name, null, member)`), as `getMetaItem` judges it (`packagelessScopedRead`), before any layer is read and whatever the metadata service holds. Only the judgment is taken; a name one holder holds keeps the layers it had. Stored-row holders are not this judgment's: the door refuses them in step 1c, as contract review S1 on objectstack-ai#33130 settled, and the in-process read in that state still resolves (the `[objectstack-ai#32354]` pin is unchanged and green). - **REST `/layers` catch (objectstack-ai#32622).** `handleRouteError(res, error, undefined, { packageScopedCandidates: true })`, as the plain read's catch (objectstack-ai#32201). The deprecated `?layers=true` spelling already answered through that catch. The dispatcher already carried the candidates (`errorFromThrown`). - **Step 1c's refusal (objectstack-ai#32622).** The package-less writes' refusal the layered door answers for a name whose active rows two packages hold (objectstack-ai#28337) keeps its sentence, code, status and `?package=` remedy, and now carries its holders as a package-scoped refusal by shape (`refusal.status: 'refused'`, `candidates` in the `/actions` shape), so both transports answer `details.candidates`. The save and delete doors do not move. This is the item the objectstack-ai#32607 seat re-ruling left to this card ("Carrying `details.candidates` on `/layers` remains objectstack-ai#32622's job", 6820653691). - `protocol.ts`: docblock only (9 lines, under the seat's 14:45Z rule change). `packagelessLayeredReadRefusal`'s docblock now says the refusal carries its holders as `refusal.candidates`, and that `getMetaItemLayered`'s in-process readers meet the registry's refusal of a name two packages register in code. The emitted `dist/index.js` and `dist/index.cjs` differ from `HEAD~1`'s in those comment lines alone (two builds, raw diff). A later commit adds the `@throws` for the two-holder refusal to `getMetaItemLayered`'s docblock (review-b N2, 4 lines). ## Tests - `packages/rest/src/meta-layers-ambiguous-package.test.ts`, new describe `[objectstack-ai#32622, objectstack-ai#32914] a name two packages register, read naming no package`: 3 compositions (engine wired; no engine wired; no engine wired with a metadata-service copy of the first holder) x 2 registration orders, both spellings answer 409 `RESOURCE_CONFLICT` with both holders as `details.candidates` and serve neither holder; in process the layered read refuses (`code` + `status` + `refusal.candidates`) in every composition and each `packageId` read still serves its holder; CONTROL: a name one package registers is served in process and on both spellings, and `?package=` serves its holder. - `[objectstack-ai#28337]` pins on both transports (`rest/.../meta-layers-ambiguous-package.test.ts`, `runtime/.../meta-layers-ambiguous-package.test.ts`, RestServer and hono): the envelope is now the writes' envelope plus `details`, with both holders as `details.candidates`; the writes' answer is asserted to carry no `details`. - `[objectstack-ai#32354]` ruling-Q2 pins (`rest/.../meta-disabled-package-doors.test.ts`, `runtime/.../meta-disabled-holder-served-stack.test.ts`): `/layers` now asserts `details.candidates` naming only the served holders. - `metadata-protocol/.../protocol.packageless-layered-read-refusal.test.ts`: the step-1c refusal carries `refusal.candidates`; the save's refusal carries none. - `rest/.../meta-qualified-item-route.test.ts`, new top-level describe `objectstack-ai#32622 — the other /layers refusal exits carry details.candidates` (review#2 S1). It covers two exits. The bare action read with the platform's item beside A's answers `[A, platform]`. `/layers?package=` of a package holding none answers `[A]`. Each is asserted equal to the item read's candidates. The stale `objectstack-ai#32365` comment there is corrected: `/layers` carries the candidates, `/published` its text. S1 ablation (the `/layers` catch without `packageScopedCandidates`, rest source): both new cases red (`AssertionError: {"error":"The action \"approve\" is held by 2 holders …` and `… is not held by package \"com.acme.gamma\" …`), 2 failed of 325; restored with blob equal to HEAD and `git diff HEAD` empty; baseline 325/325. <details><summary>Ablations (each leg restored; blob == HEAD proven by ablation-replace)</summary> HEAD `6e50dbd5c7`. Baseline green: rest 62/62, metadata-protocol 3/3, runtime 367/367 (the three files above per package). - **A2, the `/layers` catch without `packageScopedCandidates`** (rest source, read from `src`): 9 red, e.g. `/layers: expected [] to deeply equal [ 'package:app.alpha_demo', …(1) ]` and the ruling-Q2 pin `expected [] to deeply equal [ Array(2) ]`; the in-process and CONTROL cases stay green, as expected. - **A1, `getMetaItemLayered` without the resolver judgment** (metadata-protocol rebuilt, marker `ABLATED_32914` present in 2 built files): 6 red, the no-engine cases `/layers: … "label":"app.alpha_demo code" …: expected [ 200, … ] to deeply equal [ 409, 'RESOURCE_CONFLICT' ]` and the in-process cases `expected [ undefined, undefined ] to deeply equal [ 'RESOURCE_CONFLICT', 409 ]`; the engine-wired cases stay green (the door's owner step refuses there), as expected. - **A3, step 1c's refusal without its candidates** (metadata-protocol rebuilt, marker `ABLATED_32622` present): metadata-protocol `expected undefined to be 'refused'`; rest `expected [ 'code', 'error' ] to deeply equal [ 'code', 'details', 'error' ]`; runtime RestServer and hono twins red the same way (hono: `[ 'code', 'httpStatus', 'message' ]`). A first A3 attempt was refused by `ablation-replace` (its replacement contained the anchor, so the anchor count did not drop) and restored at once; its green readings were a no-op and are discarded. - Restore leg: metadata-protocol rebuilt, both markers absent from all 24 built files, working tree clean. </details> ## Acceptance notes - review-b F1 is closed on the prose faces: the `/published` rows are in the changeset banner, the `Clause-②` line and the table. Its follow-up card objectstack-ai#34101 was filed, then closed as not planned by triage under the p3 standard. So the REST and dispatcher `/published` answers stay different (REST 409 without `details.candidates`; the dispatcher swallows the throw and serves the snapshot), and neither is pinned. Recorded here as accepted. - review-b N1 / review#2 N1: `echoSecurityCatalogMutation` recovers from the refusal only when the event names no address. At a package-unbound address of a `permission` name two packages register, the echo now throws where it used to read and skip; the projector runner and the boot pass catch it and warn. No grant, lock or served answer changes (read). Its carrier objectstack-ai#34101 is closed, so it is recorded here as accepted. - review#2 S1 is folded (Tests above). review#2 S3 is folded: the stored-row FROM and the dispatcher row are in the changeset, the `Clause-②` line and the table. REST was measured (see the S3 block under Verification); the dispatcher rows are read from the tree. - review#2 S2 (read, not measured): "Step 1c's `details.candidates` are the packages the active rows are bound to (`packagelessAddress().candidates`), not the holders the plain read judges." Where a package's row stands beside its own customization pair's row (the objectstack-ai#32662 scope-note (b) state), the plain read serves that package's row, while bare `/layers` answers 409 and now names the pair as `{ kind: 'package' }`; a row the reads decline is named the same way. Not folded and no card, under the p3 standard. - review#2 S4 (read, not measured): "The layered read takes the resolver's judgment and not its answer." For a name that an overridable baseline and one other package both hold (`email_template`, baseline `com.objectstack.service.email`), the plain read serves the other package. With no metadata-service copy, the layered read's code layer is still the artifact lookup's first composite, by registration order. Not introduced by this diff. Not folded and no card, under the p3 standard. - review#2 N2 (pin breadth: candidates compared sorted, `dashboard` only, no bundle member, no dispatcher pin on a boot with no service copy) is recorded as accepted. N3 (body staleness) is fixed in this body. - Declaration re-read after the diff, on the area seat's order: the claim declared `Clause-②: no`; measured, two answers move (the bold rows above), so the PR body and the changeset now declare `Clause-②: no (narrowing)` with the BREAKING banner, the `!` title and the ADR-0087 marker, after the objectstack-ai#33646 precedent. On the composition that wires the engine (the default `RestServer` host) the door already answered 409. No gate reads the claim comment's line (the queue and level gates read this body and the changesets), so the claim comments were not amended. - The in-process readers already handle the refusal: the packaged-permission-set lock gate and the security catalog echo catch a 409 naming package candidates and read each holder at its package (ADR-0150 D4, objectstack-ai#31698). - `git merge-tree --write-tree --name-only` of this head against the open PRs sharing a file and `origin/main`: objectstack-ai#33898 (`64c5d88452`, shares `protocol.ts` and `meta-qualified-item-read.test.ts`), objectstack-ai#33889 (`bdb3a20a71`, shares `meta-disabled-holder-served-stack.test.ts`) and `origin/main` (`895783a1e8`) each exit 0, no conflicted path. objectstack-ai#33898's `protocol.ts` hunks sit near lines 322 and 7089; the docblock here is near line 4205. ## Verification <details><summary>REST /published FROM and TO (review-b F1), measured at e516f35</summary> A throwaway probe beside the REST pins, not committed. It used the same real protocol and real `SchemaRegistry`, with two packages registering the dashboard `sales`, `GET /meta/dashboard/sales/published` naming no package, both registration orders. TO is the head as built. FROM is the head with `getMetaItemLayered`'s resolver call ablated (`ablation-replace` landed, the marker present in 2 built files, then restored: blob equal to HEAD, marker absent from all 24 built files). | composition | FROM | TO | |---|---|---| | engine wired (`objectQLProvider`) | 409 `RESOURCE_CONFLICT`, `details` null | 409 `RESOURCE_CONFLICT`, `details` null | | no `objectQLProvider`, no metadata service | 501 `NOT_IMPLEMENTED` ("Nothing is runtime-published for this item, and this kernel has no code/package store …") | 409 `RESOURCE_CONFLICT`, `details` null | | no `objectQLProvider`, the protocol's service holding a copy of the first holder (two shapes) | 501 `NOT_IMPLEMENTED` (the REST host resolves no metadata service of its own) | 409 `RESOURCE_CONFLICT`, `details` null | The FROM on a host whose REST metadata service has `getPublished` (the service's answer, served 200) was NOT MEASURED. The probe shape for it, which stubs the host's `resolveMetadataService`, never got the verify lock: four 540 s waits behind pid 16926, a `pnpm --filter @objectstack/dogfood exec vitest run --maxWorkers=1` holding over 60 minutes. That row is read from the tree (`meta-item-history-routes.ts`, the fallthrough after the overlay read). Each VERDICT command-exit 0. </details> <details><summary>REST /published with a package-unbound active row (review#2 S3), measured at 9dd398c</summary> A throwaway probe beside the REST pins, deleted and never committed. Same real protocol and `SchemaRegistry`. A package-less `saveMetaItem` stores the dashboard `sales` as a package-unbound active row (`[sales, null, active]`). Then two packages register `sales` in code, both registration orders, and the RestServer has no `objectQLProvider`. TO is the head as built. FROM is the head with the resolver call ablated: the marker was present in 2 built files, then restored, with the blob equal to HEAD and the marker absent from all 24 built files. | door | FROM | TO | |---|---|---| | `GET /meta/dashboard/sales/published` | 200, the package-unbound row (`env row`) | 409 `RESOURCE_CONFLICT`, `details` null | | `GET /meta/dashboard/sales` (plain read) | 409 with `details.candidates` naming both | the same | VERDICT command-exit 0. The dispatcher rows are read from the tree, not measured. </details> <details><summary>Dogfood battery, on fa7fb66</summary> Built `@objectstack/dogfood^...` (turbo, VERDICT command-exit 0), then under the lock `pnpm --filter @objectstack/dogfood test` with no `OS_TEST_SHARD` and no path: VERDICT command-exit 0, Test Files 467 passed, 3 skipped (470); Tests 3959 passed, 42 skipped (4001). The final head adds only the `protocol.ts` docblock commit; the emitted JS differs from `fa7fb66a7c`'s in comment lines alone, so the battery reading covers the head's executable bytes. The final head adds a changeset edit and the 4-line `@throws` docblock, again comment-only. </details> <details><summary>Packages, on head 6e50dbd (before merging main) and on 02d6109 (after it)</summary> On `6e50dbd5c7`, under the verify lock (VERDICT command-exit 0): typecheck and test green for metadata-protocol (22883 passed), rest (8451), runtime (10874), plugin-security (6681), objectql (13110), service-automation (3976), client (812), cloud-connection (1217), plugin-auth (5465), plugin-email (1018), service-messaging (966), service-package (144), plugin-dev tests (89). organizations, plugin-approvals, verify, cli and three typechecks went red there on `Cannot find module` / `Failed to resolve entry` for packages this worktree had not built (build state, not this diff). On `02d6109dde` (one merge of `origin/main`, no conflict, no touched file moved upstream), after building the whole closure of those packages (turbo exit 0), under the lock (VERDICT command-exit 0): the targeted files rest 62/62, metadata-protocol 3/3, runtime 367/367; typecheck green for all 17 packages (metadata-protocol, rest, runtime, plugin-security, objectql, service-automation, client, cloud-connection, organizations, plugin-approvals, plugin-auth, plugin-dev, plugin-email, service-messaging, service-package, verify, cli); tests green for service-automation (3977), organizations (252), plugin-approvals (1652), plugin-dev (89), verify (439), cli unit (6000). </details> <details><summary>Gates</summary> The derived set (`dispatch-gates.mjs --commands`, 70 commands) ran on `d0a5dbd220`: 67 exit 0. `check:test-source-alias` was red on a runtime pin file this PR edits (a dynamic `@objectstack/metadata` load in a clocked window); fixed in `6e50dbd5c7` (module-top import), re-run exit 0. `check:dual-build-cjs-loads` and `check:type-check-debt`: PREREQUISITE NOT MET locally (no full build; the lock queue), so NOT MEASURED here; CI runs both. PR body gates on this body: closing-keyword-parity, partof-closing-keyword, changeset-no-major and adr-0087-registration exit 0. ESLint on the changed files exit 0. The union on the final head is cited in the report on objectstack-ai#32622. On `e516f3534b`, re-derived (74 commands, the `protocol.ts` touch adds `check:adr-symbol-anchors`, `check:facade-delegation-only`, `check:filter-alias-parity`, `check:wildcard-fallthrough`): 73 exit 0; `check:type-check-debt` exit 3 PREREQUISITE NOT MET (its build lost the lock queue), NOT MEASURED, CI runs it. `dispatch-gates --ran`: 74 accounted, 73 run, 1 NOT-MEASURED, 0 UNRUN. `check-platform-checklist --changed-from origin/main` exit 0. On this body: changeset-no-major (LEVEL AXIS reads `no (narrowing)` + `none` at patch), adr-0087-registration (1 declared-breaking changeset, `not-required (no-migration-prescription)`), closing-keyword-parity and partof-closing-keyword exit 0. On the final head `e57e7c0566` (the `/published` banner row and the `@throws` docblock): the 74 derived commands again gave 73 exit 0, with `check:type-check-debt` exit 3 PREREQUISITE NOT MET, so NOT MEASURED. `--ran` accounted for 74 (73 run, 1 NOT-MEASURED, 0 UNRUN). `check-platform-checklist --changed-from origin/main` exit 0. Changeset gates (adr-0087-registration, changeset-no-major, empty-changeset, changeset-fixed, nul-bytes) exit 0. `git merge-tree --write-tree --name-only` against `origin/main` `e71ecc1b32` exit 0, so it still merges clean now that objectstack-ai#33898 is merged; objectstack-ai#33889 `bdb3a20a71` exit 0. CI `Test Core (3/8)` on `e57e7c0566` failed twice: run 43743965993, job 132903743253, and the lane's one re-run, job 132914286588. Both times the only failed task was `packages/qa/scenarios` `run-date.test.ts`, on vitest's 5000 ms timeout. The first run failed `2028-03-31` at 6278 ms. The re-run failed `2028-02-28` at 5619 ms and `2028-02-29` at 6907 ms, while `2028-03-31` passed there at 4615 ms. A different case each time, and no assertion failed. The test imports only `@objectstack/spec` and the scenarios package's own sources, which this diff does not touch. The same file failed the same way on `main` without this PR: the merge-queue run of the unrelated objectql-only objectstack-ai#33902 (run 43747969462, job 132917233366, Test Core 4/8) failed `2028-02-28` at 5719 ms. `main`'s push run does not run scenarios at all (affected-only shards). Locally, on the branch merged with `origin/main` at `9dd398cda0`, the file passed 3 of 3 runs (34/34 each, about 5.4 s of tests). The scenarios closure is byte-identical to `main` there (`git diff origin/main -- packages/qa/scenarios packages/spec docs/qa` is empty). Read: a load timeout that is `main`'s, not this PR's. No rerun from here. On the final head `a2b29893d0`, two merges of `origin/main` landed, both clean. `9dd398cda0` came first. `a2b29893d0` contains objectstack-ai#34104 (`e9fb09871d`), the fix for those run-date timeouts (p0 objectstack-ai#34081). Under the lock, at that head: - build closure exit 0; - targeted pins: metadata-protocol 3/3, rest 389/389 (the S1 describe included), runtime 421/421, scenarios `run-date.test.ts` 35/35; - typecheck exit 0 for metadata-protocol, rest and runtime. Between the two merges, the runtime typecheck went red once, on `meta-object-publish-column-changes.test.ts` (`TursoDriver` not assignable to `SqlDriver`). The cause was build state: `@objectstack/driver-turso` is a peer dependency, so it is outside `runtime^...`, and its `dist` was older than `driver-sql`'s. It went green once `driver-turso` was built. Derived gates on that head: - 75 commands, 74 exit 0; - `check:type-check-debt` exit 3 PREREQUISITE NOT MET, so NOT MEASURED; - `--ran` exit 0; - `check-platform-checklist` exit 0; - changeset gates exit 0; - `git merge-tree` against `origin/main` `bf594ebd72` exit 0. </details> --- _Generated by [Claude Code](https://claude.ai/code/session_01QsR2jTkZnXtRhuEiiyidvJ)_ 🤖 Generated with [Claude Code](https://claude.com/claude-code) <!-- signed: domain:server#5 · zhuangjianguo · session_01QsR2jTkZnXtRhuEiiyidvJ --> --------- Co-authored-by: Claude <noreply@anthropic.com>
Requested by Steedos · project thread
Fixes #33507
Part of #33670
Clause-②: no
Metadata-protocol: none
维护者速读
Bare-name conflict与启动告警)给出的原因句,对已按命名空间收窄的类型改为说明新规则;另改 hook-binder 一段过时注释。NAMESPACE_CONFLICT与 422 状态都不变;回滚即撤销本 PR。packages/objectql/src/bare-name-one-holder.ts的bareNameReason;其次registry-bare-name-one-holder-ai-family.test.ts里模拟未收窄类型的新用例。pnpm --filter @objectstack/objectql exec vitest run --maxWorkers=2 src/registry-bare-name-one-holder-flow-family.test.ts,预期全绿,其中 flow 的原因句整句命中新文案。What changes
bareNameReason(packages/objectql/src/bare-name-one-holder.ts) branches onisNamespaceScopedBareNameType. A narrowed type is told its rule: "A flow holds one name per namespace: a package of another namespace may ship the same name, but within one namespace, or beside a package that declares no namespace, a name has one holder, and a bare name two holders share is refused naming both." A type not yet narrowed keeps today's one-name-per-deployment sentence with its consumers' clause; a list carrying both gets one sentence per rule, narrowed first. The doors' refusal and the cold-boot warning (registry.ts, untouched) both read this one function.NAMESPACE_SCOPED_BARE_NAME_TYPESholds all 13 covered types (BARE_NAME_ONE_HOLDER_TYPES), connector included since PR feat(service-automation)!: two packages of two namespaces may each declare a connector of the same name (ADR-0150 child B, the narrowing) #33431. So no real type reaches the per-deployment sentence today; the branch is kept per the card's ruling and core's documented path (a type joining the covered list keeps one holder per deployment until its own narrowing lists it).packages/objectql/src/hook-binder.ts: the function-bind comment no longer says the refusal "stays until the trailing backstop child (ADR-0150 D9) narrows it". It says what happens now: the rule is narrowed to the namespace,claimBareNameFunctionsthrows after the seal, the throw is not caught in the binder, and the runtime'sbindAppArtifactHandlerscatches it per owner group and logs aterror, leaving that group's functions and hooks unbound. Comment only; no bind behaviour changes. Item 2 (registry.tsbareNameColdBootWarning) stays open on objectql: hook-binder and the bare-name cold-boot warning still say a clashing function name is refused; the bind fails and the owner group stays unbound #33670..changeset/33507-bare-name-reason-namespace.md,@objectstack/objectqlpatch.Tests
registry-bare-name-one-holder-{ai,flow,request}-family.test.ts, describe retitled "states the rule of the types it lists").bareNameReason(['flow'])pinned as the whole sentence, plusbareNameReason()(every covered type) never says "one name per deployment" or "chosen by registration order".toolas not narrowed throughvi.doMock('@objectstack/core')on a fresh module copy and pins the per-deployment sentence, and the two-sentence order for a mixed list.Bare-name conflictprefix), so none moved.Update at 3036245
.changeset/33507-bare-name-reason-namespace.mdgains one sentence. For an email template, the reason also names, after "save the exceptions below", the two holdings that still meet whatever the namespaces: a platform-requested bare name (theauth.*mails) keeps one holder per deployment, and a dependent package's addition to its base's template is refused as before. The wording matchesbareNameReason. No code change.check-changeset-no-major,check-empty-changeset(and its--self-test),check:changeset-gate-self-tests,check:doc-authoring,check-adr-0087-registrationandcheck:nul-byteseach exit 0.Update at 8284267
Review-a (comment 6895373233) must-fix 1, route (a). The delta changes
packages/objectql/src/bare-name-one-holder.tsand adds pins toregistry-bare-name-one-holder-flow-family.test.ts.registry.tsis untouched.PLATFORM_REQUESTED_BARE_NAMES_BY_TYPE, asbareNameHoldersMeetasks it). The other is a bundle addition (isBundleAdditionPair, for a type keyed by anITEM_KEY_DISCRIMINATORSentry). Today both apply toemail_templateonly.crossNamespaceExceptionClauses(type), reads the same tables. When a listed narrowed type has either exception, the narrowed sentence says "may ship the same name, save the exceptions below". It is followed by: "For an email template, whatever the namespaces: a name the platform requests by its bare spelling ("auth.password_reset", "auth.verify_email", "auth.magic_link", "auth.invitation", "auth.account_invitation", "auth.two_factor_otp", "auth.email_change_notice" and "auth.existing_account_sign_up") keeps one holder per deployment and a package that depends on the name's holder (which does not depend on it back) and ships the name only in locales the holder does not ship is refused as an addition to the holder's email template." A type with neither exception (the flow, for example) keeps the sentence unchanged.auth.password_resetasserts the qualified claim and the platform-requested clause. The bundle addition's package-door refusal asserts the qualified claim and the addition clause.scripts/ablation-replace.mjs, each "ok mutation landed", then "ok restored: blob == HEAD (e72188996ac0) andgit diff HEADis empty":expected 'Bare-name conflict: package "com.acme…' to match /For an email template, whatever the n…/.expected 'Bare-name conflict: package "com.acme…' to contain 'a package that depends on the name\'s…'.hook-binder.test.tsgave Test Files 5 passed and Tests 366 passed; objectql typecheck exit 0;pnpm lintexit 0. Derived gates: 67 derived; the 65 run locally all exited 0.check:type-check-debtran under the lock and exited 0.check:dual-build-cjs-loadswas left to CI.typecheck-workspaceascancelled. That lane logged "The operation was canceled." at 13:59:03Z, 13 s after the push of 8284267 started new runs (13:58:50Z). The cause was the cancel of a superseded run, not this diff.Acceptance notes
CONSUMER_CLAUSEis now read only by the per-deployment branch, so on main it is unreachable from a real type. Kept with the branch.Verification
Readings on objectstack-ai/objectstack. Tests and typecheck re-run on the merged head
f1706ea92(origin/main 45dee17 merged in); the gate sweep ran onfe90b7362(same diff before the merge, derivation identical on both), with the ratchet and changeset gates re-run onf1706ea92.objectql suite and typecheck
pnpm --filter @objectstack/objectql test(fe90b73): Test Files 596 passed (596), Tests 13138 passed (13138), exit 0.pnpm --filter @objectstack/objectql typecheck: exit 0 on fe90b73 and on f1706ea.hook-binder.test.ts: Test Files 5 passed (5), Tests 366 passed (366).git grepover packages for the old and new phrases). Spot check@objectstack/cloud-connectionmarketplace-install-local-bare-name-conflict.test.ts: 11 passed. The other dependents' suites are left to CI's Test Core.Ablation (the narrowed-type pin)
node scripts/ablation-replace.mjsonbare-name-one-holder.ts, the two filter lines replaced bynarrowed = []andperDeployment = listed(every type gets the old sentence back): "ok mutation landed: anchor 1 -> 0". Three family files: Tests 5 failed, 245 passed. One failure readsexpected 'A flow holds one name per deployment:…' to be 'A flow holds one name per namespace: …'. Restore: "blob == HEAD (f94389afc112) andgit diff HEADis empty". A first ablation emptied both filters, so the function returned an empty string, not the old sentence. It also went red (5 failed), but it did not test the intended mutation, so it is not counted.Gates
dispatch-gates --ran: 67 derived, 66 run, each with exit code 0, 0 NOT-MEASURED. 1 UNRUN:pnpm check:dual-build-cjs-loads, left to CI.pnpm lint: exit 0.node scripts/check-nul-bytes.mjs: exit 0.!in the title and no(narrowing)arm, so the full battery is not run. No dogfood pin quotes the reason.🤖 Generated with Claude Code
https://claude.ai/code/session_01QsR2jTEivi2wogPpeo3xd5