Skip to content

refactor(cli): modularize main.rs and the test monolith — pure code movement#193

Merged
aaltshuler merged 2 commits into
mainfrom
refactor/cli-modularize
Jun 11, 2026
Merged

refactor(cli): modularize main.rs and the test monolith — pure code movement#193
aaltshuler merged 2 commits into
mainfrom
refactor/cli-modularize

Conversation

@aaltshuler

Copy link
Copy Markdown
Collaborator

Third modularization PR (pattern of #188/#192): verbatim moves + visibility bumps, zero behavior change, suite green per commit.

src/main.rs (4,197) → main 1,184 + helpers 1,085 + output 830 + cli 650 + main_tests 416

cli.rs: the entire clap surface (every command/subcommand/arg struct). helpers.rs: resolution (config/actor/graph/branch/query), remote HTTP, env/token handling, scaffolding. output.rs: all human/JSON formatting (print_*/finish_*/render_*). main.rs keeps main() and the dispatch match. The in-source test mod moved to main_tests.rs via #[path].

tests/cli.rs (4,548 lines, 112 tests) → five area suites

File Tests Area
cli_data.rs 49 load/read/change/branch/commit/export/snapshot/policy/embed/maintenance
cli_cluster.rs 24 cluster validate/plan/apply/approve/status/sync/force-unlock
cli_schema_config.rs 16 init/config scaffolding, schema plan/apply, graphs, version
cli_queries.rs 13 stored-query commands + alias resolution
cli_cluster_e2e.rs 10 spawned-binary lifecycle compositions (recovery, drift, convergence)

File-local helpers joined the existing tests/support harness.

Guarantees

161 crate tests green; full cargo test --workspace --locked green (50 suites). One-time git blame discontinuity, as before.

🤖 Generated with Claude Code

aaltshuler and others added 2 commits June 11, 2026 15:14
Verbatim moves: the clap surface (every command/subcommand/arg struct) to
cli.rs, resolution helpers (config/actor/graph/branch/query, remote HTTP,
env/token, scaffolding) to helpers.rs, human/JSON formatting to output.rs,
the in-source test mod to main_tests.rs via #[path]. main.rs (1,184 lines)
keeps main() and the dispatch match. Visibility bumps only; 22 binary
tests green.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
tests/cli.rs (4,548 lines, 112 tests) becomes five area files —
cli_cluster (24), cli_cluster_e2e (10, the spawned-binary lifecycle
compositions), cli_data (49), cli_schema_config (16), cli_queries (13) —
with the file-local helpers joining the existing tests/support harness.
Verbatim moves + visibility bumps; 161 crate tests green.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

@greptile-apps greptile-apps 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.

aaltshuler has reached the 50-review limit for trial accounts. To continue receiving code reviews, upgrade your plan.

@aaltshuler aaltshuler merged commit 7af3697 into main Jun 11, 2026
8 checks passed
@aaltshuler aaltshuler deleted the refactor/cli-modularize branch June 11, 2026 12:37
aaltshuler added a commit that referenced this pull request Jun 12, 2026
Lands an orphaned-but-accurate working-tree edit (the engine table rows
for forbidden_apis.rs, lance_surface_guards.rs, traversal_indexed,
proptest_equivalence, ordering, literal_filters, policy_engine_chassis —
all real files; 21 -> 28 count) and replaces the stale pre-modularization
crate rows: the CLI and server entries now describe the per-area suites
(#192/#193 splits) plus this cycle's additions (RFC-008 deprecation
coverage, keyed-credential auth, hermetic OMNIGRAPH_HOME harness, the
bucket-gated s3 suites).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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