Repository navigation
fix(metadata-protocol): copy an object_extension row without a name key - #38763
Conversation
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>
Claude-Session: https://claude.ai/code/session_01ADHkmQJUGAAa5rz9Yi2DvW Co-authored-by: Claude <noreply@anthropic.com>
📓 Docs Drift CheckThis PR changes 1 package(s): 6 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:
⛔ 5 release-owned page(s) also name something this change touched. These are read-only:
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 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
|
|
repo:objectstack#3 · os-steve · session_01ADHkmT9HTWLMN33WUVxVWB 席位核对REWORK @ ab13b5b (card #38709, 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
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:
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:
What may not land is a copy reported as succeeded that extends the source's object. Read and found right:
Checks at this head (read before writing): 39 success, 18 skipped, 0 failure, 0 pending. |
…tension-copy-name
…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>
…ject Claude-Session: https://claude.ai/code/session_01ADHkmQJUGAAa5rz9Yi2DvW Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack#3 · os-steve · session_01ADHkmT9HTWLMN33WUVxVWB 席位核对ACCEPT @ ab02a5c (cards #38709 and #38762, both
Checks at this head (read before writing): 41 success, 20 skipped, 0 failure. |
|
repo:objectstack#3 · os-steve · session_01ADHkmQJUGAAa5rz9Yi2DvW Landing · 2026-11-30T13:47Z · head
Checks at this head ( |
|
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 |
Requested by Steve · project thread
Fixes #38709
Fixes #38762
Clause-②: no
Metadata-protocol: none
维护者速读
What changes
planNamespaceRename(...).rewrite(the one rename engineduplicatePackageandimportUnmanagedPackagewithtargetNamespaceboth call) setname = copyName(type, name)on every rewritten body. Anobject_extensionbody is keyed byextend;ObjectExtensionSchemais a strict object andnameis only a retired alias, so every copied extension row landed infailed[]with "Unrecognized key(s) on this object extension:name". Two changes, both inpackage-namespace-rename.ts:nameforobject_extensiononly; every other type still takes its copy name.extendis 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 asacme_ticket) extends the copy, not the source's object. A prefixed name (crm_leadtoacme_lead) keeps its result and is not renamed twice, because the mapping reads the source value. Anextendnaming an object the copy does not hold (a platform object, another package's, even one spelled with the source prefix) keeps its name.copyNamenames anobject_extensionrow by the same map, so the row name and itsextendnever part.Re-measured gap (on base
2f8383ffc6, by tightening the control first and running it before the fix): the duplicate'sfailed[]heldobject_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: noobject_extensionentry infailed[], the row incopied[], stored in the target under its target name, stored body exactly{ extend }(noname). Theittitle now says it lands incopied[]and is stored.describe(duplicate level): a source package holding a bare objectticketand an extension of it, duplicated intoacme: nothing infailed[], the extension incopied[]asacme_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 caseextend: 'acme_ticket'and row nameacme_ticket; prefixed caseacme_lead, followed once; CONTROL: anextendnaming an object the copy does not hold keeps its name, body and row alike (includingcrm_platform, spelled with the source prefix); fullObjectExtensionSchema.safeParsegreen.extendstayedticket), the control red on the row name (acme_platformwhereextendstayedcrm_platform), and the duplicate-level pin red (no object named 'ticket' is registered).scripts/ablation-replace.mjs: round 1, thenameguard made unconditional, turned all threenamepins red. Round 2, theextendmapping 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
importUnmanagedPackagerefuses a manifest'sobjectExtensionsat its plan (UNMANAGED_INSTALL_KEY_DISPOSITIONS.objectExtensions: 'uncopyable', 422UNMANAGED_INSTALL_UNCOPYABLE, already pinned inpackage-unmanaged-install.test.ts), so no import can carry anobject_extensionto 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 underretryVerb: 'install'.tickettoacme_ticket), with its row named the same. Before, it stayedticketand would have extended the source's object.copyNameused to swap the prefix (crm_platformtoacme_platform) whileextendstayed. 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(thenameguard and theextendmapping inrewrite, thencopyName), then the two objectql pins.🤖 Generated with Claude Code
https://claude.ai/code/session_01ADHkmQJUGAAa5rz9Yi2DvW