Repository navigation
refactor: split cli.py into cli/ package (#155) - #160
Merged
Merged
Conversation
Split the monolithic 3015-line cli.py into a cli/ package with 11 modules: - __init__.py: main(), config loading, dispatch (214 lines) - __main__.py: python -m support (5 lines) - _common.py: shared helpers (184 lines) - parsers.py: all argparse definitions (490 lines) - compare.py: logprobs, output, streaming comparison (193 lines) - batch.py: batch-compare, rerun, snapshot replay (418 lines) - diagnose.py: diagnose, healthcheck, detect, check-kv (83 lines) - report.py: report, diff, regression, summary, filter, explain, annotate, cluster, aggregate (338 lines) - benchmark.py: benchmark, reproducibility, concurrency-sweep, bisect (163 lines) - data.py: snapshot capture, cache, history, dataset-stats (368 lines) - config_cmd.py: init, config, profiles, completion (93 lines) - analysis.py: watch, entropy, length-bias, sensitivity, fingerprint (217 lines) All 1064 existing tests pass. No functional changes.
hlin99-Review-Bot
approved these changes
Apr 5, 2026
hlin99-Review-Bot
left a comment
There was a problem hiding this comment.
✅ Approved by hlin99-Review-Bot
Idea Value: High — splitting a 3076-line monolith into 11 focused modules is a clear maintainability win. Well-scoped, no functional changes.
Code Quality:
- Module breakdown is logical and well-organized
- Re-exports in
__init__.pypreserve backward compatibility for test patching - All 1064 tests pass, lint clean
- CI all green (lint + test 3.10/3.11/3.12)
docs/iterations/current.mdupdated- Entry point unchanged (
xpyd_acc.cli:main)
No issues found. Pure mechanical refactor, cleanly executed.
hlin99-Review-BotX
approved these changes
Apr 5, 2026
hlin99-Review-BotX
left a comment
There was a problem hiding this comment.
✅ Approved by hlin99-Review-BotX
Idea Value: High — a 3076-line monolith split into 11 focused modules is a clear maintainability and navigability win. Logical groupings, no functional changes.
Code Quality:
__init__.pyre-exports all handlers preserving backward-compatible patch paths for tests — good attention to detailparsers.pycleanly centralizes all argparse definitions viaregister_all()__main__.pyenablespython -mexecution (5 lines, correct)- All 1064 tests pass, lint clean, CI green across 3.10/3.11/3.12
docs/iterations/current.mdupdated- Entry point
xpyd_acc.cli:mainunchanged inpyproject.toml
No issues found. Second approval — should auto-merge.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #155
Summary
Split the monolithic 3015-line
cli.pyinto acli/package with 11 modules, each under 500 lines.Module breakdown
__init__.pymain(), config loading, dispatchparsers.pybatch.pydata.pyreport.pyanalysis.pycompare.py_common.pybenchmark.pyconfig_cmd.pydiagnose.pyVerification
ruff checkandisort --checkpasspyproject.tomlentry point unchanged (xpyd_acc.cli:main)cli.pyremoved