v26 tail cleanup: CLI preflight + ChorusError hierarchy + MCP guard#46
Merged
lucapinello merged 1 commit intomainfrom Apr 24, 2026
Merged
v26 tail cleanup: CLI preflight + ChorusError hierarchy + MCP guard#46lucapinello merged 1 commit intomainfrom
lucapinello merged 1 commit intomainfrom
Conversation
…guard Closes the last v26 backlog items. P1 #1 / #2 (cli/main.py): `chorus setup --oracle <bad>`, `chorus health --oracle <bad>`, `chorus validate --oracle <bad>` now reject unknown names up front with the valid list, instead of dropping into "Environment file not found" or "Environment does not exist" with no recovery hint. Exit codes were already non-zero; this makes the message actionable. P2 #19 (core/exceptions.py, mcp/server.py): `_parse_region` and `_parse_position` raise `InvalidRegionError` (ChorusError subclass) instead of bare `ValueError`. `InvalidSequenceError`, `InvalidAssayError`, and `InvalidRegionError` now inherit from both `ChorusError` and `ValueError` so legacy `except ValueError` handlers still catch them. P2 #20 (mcp/server.py): `list_tracks(oracle_name)` preflight-validates the oracle name against `ORACLE_SPECS` and logs + returns an explicit error dict naming the valid oracles, rather than dropping through to the fall-through "Unknown oracle" branch without context. Tests: 340 passed, 1 skipped on fast suite (6 tests that expected `ValueError` from `_parse_region` pass through the dual-base class). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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
Closes the last v26 backlog items so v26 is fully landed on main.
cli/main.py):chorus setup --oracle <bad>,chorus health --oracle <bad>, andchorus validate --oracle <bad>now reject unknown names up front with the valid list. Exit codes were already non-zero; this makes the message actionable. (chorus genome download <bad>already did this.)core/exceptions.py,mcp/server.py):_parse_region/_parse_positionraiseInvalidRegionError(aChorusErrorsubclass) instead of bareValueError.InvalidSequenceError,InvalidAssayError,InvalidRegionErrornow multiply inherit fromChorusError+ValueErrorso legacyexcept ValueErrorhandlers still catch them.mcp/server.py):list_tracks(oracle_name)preflight-validates the oracle name againstORACLE_SPECSand logs + returns an explicit error dict naming the valid oracles, rather than falling through.Scope: 3 files, +79/−18.
Test plan
pytest tests/ --ignore=tests/test_smoke_predict.py -q→ 340 passed, 1 skippedchorus setup --oracle fakeoracle→ exit 1, "Valid oracles: alphagenome, borzoi, chrombpnet, enformer, legnet, sei"chorus health --oracle fakeoracle→ exit 1, same valid-list messageRemaining v26
After this: only P2 #5 (inconsistent error style sweep) remains — deferred because it's a diffuse stylistic cleanup, not a correctness issue.
🤖 Generated with Claude Code