Skip to content

refactor(devtools): fold the command surface into twelve verbs - #4566

Merged
Sinity merged 2 commits into
masterfrom
refactor/devtools-fold
Sep 2, 2026
Merged

Sinity merged 2 commits into
masterfrom
refactor/devtools-fold

Conversation

@Sinity

@Sinity Sinity commented Sep 2, 2026

Copy link
Copy Markdown
Owner

Summary

devtools exposed 46 commands across 30 catalog entries. It now exposes 12 root
verbs: status, test, verify, why, gate, render, schema, bench,
scenario, smoke, archive, cache.

Problem

Most of the surface was one check per command, filed under verify,
workspace, or release by accident of who added it. Three consequences,
all observed:

  • devtools verify --help listed subcommands only. --quick and --all — the
    two ways the command is actually used — were reachable only through
    --inner-help, a flag that existed on every command to proxy --help past
    Click into the wrapped argparse parser.
  • The dispatcher bolted --json onto every command, including the ones that
    print nothing structured, so the help lied about the contract.
  • verify coverage, release build-package, and release verify-distribution
    were a fourth invocation of pytest, a Nix wrapper with one caller, and a real
    invariant filed under a group that otherwise did nothing.

Solution

  • devtools/gate.py holds one table of 21 named checks. gate <name> runs one;
    verify --quick runs the twelve marked fast; gate --list prints the table
    with the quick and report-only marks. The verifier builds its steps from that
    table instead of a hand-kept list, so the two cannot drift.
  • render [<surface>|all] [--check] replaces ten render * commands (the
    surface registry already existed). schema, bench, archive, cache, and
    scenario group the remaining leaves; smoke is the one deployment probe.
  • --quick/--all are declared on verify and forwarded verbatim, so they
    appear in its own help. --inner-help is deleted everywhere. --json is
    declared per command via CommandSpec.json_flag.
  • verify coverage folds into verify --all: the corpus run now carries
    --cov and the fail_under floor read from pyproject.toml, one source as
    before. release build-package is deleted (nothing called it but the motd).
    release verify-distribution becomes gate distribution — it has three live
    CI callers, so the group went away and the check stayed.
  • consumer-reachability is report-only in the quick gate, per the review: its
    verdict is recorded in the receipt and printed, but does not decide the exit.
  • The doc-commands gate now validates render <surface>, gate <name>, and
    scenario <sub> against their declaring tables. Without this the fold would
    have blinded the one gate that catches a renamed surface, because those names
    moved from catalog entries into command arguments.
  • Deleted flags: --inner-help (every command), --full (a --all alias),
    --skip on render (subsumed by the surface argument), --readme and
    --docs-readme (path overrides on a surface that renders to two committed
    paths), --pr-body (the consumer-reachability waiver, no caller), and the
    flags that die with the removed commands: --out-link, --package on
    build-package, --pyproject, --ignore-integration, --term-missing.

Verification

devtools verify --quick        # green, 12 steps, 2m08s wall (mypy cold 48s)
devtools test tests/unit/devtools/{test_verify,test_command_catalog,test_devtools_main,
  test_verify_doc_commands,test_render_all,test_project_motd,test_mypy_daemon_lifetime,
  test_durable_schema_policy_gate,test_verify_js_tests,test_webui_package_scripts,
  test_dev_loop_service,test_deployment_browser_smoke_service,test_rebuild_safety_scenario,
  test_seeded_archive_cache_gc}.py -n 2
  → 194 passed, 1 failed

The one failure is test_seeded_archive_cache_gc::test_route_preview_apply_and_repeat_apply_use_generated_keys,
which is red on origin/master too: a run of the four affected files at
origin/master produced 35 failures across test_index_fast_forward,
test_lineage_validation, test_pytest_progress_plugin, and that test; every
failure remaining on this branch is in that inherited set. test_checkout_guard,
test_cli_wrapper, test_render_webui_design_system, and test_deployment_smoke
were baselined the same way (11 failures, all inherited).

Residuals

  • Three service modules (deployment_browser_smoke_service,
    dev_loop_service, live_provider_proof_service) are deliberately not
    catalogued as smoke subcommands. They read AgentCTL-injected ports and a
    declared service lease; a test asserts they stay out of the catalog. smoke
    is therefore one command, not four as the review sketched.
  • release verify-distribution was on the review's delete list, but it has
    three live CI callers (CircleCI distribution, GitHub ci.yml and
    release.yml). It survives as gate distribution with the same flags; the
    release group is gone.
  • The measured dead flags that were kept: --index-db,
    --sample-unresolved, --max-sample-stored-messages (live-archive evidence
    knobs on archive lineage-validation), --protected-worktree (a GC safety
    knob), --privacy/--privacy-config on the three schema write commands,
    --check-drift, --corpus-count, --keep-archive, --scenario, --oracle,
    --memory. Each is set only by its own parser today, but each names a real
    capability with no evidence of retirement; deleting them would narrow the
    tool, not tidy it.
  • verify --all now runs coverage instrumentation over the corpus. It has not
    been run end to end on this branch; the nightly verify_all operation is its
    first full exercise.

