Skip to content

Commit 1a8b7eb

Browse files
qa(checklist): cli.migrate-plan-apply-json reads its --json sweep from os migrate --help, not a typed subcommand list (#26870)
<!-- claude-projects-attribution: {"github_login":"os-warren"} --> _Requested by **Warren** · [project thread](https://claude.ai/code/project/chan_01U5RdnAAmkSQmZbqh6FtqZ8?thread=cmsg_01U5RdnAAmkSQmZbqh6FtqZ8WbZXDPXReWQm6PDNoQJQUM)_ Fixes #26795 Clause-②: no Metadata-protocol: none ## 维护者速读 - 改了什么:`areas/cli.json` 里 `cli.migrate-plan-apply-json` 删掉手打的 19 个子命令 variants 清单,新增一步从 `os migrate --help` 读子命令集合做 `--json` 退出码扫描(revision 7 → 8)。 - 为什么改:#26772 加了 `audit-key-material`,成了 20 个,清单和 source 里的「19」又漂了;按 #26431 规则,已有权威来源的集合不再手抄。 - 风险与回滚:只动 QA 台账一个 JSON 文件,不碰产品代码、不加新 gate;回滚即 revert。 - 先看:该条目新的最后一个 step(duplicates 例外、`audit-key-material`、USAGE 必填参数),acceptance[2] 的 verify/evidence,history revision 8。 - 两分钟验证:构建 CLI 后跑 `node packages/cli/bin/run.js migrate --help`,COMMANDS 下应列出 20 个,含 `migrate audit-key-material`;`pnpm check:platform-checklist` 输出 OK。 - 需要你做的:无,席位落地。 ## What changes `docs/qa/platform-checklist/areas/cli.json`, item `cli.migrate-plan-apply-json` only (revision 7 → 8): - `variants` (19 hand-typed subcommand names) is **removed**. - A new last step runs the #4873 `--json` sweep over the set the CLI itself reports: capture `os migrate --help`'s COMMANDS list (oclif pattern strategy over `packages/cli/src/commands/migrate/`, `index.ts` being the bare command), then run each subcommand's dry run with `--json` and `echo $?`, adding only what that subcommand's own `--help` USAGE line marks required (`unmapped-columns` takes `--object`). The duplicates exception stays explicit: always JSON on stdout, no `--json` flag, run bare, and an oclif Nonexistent-flag exit 2 from feeding it one is not a #4873 violation. `audit-key-material` (#26772) is named, with the same flags as `audit-mail-bodies` (`--apply`, `--yes`, `--force`, `--json`). - `acceptance[2]`: the clause sentence is unchanged; `verify` extends to every subcommand the sweep read from `--help`, and `evidence` asks for the captured COMMANDS list beside the exit code per subcommand. - The `source` note drops "the 19 registered subcommands … enumerated as variants" and says the sweep reads the set at run time. - `history` row 8 cites #26772 and #26795. ## Why The item's typed list had to be re-counted at revisions 2, 3, 4 and 6, and #26772 drifted it again (20 registered, 19 listed, source saying 19). Triage (6448491067) ruled the fix: derive the sweep from the CLI's own subcommand list under the #26431 rule, where a set that already has an authority keeps the authority and loses the retyped copy. **Variants list: dropped, not cross-checked.** The order allowed keeping a list if a gate failed on drift from the registry. I dropped it: the #26431 rule says "no new gate, no new ledger", and a gate holding a list equal to the directory is exactly the transcription pin that rule retires. The runner loses nothing, because `os migrate --help` prints the same names plus each one's description, read from the build under test. So `scripts/check-platform-checklist.mjs` and its test are untouched. **The order's hypothesis, read on main:** `packages/cli/src/commands/migrate/index.ts` does not register subcommands. It is the bare `os migrate` command (it extends `MigratePlan`). The registry is oclif's `pattern` strategy over `dist/commands/**/*.js` (`packages/cli/package.json` `oclif.commands`), so every non-test file in the directory is a command; none sets `hidden`. `audit-key-material.ts` takes the same flags as `audit-mail-bodies.ts`: confirmed. ## Verification - CLI built at this branch (`OS_SKIP_DTS=1 turbo run build --filter=@objectstack/cli...`, 61 tasks, exit 0). `node packages/cli/bin/run.js migrate --help` lists 20 subcommands under COMMANDS, `migrate audit-key-material` among them, matching the 20 non-test, non-index files in the directory. oclif 5.1.2 `showCommandHelp` prints a command's direct subcommands, which is what the step relies on. The USAGE lines of the 15 subcommands the earlier steps do not run: only `unmapped-columns` has a required flag (`--object`), and only `duplicates` has no `--json`. - The item was edited by exact-string surgery (the area file does not round-trip through a JSON re-dump), then parsed before and after: only this item's `revision`, `steps`, `acceptance`, `variants`, `source` and `history` differ; every other item and the area-level keys are identical. - `node scripts/pm/dispatch-gates.mjs --commands` derived 16 commands at head e0123bf (rebased on origin/main e9e344a); all 16 exit 0, and `--ran` reconciles 16 derived, 16 run, 0 NOT-MEASURED. `check:doc-formula-expressions` needed the `@objectstack/formula` + `@objectstack/lint` build first (container state, not the diff). - `pnpm check:platform-checklist`: OK, 16 areas, 329 items. - No changeset: `docs/qa/**` publishes nothing (`skip-changeset`). No dogfood battery: no test file changed. ## Human Minimum - [x] 1. Schemas start as Zod; `packages/spec` holds no runtime logic. (not touched) - [x] 2. Every name I added uses the casing for its kind. (no names added) - [x] 3. No formatter ran; `pnpm lint` passes. (no lintable file changed) - [x] 4. One issue, one branch off an up-to-date `main`, one pull request. - [x] 5. A change that publishes carries a changeset, and both declaration lines are filled in here and in the changeset. (publishes nothing) - [x] 6. `packages/spec` touched: its generated artifacts are regenerated and committed. (not touched) - [x] 7. No hand edits to `content/docs/references/`, `packages/*/CHANGELOG.md` or `content/docs/releases/`. - [x] 8. Title, body and comments are in English. - [x] The *Before Submitting* list in CONTRIBUTING.md is done. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01JQwxbWV1vrjPgSUEHcJzs4 --------- Co-authored-by: Claude <noreply@anthropic.com>
1 parent 20457f6 commit 1a8b7eb

1 file changed

Lines changed: 12 additions & 26 deletions

File tree

  • docs/qa/platform-checklist/areas

‎docs/qa/platform-checklist/areas/cli.json‎

Lines changed: 12 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@
277277
"title": "os migrate: bare command is a read-only plan, apply is safe-by-default, re-runs are idempotent, and --json exits 0 on success (#4873)",
278278
"since": "v15",
279279
"status": "active",
280-
"revision": 7,
280+
"revision": 8,
281281
"priority": "P1",
282282
"surface": "cli",
283283
"personas": ["operator (local shell)"],
@@ -298,7 +298,8 @@
298298
"remove a field from the config + `os build`; run `os migrate apply --yes` WITHOUT --allow-destructive (the drop must be SKIPPED with a warning), then with `--allow-destructive --yes` (applied)",
299299
"with the dev server booted and holding the DB, run `os migrate apply --yes; echo $?` (expect the busy refusal, exit 1, without --force) and `os migrate plan` (proceeds with a warning — a plan writes nothing either way)",
300300
"run `os migrate apply --json` WITHOUT --yes on a pending change: the payload must say confirmation_required with the pass--yes hint and mutate nothing",
301-
"the #4873 pair: on the scratch DB run `os migrate recorded-by --json; echo $?` and `os migrate resume --json; echo $?`"
301+
"the #4873 pair: on the scratch DB run `os migrate recorded-by --json; echo $?` and `os migrate resume --json; echo $?`",
302+
"the #4873 --json sweep over every subcommand: read the set from the CLI itself, never from a list typed into this item. `os migrate --help` prints it under COMMANDS (oclif pattern strategy: one default-exported Command per non-test file in packages/cli/src/commands/migrate/, index.ts being the bare command); capture that list. For each listed subcommand the steps above did not already run, run its dry-run form `os migrate <name> --json; echo $?` on the scratch DB, adding only what that subcommand's own `os migrate <name> --help` USAGE line marks required (unmapped-columns takes --object <name>). audit-key-material (#26772) is in the set and takes the same flags as audit-mail-bodies (--apply, --yes, --force, --json), so its dry run is the probe. ⛔ The one exception: duplicates (#8928) is ALWAYS JSON on stdout and has NO --json flag, so run it bare (`os migrate duplicates; echo $?`) and never feed it --json, whose oclif Nonexistent-flag exit 2 is not a #4873 violation (deep coverage at cli.migrate-duplicates-inventory). A subcommand added later joins the sweep through the --help list, with no edit here, unless it too lacks --json"
302303
],
303304
"acceptance": [
304305
{
@@ -316,8 +317,8 @@
316317
{
317318
"clause": "#4873 exit-code honesty: EVERY migrate subcommand with --json exits 0 on success — never the elapsed-ms leak (recorded-by/resume once passed timer.elapsed() into the exit-code slot, so the shell saw duration & 0xFF: a different bogus nonzero on every successful run)",
318319
"oracle": "log",
319-
"verify": "echo $? after plan/apply/recorded-by/resume --json successes is exactly 0; the CliExitCode 0|1 type now makes the mistake a compile error",
320-
"evidence": "the collected exit codes per subcommand"
320+
"verify": "echo $? after plan/apply/recorded-by/resume --json successes, and after every other subcommand the sweep step read from `os migrate --help` (duplicates run bare), is exactly 0; the CliExitCode 0|1 type now makes the mistake a compile error",
321+
"evidence": "the captured `os migrate --help` COMMANDS list + the collected exit code per listed subcommand"
321322
},
322323
{
323324
"clause": "apply is safe-by-default: a destructive change is SKIPPED with an explicit warning until --allow-destructive, then applied with it — both sides captured",
@@ -348,32 +349,11 @@
348349
"an apply that performs a drop WITHOUT --allow-destructive is the FAIL the safe-by-default split exists for",
349350
"exit 0 from a refused (busy) apply, or ANY nonzero exit from a successful --json run, is a FAIL — exit codes are the load-bearing CI contract here"
350351
],
351-
"variants": [
352-
"plan (default of the bare command)",
353-
"apply",
354-
"resume",
355-
"recorded-by",
356-
"duplicates (#8928 read-only cross-partition duplicate-identifier inventory — ALWAYS JSON on stdout with NO --json flag, so the #4873 --json sweep must not probe it with one; deep coverage at cli.migrate-duplicates-inventory)",
357-
"meta",
358-
"files-to-references",
359-
"summary-nulls",
360-
"value-shapes",
361-
"account-issuer",
362-
"audit-metadata-bodies",
363-
"multi-value-columns",
364-
"unmapped-columns",
365-
"organization-ownership",
366-
"security-catalog-overlays",
367-
"comment-reactions",
368-
"activity-changed-fields",
369-
"comment-parent-pair",
370-
"audit-mail-bodies"
371-
],
372352
"traps": ["stale-dist"],
373353
"source": [
374354
"packages/cli/src/commands/migrate/index.ts + plan.ts (#2186 bare-command-is-plan; #3917 enforced never-mutates; occupancy warning) + apply.ts (--allow-destructive / --force / --yes / in_sync)",
375355
"packages/cli/src/utils/format.ts#CliExitCode (CliExitCode narrows the emitJson exit slot — the #4873 fix, commit 83df2fd)",
376-
"packages/cli/src/commands/migrate/ (the 19 registered subcommands under `os migrate`, besides the bare command, enumerated as variants — oclif pattern strategy, one default-exported Command per non-test file)",
356+
"packages/cli/src/commands/migrate/ (the registered subcommands under `os migrate`, besides the bare command — oclif pattern strategy, one default-exported Command per non-test file, listed by `os migrate --help`; the sweep step reads the set from there at run time, so this item carries no count and no list)",
377357
"sibling item cli.migrate-duplicates-inventory (the duplicates subcommand's own contract — cross-referenced, not duplicated)"
378358
],
379359
"history": [
@@ -408,6 +388,12 @@
408388
"date": "2026-10-20",
409389
"change": "automated removed, fixtures.knownGaps[0] added — checklist-accuracy finding of QA run #24840 (18.0 sweep round 4, Tier 1 at 307ce4c4, 'Refs that claim more than their pins assert'), round 15 of wave anchor #24579. The ref said format.exit-code.test.ts covers acceptance[2]. That pin calls emitJson / emitText in-process, while acceptance[2] asks for `echo $?` after each subcommand's --json success, which only a spawned CLI answers. By RUNNER rule 6 (a pin scores only the layer it drives) it scores no clause, so automated is dropped (theme-B rule) and the knownGap says what the pin does assert. Read at base b1676441ba. No clause changed",
410390
"ref": "#24891"
391+
},
392+
{
393+
"revision": 8,
394+
"date": "2026-10-27",
395+
"change": "variants list removed; the #4873 sweep now reads the subcommand set from the CLI. #26772 added audit-key-material, the 20th registered subcommand, and the typed list (19 names, the source note saying 19) missed it, as revisions 2, 3, 4 and 6 each had to re-count it before. Under the #26431 rule a retyped list of a set that already has an authority goes, so a new steps entry derives the set from `os migrate --help` (oclif pattern strategy over packages/cli/src/commands/migrate/), keeps the duplicates exception explicit (always JSON, no --json flag, run bare), takes each subcommand's required inputs from its own --help USAGE line, and names audit-key-material, which takes the audit-mail-bodies flags. acceptance[2] verify and evidence name the derived list; the source note drops the count. No gate added: the list it would hold equal to the tree is the one removed. Clause text unchanged. Read at base 4c29f384, where `os migrate --help` lists 20 subcommands",
396+
"ref": "#26795"
411397
}
412398
]
413399
},

0 commit comments

Comments
 (0)