Repository navigation
feat(cli): group advanced verbs under a lab subcommand (keep every verb) - #1169
Conversation
|
Tip SHA: Base: Ran — fresh clone at this sha,
Independently at this sha:
Not run:
No UI surface: terminal help text only; there is no rendered interface to screenshot, and the body quotes the usage line instead. Non-blocking:
Verdict: PASS — advisory QA verdict at |
|
Fresh clone at the named sha ( Contract. Zero-change evidence, independent of the new tests. Tests and gates. At the tip: Non-blocking — Not run: full Merge path: the owner's PASS at this tip and the explicit click; nothing here approves or merges. |
|
Advisory read at T2 by path ( Tip SHA: 7bbb727
Findings:
No UI surface: the CLI help listing only; nothing rendered changes. |
|
Self-review (Birfy) Tip SHA: 7bbb727
|
Closes #1171 ## What changed After #1169, `lab` mounts every verb, including the internal `run` worker that `evolve --detach` spawns. Help already omitted its line, and `_visible_choices` already stripped it from `choose from`, but the `lab` subparsers left argparse's default metavar, so `agentdescent lab --help` and the usage line on a `lab` argparse error (plain and `--json`) listed `run` in the braces. `build_parser` now sets that metavar from the public choices, the same #420 contract as the top-level usage line. `agentdescent lab run --run-dir …` still parses. - `agentdescent/cli.py`: set `lab_sub.metavar` from choices minus `_INTERNAL_COMMANDS`. - `tests/test_cli_help_hides_internal_run.py`: pin help/usage, a typo error, the `--json` envelope, and that `lab run` still parses. - `changelog.d/1171-lab-hides-internal-run.md`. No other verb's arguments, output, or exit code change. ## Verification Tip SHA: 594b177 Red first, at `origin/main` `367d140f` with only the new tests: - `FAILED test_lab_help_and_usage_do_not_list_run` — `run` in the braces - `FAILED test_lab_every_listed_verb_has_a_help_line` — `run` has no help line - `FAILED test_lab_unknown_verb_error_does_not_list_run` — usage on `lab xyz` lists `run` - `FAILED test_lab_unknown_verb_json_hides_run` — `--json` `usage` lists `run` - `test_lab_run_still_parses` passed (already reachable) Ran: - `pytest -q tests/test_cli_help_hides_internal_run.py tests/test_cli_lab_grouping.py` → 128 passed - `python -m tools.changelog_fragments check` → 83 changelog fragment(s) OK - `agentdescent lab --help` usage braces start `{demo,init,plan,evolve,status,watch,...}` (no `run`) - `agentdescent --json lab xyz` — `"run"` is not in `error` or `usage` Not run: - Full offline suite — this diff is the `lab` usage metavar plus tests that pin #420; the CI test matrix is the line - `python -m tools.gen_api_docs --check` — no public API docstring change No UI surface: terminal help and argparse error text only.
Fixes #1112.
What changed
agentdescent --helpnow shows one first-run path; every other verb moved into an additivelabgroup. Nothing was removed, renamed or deprecated._register_commands(mount, *, with_lab)(agentdescent/cli.py), andbuild_parser()mounts them twice: at the top level (_CommandMount(..., listed=False), which dropshelpfor anything outsideDEFAULT_SURFACE) and underlab(listed=True). No block is copied.DEFAULT_SURFACEisdemo, init, plan, evolve, show, apply, doctor, status, lab, mcp. It decides the help listing and the usage{…}only — the listing is sorted to that order and the metavar is built from it.runhas used since cli:agentdescent --helpprintsrun ==SUPPRESS==and advertises the internalrunworker in usage #420.agentdescent campaign …andagentdescent lab campaign …both parse; only the listing changed.labmounts every verb but itself, so the group is not recursive (lab labis not a command) and the first-run verbs are reachable there too (lab status,lab doctor).runverb is reachable aslab run.agentdescent lab run --run-dir …parses to the samefn, has no help line at either mount (it stays internal), and_INTERNAL_COMMANDSkeeps it out ofchoose fromlists.fn, argument, output or exit code moved; the tests assert both paths parse to the same dispatch and the same namespace apart from the dispatch keys (cmd,lab_cmd).changelog.d/1112-lab-grouping.mdadded (oneChangedentry).Verification at the tip
Tip SHA: 7bbb727
Red first, at
origin/mainf8efc73with onlytests/test_cli_lab_grouping.pyadded —77 failed, 32 passed:FAILED tests/test_cli_lab_grouping.py::test_the_usage_line_names_the_same_surface—assert ['demo', 'ini…', 'watch', …] == ['demo', 'ini…', 'show', …](all 40 public verbs listed)FAILED tests/test_cli_lab_grouping.py::test_lab_path_parses_like_the_top_level[demo]—SystemExit: 2,invalid choice: 'lab'Ran at this tip:
pytest -q tests/test_cli_lab_grouping.py tests/test_cli_help_hides_internal_run.py→123 passedpytest -qover every CLI/help/integration file (test_cli*,test_meta_cli,test_snapshot_cli,test_runstore_cli,test_plain_cli_warnings,test_missing_cli_kind_remedy,test_plugin_host_cli,test_resume_host_cli,test_mcp_*,test_demo) →588 passed7 855 passed, 21 failed, 51 skipped, 10 errors. Those 21 failures + 10 errors are the docker / read-only-$HOMEfiles (test_sandbox_container,test_apply_noop,test_era_srbench,test_genesis_example,test_skill_library_*,test_integrations,test_dir_evolution,test_skill_dir_example) and reproduce identically atf8efc73in the same files:21 failed, 436 passed, 15 skipped, 10 errorsat base and at tip.python -m tools.gen_api_docs --check→docs/api.md is up to date(no regeneration needed)python -m tools.changelog_fragments check→81 changelog fragment(s) OKtests/test_cli_help_hides_internal_run.py::test_every_public_verb_is_still_listed_in_orderupdated to the new contract: the usage line lists the surface, and the advanced verbs are hidden from it, not removed.Not run:
$HOMEcases — no docker on this host; CI runs them, and they behaved the same at the base commitHelp surface at this tip
No UI surface: terminal help text only.