🤖 Generated with Claude Code

https://claude.ai/code/session_01YGi8wLWGR2HYBh8p8fXFXz

Sinity and others added 2 commits September 2, 2026 22:53
The catalog carried 46 exposed commands, most of them one check apiece under
`verify`/`workspace`/`release`. `gate <name>` is now the single dispatcher over
the invariant checks and the table `verify --quick` runs; `render`, `schema`,
`bench`, `archive`, `cache`, `smoke`, and `scenario` group the rest.

`verify --help` lists `--quick` and `--all` itself; `--inner-help` is gone and
`--json` is declared only where a command emits it. `verify coverage` folds
into the `--all` corpus run, which is the only run wide enough to judge the
committed floor. `release build-package` is deleted; the distribution check
keeps its three CI callers as `gate distribution`.

`consumer-reachability` reports without deciding the verifier's exit: the
incremental base/head diff it reasons over is not stable across rebases.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01YGi8wLWGR2HYBh8p8fXFXz
Docs, CI jobs, the AgentCTL descriptor, and the tests that assert command
strings now name the new verbs. The doc-commands gate additionally validates
`render <surface>`, `gate <name>`, and `scenario <sub>` against their declaring
tables, so a renamed gate or surface cannot pass as a bare `devtools render`.

`seeded_archive_cache_gc` executes `devtools cache gc --json`; the three
verification operations keep their exact `devtools verify [--quick|--all]`
invocations.

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_01YGi8wLWGR2HYBh8p8fXFXz
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 2, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-09-02T21:01:31.523582Z e8ea7c1 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Sep 2, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Team

Run ID: 07b32aed-7317-4cb4-8d56-513746f06ae9


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@Sinity
Sinity merged commit 985e0f9 into master Sep 2, 2026
3 checks passed
@Sinity
Sinity deleted the refactor/devtools-fold branch September 2, 2026 21:00

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: e8ea7c12b1

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread devtools/verify_doc_commands.py Resolved
Comment thread devtools/verify.py Resolved
Comment thread devtools/click_dispatch.py Resolved
Sinity added a commit that referenced this pull request Sep 2, 2026
…test-cov (#4567)

## Summary
`verify --all` no longer passes `--cov`; the CI coverage artifact upload
goes with it.

## Problem (evidence)
Job `a51519ba` (`verify_all` on 985e0f9) exited 3 after collection:
every worker raised `TestmonException: testmon doesn't support
simultaneous run with pytest-cov when branch coverage is on` on its
first test (`pytest_runtest_protocol` → `setup_coverage`). #4566 folded
the coverage floor into the corpus run; `[tool.coverage.run] branch =
true` makes testmon refuse.

## Solution
Delete the coverage args and the floor reader. The corpus run's tracer
belongs to the testmon graph.

## Verification
```
devtools test tests/unit/devtools/test_verify.py tests/unit/devtools/test_verify_runs.py -n 2   # 33 passed
ruff, mypy on devtools/verify.py clean
```
The next `verify_all` job is the end-to-end check.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_01YGi8wLWGR2HYBh8p8fXFXz

Co-authored-by: Claude Fable 5.1 <[email protected]>
Sinity added a commit that referenced this pull request Sep 3, 2026
#4566 (the devtools fold) deleted .config/wt.toml, added by #4565
minutes earlier, so every new worktree since has had no venv and no
testmon seed and the daemon's worktrunk-based workspace create cannot
provision. Restore the file as merged.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_01YGi8wLWGR2HYBh8p8fXFXz

Co-authored-by: Claude Fable 5.1 <[email protected]>
@Sinity

Sinity commented Sep 29, 2026

Copy link
Copy Markdown
Owner Author

Closing out open Codex review threads on this PR (evidence checked against master at 64a9bd0):

  • P1 devtools/verify.py:190: Stale: Managed verification no longer runs pytest-cov: the pytest command is built without coverage arguments because testmon owns the tracer (devtools/verify.py:301-302). There is no coverage verdict for a flaky rerun to clear. (checked at 64a9bd0)

Resolving every thread listed; confirmed defects are fixed under the named bead.

@Sinity

Sinity commented Oct 1, 2026

Copy link
Copy Markdown
Owner Author

Historical Codex triage: evidence checked at 5ebcfe5. This records that source revision; it does not claim a fresh review of current master.

Only the rows listed above are dispositioned. Held findings remain open.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant