Repository navigation
fix(cli): os migrate meta --write writes a moved form as a form item, or leaves it in its view - #39453
fix(cli): os migrate meta --write writes a moved form as a form item, or leaves it in its view#39453objectstack-fleet[bot] wants to merge 3 commits into
Conversation
…ith its source, or neither A conversion that moves content to another collection (the protocol-19 form move, its translation tails) reports the site it took the content from and names the destination only in `to`. The planner tied the destination's change to no entry, so it was never written while the source's removal was: the form was deleted from the view and written nowhere. The planner now reads an absolute destination path from `to` and joins its change to the entry, so the two are written together or left together. Claude-Session: https://claude.ai/code/session_016WV4cxRh6Sbfo2Xm49JPx6 Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016WV4cxRh6Sbfo2Xm49JPx6 Co-authored-by: Claude <noreply@anthropic.com>
📓 Docs Drift Check8 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 — 41 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 7f43ae6c75b1044de72c4af3da0b194da7a0dd60 && git checkout 7f43ae6c75b1044de72c4af3da0b194da7a0dd60
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin c9ea363d71087bd9d16e0a8ee6de0c5f76331e0c 2e00cd31774246647856b88894e1c606fffb56b5 && git checkout -B drift-repro c9ea363d71087bd9d16e0a8ee6de0c5f76331e0c && git merge --no-ff 2e00cd31774246647856b88894e1c606fffb56b5
node scripts/docs-audit/affected-docs.mjs --json c9ea363d71087bd9d16e0a8ee6de0c5f76331e0c |
|
repo:objectstack@os-elon-musk · os-elon-musk · session_016WV4czfEjskBjZM6jhKWFR 2026-12-04T01:04Z · L1-a verdict: ACCEPT at head 席位核对Checklist verdict. Shape: open, draft, base Code read.
The size call the zone asked to judge. Accepted. Evidence. New test, 5 cases: all 5 fail with End-to-end, recorded. The tests stop at the written source and a clean re-run. The card's user-visible loss ( Pointer for #39392: |
Requested by Elon · project thread
Fixes #39392
Clause-②: no
Metadata-protocol: none
维护者速读
What changes
os migrate meta --from 18 --writeplans its source edits by diffing the normalized stack against the migrated one and attributing each change to the conversion entry that explains it, by path. A conversion that MOVES content to another collection (the protocol-19 form moveviews[i].formViews.KEY→forms[name=OBJECT.KEY], and its translation-tail move_views.KEY.title/submitBehavior→ the bundle'sforms['OBJECT.KEY']) reports the site it took the content from and names the destination only into. No path rule tied the destination's change to that entry, and a change no entry explains is never written, so the source's removal was written alone: the form was deleted from the view file and written nowhere, the run said "no mechanical change remains", andos validatepassed.packages/cli/src/utils/authored-source-codemod.ts: newmoveDestination()reads an absolute destination path out of an entry'sto(keys,[0],['a.b'],[name=X]; resolved against the migrated stack, orpackages[i].manifestwhen the entry's path starts there) and returns it only when it reaches a value the chain changed.explainingEntries()joins every entry whose destination a change sits at, inside or around, unconditionally. Source and destination are therefore one component: written together, or both left asnot writtenwith the reason (for example a stack whoseformsis built by a call such asexportsOf(forms)), and the view block keeps its bytes. No conversion is known by name; atothat is a display value, a single key, relative, or unresolvable names no destination.WrittenSitegains optionalmovedTo { file, line }; the human report printsforms[name=OBJECT.KEY] ← views[i].formViews.KEYunder the destination's file, and--jsonaddsmovedToto the written site.@objectstack/clipatch.Tests
New
packages/cli/src/commands/migrate/meta.write-form-move-39392.test.ts(unit tier, in-processMigrateMeta.runover temp projects linking the real@objectstack/spec), 5 cases:exportsOf(…), noforms:key):formViews.intakelands in a newforms:list with the converted body, the view block goes only then, re-run is clean; the internal record form is deleted.submitBehaviortail: both moves write both halves.forms:built by a call ⇒ view file keeps its bytes, move listednot written, exit 1.Fails on main, passes here (both the write path and the refuse path), measured by swapping
origin/main'smeta.tsandauthored-source-codemod.tsinto this tree:Local, at 2e00cd3 (all under
os-verify-lock):The full cli
unitproject did not fit the container's foreground cap and was stopped, so it is narrowed to the 22 files above and declared to CI; theintegrationtier is CI's.Acceptance notes
check:dual-build-cjs-loads,check:i18n-coverage; one checker-health self-test needing a deeper clone:check-plugin-teardown-shape --self-test; two killed on the shared box:check:query-options-erasure,check:type-check-debt), all CI's.claude/issue-39392-wip@90b28ccbafter a container restart; this run verified the commit, mergedorigin/main, and ran the tests and gates.Verification
Read first, by risk:
packages/cli/src/utils/authored-source-codemod.ts:moveDestinationand theexplainingEntriesjoin (the only change to what gets written).packages/cli/src/utils/authored-source-codemod.ts: thewritten.pushhunk computingmovedTo.packages/cli/src/commands/migrate/meta.ts: the report lines.Two-minute check:
pnpm --filter @objectstack/cli exec vitest run --maxWorkers=2 src/commands/migrate/meta.write-form-move-39392.test.ts⇒Tests 5 passed (5).Generated by Claude Code