Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.PHONY: help demo test lint ci clean bench-leakage bench-multi-negatives bench-baseline bench-hidden-active bench-cluster-split bench-expert-ablation bench-expert-ablation-500 bench-selectivity bench-feature-decomp bench-gate bench-easy-baseline bench-charge-matched bench-order-dependent bench-precision-at-k bench-per-family bench-simulation-ablation bench-simulation-ablation-within-amp simulation-gate bench-strategy-compare regenerate-all generate phase3 pilot validate-scoring validate-scoring-phase3 validate-scoring-strict external-pilot pilot-confident presynth-qc gold-standard diversity synthesis-order novelty-broad external-consensus questionnaire gate-check ip-report benchmark-card wave0-5-gate-check wave0-5-novelty-audit wave0-5-novelty-audit-v2 wave0-5-panel wave0-5-evidence wave0-5-fill-external wave0-5b-generate wave0-5b-filter recalibration-engine recalibration-engine-dry-run validate-policy-version generate-synthetic-lab-results bump-policy-version generate-review-packet failed-candidate-report safe-publication-filter classify-negative-informativeness validate-rejection-events negative-result-dashboard calibration-audit calibration-audit-example calibration-overfit-check result-quality-filter synthetic-result-policy-check
.PHONY: help demo test lint ci clean bench-leakage bench-multi-negatives bench-baseline bench-hidden-active bench-cluster-split bench-expert-ablation bench-expert-ablation-500 bench-selectivity bench-feature-decomp bench-gate bench-easy-baseline bench-charge-matched bench-order-dependent bench-precision-at-k bench-per-family bench-simulation-ablation bench-simulation-ablation-within-amp simulation-gate bench-strategy-compare regenerate-all generate phase3 pilot validate-scoring validate-scoring-phase3 validate-scoring-strict external-pilot pilot-confident presynth-qc gold-standard diversity synthesis-order novelty-broad external-consensus questionnaire gate-check ip-report benchmark-card wave0-5-gate-check wave0-5-novelty-audit wave0-5-novelty-audit-v2 wave0-5-panel wave0-5-evidence wave0-5-fill-external wave0-5b-generate wave0-5b-filter recalibration-engine recalibration-engine-dry-run validate-policy-version generate-synthetic-lab-results bump-policy-version generate-review-packet failed-candidate-report safe-publication-filter classify-negative-informativeness validate-rejection-events negative-result-dashboard calibration-audit calibration-audit-example calibration-overfit-check result-quality-filter synthetic-result-policy-check calibration-decision-checklist

PYTHON := $(shell [ -f .venv/bin/python ] && echo .venv/bin/python || echo python3)
PYTEST := $(shell [ -f .venv/bin/pytest ] && echo .venv/bin/pytest || echo pytest)
Expand Down Expand Up @@ -692,3 +692,14 @@ synthetic-result-policy-check:
--proposals-json /tmp/srp_input.json \
--out-json /tmp/srp_output.json --out-md /tmp/srp_output.md
@echo "Synthetic result policy check done. See /tmp/srp_output.json"

