Repository navigation
fix(metadata-protocol): duplicating a package copies its seeds (no stamped name on a seed) - #39347
objectstack-fleet[bot] wants to merge 3 commits into
Conversation
…opy's seeds save The rename engine names every copied body; a seed is addressed by its row name and the strict SeedSchema refuses `name`, so every seed of a duplicated package was refused at the save door. Pinned on a booted kernel. Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Utp6CY1DVmttnuNH77G3ht
Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Utp6CY1DVmttnuNH77G3ht
📓 Docs Drift CheckThis PR changes 1 package(s): ⛔ 1 release-owned page(s) 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 6f5204508172e21fd530685d81a86067d24b5c63 && git checkout 6f5204508172e21fd530685d81a86067d24b5c63
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin c99c8a502209f6e924c77e227c2648993f22f3cb 6187abde571e63c03b3b3d57fdc52543083a1315 && git checkout -B drift-repro c99c8a502209f6e924c77e227c2648993f22f3cb && git merge --no-ff 6187abde571e63c03b3b3d57fdc52543083a1315
node scripts/docs-audit/affected-docs.mjs --json c99c8a502209f6e924c77e227c2648993f22f3cb
|
…ate seed pin Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Utp6CY1DVmttnuNH77G3ht
Requested by Bill · project thread
Fixes #39341
Clause-②: no
Metadata-protocol: none
维护者速读
What changes
ProtocolPackageCommitsFacet.duplicatePackagecopies every active row of the source package through the shared rename engine (planNamespaceRenameinpackage-namespace-rename.ts), whoserewritesetsnameto the copy name on every body except anobject_extensionone. Aseedbody has noname: a seed is addressed by its row name, and the strictSeedSchemarefuses the key. So every copied seed met the save door's spec validation ("Unrecognized key(s) on this seed:name") and the duplicate answeredsuccess: false, listing each seed infailed.The duplicate door now takes the stamped
nameback off a copied seed before it saves it (one line inprotocol-package-commits.ts). The seed schema is unchanged (nonameadded to its accept set, per the card's Done-when). The copy'sobjectstill follows the copied object, through the engine's reference rewrite.Where
nameenters, and why other types do not trip: the engine'srewritestamps it; every other copied type declaresnamein its schema, andobject_extensionwas already exempted at the engine. The sibling copy door, the unmanaged install withtargetNamespace, never sends aseedthroughrewrite(it plans the seed's object name itself), so it is not affected.Tests
packages/objectql/src/protocol-duplicate-package-unprefixed-object.test.ts(realObjectKernel+ObjectQLPlugin, rows read out of the driver): a source package with an object and a seed is duplicated; assertssuccess: true,failed: [], the copy's seed is stored underdupdst_customer_seed, aimed atdupdst_customer, with the source's records, nonamekey, and a fullSeedSchema.safeParsesuccess.metadata-protocolbuilt from the basefde47efb, failed with the card's exact refusal (seed/dupdst_customer_seed failed spec validation: Unrecognized key(s) on this seed: name). Green after rebuilding with the fix.Acceptance notes
rewritefor seeds for that reason. Not reproduced on any real package; no reach measured.nameonly on types whose declaration carries one) lives inpackage-namespace-rename.ts, outside this card's claimed file surface.Verification
Two-minute check:
pnpm --filter @objectstack/metadata-protocol build && pnpm --filter @objectstack/objectql exec vitest run src/protocol-duplicate-package-unprefixed-object.test.ts -t 39341shows 1 passed.Read first:
packages/metadata-protocol/src/protocol-package-commits.ts(the seed strip afterrename.rewrite), then the new describe at the end of the objectql harness file.Generated by Claude Code