Repository navigation
fix(objectql, runtime): a function's bare-name record follows its holders — a re-bind releases the old owner's claim with the function, and the one remaining holder answers the bare read - #32877
Conversation
…ders A re-bind of a multi-package artifact releases the old owner's bare-name claim on a function it moves to another owner, or drops with a package body (SchemaRegistry#releaseBareNameFunctions), so the gaining owner's bind is not refused after the cold-boot seal. When the last registration of a function name leaves and exactly one holder remains, the bare read answers that holder. Claude-Session: https://claude.ai/code/session_01L6bhgTAAvx8zsU1YcVseLQ Co-authored-by: Claude <noreply@anthropic.com>
… source types it Claude-Session: https://claude.ai/code/session_01L6bhgTAAvx8zsU1YcVseLQ Co-authored-by: Claude <noreply@anthropic.com>
📓 Docs Drift CheckThis PR changes 2 package(s): 5 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:
⛔ 2 release-owned page(s) also name something this change touched. These are read-only:
What this run could not see
Coarse fallback — 39 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 988bb27b8603904a3c4623cf6b204a8c299c81a5 && git checkout 988bb27b8603904a3c4623cf6b204a8c299c81a5
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin c1a645e2f0b7bdb124c10ae969ff631ff55bb5e9 342fa08f6d1bc79834ba92a146f11638d43cf934 && git checkout -B drift-repro c1a645e2f0b7bdb124c10ae969ff631ff55bb5e9 && git merge --no-ff 342fa08f6d1bc79834ba92a146f11638d43cf934
node scripts/docs-audit/affected-docs.mjs --json c1a645e2f0b7bdb124c10ae969ff631ff55bb5e9
|
|
domain:server#4 · os-sales · session_01L6bhgWRcTEB3toGxnWvuvX Contract-review-claim: session_01L6bhgWRcTEB3toGxnWvuvX · head bc9dbb6 · 2026-11-12T22:53Z Generated by Claude Code |
|
domain:server#4 · os-sales · session_01L6bhgWRcTEB3toGxnWvuvX Contract reviewServed-tier: ① Derived judgments
Findings:
② Semver level
③ Boundary flags
Implemented-by: VERDICT: PASS Generated by Claude Code |
…he same name; mark the platform-plus-package pin as current behaviour Contract review S1: every release pin released a name only the releasing owner claimed, so a release that dropped the name's whole claimant set passed them all. The new CONTROL has two namespaces' packages claim one function name after the seal, releases one, and holds the other's co-owner refused naming the remaining holder (ablation: drop the whole set is red, 1 failed / 65 passed). Contract review S2: the platform beside one package answering nothing is today's behaviour, not the rule (ADR-0150 D4 would refuse the pair). The pin is marked current behaviour pending that ruling, and the changeset no longer states it as the rule. Claude-Session: https://claude.ai/code/session_01L6bhgTAAvx8zsU1YcVseLQ Co-authored-by: Claude <noreply@anthropic.com>
… at the card that aligns it with D4 The epic seat filed the alignment as its own card instead of a pending ruling, so the CONTROL reads "current behaviour, see #32907" and the changeset sentence names that card. Claude-Session: https://claude.ai/code/session_01L6bhgTAAvx8zsU1YcVseLQ Co-authored-by: Claude <noreply@anthropic.com>
|
domain:server#4 · os-sales · session_01L6bhgWRcTEB3toGxnWvuvX Contract reviewServed-tier: ① Derived judgments
Findings on the delta:
② Semver level
③ Boundary flags
Implemented-by: VERDICT: PASS Generated by Claude Code |
|
epic:#31527#1 · os-sales · session_01L6bhgUH9QaHo2KBECU6SVN Epic red-line read · 2026-11-12T23:55ZHead-sha: Verdict: NO PASS. One code must-fix, F1, to be fixed in this PR (epic seat's ruling). Everything else holds. PR #32877 (card #32534 with folded #32639, ADR-0150 D4). First read. Read whole: the PR body, the card, os-dev-report 6838125295, contract reviews 6838451475 (PASS, on bc9dbb6) and 6838714425 (PASS, delta on this head), card #32907. The one merge of main (5c0f113, merge commit c43f611) has an empty remerge-diff. Everything below is measured in my own worktree at this head unless it says "read". FROM means the four production files as on merged main 5c0f113, with the objectql dist rebuilt outside turbo; TO means this head. Touched test files at head: objectql Red line 1 — resolution is not loosened: holds except F1
Red line 2 — ambiguity is reported, never guessed
Red line 3 — independently releasable
Every ablation went through Must-fix (code; fixed in this PR, per the epic seat)
The epic seat's rulings on the other open points
Nits (follow-up card, no extra round)
Pre-existing, for the seat to route
Generated by Claude Code |
…'s package no longer holds Red-line read F1: the re-bind released the binder's record of its last bind, while the engine's removal it follows is by the exact owner string (app:<id>). A function the host also registered for the package under its bare id stayed held, yet its claim was dropped, so a bind refused on main was admitted and two packages of one namespace then held the name. SchemaRegistry#releaseBareNameFunctions(owner, stillHolds) now walks the package's function claims and releases each name stillHolds says it no longer holds. The runtime binder asks the engine's holder set right after the removal (and, for a moved function, after what the old owner keeps is registered again). The same rule closes contract review S3: a name an earlier bind gave the owner that left with the removal is released too. Claude-Session: https://claude.ai/code/session_01L6bhgTAAvx8zsU1YcVseLQ Co-authored-by: Claude <noreply@anthropic.com>
…ame an earlier bind gave it Without a hook of its own beta left the bind and the case ran through the dropped-body teardown; with one it goes through releaseMovedFunctions, and its kept name holds its claim (CONTROL). Claude-Session: https://claude.ai/code/session_01L6bhgTAAvx8zsU1YcVseLQ Co-authored-by: Claude <noreply@anthropic.com>
|
domain:server#4 · os-sales · session_01L6bhgWRcTEB3toGxnWvuvX Contract reviewServed-tier: ① Derived judgments
Findings on the delta:
② Semver level
③ Boundary flags
Implemented-by: VERDICT: PASS Generated by Claude Code |
|
epic:#31527#1 · os-sales · session_01L6bhgUH9QaHo2KBECU6SVN Epic red-line delta read · 2026-11-13T00:57ZHead-sha: Verdict: PASS-with-nits. F1 is closed, and S3 is closed by the same rule. No must-fix. The nits go to the follow-up card; N5 is a pin gap with a measured composition. PR #32877 (card #32534 with folded #32639, ADR-0150 D4). Delta read after red-line read 6839471011 (NO PASS on F1, at 8564eaa). The hop is two commits, 658dc99 and 0c9fad9, with no merge of main. Read: the diff of the two heads over the PR's files (five files, +197 −51) and the PR body, which equals the r4 draft. The PR and the card carry no new comment since the first read. Everything below is measured in my own worktree at this head unless it says "read". Three states are compared:
For MAIN and PREV the objectql dist was rebuilt with the package's own build, never turbo. Touched test files at head: objectql What the hop changes (read)
Red line 1 — resolution is not loosened: holdsF1 is closed.
S3 is closed. After three binds, no claim stays for a name its owner no longer registers.
Totals at head, over the 114 name cells of the new probe (54 compositions, one later bind attempt per cell):
Nothing else moves against 8564eaa. The first read's saved probes, re-run at HEAD and compared with their saved 8564eaa output:
Red line 2 — ambiguity is reported, never guessed: holds
Red line 3 — independently releasable: holds
Must-fixNone. Nits (follow-up card, no extra round)
Carried, unchanged by this hop
Generated by Claude Code |
… with the removal Red-line delta read N6: the claim release covers a function bound under the old owner's app: owner outside the artifact's binder as well as one an earlier bind of the artifact gave it; the changeset now says both, with the FROM and TO. Claude-Session: https://claude.ai/code/session_01L6bhgTAAvx8zsU1YcVseLQ Co-authored-by: Claude <noreply@anthropic.com>
|
epic:#31527#1 · os-sales · session_01L6bhgUH9QaHo2KBECU6SVN Epic red-line text re-read · 2026-11-13T01:00ZHead-sha: Read: the one commit since 0c9fad9. It changes the changeset only (1 line) and touches no source or test file. Also read: row 8 and the F1 / S3 acceptance note in the body's next revision, which 席 C prepared for the PR.
Still on the follow-up card, as ruled: N5 (the moved path's ask order has no pin), N2, N3, and the pin-label and A4-count nits. Generated by Claude Code |
|
domain:server#4 · os-sales · session_01L6bhgWRcTEB3toGxnWvuvX Contract reviewServed-tier: ① Derived judgments
② Semver level
③ Boundary flags
Implemented-by: VERDICT: PASS Generated by Claude Code |
Claude-Session: https://claude.ai/code/session_01L6bhgTAAvx8zsU1YcVseLQ Co-authored-by: Claude <noreply@anthropic.com>
…ond) Claude-Session: https://claude.ai/code/session_01L6bhgTAAvx8zsU1YcVseLQ Co-authored-by: Claude <noreply@anthropic.com>
|
domain:server#4 · os-sales · session_01L6bhgWRcTEB3toGxnWvuvX Regen-provenance: 6840603250 · 398a221 → 342fa08 · diff of Read at 2026-11-13T03:15Z. The head moved by two merges of Generated by Claude Code |
|
domain:server#4 · os-sales · session_01L6bhgWRcTEB3toGxnWvuvX 席位核对 — ACCEPT ·
|
…lling" in the released objectstack-ai#32877 CHANGELOG entries (objectstack-ai#33446) <!-- claude-projects-attribution: {"github_login":"os-elon-musk"} --> _Requested by **Elon** · [project thread](https://claude.ai/code/project/chan_01WedDzV26nniwxv7jC88B9D?thread=cmsg_01WedDzV26nniwxv7jC88B9DDwkEEJd65kqFZGFjQnzBQt)_ Refs objectstack-ai#32910 (D2-N2 wording; the pins land in objectstack-ai#33439) Area-lease pilot objectstack-ai#33059 · area E2b · seat `domain:server#5` · os-elon-musk · session_016WV4cz4f7zEQZ2C9GTG382 ## What changes The released 18.4.0 entries for PR objectstack-ai#32877 (a re-bind takes the old owner's bare-name claim off with the function) in `packages/objectql/CHANGELOG.md` and `packages/runtime/CHANGELOG.md` say: > So a name the package still holds under another owner spelling (its bare id) keeps its claim … Both now read: > So a name the package still holds **in the engine's holder set** under another owner spelling (its bare id) keeps its claim … Docs-only. No code, no test, no changeset. ## Why objectstack-ai#32910 D2-N2 (epic red-line delta read 6840550973): whether the package "still holds" the name is read from the engine's holder set, and with the two owner spellings registered in the other order the shared holder entry is replaced first and the claim is (correctly) freed. objectstack-ai#32910 asked to qualify the changeset-level wording; that changeset has been consumed by the 18.4.0 release, so per AGENTS.md (RELEASE-OWNED, `packages/*/CHANGELOG.md`) the released entries are amended in a dedicated docs-only PR. ## Verification - `git diff origin/main` — two lines, the same five-word insertion in each entry. - `git grep "another owner spelling" origin/main` finds only these two entries. Clause-②: no Metadata-protocol: none ## Human Minimum - [x] 1. Schemas start as Zod; `packages/spec` holds no runtime logic. (n/a) - [x] 2. Every name I added uses the casing for its kind. (n/a) - [x] 3. No formatter ran; `pnpm lint` passes. - [x] 4. One issue, one branch off an up-to-date `main`, one pull request. - [x] 5. A change that publishes carries a changeset — n/a, docs-only amendment of released entries (`skip-changeset`). - [x] 6. `packages/spec` touched: n/a. - [ ] 7. No hand edits to `packages/*/CHANGELOG.md` — deliberate exception: AGENTS.md's dedicated docs-only amendment of a released entry. - [x] 8. Title, body and comments are in English. - [x] The *Before Submitting* list in CONTRIBUTING.md is done. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_016WV4cz4f7zEQZ2C9GTG382 Co-authored-by: Claude <noreply@anthropic.com>
…g both when the platform and a package hold the name, and answers nothing for a name only a disabled package holds (ADR-0150 D4) (objectstack-ai#33439) <!-- claude-projects-attribution: {"github_login":"os-elon-musk"} --> _Requested by **Elon** · [project thread](https://claude.ai/code/project/chan_01WedDzV26nniwxv7jC88B9D?thread=cmsg_01WedDzV26nniwxv7jC88B9DDwkEEJd65kqFZGFjQnzBQt)_ Fixes objectstack-ai#32907 Fixes objectstack-ai#32933 Fixes objectstack-ai#32910 Clause-②: no (narrowing) Metadata-protocol: none Skills-docs: none — `skills/**` and `content/docs/**` name neither `resolveFunction`/`resolveFunctionEntry` nor `resolvePackageScopedFunction`, and teach no function name held by the platform beside a package or by a disabled package; the prescription ships in the changeset's BREAKING paragraph. ## 维护者速读 1. 改了什么:不带包名按名读函数(`resolveFunction` / `resolveFunctionEntry`,以及无调用包的 `resolvePackageScopedFunction`)时,平台(无主注册)与一个包同持一个名字,一律 409 点名双方,不再按注册先后答其一;只有已停用包持有的名字不再答该包的函数(停用包仍计为持有者,照样参与歧义判定)。运行时重绑从持有者集读回保留函数,不再走裸读。另补 objectstack-ai#32910 的四组运行时钉子。 2. 为什么改:ADR-0150 D4 规定无包调用方在平台+包同名时应被拒并点名双方,原实现只数包,按先后答或答空;ruling A(6824698376)要求停用包"计为持有者、永不被解析到"。 3. 风险与回滚:只收窄(Clause-② no (narrowing),标题带 `!`),原先被拒的一律仍拒,无任何放宽;仍会答的:单一启用包、仅平台、调用方自身包。第一方:仓内无平台与包同名的函数注册(见 Acceptance notes)。回滚即还原本 PR。 4. 先看:`packages/objectql/src/package-scoped-resolver.ts` 的 `callerlessFunctionResolution`;`packages/objectql/src/engine-hooks-and-functions.ts` 的 `bareFunctionEntry`;`packages/runtime/src/app-artifact-handlers.ts` 的 `releaseMovedFunctions` 中 `bare:` 一行。 5. 两分钟验证:`pnpm --filter @objectstack/objectql exec vitest run src/registry-bare-name-one-holder-request-family.test.ts`,预期 78/78 绿;其中 `[objectstack-ai#32907]`、`[objectstack-ai#32933]` 两组在 main 上 5 条红。 6. 需要你做的:裁定 objectstack-ai#32933 的读法(见 Acceptance notes 的 needs_decision:本 PR 实施"计数不解析",另一读法"只数在用持有者"会放宽两个格子)。 ## What changes The engine keeps every holder of a function name: each package that registered one, and the platform for a registration under no package (`ObjectQL#functionHoldersOf`). A read that names no package resolves the name by ADR-0150 D3 over those holders. 1. **objectstack-ai#32907 — the platform beside a package is two holders.** `bareFunctionEntry` (`packages/objectql/src/engine-hooks-and-functions.ts`, the body of `ObjectQL#resolveFunction` / `resolveFunctionEntry`) now always runs the rule (`resolvePackageScopedHolders`, caller with no package) over the holder set, platform included. Before, it consulted the rule only when two PACKAGES held the name, and otherwise answered the bare map's last registration, so the platform plus one package answered by order (the package's entry, or the platform's when it registered last) or nothing after a third, last-registered package left. Now every one of those cells is `409 RESOURCE_CONFLICT`, reason `ambiguous-in-environment`, candidates `[package, platform]` — the same refusal the caller-less `resolvePackageScopedFunction` already answered, so the two reads agree. When the rule resolves (one holder), the answer is still the bare map's entry, the same entry object, so the one-holder answer is unchanged byte for byte. PR objectstack-ai#32877's CONTROL pin for this row is flipped to the verdict. 2. **objectstack-ai#32933 — a disabled package is counted, never resolved to.** New `callerlessFunctionResolution` (`packages/objectql/src/package-scoped-resolver.ts`, not re-exported from the package entry) post-filters the rule's answer for a caller with no package: when the rule picked a package as the environment's unique holder (`via: 'unique-holder'`, the step only a caller with no package reaches) and the registry says that package is disabled (`SchemaRegistry#isPackageDisabled`), the answer is `not-found`. Both the bare read and `resolvePackageScopedFunction` apply it. Refusals are computed over EVERY holder, the disabled one included, so a disable never turns a refused name into an answer. A caller naming its own package, a caller's closure step, the platform's item and every refusal pass through unchanged. The every-holder doors (the hook binder's bind after the seal, `claimBareNameFunctions`; the cold-boot seal, `sealBareNameHolders`) read the registry's claims, which never looked at enablement; they are pinned, not changed. 3. **Runtime re-bind — read the kept entry off the holder set.** `releaseMovedFunctions` (`packages/runtime/src/app-artifact-handlers.ts`) read the bare slot of each kept name through `resolveFunctionEntry`. With (1) that read throws for a name the platform holds beside the package — aborting the re-bind's teardown — and with (2) it answers nothing for a disabled package, which would drop the owner spelling the package held a kept function by. For a name the package alone holds the bare slot IS the package's holder entry (one entry object in both maps), so the binder now uses that entry; the two-package case (`packageHolders.length > 1`) is unchanged. 4. **objectstack-ai#32910 — runtime pins only** (no code): the re-bind before the seal (N4), the move path's ordering CONTROL (D2-N1), the other owner-spelling order (D2-N2). No `packages/objectql/src/registry.ts` symbol is changed (`registry_symbols`: none). No export is added; `engine.ts` changes docblocks only. ## Tests Pins, numbered for this PR (no numeral lives in the files; the skipped (iii) of objectstack-ai#32910's "Numbering" item was in PR objectstack-ai#32877's body only, so there is nothing to renumber in the file): - objectql `src/registry-bare-name-one-holder-request-family.test.ts` - (i) flipped: `[objectstack-ai#32534] … the platform and one package remain after the last-registered package leaves … (FROM nothing TO 409)` — was the CONTROL "current behaviour, see objectstack-ai#32907". - (ii) `[objectstack-ai#32907] … the package registered last (FROM the package's entry TO 409)`. - (iii) `[objectstack-ai#32907] … the platform registered last (FROM the platform's entry TO 409)` — the platform-last-registrant cell. - (iv) `[objectstack-ai#32933] a name only a disabled package holds: the bare read and the caller-less read answer nothing; enabled again, both answer it`. - (v) `[objectstack-ai#32933] counted: the platform beside a disabled package is still two holders`. - CONTROLs: the platform alone and one package alone answer; a caller package holding the name resolves its own beside the platform; the disabled package's own read resolves its own; two packages, one disabled, stay refused naming both; after the seal a co-owner's bind of a name a disabled package holds is refused naming it; the cold-boot seal reports a co-owner clash with one holder disabled. - runtime `src/app-artifact-handlers.test.ts` - (vi) the teardown it.each gains a row: the platform holds the name beta keeps too — the teardown runs whole, the bare read is refused `[beta, platform]`. - (vii) N4, it.each moved / dropped: a re-bind before the seal releases the old owner's claim; the seal then reports no clash. - (viii) D2-N1 CONTROL: the move path releases after the old owner's kept functions are registered again — a function the new bind neither moves nor gives back keeps its claim. - (ix) D2-N2, it.each moved / dropped: the bare-id registration before the bind; the removal takes the entry the bind replaced it with and the claim is released. - (x) CONTROL: a disabled old owner keeps a kept function under the bare-id spelling it held it by, and its claim. The red-on-main reading and the ablations ran before the merge (the reading on `90423f6b`, every ablation on `e8106eb3`); the merge touched none of the files they read. Red on main / green after: (i)–(v) are red on `main`'s objectql sources and green on this head; every objectql CONTROL is green on both. (vi)–(x) pin behaviour `main` already has (the objectstack-ai#32910 rows are coverage of objectstack-ai#32534's release; (vi) and (x) guard the re-bind against this PR's engine change), so each is proven by its ablation instead. <details><summary>Red-on-main reading (objectql sources restored from df9fe94, test file at head)</summary> ```text pnpm --filter @objectstack/objectql exec vitest run --maxWorkers=2 src/registry-bare-name-one-holder-request-family.test.ts Tests 5 failed | 73 passed (78) x the platform and one package remain after the last-registered package leaves ... (FROM nothing TO 409) x the package registered last (FROM the package's entry TO 409) x the platform registered last (FROM the platform's entry TO 409) x a name only a disabled package holds: ... (FROM its entry TO nothing) x counted: the platform beside a disabled package is still two holders ... restore: git checkout HEAD -- (3 paths); git diff HEAD empty, git status clean ``` </details> <details><summary>Ablations — one per pin, each through scripts/ablation-replace.mjs (anchor hit x1, blob changed, restored to the HEAD blob, git diff HEAD empty)</summary> Neither suite reads a rebuilt `dist/` for the mutated file: the objectql file imports objectql `src/`, and every runtime mutation is in runtime `src/` (objectql `dist/` was built once from this head's objectql sources before the runtime runs). ```text A1 objectql bareFunctionEntry: hide the platform from the holder set ({ ...functionHoldersOf(name), platformItem: () => undefined }) -> 7 failed | 71 passed (78): (i) (ii) (iii) (v), plus the three platform CONTROLs (the platform-alone answer and the two objectstack-ai#32534 owner-less rows), which read the platform too A2 objectql callerlessFunctionResolution: return resolution unfiltered -> 1 failed | 77 passed (78): (iv) A3 runtime releaseMovedFunctions: read the bare slot through resolveFunctionEntry again -> 2 failed | 40 passed (42): (vi), (x) A4 runtime releaseFunctionClaims: return before releasing anything -> 10 failed | 32 passed (42): (vii) x2, (viii), (ix) x2, (x), and the four objectstack-ai#32534 release pins A11 runtime releaseMovedFunctions: release right after the unregister, before the kept functions are registered again -> 1 failed | 41 passed (42): (viii) alone — the card's epic-read measurement (34/34 green under A11) closed ``` </details> ## Acceptance notes - **needs_decision — objectstack-ai#32933's reading.** objectstack-ai#32933 asks the bare and caller-less function reads to "answer from served holders only" (objectstack-ai#32497's default). objectstack-ai#32907's own constraint says "Ruling A 6824698376: a disabled package is still a holder" and "anything refused today stays refused", and ruling A says a disabled holder is "counted, never resolved to". The two readings agree on a name only a disabled package holds (nothing answers — implemented) and disagree on two cells: (a) two packages, one disabled; (b) the platform beside a disabled package. Served-only answers the enabled holder / the platform there, where today both are refused (409): a loosening. Per the dispatch's red line this PR implements the reading that never loosens — counted, never resolved to — and pins both cells refused. Alternative: served-only (drop disabled packages from `packageHolders` for these reads, keep the caller's own); cost one filter plus two pins flipped, and an explicit epic ruling that a disable may turn a refusal into an answer for functions. - **objectstack-ai#32910 D2-N2 wording.** "still holds under another owner spelling" ships in the released `packages/objectql/CHANGELOG.md` and `packages/runtime/CHANGELOG.md` entries of PR objectstack-ai#32877; qualifying it "in the engine's holder set" is a release-owned file, so it is owed as a dedicated docs-only PR, never this one. - **First-party exposure: 0 measured by source scan.** Outside tests, no first-party code registers an owner-less engine function: `ObjectQL#registerFunction` has one non-test caller, the hook binder, which passes the bind's `packageId`, and every first-party bind of functions is the app-artifact binder's, under `app:` plus the package id (the objectql plugin's `metadata-service` binds carry hooks, no functions). So no first-party name is held by the platform beside a package. A disabled package's function is reached by a caller-less read only when an environment-authored flow names it. ## Verification Head `d0af5314` (this branch's work on `df9fe946`, then `origin/main` at `b4624440` merged once before opening; the merge touched none of this PR's files). <details><summary>Local runs on d0af531 (objectql suite, typechecks and the two changed test files re-run after the merge, runtime's dependency closure rebuilt)</summary> ```text pnpm --filter @objectstack/objectql test 595 files, 12988/12988 passed (12972/12972 before the merge, on 039e6bb) pnpm --filter @objectstack/objectql typecheck exit 0 (tsc + check:test-typecheck: 39 files / 233 errors / 64 pinned, held) pnpm --filter @objectstack/runtime typecheck exit 0 (tsc + check:test-typecheck: 27 files / 183 errors / 66 pinned, held) pnpm --filter @objectstack/objectql exec vitest run src/registry-bare-name-one-holder-request-family.test.ts 78/78 pnpm --filter @objectstack/runtime exec vitest run src/app-artifact-handlers.test.ts 42/42 eslint --no-inline-config on the six changed source and test files exit 0 ``` </details> <details><summary>Derived gate families (dispatch-gates --commands on d0af531: 72 families, the same list as on 039e6bb) — reconciled with --ran: 72 run, 0 NOT MEASURED, 0 UNRUN</summary> ```text 72/72 exit 0 on d0af531, among them: check-adr-0087-registration --base origin/main (1 declared-breaking changeset, BREAKING+bang+clause-2-narrowing, not-required (no-migration-prescription)), check-changeset-no-major, check-empty-changeset, check:changeset-gate-self-tests, check:engine-double-contract, check:durability-log-level, check:startup-registry-verdict, check:lean-entry-closure, check:facade-delegation-only, check:nul-bytes, check:type-check-coverage, check:type-check-debt, check:test-source-alias, check:cross-package-test-inputs, check:doc-authoring, check:issue-citations, check:published-files, check:dual-build-cjs-loads. check-plugin-teardown-shape --self-test reads a fixture pinned to commit 621a487, outside the shallow clone: that one commit was fetched (depth 1) before the run. On 039e6bb (before the merge) 71/72 exit 0 and check:dual-build-cjs-loads exit 3 (PREREQUISITE NOT MET, unbuilt dist/). ``` </details> Declared to CI: the full runtime suite and its dependents (the addendum's scope: only the runtime file touched ran locally), the repo-wide `pnpm lint`, `test:repo`, and the full dogfood battery this `!` title owes (NOT MEASURED locally: the dependents' run holds the shared verify lock for about 90 minutes). Session: https://claude.ai/code/session_016WV4cz4f7zEQZ2C9GTG382 --- 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude <noreply@anthropic.com>
Requested by Sales · project thread
Fixes #32534
维护者速读
packages/runtime/src/app-artifact-handlers.ts的拆除段与releaseMovedFunctions;packages/objectql/src/registry.ts的releaseBareNameFunctions;packages/objectql/src/engine-hooks-and-functions.ts的unregisterFunctionsByPackage。pnpm --filter @objectstack/objectql exec vitest run src/registry-bare-name-one-holder-request-family.test.ts,预期全绿(含 objectql: a function's bare-name record follows its holders — a sealed re-bind releases the old owner's claim, and the last remaining holder answers the bare read (ADR-0150 D4; collects #32534 #32639) #32534 的 12 个新用例;runtime 另有 6 个)。Clause-②: yes (widening)
Metadata-protocol: none
What changes
The engine's function registry (
ObjectQL, the bare map plus the holder setfunctionHoldersOf, ADR-0150 D4) and the registry's one-holder rule (SchemaRegistry, the function claims the hook binder records) each keep a record of who holds a function name. Two of those records outlived the holding. This PR makes both follow the holders.SchemaRegistry#releaseBareNameFunctions(owner, stillHolds)(new,packages/objectql/src/registry.ts): releases the owner's package's claim, recorded byclaimBareNameFunctionsat the bind, on each function name it claims thatstillHolds(name)says it no longer holds. Only that package's claims go; each name it still holds and every other holder's claims stay. It judges nothing itself, sealed or not; an owner-less call releases nothing.packages/runtime/src/app-artifact-handlers.ts,releaseFunctionClaims) right after it removes functions from the engine, in both places a re-bind takes functions off an owner, and asks the engine's holder set (functionHoldersOf(name).packageItem(<package>)), never the binder's record of its last bind (red-line read 6839471011 F1, contract review S3):releaseMovedFunctions: after the removal and after what the old owner keeps is registered again, ahead of the gaining owner's bind (card acceptance (a));app-artifact-handlers.ts, only to call the release").app:<id>). So a function the host also registered for the package under its bare id stays held and keeps its claim, refused as on main (F1); and a function an earlier bind gave the owner that the last bind no longer named leaves with the removal and is released with it (S3).packages/objectql/src/engine-hooks-and-functions.ts,unregisterFunctionsByPackage): when the leaving package's registration was the bare entry and exactly one holder of the name remains, that holder's entry becomes the bare entry. Two or more remaining holders get no pick. An owner-less registration never leaves with a package, so it keeps its rules.engine.tsdocblock ofunregisterFunctionsByPackageupdated.Premises re-measured on
mainatc04aa295(scratch probes, not committed)sealBareNameHolders()(no conflict), bound again with a top-level hook namingqa_moving, which moves the function from beta to alpha:alpha, depends on alpha): the second bind logs[AppPlugin] Failed to bind declarative hooks :: Bare-name conflict: package "com.qa.bodies.alpha" … the function "qa_moving", already held by package "com.qa.bodies.beta";functionHoldersOf('qa_moving').packageHolders=[]; alpha's hooks do not fire (its other hookqa_alpha_otherincluded); the claims still name beta.[beta, alpha]while only alpha holds the function.qa_beta_fn, sealed, re-bound without beta: holders[], claims[beta], and a later bind ofqa_beta_fnby another package (no namespace) is refused namingcom.qa.bodies.beta.[alpha], claims[alpha]in all three modes; the dropped body's claims[]and the later bind admitted.registerFunction('f', …, { packageId: 'app:com.acme.alpha' }), then beta's, thenunregisterFunctionsByPackage('app:com.acme.beta'):functionHoldersOf('f').packageHolders=["com.acme.alpha"],resolveFunctionEntry('f')=undefined(no throw). Also measured: the platform's (owner-less) registration then beta's, beta leaves:undefined; platform + alpha + beta, beta leaves:undefined; alpha then the platform, alpha leaves: the platform answers. On this PR's head: alpha's entry; the platform's entry;undefined(unchanged, two holders); the platform (unchanged).FROM → TO (main
c04aa295→ this PR)bindAppArtifactHandlersre-bind after the cold-boot seal; a function moves from owner A to owner B, and the two meet under the rule (one namespace, or a body with no namespace read)NAMESPACE_CONFLICT(422) naming A, logged at error by the binder; B's hooks never bind; the moved function is held by nobodybindAppArtifactHandlersre-bind that drops a package body, after the seal'warn', the boot refused under'refuse')ObjectQL#resolveFunction/resolveFunctionEntryafterunregisterFunctionsByPackage: two packages held the name, the last-registered leftundefinedundefinedunregisterFunctionsByPackage(P)return value, when P is the remaining holder of row 5 and leaves later0(no bare entry left)1(the bare entry P held since row 5)app:<id>registrations held that the re-bind does not register again, after the seal, whichever way it was bound under that owner: an earlier bind of the artifact that the last bind no longer named (it stayed registered, replaced by name, as before), or a bind under that owner outside the artifact's binder (contract review S3; red-line delta read 6840550973 N6)Unchanged (each a CONTROL pin): the first-registered holder leaving (the last-registered answers); two package holders remaining (409 naming both); a one-holder name leaving (nothing answers); an owner-less registration over a package's (never leaves with it, still answers); the platform beside one package after the last-registered package leaves (two holders: nothing picked; current behaviour, not the rule, see #32907); a package's other claims and every other package's claims after a release; an owner-less release, and one whose package still holds every name; a moved or dropped name the old owner's package still holds under its bare id (the removal is by
app:<id>): its claim stays and the bind is refused naming it, as on main (red-line read F1; objectql (vii), runtime (vi), (vii)).When an outside package or the platform still holds a moved name, the rule is unchanged and acts on the new holder set (epic seat ruling on red-line read N1).
Red line 2, for the restore: the restore answers nothing by order. A restored bare entry is the only holder the name has; with two or more holders the bare map is left as it was (two packages refuse, naming both). The bare read as a whole still answers the platform beside one package by its last registration while that registration stays; that is older than this PR and #32907 carries it.
Reach: the re-bind rows need
bindAppArtifactHandlerscalled again with callables on a live engine (the exported binder, or a hot reload); the JSON install-local door carries no function. Production bare readers of the function map: one,releaseMovedFunctions, which reads it for a one-holder name only (git grepofresolveFunction/resolveFunctionEntryoutside tests). First-party exposure 0 (ruling 6829776521).Tests
Every pin and ablation below is measured on
0c9fad9f(the F1 and S3 fix,658dc995, and its pin fix-up); the two package suites on the same head.398a221achanges the changeset's wording only (red-line delta read N6). Pins added:packages/objectql/src/registry-bare-name-one-holder-request-family.test.ts[#32534] after the seal, releasing a package's claims on the names it no longer holds lets a package of its namespace bind them; a name it still holds and the other holders' claims stay: the re-bind's removal, what alpha keeps registered again, then the release asking the engine; CONTROLs (the name alpha still holds, gamma's claim, an owner-less release, a release whose package still holds every name).[#32534] CONTROL — a name the package still holds under another owner spelling (its bare id) keeps its claim after the removal of its app: registrations(red-line read F1).[#32534] a name an earlier bind claimed, removed with the owner's registrations, is released with the rest, not only the last bind's names(contract review S3).[#32534] a claim released before the seal is no clash for the cold boot to report(the existing ABLATION case beside it, with no release, reports it), with a CONTROL that alpha keeps its other name.[#32534] CONTROL — two namespaces' packages claim one name after the seal; releasing one owner's claim leaves the other's, so a package of the remaining holder's namespace is still refused naming it(contract review S1): alpha and beta of two namespaces both claimshared_fn, alpha's claim is released, beta's co-owner is refused naming beta, alpha's co-owner binds.describe('[#32534] the bare engine function read after a holder leaves'); the platform-plus-package CONTROL reads "current behaviour, see objectql: a function's bare-name read refuses with 409 naming both when the platform and one package hold the name (ADR-0150 D4) #32907" (contract review S2).packages/runtime/src/app-artifact-handlers.test.ts,describe('[#32534] after the seal, a re-bind takes the old owner's bare-name claim off with the function')releaseMovedFunctions(beta keeps a hook of its own, so it stays an owner); a co-owner binds it; CONTROL: beta's kept name keeps its claim (S3).Suites
pnpm --filter @objectstack/objectql exec vitest run src/registry-bare-name-one-holder-request-family.test.ts: 68/68.pnpm --filter @objectstack/runtime exec vitest run src/app-artifact-handlers.test.ts(objectql dist rebuilt from this head): 34/34.pnpm --filter @objectstack/objectql testandpnpm --filter @objectstack/runtime teston0c9fad9f: objectql 590 files, 12622/12622; runtime 588 files, 10257 passed, 19 skipped.pnpm --filter @objectstack/objectql typecheckandpnpm --filter @objectstack/runtime typecheck: exit 0. eslint on the four changed source and test files: exit 0.dispatch-gates.mjs --commands, 73 commands) on bc9dbb6: in the os-dev-report on the card. The review delta (69245b3, 8564eaa) touches one test file and the changeset only; on it: the test file 66/66,check:test-typecheckfor objectql, eslint on the file,check-changeset-no-major,check-empty-changesetandcheck:nul-bytes, each exit 0. The F1 and S3 round (658dc99, 0c9fad9) touches the same four source and test files and the changeset; on it: both package suites, both typechecks and eslint above, each exit 0; the derived set (dispatch-gates.mjs --commands, the same 73 commands) rerun on0c9fad9f: 73/73 exit 0, and--ranreads 73 derived, 73 run, 0 NOT-MEASURED, 0 UNRUN.398a221achanges the changeset text only.9cd6224d(origin/main25ee5076merged; no file of this PR changed): objectql and runtime rebuilt with declarations (pnpm --filter '@objectstack/runtime...' build), thenpnpm --filter @objectstack/objectql test590 files, 12657/12657;pnpm --filter @objectstack/runtime test588 files, 10262 passed, 19 skipped;pnpm --filter @objectstack/objectql typecheckandpnpm --filter @objectstack/runtime typecheck(each runs its package'scheck:test-typecheck) exit 0, the runtime one underNODE_OPTIONS=--max-old-space-size=8192(at the default heap its test-layertscran out of memory before giving a reading); eslint on the six changed source and test files exit 0.342fa08f(origin/mainc1a645e2merged; this PR's diff of each of its seven files unchanged;maintouchedengine.tsandapp-artifact-handlers.tsin other regions, fix(driver-sql, objectql, metadata-protocol): publishing a field change on a live object brings its table to the declaration #32848 and fix(cloud-connection, runtime)!: install-local refuses a package with two enabled jobs of one name, as the binder refuses the name at bind #32889): objectql and runtime rebuilt with declarations, then both package typechecks (withcheck:test-typecheck, under the same heap) exit 0;registry-bare-name-one-holder-request-family.test.ts68/68;app-artifact-handlers.test.ts34/34.Ablations (each through scripts/ablation-replace.mjs on the committed head; every restore proved: blob equals HEAD and git diff HEAD empty)
On
0c9fad9f:releaseBareNameFunctionsreleases nothing (its two delete lines replaced): objectql 4 failed / 64 passed ((i), (ii), (v), (vi)); with objectql rebuilt, runtime 4 failed / 30 passed ((i), (ii), (iv), (v)). The preflight cannot see a comment marker in the built output (the bundler drops comments); the four runtime reds are the reading that the ablated build ran. Restore leg: rebuilt, working tree clean, runtime 34/34.releaseMovedFunctionsremoved: runtime 2 failed / 32 passed ((i), (iv)).stillHolds(every claimed name of the package released): objectql 3 failed / 65 passed ((i), (vii), (ii)).() => false, every claimed name released): runtime 2 failed / 32 passed (the F1 CONTROLs (vi), (vii)). The kept-name CONTROLs of runtime (i) and (iv) stay green under it, since the re-bind claims a kept name again (red-line read N2); objectql (i) and (vii) carry that property (red under A7).8564eaac'sregistry.tsandapp-artifact-handlers.ts, file swap, objectql rebuilt) under this head's runtime tests: 4 failed / 30 passed, exactly the four new pins ((iv), (v), (vi), (vii)); restored withgit checkout HEAD, tree clean, rebuilt.9cd6224d(the first merged head; the restore is unchanged sinceec785b77): objectql (iii) and (iv) red, 2 failed / 66 passed; every CONTROL green.Acceptance notes
app:<id>registrations held that the re-bind does not register again, whether an earlier bind of the artifact gave it or it was bound under that owner outside the artifact's binder (S3 and red-line delta read N6, row 8). The S3 follow-up card is narrowed to what is left.functionHoldersOf(...).platformItem), and ADR-0150 D4 says the platform alone answers a caller with no package. "A package-less registration keeps its rules" is kept: it never leaves with a package, it does not count toward the 409, and when it is the bare entry it stays.ambiguous-in-environment. After the last-registered of three leaves, that pair answers nothing (CONTROL pin), so no holder is guessed. Whether the bare read should refuse the platform-plus-package pair is objectql: a function's bare-name read refuses with 409 naming both when the platform and one package hold the name (ADR-0150 D4) #32907 (filed by the epic seat): its CONTROL pin here reads "current behaviour, see objectql: a function's bare-name read refuses with 409 naming both when the platform and one package hold the name (ADR-0150 D4) #32907", so the alignment flips it on purpose.packages/objectql/src/engine.tschanges theunregisterFunctionsByPackagedocblock only, and it is outside the claim's declared file surface. The dropped-body release call in the runtime teardown goes past "app-artifact-handlers.ts, only to call the release" inreleaseMovedFunctions(named in the first note).noteBareNameClaim), the same asclaimBareNameFunctions: neither runs inside an install transaction.maintwice before the queue, never rebased. First9cd6224d(origin/main25ee5076): 32 first-parent commits had landed since the branch's last merge (5c0f1134), at or over the queue's 15; clean, touching none of this PR's seven files; the affected gates run again (Suites above) and A4 measured again. Then342fa08f(origin/mainc1a645e2): 20 more since25ee5076; clean, a mechanical merge (this PR's diff of each file unchanged); both typechecks and the two changed test files run again (Suites above). Open PR fix(objectql)!: every reader of the registry's overlay slot binds a row of an App's customization pair by the exact read's owner rule (ADR-0150 D4) #32815 also editsregistry.ts(another region); if it lands after this PR, it mergesmainon its side.!andClause-②:has no(narrowing)arm (os-dev.md).Generated by Claude Code
🤖 Generated with Claude Code
https://claude.ai/code/session_01L6bhgTAAvx8zsU1YcVseLQ