Skip to content

fix(metadata-protocol)!: an unmanaged rename refuses a stray-object package and a declared namespace its object names do not carry - #37065

Merged
os-zhuang merged 5 commits into
mainfrom
claude/project-thread-k7ujmv
Nov 25, 2026
Merged

os-zhuang merged 5 commits into
mainfrom
claude/project-thread-k7ujmv

Conversation

@objectstack-fleet

@objectstack-fleet objectstack-fleet Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

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's targetNamespace rename (git grep of skills/ for targetNamespace, rename-on-install and unmanaged: zero hits at a73edb3; control: namespace hits skills/objectstack-api/SKILL.md six times)

Seat: repo:objectstack#2 · huangyiirene · session_01J8VVAjMiYmA3shv2bCSnaS

Declaration ruled. The maintainer chose 「B 照 #36138 先例声明为 patch」 (seat record Ruling-ref: #36166 comment 7146137652): the changeset is patch with Clause-②: no (narrowing), Metadata-protocol: none and the ADR-0087 not-required (no-migration-prescription) marker, the same pair as #36138's changeset. No packages/spec entry is written. The diff changes the answer an install request gets, not what a metadata author can write.

维护者速读

  • 以不托管方式安装应用包并指定新命名空间的人:原来有两种包会被静默拼成双前缀的对象名,现在安装前就拒绝并说明原因;只有一个对象的包照旧改名。
  • 属于"应用包安装与命名"这条线,接续上一轮已合并的双前缀拒绝修复。
  • 碰到这两种包的安装者会看到明确的拒绝,不再得到三种拼写混杂的副本;改法是在包上声明命名空间,随时可撤回本改动。
  • 无。

What changes

planUnmanagedImport (packages/metadata-protocol/src/package-unmanaged-install.ts), on the rename path only (a targetNamespace that differs from the source namespace). Each of the card's three cases now has an answer, and a test pins each one:

  1. Single object, namespace-less (demoasset_asset alone): 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.
  2. A stray object beside a shared prefix (demoasset_asset, demoasset_site, site): refused. derivedNamespaceContradiction now 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, the every(...) early return let one stray turn the signal off.
  3. A declared namespace the object names do not carry (namespace: 'other', demoasset_*): refused. The new declaredNamespaceContradiction asks the one prefix judge, validateObjectNamespacePrefix (@objectstack/spec/kernel), the same judge defineStack, the publish pre-flight and the save door ask. Each object it refuses is named.

Both refusals use the existing unmanagedInstallRenameRefusal envelope (400 INVALID_REQUEST, details.targetNamespace, details.refused with one object entry each, its reason naming 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):

  • PM assumption 1 (case 3 without a rename refuses at the save door): holds. importUnmanagedPackage with no targetNamespace answers NAMESPACE_PREFIX/422. But the same probe shows the save door also refuses the honest namespace-less purchase_order without 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 no namespace is 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.
  • PM assumption 2 (the group signal): holds. No CONTROL changes answer: purchase_order+asset_owner share nothing, asset+site have no segment, and one object carrying the derived prefix still clears it. purchase_order+purchase_item+vendor is now refused (purchase_order, purchase_item named). Without vendor it 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.
  • PM assumption 3 (case 1 stays as the rename): holds, as decided above.

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.mdx now teaches the new answers: the in-front rename holds for a package that declares no namespace, the group row no longer needs every object name, and a new row covers a declared namespace the object names do not carry (S1). The changeset names the bare-name case and its closing remedy is "declare namespace and 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 claims built its collision from a bare lead under a declared crm, which case 3 now refuses first. Its fixture drops namespace (so crm is derived from com.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 of until 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.)

Note (2026-11-24, #36166, following #35823 / PR #36138) — on §3.5's rename sentence "a name that lacks the package's prefix takes it in front". On the unmanaged rename path that sentence now has three bounds. (1) A package that declares no namespace is refused, not renamed, when no object name carries the namespace derived from its id and two or more object names share a first segment: each object of each such group is refused (400 INVALID_REQUEST), whether every object shares the segment (#36138) or a stray object stands beside the group (#36166). So two-word short names the package repeats (purchase_order beside purchase_item) are refused too, and declaring namespace lifts the refusal. (2) A package that declares a namespace is refused for each object name the namespace-prefix judge (validateObjectNamespacePrefix) refuses under it. The rename has no declared prefix in such a name to replace, and every authoring door already refuses that name. (3) Decided to stay as written: a namespace-less package's single object, foreign prefix or not (demoasset_asset alone copies as TARGET_demoasset_asset), because one name cannot tell a two-word short name from a foreign prefix. Namespace-less object names that share no first segment (purchase_order beside asset_owner, bare asset beside site) also stay as written. A body that writes the id-derived namespace out as namespace is judged as declared, so bound (2) applies to it and the shapes in (3) are refused for it. Pinned in packages/metadata-protocol/src/package-unmanaged-install.test.ts.

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_metadata empty). One new CONTROL (the save door agrees without a rename). One CONTROL retitled DECIDED. The declared CONTROL keeps its namespace: 'demoasset' half and loses the other half, now a refusal. Refusal tests assert status + code and the details.refused names. The only prose they check is the namespace named in reason.
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 test Test 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 --noEmit exit 0; lock VERDICT 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 includes metadata-protocol (dist/index.js carries declaredNamespaceContradiction): Tests 22 passed (22), VERDICT command-exit 0. The cloud-connection install-local tests stub the importer. The dogfood and runtime callers use duplicatePackage, which is not touched.

Ablations (committed first; `scripts/ablation-replace.mjs`, restore = HEAD blob, `git diff HEAD` empty)
  • Case 2: the group-size guard (skip a group of fewer than two names) gained a second clause that also skips any group smaller than the whole object set, which puts the old every-or-nothing hole back. The mutation landed (anchor 1 to 0, blob b6525739 to 50f7c2b9). Red: 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 HEAD empty.
  • Case 3: anchor : 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 HEAD empty.
  • Green before and after: Tests 112 passed (112).

Acceptance notes

Verification

Readings at the head c4494a6
  • Derived gates at c4494a6 (dispatch-gates.mjs --commands, 95 families; --ran with exit codes: 95 derived, 91 run, 4 NOT MEASURED, 0 unrun): all 91 exit 0, including check: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, and check: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) and check-plugin-teardown-shape --self-test (needs an unshallow clone). overlap-check: VERDICT clean exit 0 against origin/main a386a1d.
  • PR check-runs at c4494a6, all completed: 40 success, 15 skipped by their selectors, 0 failed. The successes include every required context in play: Lint & Repo Gates, TypeScript Type Check, Test Core and Test Core 1/10 to 10/10, Build Core, Governed Surface Queue Guard, Live E2E UI, Test UI, Dogfood Regression Gate, plus Check Changeset, Build Docs, Check Documentation Links and Spec property liveness.
  • Full dogfood battery at c4494a6 (owed by the (narrowing) arm): git rev-parse HEAD = c4494a6 before and after, clean tree. Dogfood closure built under the verify lock (VERDICT command-exit 0), then pnpm --filter @objectstack/dogfood test with 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.
  • Earlier readings, superseded: c171abb Tests 4128 passed | 68 skipped (4196); 1188c47 Tests 4127 passed | 68 skipped (4195).
  • Accepted deviation (contract-review N2, inherited from fix(metadata-protocol)!: an unmanaged rename refuses a package without namespace whose object names all share a prefix other than the derived one #36138's signal): on the namespace-less path, two or more sys_* object names form a group and are refused with "declare namespace", while the declared path's judge exempts sys_*. 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 retitled DECIDED single-object pin.

Two-minute verification: pnpm --filter @objectstack/metadata-protocol exec vitest run --maxWorkers=2 src/package-unmanaged-install.test.ts shows Tests 112 passed (112).

Session: https://claude.ai/code/session_01J8VVAjMiYmA3shv2bCSnaS

🤖 Generated with Claude Code

…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
@github-actions github-actions Bot added size/m documentation Improvements or additions to documentation tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 24, 2026
@github-actions

github-actions Bot commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

3 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
  • the SDK route bridge reached 69 of 252 client-bound route-ledger rows — the other 183 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 183: 0 are remediable by widening that discovery convention (an in-repo file declares the path; the convention did not scan it); 59 are structural — on a ledger where NOT ONE row is declared in-repo, so no discovery change reaches them at any price; 124 are undecided (no in-repo declaration, on a ledger that has other in-repo registrars — absence and an unreadable spelling are not distinguishable here). The rows themselves: node scripts/docs-audit/affected-docs.mjs --bridge-coverage
  • a page that states a rule by its inputs shares no identifier with the emitter that implements the rule, so an emitter-only diff cannot list it — not on this run and not on any run. Measured on fix(driver-sql): emit varchar(maxLength) for a text field a declared index keys on #11430: content/docs/protocol/objectql/types.mdx documents the text-family column mapping by the ObjectQL type names it maps FROM (text / textarea / html) while the diff changed createColumn; it went unlisted, and it was the page that diff falsified, in four places. No shared token exists to detect this on, so a rule your change carries has to be re-read by hand in the pages that restate it.
  • a key NAME is not a key, so the hand re-read the line above prescribes can land on the wrong schema. The same spelling is authorable on one governed type and a [REMOVED] tombstone on another for each of active, aria, joins, objects, template, tools and version (censused on [finding] tools is a key on BOTH AgentSchema (tombstoned, dead) and SkillSchema (live, cloud-attested), so a name-based search attributes skill examples to the agent key — it produced a false stop-the-line alarm on PR #19059 #19093 over the liveness ledger's governed types, top-level keys); nothing in a search result distinguishes the two, so a grep hit on a LIVE example reads as evidence about the DEAD key. Measured on fix(spec): the agent.tools liveness row says dead — it claimed live on a key the schema tombstoned #19059: content/docs/ai/agents.mdx was reported as contradicting the agent.tools tombstone over its tools: example at :161, which is inside the defineSkill({ block opened at :155 — the page was already correct. Settle ownership by PARSING the value against both schemas, never by the name: that literal PASSES SkillSchema, and as an AgentSchema it FAILS at tools with the tombstone prescription. ⛔ These names are not the whole class — a key retired through a .strict() guidance map leaves no tombstone in the walked shape and none of them here (tool.category, live as AIToolDefinition.category).

Coarse fallback — 10 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): node scripts/docs-audit/affected-docs.mjs --json a386a1d883d0a0f43535ee248122593278c7cc3a → packageMentionDocs.

Which tree this was computed on

This run read content/docs from 9c597e68d60ea6ac097773342895121d17d92f75 — the merge of head c4494a60c2a194d7b4e872b39482ff00a9310b51 into base a386a1d883d0a0f43535ee248122593278c7cc3a, which is what actions/checkout gives a pull_request run. Not the PR head.

A worktree cut from an older main holds a different content/docs, so re-deriving there can legitimately return a different list — that is a different tree, not a wrong row. To answer on the same tree:

# 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

⚠️ That checkout carried uncommitted changes, so the commit above does not fully identify what was read.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#2 · huangyiirene · session_01J8VVAkBhKxchpbbRXtA3Mf

L1 review · REWORK (two items, neither moves the code)

Head-sha: c171abb9bbf2e286d0b7a5f1d268d35f193f6930 · read 2026-11-25T05:13Z

Clean at this head. l1-face.mjs --pr 37065 at c171abb9bb: 12 of 13 items ok. It is a draft against main, with no closing keyword next to another card number. @objectstack/metadata-protocol carries its changeset (patch), which is not empty. Clause-②: no (narrowing) · Metadata-protocol: none · Ruling-ref: #36166 comment 7146137652 match ruling B. The Skills-docs: line holds, with its grep and a control. Lint & Repo Gates and TypeScript Type Check success; 37 success, 16 expected skip, 0 failed.

The code holds as far as L1 reads it.

  • derivedNamespaceContradiction now groups object names by first segment, so a stray no longer lifts the refusal.
  • declaredNamespaceContradiction asks the one judge, validateObjectNamespacePrefix, that defineStack and the save door ask.
  • Both refusals are raised through unmanagedInstallRenameRefusal before any write, and the tests assert status + code + details.refused.
  • I read the changeset sentence by sentence against the diff. The three refused/unchanged cases it names are the ones the planner implements, and each is pinned by a test.

Asked:

  1. Relation: Fixes #36166 closes the card short of its Done-when. The card's Done-when includes "ADR-0048 §3.5 carries the dated note for 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 narrowing", and case 1 is "decided to stay as the ADR rename, with the decision recorded on the ADR". This diff writes neither: the note text is in the PR body under "ADR note owed", to be ledgered after the merge. An add-only ADR note is its own Tier S PR (AGENTS.md, lowRiskArmVerdict), so splitting it off is right. But then this PR delivers the implementable part, and the body's first line must read Part of #36166, with no verb next to the number. The card keeps pm:dispatched until the ADR-note PR lands, and that PR carries Fixes #36166. Say in the body which PR or card carries the note. The other way is to add the note to this diff, which makes the PR governed (Tier H) and moves the head.
  2. Dogfood is not pinned to this head. The (narrowing) arm owes the full dogfood battery on the head to be enqueued. The body's reading (4127 passed) is at 1188c47a. c171abb9 merges 90 commits of main on top of it, so that reading does not pin this head. Run the full battery at c171abb9 and record it under dogfood_battery, or on the PR, with the head sha.

The body edit in item 1 goes through the relay's issue_patch and does not move the head, so the contract-review-tier L2 (narrowing) can run at c171abb9 once item 2's reading is in. Send the head back here for a short delta read of the body and the dogfood line.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#2 · huangyiirene · session_01J8VVAkBhKxchpbbRXtA3Mf

L1 review · delta read · one body line left (REWORK round 2, body only)

Head-sha: c171abb9bbf2e286d0b7a5f1d268d35f193f6930 · read 2026-11-25T06:01Z

Closed from 7153573004:

Left: the Carrier: line names a closed card. It sends the ADR-0048 §3.5 note to "the open 'ADR revisions' rolling card #36086". #36086 closed completed at 2026-11-24T19:17Z, and a search for an open ADR revisions issue finds none. As written, the note's carrier does not exist. Point the line at a carrier that is open. Either of these does it:

Body only, through the relay's issue_patch: the head does not move. Send it back and I'll ACCEPT on that read once Check Changeset (re-run by the body edit, in_progress at this read) is green.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#2 · huangyiirene · session_01J8VVAkBhKxchpbbRXtA3Mf

席位核对

ACCEPT — PR #37065 at c171abb9. L1-a; closes REWORK 7153573004 and its delta 7154364768.

Head-sha: c171abb9bbf2e286d0b7a5f1d268d35f193f6930 · read 2026-11-25T06:06Z

  1. 形态. Draft against main, and mergeable_state clean. Body line 3 reads Part of #36166: l1-face finds no closing keyword bound to Unmanaged rename: a copy still double-prefixes when a single object, one stray object, or a declared namespace contradicts the object names #36166 or to any other card, and a grep agrees. The Carrier: line names Unmanaged rename: a copy still double-prefixes when a single object, one stray object, or a declared namespace contradicts the object names #36166 itself, which is open with pm:dispatched until an add-only docs/adr PR brings the ADR-0048 §3.5 dated note and the case-1 decision, with the closing line. The changeset is '@objectstack/metadata-protocol': patch with Clause-②: no (narrowing) · Metadata-protocol: none · Ruling-ref: #36166 comment 7146137652 · the adr-0087: not-required marker, which is ruling B. Skills-docs: none, with its grep and a control.
  2. 前提实测. In planUnmanagedImport, on the rename path only:
    • derivedNamespaceContradiction groups object names by first segment. When no object carries the derived prefix, each group of two or more is refused. A stray neither joins nor lifts the refusal, and one object carrying the derived prefix still clears it.
    • declaredNamespaceContradiction asks validateObjectNamespacePrefix, the judge defineStack and the save door use.
    • Both refusals go through unmanagedInstallRenameRefusal (400 INVALID_REQUEST, details.refused) before any write.
    • Case 1 (a single object) keeps the rename, pinned as DECIDED.
    • I read the changeset sentence by sentence against the diff. Its two refused bodies, its unchanged cases and its examples (demoasset_asset/demoasset_site/site, purchase_order/purchase_item/vendor, namespace: 'other') each match the planner and a test in package-unmanaged-install.test.ts. The refusal tests assert status, code and the details.refused names.
  3. 门禁 check-runs. At c171abb9: 40 success, 18 expected skip, 0 unexpected skip, 0 pending. Lint & Repo Gates and TypeScript Type Check success. Check Changeset has three runs on this head. The newest (139013655541, 06:02:35Z) is success. The cancelled one (139012200362) was superseded by it within the same body-edit re-run, so it is not a red. Dogfood (owed by the (narrowing) arm): the full battery at c171abb9bbf2e286d0b7a5f1d268d35f193f6930, 487 files passed · 3 skipped, 4128 tests passed · 68 skipped, 0 failed, recorded in the body with the sha. The 1188c47a reading is marked superseded.
  4. 接受的偏差. The commit trailers are the model-free AGENTS.md pair, as the dev reported.
  5. 范围外去向. The ADR-0048 §3.5 note's carrier is Unmanaged rename: a copy still double-prefixes when a single object, one stray object, or a declared namespace contradicts the object names #36166 (above).
  6. 落地条款. The contract-review-tier L2 is owed on the narrowing face (Clause-②: no (narrowing)), at this same head. Its scope is every path of the diff outside the prose faces. Until a same-shape PASS is on record for this head, needs:contract-review applies (the dispatching seat hangs it). After the merge, Unmanaged rename: a copy still double-prefixes when a single object, one stray object, or a declared namespace contradicts the object names #36166 stays open with pm:dispatched (landing rule B), because the relation is Part of.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#2 · huangyiirene · session_01J8VVAjMiYmA3shv2bCSnaS

Contract-review-claim: session_01J8VVAjMiYmA3shv2bCSnaS · head c171abb · 2026-11-25T06:06Z

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#2 · huangyiirene · session_01J8VVAjMiYmA3shv2bCSnaS

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: c171abb9bbf2e286d0b7a5f1d268d35f193f6930
Local-runs: none
Scope: packages/metadata-protocol/src/package-unmanaged-install.ts, packages/metadata-protocol/src/package-unmanaged-install.test.ts (the narrowing face: every path of the diff outside the prose faces; the changeset under ② only) + read, not reviewed: packages/spec/src/kernel/namespace-prefix.ts (validateObjectNamespacePrefix, deriveNamespaceFromPackageId), packages/metadata-protocol/src/package-namespace-rename.ts (planNamespaceRename), packages/metadata-protocol/src/protocol-save-door-refusals.ts (objectNamespacePrefixViolation), packages/cloud-connection/src/marketplace-install-local-plugin.ts (the door's call), docs/adr/0048-cross-package-metadata-collision.md §3.5, content/docs/deployment/install-modes.mdx, .changeset/35823-unmanaged-derived-namespace-mismatch.md
Security-touching: no
Rule-change-verified: none

① Derived judgments

Inputs read: card #36166 body and all 8 comments, PR #37065 body and file list (3 files), the net diff against main, the check-runs on the head. Every check-run on the head is success or skipped by its selector; the one cancelled Check Changeset run (05:58Z) is superseded by a success run at 06:02Z. Test Core 1/10 to 10/10, Type Check (4 lanes), Build Core, Dogfood Regression Gate, Lint lanes, PR-body guards: success.

Accept-set changes the diff implies, on the rename path only (targetNamespace differing from the source namespace), each read in the tree:

  • Namespace-less body, no object carrying the derived prefix, a group of two or more object names sharing a first segment, other objects beside it: was renamed in front, now 400 INVALID_REQUEST naming the group's objects. Right: the every(...) early return is gone, names are grouped by first segment, groups of one are skipped. The all-sharing case (fix(metadata-protocol)!: an unmanaged rename refuses a package without namespace whose object names all share a prefix other than the derived one #36138) is the same code path with the same sentence (begins), so its pin holds unchanged.
  • Namespace-less body, a single object: unchanged (rename in front). Right: the length < 2 guard is subsumed by the group-size guard; the pin keeps its assertion.
  • Namespace-less body, one object carrying the derived prefix: unchanged, nothing refused. Right: the first line returns before grouping.
  • Declared namespace, any object name validateObjectNamespacePrefix refuses under it (foreign prefix, bare name, legacy ns__short form): was renamed (in front, or prefix-swapped for the __ form), now 400 INVALID_REQUEST naming each such object. Right as to mechanism: the judge and the namespace argument are the ones the save door passes for a non-rename install (objectNamespacePrefixViolation reads the base manifest's namespace, which without a rename is the declared one), so the rename path refuses exactly the names the non-rename path refuses with 422 NAMESPACE_PREFIX, no more. sys_* names stay exempt on both.
  • Declared namespace, a bare name whose copy name a prefixed sibling claims (lead beside crm_lead): still 400 INVALID_REQUEST naming lead, but by the declared-prefix refusal, which is raised first; the collision sentence is now reached from namespace-less bodies (and sys_* names) only. Right: same code, status and refused name; the fixture was moved to a namespace-less body and still pins the collision branch.
  • Public surface: no export, schema key, envelope key or error code is added or changed; declaredNamespaceContradiction is module-private; one new import of an existing spec export. Right.

② Semver level

'@objectstack/metadata-protocol': patch, Clause-②: no (narrowing), Metadata-protocol: none, Ruling-ref: #36166 comment 7146137652, and the adr-0087: not-required (no-migration-prescription) marker. Checked as a copy against the ruling (comment 7146137652: patch + Clause-②: no (narrowing) + Metadata-protocol: none + the not-required marker, same as #36138) and against .changeset/35823-unmanaged-derived-namespace-mismatch.md in the tree: front matter, both declaration lines and the marker kind are identical. The PR body carries the same three lines. Not re-ruled. Check Changeset on the head: success. The diff publishes no new export or schema shape, so nothing in it asks for a level above the ruled one.

③ Boundary flags

  • Report 7139917764, open_questions (the declaration pair, A or B): answered by the maintainer ruling recorded in 7146137652 (B); the changeset and PR body at this head carry B. The withdrawn correction pair 7139969130 / 7140001966 is superseded by that ruling.
  • Report 7139917764, three gate families NOT MEASURED locally (check:dual-build-cjs-loads, check:lean-entry-closure, check-plugin-teardown-shape --self-test): answered by the head's check-runs (Build Core, Lint · CI, release & engine gates, Lint · repo & tooling gates: success).
  • Reports 7139917764 and 7148766924, out-of-scope notes (the dispatch's model-named commit trailer; the relay's signed-trailer position in the PR body): process notes with no effect on the diff; no carrier owed by this review.
  • Reports 7148766924 and 7154330642: open_questions empty.
  • Card Done-when, the ADR half (the dated §3.5 note and the case-1 decision "recorded on the ADR"): not in this diff by the claim's file surface. The PR says Part of #36166, so the card stays open as the carrier; the note text is in the PR body. Not a finding on this head; the card must not close on this merge.
  • For the maintainer's approval read (the PR's own "Read first" 2): the group signal refuses an honest namespace-less package whose two-word names repeat a first word beside other objects (sales_order, sales_invoice, customer), which before copied uniformly under the target. This is 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 family extended as the card's case 2 wrote it (purchase_order named as a stray there), so it is not graded against the dev; see S2 for what the refusal then tells that package.
  • SQL push-down: none in play. Both functions are pure, over the object names of the manifest in memory; no query, no id materialisation, no in-app join.
  • PR author: objectstack-fleet[bot].

④ Design judgment

packages/metadata-protocol/src/package-unmanaged-install.ts

  • Holds against the cited code. validateObjectNamespacePrefix is the one judge defineStack and the save door ask (stack.zod.ts, protocol-save-door-refusals.ts), it skips an empty namespace as the docblock says, and the door (marketplace-install-local-plugin.ts) passes the package body as declared, so a namespace-less body reaches the derived branch and a declared one the new branch. Both refusals are thrown inside planUnmanagedImport, before the base exists, through the existing unmanagedInstallRenameRefusal envelope.
  • Break attempts that did not break it: a derived-prefix carrier beside a foreign group (cleared, first line); a name with no separator (in no group); a derived namespace containing _ (a name carrying it returns on the first line, so no group can be the derived namespace); the case-3 judge against the non-rename install (same judge, same namespace: nothing refused on the rename path that the save door accepts).
  • S1 (should-fix) — the hand-written public page for this door, content/docs/deployment/install-modes.mdx ("Rename on install"), is left teaching the pre-PR answers. Its refusal table row reads "two or more objects whose names all begin with the same first word", which the group signal no longer requires; it has no row for a declared namespace the object names do not carry; and its rule "an object whose name lacks the package's prefix takes the new one in front (ticket copies as acme_ticket)" is now true of a namespace-less package only, while a package declaring crm gets 400 INVALID_REQUEST for ticket. The PR body states the tree was not read. The changeset's second bullet shows only the foreign-prefix example and should name the bare-name case too, since that is the one the page and ADR-0048 §3.5 spell out. Fix: update the page's bullet and table in this PR (hand-written tree, not auto-generated), or name a carrier card for it before the queue.
  • S2 (should-fix) — the stray-group refusal prescribes a fix the same planner refuses on the next attempt. For demoasset_asset, demoasset_site, site the reason ends "Declare namespace on the package, the prefix its object names carry, then install again"; with namespace: 'demoasset' declared, declaredNamespaceContradiction refuses site. With two groups (a_x, a_y, b_x, b_y) each group is told to declare its own prefix. The sentence was complete when every object shared the prefix (fix(metadata-protocol)!: an unmanaged rename refuses a package without namespace whose object names all share a prefix other than the derived one #36138); for a partial group it is one step short, and for the honest package in ③ the real remedy (every object named under the declared namespace) is never stated on the first refusal. Fix: on the partial-group arm, say that the other object names must carry the declared namespace too; the changeset's closing line ("declare ... or name each object ...") wants the same "and".
  • N1 (nit) — the docblock sentence "Without a rename the save door's own prefix rule refuses the same names" is kept on derivedNamespaceContradiction; it is accurate, but the stray of a refused group is also refused there, which the sentence's "same names" understates.
  • N2 (nit) — on the derived path two or more sys_* object names form a group and are refused with "declare namespace", while the declared path's judge exempts sys_*. Inherited from fix(metadata-protocol)!: an unmanaged rename refuses a package without namespace whose object names all share a prefix other than the derived one #36138's signal; only the stray case is new.
  • N3 (nit) — a body that writes the id-derived namespace out as namespace is judged declared, so the single-object and no-shared-segment shapes "decided to stay" are refused for it. Consistent with "declared is declared"; worth one clause in the ADR note.

packages/metadata-protocol/src/package-unmanaged-install.test.ts

  • Holds against the card's three cases: case 1 pinned as the rename (retitled DECIDED, assertion unchanged); case 2 pinned at the planner for both strays the card names (site, purchase_order) and at the verb with writes, packages and sys_metadata empty; case 3 pinned at the planner (all refused, partial, bare name) and at the verb with zero writes, plus the non-rename control at 422 NAMESPACE_PREFIX. Every refusal test asserts status and code together and the refused names by exact list; the only prose asserted is the namespace and prefix tokens inside reason, which is where the envelope carries them. The removed half of the declared CONTROL is the answer that changed, and it reappears as a refusal pin, so no pin was dropped.
  • N4 (nit) — no test has two refused groups in one body, so the final sort back into manifest order (the only reason the sort exists) is unpinned.

No must-fix. S1 and S2 are should-fix and each owes a delta review of its fix.

Implemented-by: claude/project-thread-k7ujmv
Reviewed-by: subagent of session_01J8VVAjMiYmA3shv2bCSnaS

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
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#2 · huangyiirene · session_01J8VVAjMiYmA3shv2bCSnaS

Contract-review-claim: session_01J8VVAjMiYmA3shv2bCSnaS · head c4494a6 · 2026-11-25T07:42Z

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#2 · huangyiirene · session_01J8VVAjMiYmA3shv2bCSnaS

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: c4494a60c2a194d7b4e872b39482ff00a9310b51
Local-runs: none
Scope: packages/metadata-protocol/src/package-unmanaged-install.ts, packages/metadata-protocol/src/package-unmanaged-install.test.ts, content/docs/deployment/install-modes.mdx (prose face, read against the planner it describes), .changeset/36166-unmanaged-rename-stray-and-declared-namespace.md (under ② only) + read, not reviewed: packages/spec/src/kernel/namespace-prefix.ts, packages/metadata-protocol/src/package-namespace-rename.ts
Security-touching: no
Rule-change-verified: none

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 main, and the check-runs on this head.

① Derived judgments

No accept-set or public-surface change in the delta. The planner hunk changes only the last sentence of the derived refusal's reason on the arm where the refused group is not the whole package; which bodies are refused, the status, the code, details.refused and its order are as judged on c171abb. The whole-package arm keeps #36138's sentence word for word. Check-runs on the head: every one success or skipped by its selector, Test Core 1/10 to 10/10, Type Check lanes, Build Core, Build Docs, Check Documentation Links and Dogfood Regression Gate included. Check Changeset: the newest run (started 07:40:38Z, the re-run on the body edit) concluded success.

② Semver level

Unchanged and still the ruled copy: patch, Clause-②: no (narrowing), Metadata-protocol: none, Ruling-ref: #36166 comment 7146137652, the adr-0087: not-required (no-migration-prescription) marker; the PR body carries the same lines. The delta edits two prose sentences of the changeset only (the bare-name example ticket under a declared crm, and the closing remedy), both accurate against the planner.

③ Boundary flags

④ Design judgment

S1: closed
S2: closed

  • package-unmanaged-install.ts — on the partial-group arm the reason now ends "Declare namespace on the package, the prefix its object names carry, and name every other object under that namespace too, then install again", which is what declaredNamespaceContradiction holds the next attempt to; with two groups each entry carries the same clause, so neither prescription ends in a second refusal unannounced. The docblock now says the stray is refused at the save door too (N1) and that namespace lifts the family only with every object named under it. Nothing else moved.
  • package-unmanaged-install.test.ts — the new test (beta_x, alpha_x, beta_y, alpha_y) asserts status and code and the refused names in manifest order; grouping alone would answer beta_x, beta_y, alpha_x, alpha_y, so it pins the sort (N4).
  • content/docs/deployment/install-modes.mdx — each changed sentence checked against the planner: the in-front rename is stated for a namespace-less package only, a declared one refused; the collision row is qualified to a namespace-less body whose id derives crm (there crm_ticket carries the derived prefix, so the collision branch is the one reached); the group row drops "all", names the stray case, the single-object exception and the full remedy; the new declared row gives 400 INVALID_REQUEST and the 422 NAMESPACE_PREFIX answer without a rename. All accurate. Build Docs and Check Documentation Links: success.
  • Nothing in the commit breaks what c171abb held.

No must-fix, no should-fix.

Implemented-by: claude/project-thread-k7ujmv
Reviewed-by: subagent of session_01J8VVAjMiYmA3shv2bCSnaS

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#2 · huangyiirene · session_01J8VVAkBhKxchpbbRXtA3Mf

席位核对

ACCEPT — PR #37065 at c4494a60. L1-a delta read of ACCEPT 7154446571 (at c171abb9) after the L2 fix round.

Head-sha: c4494a60c2a194d7b4e872b39482ff00a9310b51 · read 2026-11-25T07:46Z

  1. 形态. One commit on top of c171abb9, four files: the planner, its test, the changeset and content/docs/deployment/install-modes.mdx. The page widens the surface, as L2 S1 asked (record 7154567814). Body line 3 is still Part of #36166, and the Carrier: line still names Unmanaged rename: a copy still double-prefixes when a single object, one stray object, or a declared namespace contradicts the object names #36166. Declarations unchanged.
  2. 前提实测 (delta, c171abb9..c4494a60).
    • Planner: in derivedNamespaceContradiction, only the reason remedy changes. When the group is the whole package, the old sentence stays. When it is part of the package, the remedy also asks to name every other object under the declared namespace (L2 S2), because declaredNamespaceContradiction would refuse a stray on the next attempt. Refusal logic, codes and order are untouched. The docblock edits say the same.
    • Test: one new case, two refused groups in one body, asserts 400/INVALID_REQUEST and every object named in manifest order. That matches the order sort in the code.
    • Changeset, sentence by sentence: "a package declaring crm with an object named ticket copied it as trialdemoasset_ticket; both are refused now" holds, because validateObjectNamespacePrefix('ticket','crm') refuses and the declared path now refuses before the rename. "Without a targetNamespace the save door already refused both (422 NAMESPACE_PREFIX)" is the same judge at the save door. "declare namespace on it and name every object under that namespace" covers both refusals' remedies.
    • install-modes.mdx, sentence by sentence:
      • The rename bullet: a no-namespace package's unprefixed object takes the target in front, and a declared package's is refused. That matches the derived/declared split.
      • The collision row now names a no-namespace package whose id derives crm. That is the shape the collision branch is still reached from, and the fixture was changed to it.
      • The group row: "no object carries the derived namespace … two or more … whatever other objects stand beside them … with or without site", the remedy "declaring namespace … and naming every object under it", and "a single object keeps the rename". Each matches the code and its pins.
      • The new declared row: "ticket or demoasset_asset in a package that declares crm" is refused, naming each object and the declared namespace, and the install without targetNamespace answers 422 NAMESPACE_PREFIX. That matches declaredNamespaceContradiction's reason and the save door.
  3. 门禁 check-runs. At c4494a60: 42 success, 17 expected skip, 0 unexpected skip, 0 failed, 0 pending. Lint & Repo Gates and TypeScript Type Check success. Dogfood: the full battery at c4494a60c2a194d7b4e872b39482ff00a9310b51 is recorded in the body (rev-parse before and after, clean tree). Dogfood Regression Gate is success on this head.
  4. 接受的偏差. As at 7154446571 (model-free trailers). The content/docs widening was ordered by the L2 should-fix.
  5. 范围外去向. Unchanged: the ADR-0048 §3.5 note's carrier is Unmanaged rename: a copy still double-prefixes when a single object, one stray object, or a declared namespace contradicts the object names #36166.
  6. 落地条款. L2 delta PASS on this head: 7156203232 (Served-tier: CONTRACT_REVIEW_TIER, S1: closed, S2: closed, no must-fix, no should-fix). Its Scope: is the diff outside the prose faces plus the page. After the merge, Unmanaged rename: a copy still double-prefixes when a single object, one stray object, or a declared namespace contradicts the object names #36166 stays open with pm:dispatched (landing rule B).

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#2 · huangyiirene · session_01J8VVAm8Y73VGNq3PkTe3dc

维护者速读

  • 改了什么:非托管安装改名到 targetNamespace 时,两类包体改为整体拒绝(400 INVALID_REQUEST,逐个对象列出原因),不再复制成双重前缀:未声明 namespace 但有一组共享首段的对象旁边还带别的对象;声明了 namespace 但对象名不带它。安装模式文档同步说明这两种拒绝。
  • 为什么改:Unmanaged rename: a copy still double-prefixes when a single object, one stray object, or a declared namespace contradicts the object names #36166 量到这两种包会被复制成 trialdemoasset_demoasset_asset 这样的双前缀名,数据从此不对。
  • 风险与回滚:只影响带 targetNamespace 的非托管安装请求;被拒的包什么也不装。已按你 11-24 18:54Z 的裁决 B 声明为 patch(Clause-②: no (narrowing))。revert 一个合并即可。
  • 先看:package-unmanaged-install.ts 里按首段分组的判断和新的 declaredNamespaceContradiction。
  • 两分钟验证:package-unmanaged-install.test.ts 的新钉子;dogfood 全量在当前 head 已跑(报告 7156146100)。
  • 需要你做的:无。非治理面,本席经队列落地。契约评审 PASS 7156203232,Head-sha c4494a60c2a194d7b4e872b39482ff00a9310b51。

席位意见:ACCEPT(L1-a 7156247849),落地。

席位核对

ACCEPT · repo:objectstack#2 · head c4494a60c2a194d7b4e872b39482ff00a9310b51 · card #36166

  1. 形态:4 个文件,+236/−52:packages/metadata-protocol/src/package-unmanaged-install.ts 及其测试、changeset、content/docs 安装模式页;Part of #36166。
  2. 前提实测:check-governed-merges --pr 37065 读出 NOT governed(0/4 路径命中);landing-k --pr 37065 读出 K = 7 < 15(分支已于 04:45Z 合入 main)。dogfood 全量在 c4494a6 通过(7156146100)。
  3. 门禁 check-runs:当前 head 42 success、17 expected skip、0 failed、0 pending,mergeable_state clean(pr-state --pr 37065);check-expected-skips --pr 37065 OK。
  4. 接受的偏差:契约评审首轮 S1/S2 已在 c4494a6 关闭(delta PASS 7156203232);L1 首轮两项返工(Part of、dogfood 重读)已完成。
  5. 范围外去向:ADR-0048 §3.5 的带日期注记不在本 PR,载体是 Unmanaged rename: a copy still double-prefixes when a single object, one stray object, or a declared namespace contradicts the object names #36166 本身(合并后仍保持打开,注记文本在 PR 正文),由后续只增的 ADR PR 承接。Skills-docs: none。
  6. 落地条款:非治理面,本席 ready 并开启 auto-merge 经队列落地;Unmanaged rename: a copy still double-prefixes when a single object, one stray object, or a declared namespace contradicts the object names #36166 不随本次合并关闭。head 若移动,本记录与评审作废。

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 25, 2026 08:28
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 25, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 25, 2026
@objectstack-fleet
objectstack-fleet Bot marked this pull request as draft November 25, 2026 09:01
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#2 · huangyiirene · session_01J8VVAm8Y73VGNq3PkTe3dc

维护者速读

Correction to the seat record 7157071183: its "需要你做的:无" was wrong. check-governed-merges reads paths only and read NOT governed, but the queue guard reads the declared narrowing and removed the pull at 08:46Z (exit 10, the narrowed leg). The seat has disarmed it and put it back in draft.

Approval requested on head c4494a60: the narrowed leg (Tier H by the 2026-11-19 ruling on #35321). Contract review: PASS 7156203232 at this head (Served-tier: CONTRACT_REVIEW_TIER, the narrowing face). L1 ACCEPT 7156247849. All checks are green (43 success, 17 expected skip), and K = 7. After an authorized approval on this head, seat 2 lands it through the queue. Part of #36166: the card stays open as the carrier of the ADR-0048 §3.5 note.

@objectstack-fleet objectstack-fleet Bot added the pm:awaiting-merge PR only: landing waits on the maintainer's own review and merge (SKILL.md 复核 ②); never on an issue label Nov 25, 2026
@os-zhuang
os-zhuang marked this pull request as ready for review November 25, 2026 09:03
@os-zhuang
os-zhuang added this pull request to the merge queue Nov 25, 2026
Merged via the queue into main with commit ede9b91 Nov 25, 2026
66 checks passed
@os-zhuang
os-zhuang deleted the claude/project-thread-k7ujmv branch November 25, 2026 09:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation pm:awaiting-merge PR only: landing waits on the maintainer's own review and merge (SKILL.md 复核 ②); never on an issue size/m tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants