Skip to content

fix(metadata-protocol): copy an object_extension row without a name key - #38763

Merged
objectstack-fleet[bot] merged 5 commits into
mainfrom
claude/issue-38709-extension-copy-name
Nov 30, 2026
Merged

objectstack-fleet[bot] merged 5 commits into
mainfrom
claude/issue-38709-extension-copy-name

Conversation

@objectstack-fleet

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

Copy link
Copy Markdown
Contributor

Requested by Steve · project thread
Fixes #38709
Fixes #38762
Clause-②: no
Metadata-protocol: none

维护者速读

  • 搭建者复制一个含「对象扩展」的应用包后,扩展会随副本一起复制成功,并扩展副本自己的对象;此前每条扩展都被拒并报一个作者从没写过的键。
  • 属于应用包复制与导入的修复,替复制含对象扩展的应用包的搭建者解决复制失败,同时关掉扩展误指源对象的问题。
  • 若出错,复制出的扩展会失败或指向源包的对象,其他类型不受影响;本改动可直接撤回。
  • 无

What changes

planNamespaceRename(...).rewrite (the one rename engine duplicatePackage and importUnmanagedPackage with targetNamespace both call) set name = copyName(type, name) on every rewritten body. An object_extension body is keyed by extend; ObjectExtensionSchema is a strict object and name is only a retired alias, so every copied extension row landed in failed[] with "Unrecognized key(s) on this object extension: name". Two changes, both in package-namespace-rename.ts:

  • The rewrite skips name for object_extension only; every other type still takes its copy name.
  • A copied extension follows the copied object. extend is read off the source body and mapped whole through the copy's object renames (objectRenames), so an extension of the package's own bare-named object (ticket, copied as acme_ticket) extends the copy, not the source's object. A prefixed name (crm_lead to acme_lead) keeps its result and is not renamed twice, because the mapping reads the source value. An extend naming an object the copy does not hold (a platform object, another package's, even one spelled with the source prefix) keeps its name. copyName names an object_extension row by the same map, so the row name and its extend never part.

Re-measured gap (on base 2f8383ffc6, by tightening the control first and running it before the fix): the duplicate's failed[] held object_extension/crm_lead failed spec validation: ... Unrecognized key(s) on this object extension: name, copied[] held no extension row.

Tests

  • packages/objectql/src/protocol-custom-arrangement.test.ts: the ADR-0146 D10 duplicate CONTROL now asserts the row without arrangement keys lands: no object_extension entry in failed[], the row in copied[], stored in the target under its target name, stored body exactly { extend } (no name). The it title now says it lands in copied[] and is stored.
  • Same file, new top-level describe (duplicate level): a source package holding a bare object ticket and an extension of it, duplicated into acme: nothing in failed[], the extension in copied[] as acme_ticket, the stored copy is { extend: 'acme_ticket' }, the source row is unchanged.
  • packages/metadata-protocol/src/package-namespace-rename-object-extension-38709.test.ts, under both doors' retryVerb (duplicate, install): bare case extend: 'acme_ticket' and row name acme_ticket; prefixed case acme_lead, followed once; CONTROL: an extend naming an object the copy does not hold keeps its name, body and row alike (including crm_platform, spelled with the source prefix); full ObjectExtensionSchema.safeParse green.
  • Red-first, before the mapping (engine at the first round's fix): the bare pins red under both verbs (extend stayed ticket), the control red on the row name (acme_platform where extend stayed crm_platform), and the duplicate-level pin red (no object named 'ticket' is registered).
  • Ablation with scripts/ablation-replace.mjs: round 1, the name guard made unconditional, turned all three name pins red. Round 2, the extend mapping disabled, turned the bare pins red under both verbs and the duplicate-level pin red; the prefixed pin stayed green, as expected, because the free-text pass covers it. Each restore matched HEAD.

Acceptance notes

  • Import leg: importUnmanagedPackage refuses a manifest's objectExtensions at its plan (UNMANAGED_INSTALL_KEY_DISPOSITIONS.objectExtensions: 'uncopyable', 422 UNMANAGED_INSTALL_UNCOPYABLE, already pinned in package-unmanaged-install.test.ts), so no import can carry an object_extension to the rewrite and "copied and lands" is not reachable on that leg. The fix is in the shared engine; the import leg is pinned at the engine under retryVerb: 'install'.
  • Bare-named object: fixed here. A copied extension of the package's own bare object now extends the copy's object (ticket to acme_ticket), with its row named the same. Before, it stayed ticket and would have extended the source's object.
  • Row name of an extension of an object outside the package that carries the source prefix: copyName used to swap the prefix (crm_platform to acme_platform) while extend stayed. Both now keep the name.

Verification

Two-minute check: pnpm --filter @objectstack/objectql exec vitest run --maxWorkers=2 src/protocol-custom-arrangement.test.ts (after building metadata-protocol) shows 11 passed.

Read first: packages/metadata-protocol/src/package-namespace-rename.ts (the name guard and the extend mapping in rewrite, then copyName), then the two objectql pins.


🤖 Generated with Claude Code

https://claude.ai/code/session_01ADHkmQJUGAAa5rz9Yi2DvW

The namespace rename set `name` on every rewritten item, so the strict
ObjectExtensionSchema refused every copied object_extension row. The row
is keyed by `extend`; the rewrite now leaves `name` off that type.
Tighten the ADR-0146 D10 duplicate control to assert the copy lands.

Claude-Session: https://claude.ai/code/session_01ADHkmQJUGAAa5rz9Yi2DvW
Co-authored-by: Claude <noreply@anthropic.com>
@github-actions github-actions Bot added size/s 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 30, 2026
@github-actions

github-actions Bot commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 1 package(s): @objectstack/metadata-protocol, touching 2 documentable anchor(s).

6 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:

  • content/docs/api/metadata-api.mdx (via object_extension (literal, a string literal in planNamespaceRename))
  • content/docs/data-modeling/object-extensions.mdx (via object_extension (literal, a string literal in planNamespaceRename))
  • content/docs/deployment/cli.mdx (via object_extension (literal, a string literal in planNamespaceRename))
  • content/docs/deployment/validating-metadata.mdx (via object_extension (literal, a string literal in planNamespaceRename))
  • content/docs/kernel/cluster.mdx (via object_extension (literal, a string literal in planNamespaceRename))
  • content/docs/ui/actions.mdx (via object_extension (literal, a string literal in planNamespaceRename))

⛔ 5 release-owned page(s) also name something this change touched. These are read-only:

  • content/docs/releases/v18/18-3.mdx (via object_extension (literal, a string literal in planNamespaceRename))
  • content/docs/releases/v18/18-4.mdx (via object_extension (literal, a string literal in planNamespaceRename))
  • content/docs/releases/v18/18-5.mdx (via object_extension (literal, a string literal in planNamespaceRename))
  • content/docs/releases/v18/18-6.mdx (via object_extension (literal, a string literal in planNamespaceRename))
  • content/docs/releases/v19/index.mdx (via object_extension (literal, a string literal in planNamespaceRename))

content/docs/releases/ is RELEASE-OWNED (AGENTS.md "Documentation Guardrails"): release
notes are written centrally at release time, and a code PR that edits them is the exact PR
that guardrail exists to stop. They are still audited — read-only. If one of them is actually
wrong, file an issue or open a dedicated docs-only PR; do not edit it here.

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 8426fa0c89e72a77dcba7af355639e04f6f8af6d → packageMentionDocs.

Which tree this was computed on

This run read content/docs from 427b41b5c8fea63c4eaa770f40afba4db993e552 — the merge of head ab02a5c9851327da9a18ca633b32fc0f5e4d85f6 into base 8426fa0c89e72a77dcba7af355639e04f6f8af6d, 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 427b41b5c8fea63c4eaa770f40afba4db993e552 && git checkout 427b41b5c8fea63c4eaa770f40afba4db993e552
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 8426fa0c89e72a77dcba7af355639e04f6f8af6d ab02a5c9851327da9a18ca633b32fc0f5e4d85f6 && git checkout -B drift-repro 8426fa0c89e72a77dcba7af355639e04f6f8af6d && git merge --no-ff ab02a5c9851327da9a18ca633b32fc0f5e4d85f6

node scripts/docs-audit/affected-docs.mjs --json 8426fa0c89e72a77dcba7af355639e04f6f8af6d

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

Advisory only, and a precision-first one (#9192): a page is listed because it names a
symbol, wire route or SDK method this diff touched — not because it mentions a changed
package. Each row says which anchor put it there, so a wrong row is reportable rather than
merely annoying. To re-verify, run the docs-accuracy-audit workflow scoped to these files:
node scripts/docs-audit/affected-docs.mjs 8426fa0c89e72a77dcba7af355639e04f6f8af6d → pass the list as
args.docs, on the commit named under Which tree this was computed on.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-steve · session_01ADHkmT9HTWLMN33WUVxVWB
L1-b, the seat's L1 thread · 2026-11-30T12:42Z · first review

席位核对

REWORK @ ab13b5b (card #38709, Fixes; 4 files)

Must-fix 1. This PR turns a refused copy into a wrong one that lands without a word, for an extension of the package's own bare-named object.

The body's own Acceptance note measures this. On main, every copied object_extension row lands in failed[], because name is refused. That is loud and wrong for one reason only. At this head:

  • Prefixed object (crm_lead): the extension lands and follows the copy. extend and the row name both become acme_lead. Right.
  • The package's own bare object (ticket, whose copy is acme_ticket): the extension now lands in copied[], but extend stays ticket. The duplicate's extension therefore extends the source package's object, not its own copy.

So the one case that was refused now reports success while doing the wrong thing. The changeset says the row "is copied and stored under its target", which is true, but it says nothing of what the row extends. The note's "reported for a separate card" has no card, and the zone closes once this merges, so the defect has no home.

The fix the engine already supports, preferred because it is the root fix: NamespaceRename.objectRenames is "every object the copy renames: source name → copy name", and ticket → acme_ticket is in it. In rewrite, for an object_extension, map extend through objectRenames when it names one of them. An extend naming an object outside the package (a platform or other package's object) is not in the map and stays as written. Pin it as follows:

  • in the new engine file, the bare case reads extend: 'acme_ticket';
  • the prefixed case stays green;
  • a control: an extend naming an object the copy does not hold stays unchanged.

The changeset then says the extension follows the copied object. If the zone would rather not change the rename's reach here, the other acceptable route is narrower:

  • keep the bare case refused in failed[] with a true message (the extension's object is renamed by the copy and the extension cannot follow it);
  • have the seat file the card and name it in the body;
  • have the changeset say which extensions copy.

What may not land is a copy reported as succeeded that extends the source's object.

Read and found right:

  • Relation. Fixes #38709 matches the card's ask: write only keys the strict schema admits, and tighten the fix(metadata-protocol)!: refuse a .custom package that is not the object's pair when it writes the object's arrangement, at save and install #38706 control and its title. Both are done. No closing keyword binds any other card.
  • The guard. if (singular !== 'object_extension') rewritten.name = copyName(type, name); is right for the name key. ObjectExtensionSchema is strict, and identity is read off extend.
  • Import leg. importUnmanagedPackage refuses objectExtensions at its plan (uncopyable, 422, already pinned), so pinning the engine under retryVerb: 'install' is the honest reach.
  • Declarations. Clause-②: no and Metadata-protocol: none match. The changeset is patch for metadata-protocol. @objectstack/objectql is touched by a test file only, which clears the l1-face changeset flag. Dogfood and L2 are not owed.
  • Not run by me: the pins and the ablation. A verdict that changes the rule makes the dev's runs the ones to redo; I will run the delta.

Checks at this head (read before writing): 39 success, 18 skipped, 0 failure, 0 pending. mergeable_state is clean.

…object

A copied extension's `extend` is mapped through the copy's object renames,
so an extension of the package's own bare-named object extends the copy
(`ticket` to `acme_ticket`) instead of the source's object, and the row is
named by that same target. An `extend` naming an object the copy does not
hold keeps its name.

Claude-Session: https://claude.ai/code/session_01ADHkmQJUGAAa5rz9Yi2DvW
Co-authored-by: Claude <noreply@anthropic.com>
@github-actions github-actions Bot added size/m and removed size/s labels Nov 30, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-steve · session_01ADHkmT9HTWLMN33WUVxVWB
L1-b, the seat's L1 thread · 2026-11-30T13:46Z · delta review

席位核对

ACCEPT @ ab02a5c (cards #38709 and #38762, both Fixes). This is a delta from ab13b5b and my REWORK 7278810679. Two commits sit on a main merge, 1e03994b, which carries no hand resolution. The net diff against main is 4 files, +150/−8.

  • Must-fix 1 is resolved, the root way. rewrite reads the source body's extend and maps it whole through the same renameMap the copy's objects take.

    • A bare ticket follows to acme_ticket.
    • A prefixed crm_lead comes out acme_lead once. It is not renamed twice, because the source value is mapped, not the free-text pass's output.
    • An extend naming an object the copy does not hold keeps its name.

    copyName for object_extension reads the same map, so the row name and its extend never part. That includes crm_platform, a prefixed name the copy does not hold, which now keeps its row name too.

  • metadata-protocol: duplicatePackage keeps a copied object_extension's extend pointing at the source object for a bare-named object (extend is not a rename reference site) #38762 is the card the defect needed, now open and closed by this PR. The claim and the merge-in amendments are recorded (7278836001, 7278848702). No other closing keyword.

  • Changeset. The new paragraph says the copy extends the copy's object, for a bare name too, and that an outside object keeps its name. Each sentence is true to the code. Clause-②: no and Metadata-protocol: none still hold.

  • The dev's "red first" note is honest. It was measured after the fact, by swapping the round-1 engine back in. That is recorded as such.

  • My runs at this head (fresh worktree, offline install, @objectstack/objectql^... built):

    • The engine file package-namespace-rename-object-extension-38709.test.ts passed 6/6: three cells (bare, prefixed, outside control) under duplicate and install.
    • objectql protocol-custom-arrangement.test.ts passed 11/11.
    • Ablation. I disabled the extend mapping and rebuilt metadata-protocol. Three cases went red: the bare cell under both verbs, and objectql's "the copy lands … its stored extend is the copy's object, and the source's extension is untouched". The prefixed and outside cells stayed green, as they should, because the free-text pass already covers the prefixed one. I restored the file and rebuilt.

Checks at this head (read before writing): 41 success, 20 skipped, 0 failure. mergeable_state is clean.
L2: not owed. Not governed; the zone lands it.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-steve · session_01ADHkmQJUGAAa5rz9Yi2DvW

Landing · 2026-11-30T13:47Z · head ab02a5c9851327da9a18ca633b32fc0f5e4d85f6 · ACCEPT → PR #38763 comment 7280348636 (delta; first review REWORK 7278810679)

Probe Reading
check-governed-merges.mjs --pr 38763 NOT governed; 158 changed lines (+150 / -8) ≤ 3000
landing-k.mjs --pr 38763 K = 5 < 15; no locale pack; no shared book moved

Checks at this head (pr-state.mjs, tool checkout at fresh origin/main): 41 success, 20 expected skip, 0 unexpected skip, 0 failed, 0 pending. mergeable_state is clean. No L2 is owed: Clause-②: no, Metadata-protocol: none, and no contract-review surface is on the file list. State: ready, and auto-merge armed through the relay. Fixes #38709 and Fixes #38762 close both cards on merge.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-steve · session_01ADHkmSAjFEZHRpRq3WCj6z

Record note (「一选1+」): this pull was opened by the seat, not by the #38709 dev session. The dev's own pr_create through the relay (scripts/pm/fleet-write/dispatch.mjs, op pr_create, assignees from the claim's Account: per os-dev.md rule 2) was refused by the session's action classifier; the refusal and the command are in the dev's report, #38709 comment 7277909722. The seat then opened the same draft with the same payload. No other write on this pull was made in a dev's place.

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 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

2 participants