Skip to content

feat: pre-wet-lab polish — error handling, CLI validation, WAVE2 context - #67

Merged
cschanhniem merged 2 commits into
mainfrom
feat/pre-wetlab-polish
Jun 28, 2026
Merged

cschanhniem merged 2 commits into
mainfrom
feat/pre-wetlab-polish

Conversation

@cschanhniem

Copy link
Copy Markdown
Collaborator

Summary

Final hardening pass before synthesis ordering. All issues identified in audit by code-reviewer agent.

CRITICAL

  • cli.py pilot-panel JSONL error handling: bare JSONDecodeError crash on any malformed line → structured JSON error with line number and 120-char preview, exit code 1. A single stray character in a multi-thousand-line ranked.jsonl file would have silently terminated the entire pilot panel selection.

HIGH

MEDIUM

  • cli.py validate-scoring stdout: now includes n_positives, n_negatives, benchmark_type, auprc alongside auroc — previously required reading the --out JSON file to see these fields
  • cli.py synthesis-order CSV validation: explicit header check before row iteration; missing candidate_id/sequence columns → structured error with found_columns list instead of bare KeyError
  • WAVE2_PLAN.md: added SEED-008 (puroindoline-a) Trp mechanism divergence note explaining that disagreement ~0.37 is mechanistic (Boman W=−3.398 vs Wimley-White W=−1.85 kcal/mol), not prediction uncertainty — Wave 2 should expand Trp-rich scaffold confidently if SEED-008 hits

LOW

  • presynth_check.py check_sequence(): validates all 20 canonical AAs before running QC; raises ValueError with bad-residue list on non-canonical input

Tests (1191 → 1200)

  • TestCheckSequenceInputValidation — 6 tests: canonical accepted, lowercase normalized, non-canonical raises, error message names residues, all 20 AAs accepted
  • test_validate_scoring_stdout_includes_n_and_auprc — asserts n_positives=43, n_negatives=44, benchmark_type and auprc in stdout
  • test_pilot_panel_malformed_jsonl_returns_error — asserts exit code 1, structured error, "line 2" in message
  • test_synthesis_order_missing_columns_returns_error — asserts exit code 1, structured error, "sequence" in message

Test plan

  • pytest tests/ -q → 1200 passed
  • All 4 new integration tests exercise the new error paths directly
  • Existing 1191 tests unchanged

🤖 Generated with Claude Code

…E2 context

CRITICAL fix:
- cli.py pilot-panel: bare JSONDecodeError on malformed JSONL → structured error with
  line number and 120-char line preview; returns exit code 1 (was unhandled crash)

MEDIUM fixes:
- cli.py validate-scoring stdout now includes n_positives, n_negatives, benchmark_type,
  auprc alongside auroc (previously needed --out file to see these fields)
- cli.py synthesis-order: explicit CSV header validation before row iteration; missing
  candidate_id/sequence columns → structured error with found_columns list
- WAVE2_PLAN.md: added SEED-008 Trp mechanism divergence note (disagreement ~0.37 is a
  mechanistic marker — Boman W=-3.398 vs Wimley-White W=-1.85 kcal/mol — not uncertainty;
  safe to expand Trp-rich scaffold in Wave 2 if SEED-008 hits)

HIGH fix:
- CHANGELOG.md Unreleased section updated with PRs #61-66 impact; stale "phase3.yaml: 0.30"
  (wrong) corrected to 0.40 (unified in PR #61)

LOW fix:
- presynth_check.py check_sequence(): validates all 20 canonical amino acids before QC;
  raises ValueError with bad-residue list on non-canonical input

Tests added (1191 → 1200):
- test_presynth_qc.py::TestCheckSequenceInputValidation (6 tests)
- test_cli.py::test_validate_scoring_stdout_includes_n_and_auprc
- test_cli.py::test_pilot_panel_malformed_jsonl_returns_error
- test_cli.py::test_synthesis_order_missing_columns_returns_error
@cschanhniem
cschanhniem merged commit bb5c18e into main Jun 28, 2026
2 checks passed
@cschanhniem
cschanhniem deleted the feat/pre-wetlab-polish branch June 28, 2026 11:52
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