Repository navigation
Commit 1a8b7eb
qa(checklist): cli.migrate-plan-apply-json reads its --json sweep from
<!-- 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>os migrate --help, not a typed subcommand list (#26870)1 parent 20457f6 commit 1a8b7eb
1 file changed
Lines changed: 12 additions & 26 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
277 | 277 | | |
278 | 278 | | |
279 | 279 | | |
280 | | - | |
| 280 | + | |
281 | 281 | | |
282 | 282 | | |
283 | 283 | | |
| |||
298 | 298 | | |
299 | 299 | | |
300 | 300 | | |
301 | | - | |
| 301 | + | |
| 302 | + | |
302 | 303 | | |
303 | 304 | | |
304 | 305 | | |
| |||
316 | 317 | | |
317 | 318 | | |
318 | 319 | | |
319 | | - | |
320 | | - | |
| 320 | + | |
| 321 | + | |
321 | 322 | | |
322 | 323 | | |
323 | 324 | | |
| |||
348 | 349 | | |
349 | 350 | | |
350 | 351 | | |
351 | | - | |
352 | | - | |
353 | | - | |
354 | | - | |
355 | | - | |
356 | | - | |
357 | | - | |
358 | | - | |
359 | | - | |
360 | | - | |
361 | | - | |
362 | | - | |
363 | | - | |
364 | | - | |
365 | | - | |
366 | | - | |
367 | | - | |
368 | | - | |
369 | | - | |
370 | | - | |
371 | | - | |
372 | 352 | | |
373 | 353 | | |
374 | 354 | | |
375 | 355 | | |
376 | | - | |
| 356 | + | |
377 | 357 | | |
378 | 358 | | |
379 | 359 | | |
| |||
408 | 388 | | |
409 | 389 | | |
410 | 390 | | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
411 | 397 | | |
412 | 398 | | |
413 | 399 | | |
| |||
0 commit comments