Skip to content

cli: os migrate meta --from 18 --write on the 18.6.0 showcase writes 6 files, fails its own re-check and restores all of them (exit 1), protocol range included: independent edits are all-or-nothing #38922

Description

@objectstack-fleet

qa#1 · os-justin · session_01QSeKYpxQpmErd1ixfkgbYh

Provenance: filed by the verification seat from runner session_01QSeKYnbcNyGspzsj2EpdvP (upgrade acceptance, test 1 of #38907); the runner made no GitHub write.
Ruling-ref: priority:p1 — maintainer 「都应该是 p1 吧?」 (2026-12-01, verification seat session; GA focus 「重点解决 v18到 v19 的升级」)

Filing gate: ① product defect, reproduced through the public entry (os migrate meta --write) · Source: maintainer, 「你发现的问题立卡了嘛?都应该是 p1 吧?」 (2026-12-01).

Grading: area:build · domain:cli · Bug · p1 (maintainer's word, Ruling-ref above) · reach: every 18.x app whose views name actions that the writer cannot place, measured on the 18.6.0 showcase · evidence: measured.

QA-source: #38920 · upgrade:18.6.0-to-19.0.0-next.3 · C2

Business reason

This is the GA upgrade path. The build error for view.list.bulkActions (#38550) sends every 18 user to os migrate meta --from 18 --write. On a real app the command now does nothing at all: it writes, its self-check disagrees, and it puts every file back. The user is left with 138 mechanical edits to make by hand from an index-keyed list, and also loses the one edit that worked, the root manifest's engines.protocol move to '^19', which the v19 page step 2 says --write makes.

Reproduction (measured 2026-12-01, framework ea6e312a, all packages from npm)

  1. Take the 18.6.0 showcase standalone: swap workspace:* for 18.6.0, install with pnpm. It validates, builds and boots on 18.
  2. Bump every @objectstack/* pin to 19.0.0-next.3, reinstall.
  3. npx os migrate meta --from 18 lists 138 mechanical changes (116 action-location renames, 17 bulk-action moves, 5 viewAllFields additions) and 85 manual.
  4. npx os migrate meta --from 18 --write: exit 1. It wrote 6 files, re-ran the chain over them, the result did not match, and it restored all 6. Net 0 written; engines.protocol stays '^18'.

Mechanism, as the run reads it: a view written as a literal names actions that are not themselves literals the writer can place (built by a helper, or the action name appears twice in src). The writer removes the view's bulkActions; the re-run then can no longer derive the matching selection additions on those actions from the rewritten sources, so the self-check fails and the whole write is undone.

After applying all 138 edits by hand, the replay (--from 18 --to 19) reports applied: 0, so the conversions themselves are right.

Expected

  1. Edits that do not depend on each other are not undone together. The engines.protocol rewrite and the action-location renames stand on their own and stay written.
  2. A bulkActions removal is written only together with the selection additions it pairs with; if those cannot be written, the removal is not written either, and the output names that pair (view, actions, files).
  3. A partial write says so on its first line ("wrote N of M; these K were left because …") and exits non-zero only for what it could not do, not by discarding what it did.

Reader

The domain:cli lane dev who owns os migrate meta's source writer and its post-write re-check. Acceptance pins: a fixture shaped like the showcase (a literal view naming helper-built actions) keeps its independent edits and the protocol range after --write; the paired removal is either written whole or skipped and named.

Dedupe

Searches (open and closed):

#38879 is the sibling: there the writer never writes; here it writes and then throws everything away. Different step of the same command, filed separately so each has its own acceptance; triage may fold them.

Related: #38550, #38879, #38907 (section B).

Activity

  1. added
    bug
    priority:p1
    domain:server
    on Dec 1, 2026
  2. objectstack-fleet commented on Dec 1, 2026

    @objectstack-fleet
    ContributorAuthor

    triage@os-warren · os-warren · session_01JQwxbZzZ2f5mzcvJbRrRNZ

    Triage: first-touch · lane grade kept: area:build · Bug · p1 (maintainer 「都应该是 p1 吧?」) · pm:queue. Part of the 19 GA upgrade lines on #38907.

  3. added
    pm:queue
    on Dec 1, 2026
  4. objectstack-fleet commented on Dec 2, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack@os-justin · os-justin · session_01QSeKYoSKoNUygbCoMBTbGc

    Claim: PM loop round 1 (zone build)
    Session: session_01QSeKYoSKoNUygbCoMBTbGc
    Account: os-justin
    Area: build
    Branch: claude/issue-38922-migrate-write-partial
    Worktree: objectstack-issue-38922
    Domain: domain:server
    Seat: repo:objectstack@os-justin
    File surface: packages/cli/src/utils/authored-source-codemod.ts, packages/cli/src/commands/migrate/meta.ts, packages/cli/src/utils/authored-source-site-finder.ts (from #39096), new sibling modules under packages/cli/src/utils/ only if authored-source-codemod.ts (over 1,000 lines) gains a new concern, new per-card test file packages/cli/src/commands/migrate/meta.write-partial.test.ts and its fixtures
    Container & model: M, mode:subagent, model: default judgement tier — dispatch-gates --tier on the same surface: "no path-derived mandate", effort: high (design judgement: which edits are independent and which pair)
    Clause-②: no
    Metadata-protocol: none
    Responsibility: packages/cli source writer and its post-write re-check in objectstack | no platform path covers it: #38550's build error sends 18 users here | every 18.x app whose literal views name actions the writer cannot place — measured on the 18.6.0 showcase (0 of 138 written, exit 1, engines.protocol rolled back)
    Thread-read: 7313665407
    Premise: holds — measured 2026-12-01 at ea6e312a; the dev re-measures on the #38879 branch head ec0a60d42e (that fix changes which sources resolve) with a fixture shaped like the showcase (a literal view naming helper-built or twice-named actions), and stops with evidence if the rollback no longer reproduces
    Pre-claim lane: domain:server (file ownership only) — packages/cli/** inside zone build's lease
    Pre-claim deps: no Blocked-by:. check-handover.mjs --inflight: OVERLAP with #38879 only (this zone's own claim 7336933200, PR #39096, L1 ACCEPT 7340092033, armed for auto-merge 7340113353) — this card is serial behind it. The dev starts from claude/issue-38879-migrate-write-exportsof@ec0a60d42e (area-lease: same-series card starts from the previous card's branch), and opens its PR only after #39096 is MERGED and origin/main is merged in (no stacked PR).
    Prior rulings read: check-prior-rulings on this surface (read for #38879 at 431f880): ruling 0 · Ruling-ref 0 · maintainer 0 · ⛔ 5 in meta.ts; carried: :1064 ADR-0087 D3 "never silence" (no notice dropped), :337 --json reads the report function (payload shape unchanged). ADR-0087 D3 read: the chain applies conversions to sources; no text requires an all-or-nothing write. No conflict.
    Fold-or-serial: no fold with #38879 (already ACCEPTed and armed; different mechanism, fold gate ①); serial behind it. #38923 / #38924 / #38925 queue behind this card on meta.ts.
    Serial constraints cleared: #38879 / PR #39096 named above (queued behind it)

  5. added
    pm:dispatched
    and removed
    pm:queue
    on Dec 2, 2026
  6. objectstack-fleet commented on Dec 2, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack@os-justin · os-justin · session_01QSeKYoSKoNUygbCoMBTbGc

    Claim amendment (claim 7340158020) · 2026-12-02T09:22Z
    File surface (added): docs/qa/platform-checklist/areas/cli.json — only the WRITE MODE verify sentence "⛔ A write the re-run disagrees with must come back restored with exit 1 and every file at its old bytes", which this card's per-unit re-check makes false. check-handover.mjs --inflight --paths=docs/qa/platform-checklist/areas/cli.json: no overlap (one unread surface, #38415, a pm-dispatch skill card). The zone's text-only companion PR to #39096 edits the Applied wording on other lines of the same file and leaves this sentence to this card; the later lander merges.
    Base: #39096 merged as 4b561894de; the dev merges origin/main before opening the PR.

  7. objectstack-fleet commented on Dec 2, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack@os-justin · os-justin · session_01QSeKYoSKoNUygbCoMBTbGc
    os-dev-report

    {
      "issue": 38922,
      "status": "done",
      "branch": "claude/issue-38922-migrate-write-partial",
      "pr": "https://github.com/objectstack-ai/objectstack/pull/39123",
      "session": "session_01QSeKYoSKoNUygbCoMBTbGc",
      "premise_still_valid": true,
      "summary": "Premise re-measured on the start point ec0a60d42e before any edit, with a showcase-shaped fixture (literal view naming a literal and a helper-built action, an action-location rename, engines.protocol '^18'): --write restored every file ('no longer converted: actions[1].locations'), range left at '^18'. Fix: (1) the planner asks the chain in memory, per unit, which units cannot be written without each other (new sibling module authored-source-write-units.ts; names no conversion: the predicted post-write stack is the start stack plus the written units' changes, each candidate unit is written alone beside the rest, and the entries that then vanish or reapply join it); a pair with a refused site is held whole as `entangled`, naming the blocking site. (2) The post-write disk re-check stays and now puts back only the units it disagrees with (`unverified`, a new refusal kind) and writes the rest again; an unattributable disagreement still restores every file. (3) The write group's first line says 'Wrote N of M ...; K left because of CAUSES (counts), listed below:', a pair group names each pair's sites (path, item names, file:line or reason) and files; a --write that leaves anything by hand exits 1. --json adds `write.pairs`, nothing renamed or removed. Checklist WRITE MODE verify text rewritten to the per-unit behaviour after merging #39112.",
      "tests": "New packages/cli/src/commands/migrate/meta.write-partial.test.ts, 4 cases. Targeted unit subset on 18764e5eb7 (vitest run --project unit over src/commands/migrate/meta.*, test/migrate-meta* unit tier, doctor-deprecation-hint-commands, invocation.test.ts, vitest-tiers-partition): `Test Files 20 passed (20)`, `Tests 217 passed (217)`; all eight --write suites are unit tier (vitest list). `pnpm --filter @objectstack/cli typecheck` exit 0 on 18764e5eb7. Ablations via scripts/ablation-replace.mjs, restore verified (blob == HEAD, git diff HEAD empty), cli tests resolve source (no dist leg), over the 4 write suites (62 cases): A in-memory pair hold off -> 3 failed / 59 passed; B disk put-back off -> 2 failed / 60 passed; C exit predicate off -> 5 failed / 54 passed / 3 skipped (first C attempt refused by the tool as a no-op, anchor inside replacement; re-run with a disjoint anchor). Cost probe (scratch, deleted): 200 entries, 20 views, 5 held pairs: --write 467 ms, verification ok (shared box).",
      "gates": "Local: all 77 families from `dispatch-gates.mjs --commands` (tree 74f3c5d2da), exit codes captured before any pipe; `--ran`: 77 accounted, 75 run, 2 NOT-MEASURED derived from exit 3 (check:dual-build-cjs-loads, check:i18n-coverage: PREREQUISITE NOT MET, need a full workspace build; CI). check:test-source-alias exit 1 on 74f3c5d2da (the two edited suites lacked module-top imports), fixed in 0666c92821, re-run exit 0 with check:cross-package-test-inputs, check:nul-bytes, check:tier-file-adoption, check:cli-test-child-env (all exit 0). After merging origin/main (#39112): check:platform-checklist exit 0, targeted subset and cli typecheck re-run green on 18764e5eb7. eslint --no-inline-config on the 4 main changed files exit 0. overlap-check VERDICT clean before each push except the 0666c92821 push, which reported overlap with #39112 (the expected companion); #39112 had already merged, so origin/main was merged and the checklist line reconciled, then VERDICT clean. CI on PR #39123: not read (convergence is PM's).",
      "mcp_calls": "0",
      "api_writes": "2 relay strokes: (1) pr_create via fleet-write dispatch (POST pulls + assignees [os-justin]), read back identical, 7479 bytes; (2) this os-dev-report comment via post-stamped.mjs on #38922. git push not counted.",
      "classifier_refusals": [],
      "open_questions": [],
      "security_findings": "none",
      "out_of_scope_findings": [],
      "files_changed": [
        ".changeset/38922-migrate-write-partial.md",
        "docs/qa/platform-checklist/areas/cli.json",
        "packages/cli/src/commands/migrate/meta.ts",
        "packages/cli/src/commands/migrate/meta.write-partial.test.ts (new)",
        "packages/cli/src/commands/migrate/meta.write-exportsof.test.ts",
        "packages/cli/src/utils/authored-source-codemod.ts",
        "packages/cli/src/utils/authored-source-write-units.ts (new)",
        "packages/cli/test/migrate-meta-protocol-range.test.ts",
        "packages/cli/test/migrate-meta-write.test.ts"
      ],
      "line_budget": "9 files, +1130 / -73 vs origin/main (PR #39123 head 18764e5eb7), under the 3,000-line line; no skills/** diff. authored-source-codemod.ts 2093 -> 2246, meta.ts 1863 -> 2027, new authored-source-write-units.ts 260.",
      "deviations": [
        "File surface widened past the claim: three existing test files whose pins assert the behaviour this card changes (test/migrate-meta-write.test.ts: a partial write exits 1 and its first line; meta.write-exportsof.test.ts: a 0-of-N write exits 1; test/migrate-meta-protocol-range.test.ts: a range that does not land is put back alone). The two test/ files also gained the module-top imports check:test-source-alias requires of an edited suite. The claim's file surface needs this supplement.",
        "Exit code: a --write that leaves any mechanical change or the declared range by hand now exits 1 (card Expected 3, dispatch section 3). This flips the earlier exit-0 behaviour for every partial write, including #38879's freshly pinned 0-of-N case.",
        "meta.ts (over 1,000 lines) gained the report helpers (leftBecause, printPairs, pair JSON) and the disk put-back mapping (disagreeingUnits) beside the existing report and writeSources code; the pairing logic itself is in the new sibling module. The codemod gained only the Phase 5 call, the hold input and the pair report.",
        "CodemodRefusalKind gains `unverified`; --json `manual[].kind` can carry it, and `write.pairs` is added. No field renamed or removed.",
        "Two gate-batch commands overran the 10-minute foreground limit and were moved to the background by the harness (not by me); I read their results in the foreground before going on.",
        "Commit trailers use the AGENTS.md model-free pair, not the harness reminder's model-named Co-Authored-By; the PR footer uses the AGENTS.md session-URL form.",
        "One build invocation was mis-typed (`--concurrency=2` handed to a pnpm recursive run, appended to the cli build script: exit 2, `sh: Syntax error`); the dependency closure had built, and cli was built again alone, exit 0."
      ]
    }
  8. objectstack-fleet commented on Dec 2, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack@os-justin · os-justin · session_01QSeKYoSKoNUygbCoMBTbGc

    Claim amendment (claim 7340158020) · 2026-12-02T10:40Z
    File surface (added): packages/cli/test/migrate-meta-write.test.ts, packages/cli/test/migrate-meta-protocol-range.test.ts and packages/cli/src/commands/migrate/meta.write-exportsof.test.ts. Their existing pins assert the behaviour this card changes: the partial-write exit code and first line, the 0-of-N exit code, and the range put-back. packages/cli/src/utils/authored-source-write-units.ts was already covered by the claim's new-sibling-module clause. check-handover.mjs --inflight on the added paths: see the reading above this stroke, in this session.
    PR: #39123 (draft, head 18764e5eb7), dev report 7342772453.

  9. objectstack-fleet commented on Dec 2, 2026

    @objectstack-fleet
    ContributorAuthor

    repo:objectstack@os-justin · os-justin · session_01QSeKYoSKoNUygbCoMBTbGc

    Delivered · 2026-12-02T11:31Z · PR #39123 merged as a533126fb4 (L1 ACCEPT 7343376759, landing 7343402815). Card closed by Fixes #38922; pm:dispatched removed with this note. Carried nit for the zone's next text PR: the changeset should say manual[].kind gains unverified.

  10. removed
    pm:dispatched
    on Dec 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area:buildbugdomain:serverpriority:p1

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions