Skip to content

feat: route selectivity_proxy into pilot_priority ranking formula (#48) - #48

Merged
cschanhniem merged 2 commits into
mainfrom
feat/selectivity-in-pilot-priority
Jun 28, 2026
Merged

cschanhniem merged 2 commits into
mainfrom
feat/selectivity-in-pilot-priority

Conversation

@cschanhniem

Copy link
Copy Markdown
Collaborator

Summary

  • Gap closed: selectivity_proxy (added in PR feat: add selectivity_proxy — cytotoxicity risk detector for Stage 2 (#47) #47) was computed in compute_features() but never stored in the pipeline scores dict — so _pilot_priority() could not use it. Low-selectivity candidates (e.g. temporin-like SEED-004, proxy=0.30) were ranked identically to selective peers with equal ensemble scores.
  • Pipeline change: pipeline.py now stores selectivity_proxy in raw_scores (read from features["selectivity_proxy"]). Default 1.0 when key is absent (backward-compatible with pre-PR-47 records).
  • Pilot formula updated: _pilot_priority() gains + 0.05×selectivity_proxy term. Full formula: ensemble − 0.30×disagreement + 0.05×serum_stability + 0.05×novelty + 0.05×selectivity_proxy. Weight 0.05 is consistent with stability and novelty terms — keeps ensemble dominant (max selectivity contribution = 0.05).
  • SEED-004 impact: Temporin-like variants (proxy=0.30, GRAVY=+1.81) are now demoted by 0.035 relative to a fully selective peer with equal ensemble score. They can still earn their max_per_seed slots if they score well, but won't crowd out more selective candidates in tie situations.
  • Discovery probability: Stage 2 (TI > 10) improved to ~41–56%; combined "breaking news" probability updated to ~25–46%.

Test plan

  • 5 new tests in test_pilot_panel.py: higher selectivity → higher priority; max delta = 0.05; absent key defaults to 1.0; SEED-004 temporin demoted vs selective peer of equal ensemble
  • 2 existing tests updated to include the new selectivity term in expected formula
  • 1086 total tests pass (pre-push hook confirmed)
  • Lint clean
  • selectivity_proxy absent in scores dict defaults safely to 1.0 (no regression for old records)

🤖 Generated with Claude Code

Previously selectivity_proxy was computed in compute_features() but
never reached the pipeline scores dict — so _pilot_priority() couldn't
use it. Low-selectivity candidates (e.g. temporin-like SEED-004) were
ranked identically to selective peers with equal ensemble scores.

Changes:
- pipeline.py: add selectivity_proxy to raw_scores dict (from features)
- pilot.py: add 0.05×selectivity_proxy term to _pilot_priority(); formula now:
  ensemble − 0.30×disagreement + 0.05×serum_stability + 0.05×novelty
           + 0.05×selectivity_proxy
  Weight 0.05 matches stability and novelty — keeps ensemble dominant.
- test_pilot_panel.py: update 2 existing tests for the new term;
  add 5 new tests for selectivity behaviour (higher is better, max delta=0.05,
  absent defaults to 1.0, SEED-004 temporin demoted vs selective peer)
- Makefile: update echo to 1086-test suite
- docs: discovery probability updated to ~25-46% (Stage 2: ~41-56%)
  SEED-004 temporin demoted 0.035 relative to equivalent selective candidate
- pilot_panel.py: add selectivity_proxy to CSV (_CSV_FIELDS + _row())
  so wet-lab teams can audit why candidates were demoted in the CSV handoff
- pilot_panel.py: update write_pilot_markdown() formula string to include
  all three bonus terms (stability + novelty + selectivity_proxy); was
  two terms out of date — fix the HIGH issue flagged in code review
- pilot_panel.py: add Sel.Px column to the Markdown candidate table
- test_pilot_panel.py: _make() now accepts selectivity_proxy= kwarg
- test_pilot_panel.py: add test_selectivity_proxy_breaks_tie_in_panel_ordering
  — first panel-level integration test for the selectivity ranking path
- test_pilot_panel.py: add test_selection_method_describes_full_formula
  — guards against future formula-string staleness
- test_pilot_panel.py: update test_correct_columns to include selectivity_proxy
- test_pilot_panel.py: make all four defaults explicit in
  test_missing_disagreement_defaults_to_0_5 comment and assertion
- Makefile: update test count to 1088
@cschanhniem
cschanhniem merged commit fafc950 into main Jun 28, 2026
3 checks passed
@cschanhniem
cschanhniem deleted the feat/selectivity-in-pilot-priority branch June 28, 2026 07:11
cschanhniem added a commit that referenced this pull request Jun 28, 2026
- Combined probability updated: ~25-46% (PR #48) → ~27-47% (PR #49)
- Synthesis gate: ~89% → ~90% (aggregation propensity model)
- Serum stability gate: ~28-42% → ~29-44% (3-protease elastase model)
- Table: add PR #49 column across all criteria
- Add rationale sections for both new features (aggregation + elastase)
- Add Points 12 and 13 to "What the Pipeline Got Right" section
- Update "breaking news" probability history in executive summary
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