calibration-decision-checklist:
echo '{"G9-01":true,"G9-02":true,"G9-03":true,"G9-04":true,"G9-05":true,"G9-06":true,"G9-07":true,"G9-08":true,"G9-09":true,"G9-10":true}' > /tmp/checklist_responses.json
.venv/bin/openamp-foundry calibration-decision-checklist \
--checklist-id CHK-2026-001 \
--date 2026-07-09 \
--reviewer "human-reviewer" \
--responses-json /tmp/checklist_responses.json \
--out-json /tmp/checklist_output.json \
--out-md /tmp/checklist_output.md
@echo "Calibration decision checklist done. See /tmp/checklist_output.json"
5 changes: 3 additions & 2 deletions docs/evidence/METRICS_CURRENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ Machine-readable snapshot: `outputs/metrics_snapshot.json` regenerated with `mak
> **Purpose:** One authoritative table of current pipeline metrics. If any doc disagrees
> with this file, this file wins. Updated whenever benchmark/benchmark config changes.
>
> **Last updated:** 2026-07-09 (Phase G G8 — synthetic-result policy — v0.5.86)
> **Last updated:** 2026-07-09 (Phase G G9 — calibration decision review checklist — v0.5.87)
> **New in v0.5.87:** Calibration decision review checklist (G9) — `build_checklist()` produces a structured `CalibrationDecisionChecklist` with 12 checklist items (10 required) covering data quality, statistical validity, safety consistency, approval, and documentation. Each item has an id, category, question, rationale, and required flag. `CalibrationDecisionChecklist` dataclass tracks responses, notes, overall_pass, and missing_required. CLI (`openamp-foundry calibration-decision-checklist`) accepts `--checklist-id`, `--date`, `--reviewer`, `--responses-json`, `--out-json`, `--out-md`. JSON + Markdown output. Schema (`schemas/calibration_decision_checklist.schema.json`). `make calibration-decision-checklist` target. 14 tests. 3063 total. Makes human review structured and auditable.
> **New in v0.5.86:** Synthetic-result policy enforcement (G8) — `check_synthetic_result_policy()` and `run_policy_batch()` enforce that synthetic/simulation outputs cannot raise the proof-ladder level of a candidate. Levels 4+ require wet-lab evidence; synthetic/unknown sources are rejected for such proposals. CLI (`openamp-foundry synthetic-result-policy-check`) accepts `--proposals-json`, `--out-json`, `--out-md`. Schema (`schemas/synthetic_result_policy_check.schema.json`). `make synthetic-result-policy-check` target. 27 tests. 3049 total. Anti-overclaim safeguard.
> **New in v0.5.85:** Result-quality flag propagation (G7) — `assess_result_quality()` and `filter_results_for_calibration()` propagate result-quality flags into the calibration engine. Candidates with contamination or assay interference are excluded; candidates with 2+ quality flags are excluded; candidates with 1 flag are included with caution; clean candidates are fully included. `QUALITY_FLAGS` dictionary (8 flags). `ResultQualityReport` dataclass. CLI (`openamp-foundry result-quality-filter`) accepts `--results-json`, `--out-json`, `--out-md`. JSON + Markdown output. Schema (`schemas/result_quality_report.schema.json`). `make result-quality-filter` target. 27 tests. 3022 total.
> **New in v0.5.84:** Calibration-overfit warning (G6) — `check_cohort_overfit_risk()` and `run_overfit_check()` flag when a calibration cohort is too small relative to model parameters. Warns at three severity levels (critical/warning/caution/none). CLI (`openamp-foundry calibration-overfit-check`) accepts comma-separated cohort sizes, model params, n features. JSON + Markdown output. Schema (`schemas/calibration_overfit_check.schema.json`). `make calibration-overfit-check` target. 21 tests. 2995 total.
Expand Down Expand Up @@ -78,7 +79,7 @@ Machine-readable snapshot: `outputs/metrics_snapshot.json` regenerated with `mak
> **New in v0.5.31:** Added dipeptide-order features for sequence-order awareness. `dipeptide_order_score` achieves AUROC 0.7861 on AMP-vs-scrambled discrimination — the strongest order-dependent feature in the pipeline. Only 7/31 features survive scrambling (amphipathicity/helix-wheel + dipeptide). All composition features are purely position-independent (exactly 0.5000 AUROC on scrambled test).
> **New in v0.5.30:** Easy baseline benchmark added — charge density alone (AUROC 0.8166) outperforms the full pipeline ensemble (0.7792) on AMP-vs-Swiss-Prot-decoy discrimination. Honest finding documented: expected because pipeline optimizes for safety, not raw discrimination.
> **New in v0.5.29:** Expanded benchmark to 500 AMPs + 500 composition-matched decoys (n=1000). AUROC 0.7792 (CI₉₅: 0.7505–0.8065) confirms signal generalizes. Cluster-aware CI: 0.746–0.8102. Representative AUROC: 0.778. Standard benchmark (n=191) retained for backward comparison.
> **Pipeline version:** v0.5.86 (G8)
> **Pipeline version:** v0.5.87 (G9)
> **Branch:** main

---
Expand Down
51 changes: 51 additions & 0 deletions docs/research/ROADMAP.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,56 @@
# Roadmap

## v0.5.87 — Loop 87: Phase G G9 — Calibration Decision Review Checklist ✓ (2026-07-09)

`build_checklist()` produces a structured `CalibrationDecisionChecklist` with 12
checklist items (10 required) covering data quality, statistical validity, safety
consistency, approval, and documentation. Each item has an id, category, question,
rationale, and required flag. `CalibrationDecisionChecklist` dataclass tracks
responses, notes, overall_pass, and missing_required. JSON + Markdown output.
Schema (`schemas/calibration_decision_checklist.schema.json`).
CLI (`openamp-foundry calibration-decision-checklist`).
`make calibration-decision-checklist` target. 14 tests. 3063 total.
Makes human review structured and auditable.

