v26 remaining P1s: templates + interval + MCP debug + P0 regression test#44
Merged
lucapinello merged 1 commit intomainfrom Apr 24, 2026
Merged
Conversation
…egression test Picks up the parts of v26 my PR #43 fixed that didn't land in the parallel 96fc28d commit. 96fc28d landed the track-ID _validate_assay_ids override + INFO→DEBUG demotion (4 files). These 5 files close the remaining items from v26's list. ## P1 #12 — subprocess templates raise bare Exception enformer_source/templates/predict_template.py and borzoi_source/templates/predict_template.py had raise Exception(f"Some assay IDs not found in metadata: {...}") The env-runner wraps subprocess failures in RuntimeError, so the user saw a generic traceback prefix instead of a recognisable exception type. Upgraded to ValueError with a `get_track_info()` pointer and a specific missing-IDs list (vs dumping the whole assay_ids arg). ## P1 #13 — interval.py bare Exception('') CIGAR parser fallback at interval.py:673 raised an empty Exception('') — meaningless if a user ever hit it. Replaced with IntervalException naming the bad symbol + valid set ('=MIDX'). ## P1 #18 — MCP _safe_tool hides traceback The decorator returns {"error", "error_type", "tool"} dicts — MCP clients debugging a failing tool couldn't see which line raised. Opt-in: CHORUS_MCP_DEBUG=1 includes a "traceback" field in the error payload. Default behaviour unchanged. ## P0 #9 regression test tests/test_prediction_methods.py::test_unknown_track_id_gives_actionable_error exercises the EnformerOracle._validate_assay_ids path (96fc28d added this override, but no regression test for it landed). Covers: - unknown ENCFF ID → InvalidAssayError naming list_tracks/search_tracks - bad description → same - None/[] input → no-op (doesn't raise) Stubs enformer_metadata.get_metadata so the test runs in the base chorus env without TF. ## Tests 340 passed / 1 skipped in 9m 17s (+1 regression test from 339). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This was referenced Apr 24, 2026
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 4 remaining v26 items (3 P1s + 1 regression test) that didn't land in the parallel
96fc28dcommit. That commit picked up the track-ID_validate_assay_idsoverride + INFO→DEBUG demotion — great. These 5 files are the rest.Answer to "so all good?": not quite — these 4 remaining items are real and worth one more small PR.
P1 #12 — subprocess templates raised bare
ExceptionBoth
predict_template.pyfiles hadraise Exception(f"Some assay IDs not found in metadata: {args['assay_ids']}"). The env-runner wraps subprocess failures inRuntimeError, so users saw a generic traceback instead of a recognisable type. Now raisesValueErrorwith:assay_idsarg)get_track_info()pointer consistent with the direct-load pathP1 #13 —
chorus/core/interval.pybareException('')CIGAR parser fallback at line 673 raised an empty
Exception('')— if a user ever hit it they'd get no information. Replaced withIntervalExceptionnaming the bad CIGAR symbol and the valid set'=MIDX'.P1 #18 — MCP
_safe_toolhides tracebackThe decorator returns
{"error", "error_type", "tool"}dicts on failure. MCP clients debugging a failing tool can't see which line raised. Opt-in viaCHORUS_MCP_DEBUG=1env var now includes a"traceback"field in the error payload. Default behaviour unchanged.P0 regression test
96fc28daddedEnformerOracle._validate_assay_idsbut shipped no regression test. Addedtest_unknown_track_id_gives_actionable_errorthat exercises the override with a stubbed metadata (no TF needed in the basechorusenv). Covers:ENCFF…ID →InvalidAssayErrornaminglist_tracks/search_tracksNone/[]input → no-op, doesn't raiseTest plan
pytest tests/ --ignore=tests/test_smoke_predict.py -q→ 340 passed / 1 skipped (+1 from 339, the new regression test)oracle.predict(..., ['ENCFF999BADID'])via env-runner → error containsget_track_info()+ list of missing IDsgrep "raise Exception('')" chorus/→ 0 matches (was 1)grep "raise Exception(f\"Some assay" chorus/→ 0 matches (was 2)CHORUS_MCP_DEBUG=1includes traceback in MCP error payload; unset omits it🤖 Generated with Claude Code