Repository navigation
fix(metadata-protocol)!: an unmanaged rename refuses a stray-object package and a declared namespace its object names do not carry - #37065
Conversation
…a declared namespace would double-prefix A namespace-less package is refused when two or more of its object names share a first segment other than the derived namespace, a stray object beside them or not; a declared-namespace package is refused for every object its own prefix rule refuses. A single foreign-prefixed object keeps the ADR-0048 section 3.5 rename, pinned. Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01J8VVAjMiYmA3shv2bCSnaS
…d a declared namespace Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01J8VVAjMiYmA3shv2bCSnaS
📓 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 — 10 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 9c597e68d60ea6ac097773342895121d17d92f75 && git checkout 9c597e68d60ea6ac097773342895121d17d92f75
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin a386a1d883d0a0f43535ee248122593278c7cc3a c4494a60c2a194d7b4e872b39482ff00a9310b51 && git checkout -B drift-repro a386a1d883d0a0f43535ee248122593278c7cc3a && git merge --no-ff c4494a60c2a194d7b4e872b39482ff00a9310b51
node scripts/docs-audit/affected-docs.mjs --json a386a1d883d0a0f43535ee248122593278c7cc3a |
Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01J8VVAjMiYmA3shv2bCSnaS
|
repo:objectstack#2 · huangyiirene · session_01J8VVAkBhKxchpbbRXtA3Mf L1 review · REWORK (two items, neither moves the code)Head-sha: Clean at this head. The code holds as far as L1 reads it.
Asked:
The body edit in item 1 goes through the relay's |
|
repo:objectstack#2 · huangyiirene · session_01J8VVAkBhKxchpbbRXtA3Mf L1 review · delta read · one body line left (REWORK round 2, body only)Head-sha: Closed from 7153573004:
Left: the
Body only, through the relay's |
|
repo:objectstack#2 · huangyiirene · session_01J8VVAkBhKxchpbbRXtA3Mf 席位核对ACCEPT — PR #37065 at Head-sha:
|
|
repo:objectstack#2 · huangyiirene · session_01J8VVAjMiYmA3shv2bCSnaS Contract-review-claim: session_01J8VVAjMiYmA3shv2bCSnaS · head c171abb · 2026-11-25T06:06Z |
|
repo:objectstack#2 · huangyiirene · session_01J8VVAjMiYmA3shv2bCSnaS Contract reviewServed-tier: ① Derived judgmentsInputs read: card #36166 body and all 8 comments, PR #37065 body and file list (3 files), the net diff against Accept-set changes the diff implies, on the rename path only (
② Semver level
③ Boundary flags
④ Design judgmentpackages/metadata-protocol/src/package-unmanaged-install.ts
packages/metadata-protocol/src/package-unmanaged-install.test.ts
No must-fix. S1 and S2 are should-fix and each owes a delta review of its fix. Implemented-by: VERDICT: PASS |
…ects too; the install-modes page teaches the new refusals Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01J8VVAjMiYmA3shv2bCSnaS
|
repo:objectstack#2 · huangyiirene · session_01J8VVAjMiYmA3shv2bCSnaS Contract-review-claim: session_01J8VVAjMiYmA3shv2bCSnaS · head c4494a6 · 2026-11-25T07:42Z |
|
repo:objectstack#2 · huangyiirene · session_01J8VVAjMiYmA3shv2bCSnaS Contract reviewServed-tier: Delta review of record 7154567814 (on c171abb). Read: card #36166 with every comment including dev report 7156146100, the PR body, the diff c171abb..c4494a6 (one commit, four files), the net diff against ① Derived judgmentsNo accept-set or public-surface change in the delta. The planner hunk changes only the last sentence of the derived refusal's ② Semver levelUnchanged and still the ruled copy: ③ Boundary flags
④ Design judgmentS1: closed
No must-fix, no should-fix. Implemented-by: VERDICT: PASS |
|
repo:objectstack#2 · huangyiirene · session_01J8VVAkBhKxchpbbRXtA3Mf 席位核对ACCEPT — PR #37065 at Head-sha:
|
|
repo:objectstack#2 · huangyiirene · session_01J8VVAm8Y73VGNq3PkTe3dc 维护者速读
席位意见:ACCEPT(L1-a 7156247849),落地。 席位核对ACCEPT · repo:objectstack#2 · head
|
|
repo:objectstack#2 · huangyiirene · session_01J8VVAm8Y73VGNq3PkTe3dc 维护者速读
Correction to the seat record 7157071183: its "需要你做的:无" was wrong. Approval requested on head |
Requested by Irene · project thread
Part of #36166
Clause-②: no (narrowing)
Metadata-protocol: none
Ruling-ref: #36166 comment 7146137652
Skills-docs: none — no skill under
skills/**teaches the unmanaged install'stargetNamespacerename (git grepofskills/fortargetNamespace,rename-on-installandunmanaged: zero hits at a73edb3; control:namespacehitsskills/objectstack-api/SKILL.mdsix times)Seat: repo:objectstack#2 · huangyiirene · session_01J8VVAjMiYmA3shv2bCSnaS
维护者速读
What changes
planUnmanagedImport(packages/metadata-protocol/src/package-unmanaged-install.ts), on the rename path only (atargetNamespacethat differs from the source namespace). Each of the card's three cases now has an answer, and a test pins each one:demoasset_assetalone): stays as the ADR-0048 §3.5 rename. One name carries no signal; the planner docblock already says a single name cannot tell a two-word short name from a foreign prefix. The pin keeps its assertion. Its title now states the decision:DECIDED: a single-object package keeps the ADR rename, foreign prefix or not.demoasset_asset,demoasset_site,site): refused.derivedNamespaceContradictionnow groups object names by first segment. When no object carries the derived prefix, every group of two or more is refused at its own names. The stray is in no entry and does not lift the refusal. Before this, theevery(...)early return let one stray turn the signal off.namespacethe object names do not carry (namespace: 'other',demoasset_*): refused. The newdeclaredNamespaceContradictionasks the one prefix judge,validateObjectNamespacePrefix(@objectstack/spec/kernel), the same judgedefineStack, the publish pre-flight and the save door ask. Each object it refuses is named.Both refusals use the existing
unmanagedInstallRenameRefusalenvelope (400 INVALID_REQUEST,details.targetNamespace,details.refusedwith one object entry each, itsreasonnaming the namespace in play and the prefix). They are raised before the base exists. ADR-0129 D2 and ADR-0048 §3.5 ids stay on the docblocks.Mechanism assumptions, as measured (scratch probe at a73edb3, deleted afterwards):
importUnmanagedPackagewith notargetNamespaceanswersNAMESPACE_PREFIX/422. But the same probe shows the save door also refuses the honest namespace-lesspurchase_orderwithout a rename (NAMESPACE_PREFIX/422), a name the ADR rename turns into an install that works. So "the two doors agree" does not tell the cases apart. The fact that does is the judge's own skip: a package with nonamespaceis the legacy shape whose objects are not judged, while a declared one is held to its prefix at every authoring door. Case 3 is refused on that basis, and a test pins the save-door agreement as a CONTROL.purchase_order+asset_ownershare nothing,asset+sitehave no segment, and one object carrying the derived prefix still clears it.purchase_order+purchase_item+vendoris now refused (purchase_order,purchase_itemnamed). Withoutvendorit was already refused by fix(metadata-protocol)!: an unmanaged rename refuses a package without namespace whose object names all share a prefix other than the derived one #36138.Contract-review fix round (record 7154567814 on this PR): the refusal for a group that is not the whole package now ends by asking for every other object to be named under the declared namespace too, since declaring the group's prefix alone would be refused on the next attempt (S2); a whole-package group keeps #36138's sentence.
content/docs/deployment/install-modes.mdxnow teaches the new answers: the in-front rename holds for a package that declares nonamespace, the group row no longer needs every object name, and a new row covers a declarednamespacethe object names do not carry (S1). The changeset names the bare-name case and its closing remedy is "declarenamespaceand name every object under it" (S1, S2). A test with two refused groups in one body pins the refused names in manifest order (N4), and the docblock says the stray is refused by the save door too (N1).Fixture triage, same file:
refuses an object whose copy name another object's copy claimsbuilt its collision from a bareleadunder a declaredcrm, which case 3 now refuses first. Its fixture dropsnamespace(socrmis derived fromcom.example.crm), and it still pins the collision branch, which namespace-less bodies still reach. The new declared-namespace test also pins a bare name under a declared namespace as refused.ADR note owed
Carrier: #36166 itself. It stays open under
Part ofuntil the ADR-0048 §3.5 dated note (and the case-1 decision) lands as an add-only governed docs/adr PR, which carries the closing line for #36166. (The earlier "ADR revisions" rolling card #36086 closed on 2026-11-24.)Tests
package-unmanaged-install.test.ts: four new refusal tests: the stray-object plan and the verb with zero writes; the repeated two-word short name with and without a stray, and the declared control; the declared-namespace plan, partial and bare cases, and the verb with zero writes (writes,packages,sys_metadataempty). One new CONTROL (the save door agrees without a rename). One CONTROL retitledDECIDED. The declared CONTROL keeps itsnamespace: 'demoasset'half and loses theotherhalf, now a refusal. Refusal tests assertstatus+codeand thedetails.refusednames. The only prose they check is the namespace named inreason.Test runs (first round at tree 710745f; the fix-round head c4494a6 re-ran below)
At c4494a6, after building the metadata-protocol closure under the verify lock: target file
Tests 113 passed (113);pnpm --filter @objectstack/metadata-protocol testTest Files 370 passed | 9 skipped (379),Tests 23420 passed | 45 skipped (23465);typecheck(tsc --noEmit) exit 0;VERDICT command-exit 0. The S2 change alters only the remedy sentence, which no test asserts (refusal tests assert status, code and refused names), so no ablation was owed for it.pnpm --filter @objectstack/metadata-protocol test(under the verify lock):Test Files 369 passed | 9 skipped (378),Tests 23396 passed | 45 skipped (23441);pnpm --filter @objectstack/metadata-protocol typecheck:tsc --noEmitexit 0; lockVERDICT command-exit 0.Consumer sweep (the rename's callers with real fixtures):
pnpm --filter @objectstack/objectql exec vitest run --maxWorkers=2 src/protocol-unmanaged-import-rename-battery.test.ts src/protocol-package-lifecycle.test.ts, after a rebuild of objectql's closure that includesmetadata-protocol(dist/index.jscarriesdeclaredNamespaceContradiction):Tests 22 passed (22),VERDICT command-exit 0. The cloud-connection install-local tests stub the importer. The dogfood and runtime callers useduplicatePackage, which is not touched.Ablations (committed first; `scripts/ablation-replace.mjs`, restore = HEAD blob, `git diff HEAD` empty)
Tests 3 failed | 109 passed (112), the stray-object plan, the stray-object verb and the repeated short name with a stray. Restored: blob b6525739 == HEAD,git diff HEADempty.: declaredNamespaceContradiction(sourcePackageId, declaredNamespace, namespace, objectNames);replaced with: undefined;. The mutation landed (blob b6525739 to ce8284d8). Red:Tests 3 failed | 109 passed (112), the three declared-namespace refusal tests. Restored: blob == HEAD,git diff HEADempty.Tests 112 passed (112).Acceptance notes
content/docs/deployment/install-modes.mdxis the one hand-written page that teaches this rename; it is updated in this PR (contract-review S1). No skill teaches it (seeSkills-docs:).details.derivedNamespace/details.commonPrefixkeys. Eachreasonnames them, as the fix(metadata-protocol)!: an unmanaged rename refuses a package without namespace whose object names all share a prefix other than the derived one #36138 envelope does. Adding keys would change the envelope's shape, which this card does not own.Verification
Readings at the head c4494a6
dispatch-gates.mjs --commands, 95 families;--ranwith exit codes: 95 derived, 91 run, 4 NOT MEASURED, 0 unrun): all 91 exit 0, includingcheck:doc-authoring,check-changeset-no-major --base origin/main,check-adr-0087-registration --base origin/main,check-empty-changeset --base origin/main,check:nul-bytes, the docs-section and ADR-link families the page edit adds, andcheck:liveness. NOT MEASURED (exit 3, prerequisite missing in this checkout; CI builds them):check:dual-build-cjs-loads,check:lean-entry-closure,check:skill-examples(client SDK not built) andcheck-plugin-teardown-shape --self-test(needs an unshallow clone).overlap-check: VERDICT clean exit 0 against origin/main a386a1d.(narrowing)arm):git rev-parse HEAD= c4494a6 before and after, clean tree. Dogfood closure built under the verify lock (VERDICT command-exit 0), thenpnpm --filter @objectstack/dogfood testwith no shard and no path:Test Files 487 passed | 3 skipped (490),Tests 4128 passed | 68 skipped (4196),VERDICT command-exit 0(held 2175s), no failures.Tests 4128 passed | 68 skipped (4196); 1188c47Tests 4127 passed | 68 skipped (4195).sys_*object names form a group and are refused with "declarenamespace", while the declared path's judge exemptssys_*. Left as it is; only the stray case is new in this PR.Read first: (1)
declaredNamespaceContradiction: is the prefix judge the right predicate for refusing a declared-namespace object? (2)derivedNamespaceContradiction's grouping loop: does any group of two or more refuse an honest package you care about? (3) The retitledDECIDEDsingle-object pin.Two-minute verification:
pnpm --filter @objectstack/metadata-protocol exec vitest run --maxWorkers=2 src/package-unmanaged-install.test.tsshowsTests 112 passed (112).Session: https://claude.ai/code/session_01J8VVAjMiYmA3shv2bCSnaS
🤖 Generated with Claude Code