Repository navigation
Route every CLI command explicitly and import handlers lazily - #164
Merged
ProfSynapse merged 2 commits intoOct 2, 2026
Merged
Conversation
- Remove compute-losses, judge-sample, cloud-compare and download-experiment from the parser choices. They had no handler and fell through to the interactive menu, hanging non-interactive callers. judge_sample.py is an unfinished draft that does not import; the other three were never built. - Replace the if-chain and bulk handler import in the router with a COMMAND_ROUTES table of lazily imported handlers. A command with no route now fails with COMMAND_NOT_ROUTED and exit code 2; only an invocation with no command opens the interactive menu. - Import handlers per command so light commands (doctor, status, list, ...) no longer depend on torch via experiment_handler. A missing dependency is reported as HANDLER_IMPORT_ERROR for that command only. - Doctor reports a broken torch install as a finding instead of crashing. - compare-runs resolves Tools/compare_runs.py from the engine root rather than the current directory. - Add tests/cli/test_router_coverage.py: every parser command must have a route, every route must name an existing handler, unrouted commands are refused, and doctor runs without torch. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013etFNjLuo22CCoQmUGYqCT
The draft never imported (missing setup_logging), called process_sample with the wrong keyword and wrote to an undefined path. Its CLI command was already removed; generation-time judging lives in SynthChat. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013etFNjLuo22CCoQmUGYqCT
3 of 4 tasks
ProfSynapse
changed the base branch from
claude/data-leakage-guards
to
feat/submodule-cloud-api-v1
October 2, 2026 23:28
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.
Summary
PR 3 of 5. Stacked on #163.
compute-losses,judge-sample,cloud-compareanddownload-experimentwere accepted but unrouted, so they fell through to the interactive menu and hung non-interactive or agent callers. None had a working implementation, so all four are removed.Tools/judge_sample.py, an unfinished draft that never imported, is deleted.COMMAND_ROUTEStable.COMMAND_NOT_ROUTED.--jsonmode, running with no command is an error.list,eval,cloud-jobsand others in torch-less environments. Now a missing dependency affects only the command that needs it.doctor: reports a torch that is installed but fails to import as a finding, instead of crashing.compare-runs: finds its script from the engine root instead of the working directory.tests/cli/test_router_coverage.py(86 cases) checks every parser command against the route table, in both directions, and checks each handler target from source. It also runsdoctor --jsonwith torch blocked.Test plan
🤖 Generated with Claude Code
https://claude.ai/code/session_013etFNjLuo22CCoQmUGYqCT
Generated by Claude Code