Changes:
- `src/openamp_foundry/calibration/decision_checklist.py` (G9) — Core module with
`CHECKLIST_ITEMS` list (12 items), `CalibrationDecisionChecklist` dataclass
(8 fields: checklist_id, date, reviewer, responses, notes, overall_pass,
missing_required, dry_lab_only), `build_checklist()` applying response validation
and missing-required analysis, `write_checklist_json()` and
`write_checklist_markdown()` for structured output.
- `schemas/calibration_decision_checklist.schema.json` (G9) — JSON Schema Draft
2020-12 for the decision checklist. Validates all 8 required fields including
date pattern, responses object, and dry_lab_only const=true.
- `src/openamp_foundry/calibration/__init__.py` — Exports all decision checklist
symbols.
- `src/openamp_foundry/cli/commands/reports.py` — Added
`_run_calibration_decision_checklist()` CLI handler with `--checklist-id`,
`--date`, `--reviewer`, `--responses-json`, `--out-json`, `--out-md` flags.
- `src/openamp_foundry/cli/main.py` — Registered `calibration-decision-checklist`
subcommand with all argument flags and dispatch to handler.
- `Makefile` — Added `calibration-decision-checklist` target with default example
data writing to `/tmp/checklist_output.json` and `/tmp/checklist_output.md`.
Added to `.PHONY`.
- `tests/calibration/test_decision_checklist.py` — 14 tests covering: all required
pass → overall_pass=True, missing required → overall_pass=False, missing_required
list correct, unknown response id raises ValueError, dry_lab_only always True,
notes stored correctly, checklist_id stored correctly, reviewer stored correctly,
date stored correctly, CHECKLIST_ITEMS minimum count, required items have
required=True attribute, all items have required fields, JSON writer, Markdown
writer with table and icons.
- `docs/evidence/METRICS_CURRENT.md` — v0.5.87 G9 changelog. Test count: 3063.
- `tests/test_test_count_regression.py` — baseline updated to 3063.

Honest boundaries:
- The checklist validates structured human-review completion, not biological
correctness. A passing checklist does not confirm biological activity or safety.
- Required items are policy-defined. Missing or false required items block the
overall_pass, but a pass does not guarantee that human review was thorough.
- All calibration decisions require qualified human review regardless of checklist
results.
- The dry_lab_only=True constraint is an attestation, not a technical proof.

## v0.5.86 — Loop 86: Phase G G8 — Synthetic-Result Policy (Anti-Overclaim) ✓ (2026-07-09)

`check_synthetic_result_policy()` and `run_policy_batch()` enforce that synthetic/
Expand Down
36 changes: 36 additions & 0 deletions schemas/calibration_decision_checklist.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "OpenAMP Calibration Decision Review Checklist",
"description": "Structured human-review checklist applied before any recalibration update takes effect. Dry-lab only.",
"type": "object",
"required": [
"checklist_id",
"date",
"reviewer",
"responses",
"notes",
"overall_pass",
"missing_required",
"dry_lab_only"
],
"properties": {
"checklist_id": { "type": "string", "minLength": 1 },
"date": { "type": "string", "pattern": "^\\d{4}-\\d{2}-\\d{2}$" },
"reviewer": { "type": "string", "minLength": 1 },
"responses": {
"type": "object",
"additionalProperties": { "type": "boolean" },
"minProperties": 1
},
"notes": {
"type": "object",
"additionalProperties": { "type": "string" }
},
"overall_pass": { "type": "boolean" },
"missing_required": {
"type": "array",
"items": { "type": "string" }
},
"dry_lab_only": { "type": "boolean", "const": true }
}
}
14 changes: 14 additions & 0 deletions src/openamp_foundry/calibration/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,14 @@
write_result_quality_markdown,
)

from openamp_foundry.calibration.decision_checklist import (
CHECKLIST_ITEMS,
CalibrationDecisionChecklist,
build_checklist,
write_checklist_json,
write_checklist_markdown,
)

__all__ = [
# Constants
"MIN_COHORT_SIZE",
Expand Down Expand Up @@ -136,4 +144,10 @@
"filter_results_for_calibration",
"write_result_quality_json",
"write_result_quality_markdown",
# Decision checklist
"CHECKLIST_ITEMS",
"CalibrationDecisionChecklist",
"build_checklist",
"write_checklist_json",
"write_checklist_markdown",
]
Loading
Loading