Repository navigation
refactor(devtools): consolidate commands, probes, and one-off tools #625
Description
Scope
Composite issue for compacting the devtools/control-plane surface: command registration/execution, pipeline-probe architecture, one-off scripts, unused showcase/CLI helpers, and campaign metadata contracts.
Problem
devtools is the repo control plane, but several command-like or verification-lab surfaces are still organized as local mini-frameworks or one-off scripts:
- top-level
devtoolsdispatch is hand-rolled argparse overCOMMAND_SPECSinstead of a generated Click group; devtools/pipeline_probe.pyis a 1,400+ line command, engine, schema, staging, sampling, execution, budget, regression, and rendering module;- unused or marginal helpers such as
ShowcaseContextand the CLI filter picker are command-like surfaces with no durable consumer; - campaign result metadata contracts are repeated across campaign tooling.
Already completed
- PR-review extraction scripts (refactor(devtools): consolidate ad-hoc PR review extraction scripts #610):
devtools/extract_pr_reviews.py,devtools/extract_cr_outside_diff.py, anddevtools/parse_review_findings.pyare already deleted on master. --list-commands --jsonparity witness exists indevtools/command_catalog.py.
Filter picker decision
The old CLI filter picker should not be deleted purely as unused one-off code. Evaluate it as a seed for query-backed fuzzy selection (polylogue select) with fzf when available and a Python fallback. If it cannot evolve cleanly into that role, delete with no shim.
Devtools command catalog (~40 commands)
Current CommandSpec categories partition the commands:
| Category | Count | Examples |
|---|---|---|
| Core loop | 5 | status, verify, render-all, mutmut-campaign, benchmark-campaign |
| Generated surfaces | 8 | render-agents, render-cli-reference, render-topology-status |
| Verification | 23 | verify-topology, verify-layering, proof-pack, obligation-diff |
| Campaigns | 3 | benchmark-campaign, mutmut-campaign, run-benchmark-campaigns |
| Maintenance | 5 | build-package, witness-discover/minimize/promote |
Target command groups
devtools verify
devtools render
devtools schema
devtools scenario
devtools witness
devtools campaign
devtools probe pipeline
devtools commands --format json
Proof/verifiability names should be integrated with #635: proof-pack → confidence/verification report, affected-obligations → verify impact.
Suggested package split
Use CommandSpec categories as the migration map:
devtools/
control_plane.py # dispatch, rendering, catalog (stays)
verify/ # all verify-* commands (23)
render/ # all render-* commands (8)
proof/ # proof-pack, obligation-diff, affected-obligations
campaigns/ # mutmut, benchmark
lab/ # lab-corpus, lab-scenario, schema-*
maintenance/ # build-package, witness-*
Acceptance criteria
- Every command-like thing is either registered in the command catalog, moved behind a real product CLI surface, or deleted.
- One-off scripts do not live as importable devtools modules unless they have tests, docs, and a command spec.
pipeline_probesplit around stable responsibilities: input selection, staging, execution, budget/regression capture, and rendering.- Generated Click dispatch preserves typed option parsing, machine-output contracts, and generated docs.
devtools --list-commands --jsonis a parity witness for command catalog entries and executable imports.devtools render-all --checkand command catalog tests cover the new organization.
Consolidated findings
This issue absorbs and supersedes:
- refactor(devtools): share campaign result metadata contracts #598 campaign result metadata contracts.
- refactor(devtools): consolidate ad-hoc PR review extraction scripts #610 one-off PR review extraction scripts (already deleted).
- chore(showcase): delete or wire unused ShowcaseContext #613 unused
ShowcaseContext. - refactor(devtools): make command metadata single-source #617 command metadata single-source execution.
- chore(cli): delete or wire the unused filter picker #583 unused CLI filter picker.
Ref #578
Ref #635
Ref #717 — filter picker may become seed for polylogue select
Activity
[-]refactor(devtools): split pipeline-probe into command and library[/-][+]refactor(devtools): consolidate commands, probes, and one-off tools[/+]Sinity commentedon May 1, 2026
Devtools compactness guard: consolidate by command ownership and lifecycle, not by hiding everything behind a generated command table.
Useful acceptance additions:
pipeline_probeshould split around stable responsibilities: input selection, staging, execution, budget/regression capture, and rendering;This issue should reduce the number of command/probe concepts. A generated dispatcher that still points at the same scattered mini-frameworks would not close it.
Sinity commentedon May 1, 2026
Implementation anchors and acceptance additions from the 2026-05-01 follow-up audit.
Code anchors:
devtools/__main__.py:43-80: top-level execution is hand-rolled argparse dispatch overCOMMANDS, including special--jsonforwarding.devtools/command_catalog.py: command metadata already exists;pipeline-probeis cataloged.devtools/pipeline_probe.py: 1,468-line module mixing CLI parsing, request/schema, staging, sampling, execution, budgets, regression, and reporting.argparse.ArgumentParsersites underdevtools/.Acceptance additions:
pipeline_probeintorequest,staging,engine,result,report, and CLI adapter modules.extract_cr_outside_diff.py,extract_pr_reviews.py,parse_review_findings.pyif present in the full repo.devtools --list-commands --jsonbecomes a parity witness for command catalog entries and executable imports.Sinity commentedon May 1, 2026
Devtools control-plane decision from 2026-05-01 bundle
Integrated decisions:
CommandSpeccategories.probe pipeline, but split internals.Target groups:
Proof/verifiability names should be integrated with #635. Avoid preserving opaque command names such as
proof-packandaffected-obligations; rename toward confidence/verification report and verify impact.The command inventory should explain why each gate exists and when to run it.
Ref #594
Ref #635
Sinity commentedon May 1, 2026
Integrated UX/fuzzy-selection direction from the 2026-05-01 feedback pass.
Do not delete the old CLI filter picker purely as unused one-off code until it is evaluated as a seed for query-backed fuzzy selection.
Decision point for this issue:
polylogue select conversation,polylogue select repo,polylogue select cwd,polylogue select tag, or equivalent names that fit the query grammar.Sinity commentedon May 1, 2026
C3 status check after #677/master sync:
The PR-review extraction scripts called out in #610 are already deleted on current
master:devtools/extract_pr_reviews.pydevtools/extract_cr_outside_diff.pydevtools/parse_review_findings.pyReference scan:
Only normal workflow/proof/devtools names remain (
.github/workflows/pr-policy.yml,.github/workflows/proof-comment.yml, and unrelated devtools modules such asproof_pack.py,pipeline_probe.py, etc.).So the PR-review extraction part of this composite should be treated as already satisfied by prior cleanup; remaining #625 work is command/probe consolidation, campaign metadata, and the filter-picker/select decision.
Sinity commentedon May 2, 2026
devtools command catalog (2026-05-02)
Current command breakdown from
devtools/command_catalog.py:~40 commands in a flat
devtools/package. TheCommandSpeccategories already partition them — use those as the migration map.Suggested package split
The
CommandSpeccategory field already assigns each command to one of these groups — the split is a mechanical move + import update, not a redesign.Sinity commentedon May 2, 2026
Click dispatch design for #625 (2026-05-03 agent analysis)
Approach: two-layer with backward-compatible shim
Layer 1: thin
main()shim handles--list-commands(byte-identical output),--jsonrelocation, then delegates to Click group.Layer 2: Click group registers one subcommand per
CommandSpec. Each subcommand wrapsspec.resolve_main()— per-command argparse parsers are never touched.Key trick: --json relocation
Current argparse allows
devtools --json verify-topology. Click expects per-subcommand options after the subcommand name. The shim relocates--jsonto position 1 (after command name) before handing control to Click.Command wrapper
What changes in command_catalog.py
Move
_print_command_inventoryfrom__main__.pytocommand_catalog.pyas a public function. Optionally addparent_group/nested_namefields toCommandSpecfor future nested aliases.Backward compatibility
All current dispatch patterns preserved (flat
devtools verify-topology,--jsonbefore or after command,--list-commands, unknown command → exit 2). Existing tests pass. Only--helpformatting changes (Click style).Reversibility
Fully incremental. Step 1: replace dispatch only. Step 2 (optional): add nested group aliases. Step 3 (future): convert individual commands from argparse to Click one at a time.
refactor(devtools): Click dispatch, split pipeline_probe, corpus roun…
Sinity commentedon May 3, 2026
Closed by #763. pipeline_probe monolith split into 6-module package. Click dispatch generated from CommandSpec catalog.
--list-commands --jsonparity witness.refactor(devtools): Click dispatch, split pipeline_probe, corpus roun…