Repository navigation
fix(cli): derive consistency-checker surface from apm --help and fit root summaries - #3643
Conversation
…root summaries The cli-consistency-checker workflow now walks apm --help recursively instead of a stale hand list, and cross-checks the current CLI reference under docs/src/content/docs/reference/cli/. Ten top-level commands get a Click short_help so apm --help prints them without truncation; their --help bodies are unchanged. Lock recompiled with gh-aw v0.89.15. Fixes #3523 Co-authored-by: Copilot App <[email protected]>
…523-cli-consistency-checker
Co-authored-by: Copilot App <[email protected]>
There was a problem hiding this comment.
🟡 Changes recommended
The nested-group test can contact the live release API and write update-cache state because the update checker is not mocked, making the test non-hermetic.
1 open issue
What changed in this PR
Addresses #3523 by deriving the CLI consistency checker’s coverage from live help output and keeping top-level command summaries readable at 80 columns.
Changes:
- Replaces the fixed command list with recursive help discovery and points documentation checks at the current CLI reference directory.
- Adds concise summaries for ten commands and synchronizes lazy-command summaries without changing command behavior or long help.
- Adds regression checks for summary formatting, command discovery, and documentation paths.
| File | Description |
|---|---|
tests/unit/test_cli_consistency.py |
Checks that root summaries fit without truncation or wrapping. |
tests/unit/test_cli_consistency_checker_workflow.py |
Adds workflow discovery and documentation-path guards. |
src/apm_cli/commands/uninstall/cli.py |
Adds a concise uninstall summary. |
src/apm_cli/commands/prune.py |
Adds a concise prune summary. |
src/apm_cli/commands/lock.py |
Adds a concise lock summary. |
src/apm_cli/commands/install.py |
Adds a concise install summary. |
src/apm_cli/commands/find.py |
Adds a concise find summary. |
src/apm_cli/commands/export_patch.py |
Adds a concise export-patch summary. |
src/apm_cli/commands/doctor.py |
Adds a concise doctor summary. |
src/apm_cli/commands/audit.py |
Adds a concise audit summary. |
src/apm_cli/commands/approve.py |
Adds concise approve and deny summaries. |
src/apm_cli/cli.py |
Synchronizes lazy-command summaries. |
CHANGELOG.md |
Records the help and checker fixes. |
.github/workflows/cli-consistency-checker.md |
Introduces recursive discovery and current documentation paths. |
.github/workflows/cli-consistency-checker.lock.yml |
Updates the compiled workflow’s body hash. |
Review effort: Balanced
Step 3.4 now says subcommands at any depth live on their top-level command's reference page, and tells the agent to invoke a docs-mentioned command or flag directly before flagging it, since hidden aliases such as apm info never appear in --help. Addresses doc-writer panel follow-ups on PR #3643. Lock recompiled with gh-aw v0.89.15. Co-authored-by: Copilot App <[email protected]>
Nested --help invocations run the root callback, which calls the update checker and may hit the release API and write cache state. Patch it so the walker parity test stays hermetic. Addresses Copilot inline on tests/unit/test_cli_consistency_checker_workflow.py:64. Co-authored-by: Copilot App <[email protected]>
Hidden options never appear in --help, so passing the option together with --help is the reliable existence probe (Click rejects unknown options before handling --help). Addresses doc-writer delta follow-up on PR #3643. Lock recompiled with gh-aw v0.89.15. Co-authored-by: Copilot App <[email protected]>
APM Review Panel:
|
| Persona | B | R | N | Takeaway |
|---|---|---|---|---|
| DevX UX Expert | 0 | 0 | 0 | New root summaries are accurate and stylistically consistent, and lose no essential meaning. |
| Test Coverage Expert | 0 | 0 | 0 | Each Done-when item has a regression trap; the walker test is hermetic after the fold; all tests pass. |
| Doc Writer | 0 | 3 | 0 | Three Step 3.4 clarity gaps (hidden aliases, depth-3 page mapping, hidden-option probe); all folded. |
B = blocking-severity findings, R = recommended, N = nits.
Counts are signal strength, not gates. The maintainer ships.
Folded in this run
- 2cbc8c7 -- [Doc Writer] Step 3.4: subcommands at any depth map to the top-level page; invoke docs-mentioned commands directly before flagging.
- 067014d -- [Copilot, LEGIT] Patch
apm_cli.cli._check_and_notify_updatesin the walker parity test so nested--helpstays offline. - 7d41aec -- [Doc Writer, delta] Probe hidden options with
--option value --help.
Copilot signals reviewed
- 4553459125 (tests/unit/test_cli_consistency_checker_workflow.py) -- LEGIT: nested
--helpruns the root callback, which calls the update checker (confirmed). Folded and thread resolved.
Evidence
- Lint: ruff check/format (uv.lock pin 0.15.12), pylint R0801 10.00/10, lint-auth-signals and lint-architecture-boundaries clean on the merged head.
- CI at 7d41aec: 32 success, 2 neutral, 1 skipped, 0 failing;
gate,Lint,license/clapass. - Canonical owner:
commands/install.py("Install command scope selection") touched only by ashort_helpstring. Exact-head functional evidence: 4 install-scope tests intests/unit/test_install_command.pypassed at 7d41aec.
| PR | head | stance | iters | folds | deferrals | copilot rounds | CI | mergeable | state | notes |
|---|---|---|---|---|---|---|---|---|---|---|
| #3643 | 7d41aec | ship_now | 2 | 3 | 0 | 2 | green | MERGEABLE | BLOCKED | pending required review |
Recommendation
Every finding from the lean pass, the Copilot inline review and the delta pass is folded and verified. CI is green at 7d41aec, and nothing is deferred.
Full per-persona findings
DevX UX Expert
No findings.
Test Coverage Expert
- [recommended] Affirmation: the mock target and scope are correct, and the test is still a valid regression trap after the fold. at
tests/unit/test_cli_consistency_checker_workflow.py:71
Doc Writer
- [recommended] Hidden aliases documented in
reference/cli/(for exampleapm info) would be flagged as high-severity drift. Folded in 2cbc8c7. - [recommended] Depth-3 subcommands (
marketplace package add) have no intermediate page; map them to the top-level page. Folded in 2cbc8c7. - [recommended] Hidden options need a
--option value --helpprobe (--branchonmarketplace add). Folded in 7d41aec.
This panel is advisory. It does not block merge. Re-apply the
panel-review label after addressing feedback to re-run.
Generated by autopilot-pr-merge-worker. This comment is AI-generated and may contain errors.
…ency-checker Co-authored-by: Copilot App <[email protected]>
Avoids landing-order conflicts with other queued PRs. Co-authored-by: Copilot App <[email protected]>
Lane L: main merged for landing
This comment was generated by an AI agent (Lane L landing desk) on behalf of Daniel Meppiel (@danielmeppiel). |
#3608 added a longer view summary and #3643 added a check that root summaries are not truncated at 80 columns; together they fail tests/unit/test_cli_consistency.py on main and on every PR merge ref. Shorten the summary so the CI merge ref for this PR is green. Co-authored-by: Copilot App <[email protected]>
This reverts commit bed006f. Lane F owns the main hotfix for the #3608 x #3643 root-help truncation; this PR stays out of that change. Co-authored-by: Copilot App <[email protected]>
* fix(cli): shorten apm view summary so root help is not truncated #3608 gave `apm view` a short_help that wraps at 80 columns, which fails the root-help no-truncation check added in #3643. apm-spec-waiver: help-text-only change, no spec surface Co-authored-by: Copilot App <[email protected]> * docs(changelog): note apm view root-help summary fix (#3651) apm-spec-waiver: help-text-only change, no spec surface Co-authored-by: Copilot App <[email protected]> --------- Co-authored-by: danielmeppiel <[email protected]> Co-authored-by: Copilot App <[email protected]>
…3614) * fix: honor APM_HOME for global user state Centralize APM-owned user metadata under APM_HOME while keeping target deployment paths independent. Document and test the contract across package, config, lifecycle, and architecture boundaries. * fix: complete APM_HOME contract for receipts, marketplaces and docs (#2884) Finish the APM_HOME single-root contract on top of the cherry-picked change from @WilliamK112 (closed PR #2967): - Deployment receipts move under get_apm_home(); the deploy-root .apm-local identity stays with the deployment root, like target files. - The architecture guard also pins the deployment ledger consumer. - Tests: subprocess isolation (two APM_HOME values, every global command family) and parity (unset/empty == ~/.apm); conftest drops a developer APM_HOME so the suite stays hermetic. - Docs: env-var contract lists marketplace registrations, receipts, lock, precedence, migration and the out-of-contract paths; apm-guide and CHANGELOG updated (entry moved to Unreleased). Co-authored-by: Ching-Wei Kang <[email protected]> Co-authored-by: Copilot App <[email protected]> * test: run APM_HOME isolation through the apm binary fixture (#2884) Co-authored-by: Copilot App <[email protected]> * docs(changelog): reference #3614 for APM_HOME entry Co-authored-by: Copilot App <[email protected]> * fix(scope): anchor a relative APM_HOME to the start directory apm lock -g and apm update -g chdir into the APM home, so a relative APM_HOME such as 'metadata' resolved to metadata/metadata on later lookups and split the manifest from its lockfile, modules and config. get_apm_home() now expands a leading ~ and anchors a relative value once against the working directory captured at import. Addresses Copilot inline on src/apm_cli/core/scope.py:54 (#2884). Co-authored-by: Copilot App <[email protected]> * fix(locking): serialize state changes across APM_HOME values Moving the lifecycle lock under APM_HOME let processes with different homes mutate the same project or harness directories at once, so a failed install's rollback could overwrite another operation's manifest. acquire_lifecycle_lock() now takes the OS-user deployment-root lock in ~/.apm-local/ (named by the deployment owner) before the APM_HOME metadata lock and releases both together; unset APM_HOME keeps the ~/.apm layout. Adds a cross-home contention regression and updates home write-set snapshots and the pre-compile lock probe. Addresses Copilot inline on src/apm_cli/install/locking.py:44 (#2884). Co-authored-by: Copilot App <[email protected]> * docs(apm-home): document relative values and cross-home locking The APM_HOME path contract now states that ~ is expanded, a relative value resolves against the start directory, and ~/.apm-local/.apm-lifecycle.lock serializes commands across APM_HOME values. Mirrors the change in apm-guide and the CHANGELOG entry (#2884). Co-authored-by: Copilot App <[email protected]> * docs(changelog): drop stray #2938 entry from the 0.31.0 block The cherry-pick from closed PR #2967 added a second Fixed heading with an unrelated GitLab entry inside the released 0.31.0 section. Released sections are not rewritten and the entry is outside #2884's scope. Addresses doc-writer panel finding on PR #3614. Co-authored-by: Copilot App <[email protected]> * docs(apm-home): link the path contract and fix stale ~/.apm wording install.md still named ~/.apm/ as the canonical metadata root, and install/update/deps/lock each restated the APM_HOME contract. They now link the env-var reference instead; the env-var page no longer claims APM_HOME is read once. approve/deny --help, config_loader docstrings and lock -g help name the APM user home. Addresses doc-writer, devx-ux and auth panel findings on PR #3614. Co-authored-by: Copilot App <[email protected]> * fix(locking): harden the cross-home lock and relative APM_HOME Adds a symlink-rejection regression for the ~/.apm-local deployment-root lock, loads LOCAL_STATE_DIR lazily so importing locking no longer pulls the deployment ledger, names the shared lock in the busy error, fails closed when a relative APM_HOME cannot be anchored, and documents the receipts containment base. Addresses test-coverage, python-architect, performance, devx-ux and supply-chain panel findings on PR #3614. Co-authored-by: Copilot App <[email protected]> * chore(spec): record Mode B waiver for the APM_HOME user-state root The user-scope metadata location (APM_HOME) and lifecycle lock placement are CLI configuration, not OpenAPM manifest, lockfile or resolution behaviour, so no req anchor applies (#2884). apm-spec-waiver: APM_HOME relocates CLI user-state paths only; no OpenAPM manifest, lockfile or resolution behaviour changes Co-authored-by: Copilot App <[email protected]> * docs(apm-home): document the fail-closed relative APM_HOME case get_apm_home() now errors when a relative APM_HOME cannot be anchored because the start directory is gone; the env-var contract and apm-guide state it. Addresses doc-writer delta panel finding on PR #3614. Co-authored-by: Copilot App <[email protected]> * fix(view): fit the root help summary in 80 columns #3608 added a longer view summary and #3643 added a check that root summaries are not truncated at 80 columns; together they fail tests/unit/test_cli_consistency.py on main and on every PR merge ref. Shorten the summary so the CI merge ref for this PR is green. Co-authored-by: Copilot App <[email protected]> * Revert "fix(view): fit the root help summary in 80 columns" This reverts commit bed006f. Lane F owns the main hotfix for the #3608 x #3643 root-help truncation; this PR stays out of that change. Co-authored-by: Copilot App <[email protected]> --------- Co-authored-by: Ching-Wei Kang <[email protected]> Co-authored-by: danielmeppiel <[email protected]> Co-authored-by: Copilot App <[email protected]>
…led by apm install -g (#3610) * fix: honor APM_HOME for global user state Centralize APM-owned user metadata under APM_HOME while keeping target deployment paths independent. Document and test the contract across package, config, lifecycle, and architecture boundaries. * feat(marketplace): declare marketplaces in the user manifest, reconciled by apm install -g Add a 'marketplaces:' list (name + an existing 'apm marketplace add' source form, optional ref) to the user manifest at the effective APM user root. 'apm install -g' reconciles it before resolving dependencies: registers missing entries, updates changed ones and removes only manifest-origin entries. The registry records each entry's origin; manual registrations are never overwritten or removed, and name conflicts are reported. Project and package manifests that declare 'marketplaces:' fail with an error naming the user manifest. The source-to-registration step is extracted from 'marketplace add' into marketplace.registration so both paths share one parser/probe. Refs #3006 Co-authored-by: Copilot App <[email protected]> * docs(changelog): reference #3610 Co-authored-by: Copilot App <[email protected]> * fix: complete APM_HOME contract for receipts, marketplaces and docs (#2884) Finish the APM_HOME single-root contract on top of the cherry-picked change from @WilliamK112 (closed PR #2967): - Deployment receipts move under get_apm_home(); the deploy-root .apm-local identity stays with the deployment root, like target files. - The architecture guard also pins the deployment ledger consumer. - Tests: subprocess isolation (two APM_HOME values, every global command family) and parity (unset/empty == ~/.apm); conftest drops a developer APM_HOME so the suite stays hermetic. - Docs: env-var contract lists marketplace registrations, receipts, lock, precedence, migration and the out-of-contract paths; apm-guide and CHANGELOG updated (entry moved to Unreleased). Co-authored-by: Ching-Wei Kang <[email protected]> Co-authored-by: Copilot App <[email protected]> * test: run APM_HOME isolation through the apm binary fixture (#2884) Co-authored-by: Copilot App <[email protected]> * docs(changelog): reference #3614 for APM_HOME entry Co-authored-by: Copilot App <[email protected]> * test(marketplace): user-manifest marketplaces follow APM_HOME (#2884) Co-authored-by: Copilot App <[email protected]> * fix(scope): anchor a relative APM_HOME to the start directory apm lock -g and apm update -g chdir into the APM home, so a relative APM_HOME such as 'metadata' resolved to metadata/metadata on later lookups and split the manifest from its lockfile, modules and config. get_apm_home() now expands a leading ~ and anchors a relative value once against the working directory captured at import. Addresses Copilot inline on src/apm_cli/core/scope.py:54 (#2884). Co-authored-by: Copilot App <[email protected]> * fix(locking): serialize state changes across APM_HOME values Moving the lifecycle lock under APM_HOME let processes with different homes mutate the same project or harness directories at once, so a failed install's rollback could overwrite another operation's manifest. acquire_lifecycle_lock() now takes the OS-user deployment-root lock in ~/.apm-local/ (named by the deployment owner) before the APM_HOME metadata lock and releases both together; unset APM_HOME keeps the ~/.apm layout. Adds a cross-home contention regression and updates home write-set snapshots and the pre-compile lock probe. Addresses Copilot inline on src/apm_cli/install/locking.py:44 (#2884). Co-authored-by: Copilot App <[email protected]> * docs(apm-home): document relative values and cross-home locking The APM_HOME path contract now states that ~ is expanded, a relative value resolves against the start directory, and ~/.apm-local/.apm-lifecycle.lock serializes commands across APM_HOME values. Mirrors the change in apm-guide and the CHANGELOG entry (#2884). Co-authored-by: Copilot App <[email protected]> * docs(changelog): drop stray #2938 entry from the 0.31.0 block The cherry-pick from closed PR #2967 added a second Fixed heading with an unrelated GitLab entry inside the released 0.31.0 section. Released sections are not rewritten and the entry is outside #2884's scope. Addresses doc-writer panel finding on PR #3614. Co-authored-by: Copilot App <[email protected]> * docs(apm-home): link the path contract and fix stale ~/.apm wording install.md still named ~/.apm/ as the canonical metadata root, and install/update/deps/lock each restated the APM_HOME contract. They now link the env-var reference instead; the env-var page no longer claims APM_HOME is read once. approve/deny --help, config_loader docstrings and lock -g help name the APM user home. Addresses doc-writer, devx-ux and auth panel findings on PR #3614. Co-authored-by: Copilot App <[email protected]> * fix(locking): harden the cross-home lock and relative APM_HOME Adds a symlink-rejection regression for the ~/.apm-local deployment-root lock, loads LOCAL_STATE_DIR lazily so importing locking no longer pulls the deployment ledger, names the shared lock in the busy error, fails closed when a relative APM_HOME cannot be anchored, and documents the receipts containment base. Addresses test-coverage, python-architect, performance, devx-ux and supply-chain panel findings on PR #3614. Co-authored-by: Copilot App <[email protected]> * chore(spec): record Mode B waiver for the APM_HOME user-state root The user-scope metadata location (APM_HOME) and lifecycle lock placement are CLI configuration, not OpenAPM manifest, lockfile or resolution behaviour, so no req anchor applies (#2884). apm-spec-waiver: APM_HOME relocates CLI user-state paths only; no OpenAPM manifest, lockfile or resolution behaviour changes Co-authored-by: Copilot App <[email protected]> * docs(apm-home): document the fail-closed relative APM_HOME case get_apm_home() now errors when a relative APM_HOME cannot be anchored because the start directory is gone; the env-var contract and apm-guide state it. Addresses doc-writer delta panel finding on PR #3614. Co-authored-by: Copilot App <[email protected]> * fix(view): fit the root help summary in 80 columns #3608 added a longer view summary and #3643 added a check that root summaries are not truncated at 80 columns; together they fail tests/unit/test_cli_consistency.py on main and on every PR merge ref. Shorten the summary so the CI merge ref for this PR is green. Co-authored-by: Copilot App <[email protected]> * Revert "fix(view): fit the root help summary in 80 columns" This reverts commit bed006f. Lane F owns the main hotfix for the #3608 x #3643 root-help truncation; this PR stays out of that change. Co-authored-by: Copilot App <[email protected]> * fix(marketplace): reconcile never destroys entries it cannot replace A malformed user manifest root (empty, list, scalar or invalid YAML) read as "no marketplaces" and removed every manifest-owned registration before package parsing rejected the file. A failed fetch for a renamed or moved entry still removed the stale one. Dry runs and no-op runs created marketplaces.json and config.json. Reject a non-mapping root before the registry is read, skip removals while any declared entry failed, and read the registry without creating files (read_registered_marketplaces). Addresses Copilot inline on src/apm_cli/marketplace/reconcile.py:116, :117 and :140. Co-authored-by: Copilot App <[email protected]> * refactor(marketplace): add parses SOURCE through the shared owner `apm marketplace add` still split #ref fragments, resolved ref precedence and classified direct URLs itself, a second authority for the grammar the user-manifest reconcile parses with parse_registration_source. Normalize the CLI-only --branch alias at the command boundary and route add through the shared parser. Extend the marketplace-source-admission owner to registration.py and its guard: add and reconcile must call parse_registration_source, and the command may not re-split fragments or classify direct URLs. Behavioural, architecture and mutation tests cover the boundary, plus regressions for the three reconcile safety fixes. Addresses Copilot inline on src/apm_cli/marketplace/registration.py:89. Co-authored-by: Copilot App <[email protected]> * fix(install): keep commands/install.py within the 2100-line guard main already sits at the 2100-line cap, so the reconcile hook pushed install.py to 2105 and failed the Lint file-length guardrail. Make the hook a single call (the user-scope check moves into reconcile_user_marketplaces_or_exit) and collapse a single-name import. Co-authored-by: Copilot App <[email protected]> * docs(marketplace): follow APM_HOME and state reconcile limits The user manifest path now reads $APM_HOME/apm.yml (default ~/.apm/apm.yml) everywhere this PR documents it, the source column notes that entries have no --host equivalent, failure and hand-over wording matches the code, apm install's reference notes the reconcile step, the CHANGELOG leads with the benefit, the apm-guide row is shorter and the "Declare instead of add" callout opens the add section. Addresses panel follow-ups from doc-writer, devx-ux-expert and oss-growth-hacker. Co-authored-by: Copilot App <[email protected]> * refactor(marketplace): one registry write per reconcile, clearer output Fetch every new or changed entry first, then apply all registrations and removals in one locked transaction (apply_manifest_marketplaces) instead of a lock-read-write cycle per entry. Removals use the [-] symbol, the kept line pluralizes, a single failure is named directly, and the manual-conflict warning shows the current source. The source admission guard now also forbids reconcile.py from re-parsing SOURCE. The integration module declares its component marker and covers `apm install -g --dry-run` creating no registry files. Addresses panel follow-ups from performance-expert, cli-logging-expert, devx-ux-expert, test-coverage-expert, supply-chain-security-expert and python-architect. Co-authored-by: Copilot App <[email protected]> * fix(marketplace): reject relative local sources in the user manifest A relative local source such as ./catalog resolved against the directory where `apm install -g` ran, so the same user manifest registered different paths (or failed) depending on the cwd. Reject it with an actionable error; absolute and ~/ paths are unchanged. The shared not-found hint now says "use the path to the apm.yml file" so it reads right for both `marketplace add` and a manifest `source:`. Addresses delta panel follow-ups from doc-writer and cli-logging-expert. Co-authored-by: Copilot App <[email protected]> --------- Co-authored-by: Ching-Wei Kang <[email protected]> Co-authored-by: danielmeppiel <[email protected]> Co-authored-by: Copilot App <[email protected]>

TL;DR
The
cli-consistency-checkeragentic workflow inspected a hand-written list of ~25 commands and readdocs/cli-reference.md, a file that no longer exists. It now walksapm --helprecursively (70+ command sections today, including marketplace's split headings) and cross-checksdocs/src/content/docs/reference/cli/. Ten top-level commands also get a Clickshort_help, soapm --helpprints every summary in full instead of....Fixes #3523
Note
Local preflight skipped by maintainer instruction (2026-11-12); CI is the gate.
Description
The workflow prompt (Step 2 and Step 3.4) and its compiled lock are updated. Ten command decorators get
short_help. Two new regression guards keep the checker and the root help from drifting again.Issue and approved scope
Issue: Fixes #3523
Human scope-approval comment: #3523 (comment) (
apm-scope:v1, approved by Daniel Meppiel (@danielmeppiel), review contact Daniel Meppiel (@danielmeppiel)).Does this PR complete the issue? Yes. All three Done-when items are covered: the checker derives commands from
apm --helprecursively, it references only docs paths that exist on main, the lock is regenerated withgh aw compile, and no top-level summary inapm --helpends in an ellipsis. A unit test enforces the last item. Out-of-scope items are untouched: command names, flags and behavior, long help bodies, and the checker's schedule, model and safe-outputs.Problem (WHY)
--helponly for init/install/uninstall/update/compile/run, deps, mcp, config and runtime setup. It skippedapprove, audit, auth, cache, deny, doctor, experimental, find, lifecycle, list, lock, marketplace, outdated, pack, plugin, policy, preview, prune, publish, search, self-update, targets, unpack, viewand newer subcommands such asdeps why,mcp list,config unsetandruntime list|remove|status.cat docs/cli-reference.md, but that file was removed. The CLI reference is now one page per command underdocs/src/content/docs/reference/cli/.apm --helptruncated 10 summaries (approve,audit,deny,doctor,export-patch,find,install,lock,prune,uninstall), for exampleapprove Approve executable primitives (hooks, MCP, LSP, bin,....Why these matter: a hand-maintained list goes stale every time a command ships, so the checker silently stops covering new surface. The root help is the first thing a new user reads, and truncated summaries hide what each verb does.
Approach (WHAT)
apm_help_walk) that parses every*commands:heading of each--helpoutput.docs/src/content/docs/reference/cli/(one page per top-level command, with subcommands on the parent page) and read pages one command at a time, not 312 KB in onecat.short_helpto the 10 truncated commands. Their--helpbodies are unchanged, and the lazy-stub summaries incli.pymatch.cli-consistency-checker.lock.ymlwith gh-aw v0.89.15 (the version pinned in the lock header).Implementation (HOW)
.github/workflows/cli-consistency-checker.md: Step 2 now usesapm_subcommands(awk over/^([A-Za-z]+ )*[Cc]ommands:$/, soMarketplaceGroup'sConsumer commands:/Authoring commands:are included) andapm_help_walk. Output goes to/tmp/gh-aw/agent/per the compiler's artifact-root warning. In Step 3.4,docs/cli-reference.mdis replaced by thereference/cli/directory. The schedule, model, permissions and safe-outputs are untouched..github/workflows/cli-consistency-checker.lock.yml: recompiled. Onlybody_hashin the metadata header changed, because the prompt is runtime-imported.src/apm_cli/commands/{approve,audit,doctor,export_patch,find,install,lock,prune}.py,uninstall/cli.py: each gets ashort_help=of 60 characters or fewer, the width left beside the 12-charexperimental/export-patchnames at 80 columns.src/apm_cli/cli.py:_LAZY_COMMANDSstub summaries match the newshort_help, sotest_lazy_stub_short_help_matches_resolved_commandstill holds.tests/unit/test_cli_consistency.py:test_root_help_command_summaries_are_not_truncatedrendersapm --helpatterminal_width=80and requires each visible top-level row to equal the command's untruncated summary on one line.tests/unit/test_cli_consistency_checker_workflow.py(new): checks that everydocs/...path in the workflow exists and that no per-command--helplist is hardcoded. It also runs the workflow's own awk program against every Click group's rendered help and requires exactly the group's visible subcommands.Diagrams
Legend: how the checker now derives its command surface. The awk parser that drives the recursion is the same program the unit test executes against the Click tree.
flowchart LR A["apm_help_walk PATH"] --> B["apm PATH --help"] B --> C["/tmp/gh-aw/agent/apm-help-all.txt"] B --> D["apm_subcommands: awk over *commands: headings"] D -->|"each subcommand"| A C --> E["Step 3.4: compare with docs/src/content/docs/reference/cli/CMD.md"] T["test_checker_walker_finds_every_visible_subcommand"] -.->|"runs same awk program"| DTrade-offs
short_helpover rewriting the first help line. I choseshort_helpbecause it changes only the root listing and leaves every--helpbody byte-identical, which keeps the out-of-scope "rewriting long help bodies" untouched. I rejected first-line rewrites because they would also changeapm <cmd> --helpand its docs quotes. The cost is that 10 commands now keep a second, short string.apm --help, and the walker tests the shipped CLI as users see it. The cost is oneapm --helpprocess per command (~70+). That is well within the 20-minute timeout.awkis absent (some Windows runners). It runs on the Linux PR CI.install.pyis now exactly 2100 lines. The CI guard fails only above 2100 (NR > max).Benefits
reference/cli/instead of a missing file.apm --helptruncates 0 summaries at 80 columns, down from 10.Validation
Lint mirror (CI Lint job, run on the merge with
origin/mainat1a370716e1):Targeted tests (no xdist):
Mutation-break evidence
Compiler:
gh aw compile cli-consistency-checker(v0.89.15) reproduced the pre-change lock byte-for-byte before editing. After the edit it reports1 succeeded, 0 warnings. Running the walker end-to-end against the source CLI printed 70===== apm ... --helpsections.Scenario Evidence
apm --helpshows every command's summary in full at 80 columnstests/unit/test_cli_consistency.py::test_root_help_command_summaries_are_not_truncated(regression-trap for #3523)tests/unit/test_cli_consistency_checker_workflow.py::test_checker_walker_finds_every_visible_subcommand::test_checker_does_not_hardcode_subcommand_help_listtests/unit/test_cli_consistency_checker_workflow.py::test_checker_references_only_existing_docs_pathsType of change
Testing
Spec conformance (OpenAPM v0.1)
CONFORMANCE.{md,json}regeneratedHow to test
COLUMNS=80 apm --help-> no row inCommands:ends with....apm install --help-> the body still starts with the full original sentence.apmon PATH ->grep -c '^===== ' /tmp/gh-aw/agent/apm-help-all.txtprints about 70, includingapm marketplace add --help.gh aw compile cli-consistency-checkerwith v0.89.15 -> no diff to the lock.Co-authored-by: Copilot [email protected]