Skip to content

test+docs: phase3 config validation, compute_features contract, wet-lab handoff guide - #27

Merged
cschanhniem merged 2 commits into
mainfrom
feat/phase3-config-test-compute-features-wetlab-docs
Jun 28, 2026
Merged

cschanhniem merged 2 commits into
mainfrom
feat/phase3-config-test-compute-features-wetlab-docs

Conversation

@cschanhniem

Copy link
Copy Markdown
Collaborator

Summary

Three remaining quality gaps closed before synthesis ordering:

  1. phase3.yaml config validation (3 new tests in test_config.py) — pipeline.yaml was validated at startup; phase3.yaml was not. If max_disagreement is accidentally removed from phase3.yaml, pipeline.py would crash at runtime with KeyError: 'disagreement' when iterating candidates. CI now catches this immediately.

  2. compute_features → synthesis_feasibility_score contract test — synthesis_feasibility_score() uses direct dict access (not .get()) for length, longest_repeat_run, and cysteine_fraction. There was no test verifying compute_features() always returns all three. A refactor that renames one key would silently crash candidate scoring. Added test_compute_features_supplies_synthesis_feasibility_keys that both checks key presence and runs the function end-to-end.

  3. docs/WET_LAB_HANDOFF.md — new guide for wet-lab scientists covering:

    • Score interpretation table (what does ensemble 0.65 mean for ordering?)
    • Synthesis decision thresholds (synthesise / conditional / expert review / exclude)
    • Selection gate rationale (why 0.30 for phase3 vs 0.40 for pipeline.yaml?)
    • Pre-synthesis QC flag guide with remediation actions (Cys, Met, hydrophobic run, trypsin sites)
    • MIC + hemolysis assay protocols (organisms, medium, concentration ranges, replicates)
    • Troubleshooting for < 10 nominations, synthesis failure, all-hemolytic batch
    • Confidence statement: "hit rate 20–40% consistent with AMP field literature"

Test plan

  • pytest tests/test_config.py tests/test_physchem.py — 57 passed
  • Full suite: 814 passed (up from 810)
  • No regressions

…act, wet-lab handoff guide

- tests/test_config.py: add test_phase3_config_selection_present, _weights_are_positive,
  and _filters_present — pins phase3.yaml keys at the same level of rigour as pipeline.yaml;
  if max_disagreement is accidentally removed from phase3.yaml the CI fails immediately rather
  than crashing at runtime when eligibility filter accesses item.scores["disagreement"]

- tests/test_physchem.py: add test_compute_features_supplies_synthesis_feasibility_keys —
  documents and verifies that compute_features() always returns the three keys that
  synthesis_feasibility_score() accesses with direct dict brackets (no .get()):
  'length', 'longest_repeat_run', 'cysteine_fraction'; a future refactor that drops
  any of these will fail loudly here rather than in mid-pipeline candidate scoring

- docs/WET_LAB_HANDOFF.md: new wet-lab handoff guide covering:
  - score interpretation table (activity/safety/synthesis/novelty/ensemble/disagreement)
  - ensemble score → synthesise/hold/exclude decision thresholds
  - selection gate rationale (why each threshold, pipeline vs phase3)
  - pre-synthesis QC flag interpretation and remediation actions
  - MIC and hemolysis assay protocols with organism, medium, concentration range, replicate count
  - troubleshooting for: too few nominations, synthesis failure, all-hemolytic batch
  - confidence statement ("hit rate 20–40% consistent with field literature")
- Troubleshooting section hardcoded 0.40 for disagreement gate but phase3.yaml uses 0.30;
  a scientist running the final synthesis batch would look at the wrong boundary to explain
  excluded candidates — now references both thresholds explicitly
- μH table used closed interval 0.55-0.80 (implying 0.55 = moderate) but presynth_check.py
  uses strict > 0.55 so μH=0.55 exactly is low risk; updated to '> 0.55 and ≤ 0.80' to match code
@cschanhniem
cschanhniem merged commit 2ca9079 into main Jun 28, 2026
1 check passed
@cschanhniem
cschanhniem deleted the feat/phase3-config-test-compute-features-wetlab-docs branch June 28, 2026 02:41
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