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
11 changes: 10 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 regenerate-all generate phase3 pilot validate-scoring validate-scoring-phase3 validate-scoring-strict external-predict 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
.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 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

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 @@ -586,3 +586,12 @@ lab-batch-pack:
--evidence-dir outputs/evidence_wave0_5 \
--out outputs/lab_batch_pack.zip \
--manifest-out outputs/lab_batch_pack_manifest.json

generate-review-packet:
PYTHONPATH=src $(PYTHON) scripts/generate_review_packet.py \
--pipeline-version v0.5.73 \
--git-sha $$(git rev-parse HEAD) \
--candidate-count 36 \
--proof-ladder-level 2 \
--out outputs/review_packet_skeleton.json \
--validate
6 changes: 4 additions & 2 deletions docs/evidence/METRICS_CURRENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@ 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 E external review schemas — v0.5.72)
> **Last updated:** 2026-07-09 (Phase E safety release, preregistration, packet generator — v0.5.73)
> **New in v0.5.73:** Safety-release decision schema (E4), pilot pre-registration schema (E5), review packet generator CLI (E6). 40 tests. 2679 total.
>
> **New in v0.5.72:** External review packet schema (E1), example packet (E2), reviewer questionnaire schema (E3). 27 tests. 2666 total.
>
> **New in v0.5.71:** Calibration benchmark added — Brier score, reliability diagram, and calibration slope for pipeline ensemble scores. Honest finding: Brier=0.318 (>0.25=uninformative), slope=0.43 (ideal=1.0). Pipeline ranks well but scores are not meaningful probabilities. `make bench-calibration`. 6 tests. ~2100 total.
Expand Down Expand Up @@ -54,7 +56,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.72
> **Pipeline version:** v0.5.73
> **Branch:** main

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

## v0.5.73 — Loop 72: Phase E E4-E6 — Safety Release, Preregistration, Packet CLI ✓ (2026-07-09)

External review infrastructure: human-gated release decisions, pre-registered pilot
design, and automated skeleton review packet generation.

Changes:
- `schemas/safety_release_decision.schema.json` (E4) — JSON Schema for human-review
release decisions. Required fields: decision_id, packet_id, decided_at (ISO datetime),
decided_by (human name/role), decision (release/hold/reject), rationale (min 20 chars),
safety_checks_passed (toxicity/hemolysis/dual_use, all bool), novelty_confirmed (bool),
dry_lab_only_acknowledged (must be true), next_steps. Constraint: agent_authored must
be false or absent — safety release decisions cannot be made by agents.
- `schemas/pilot_preregistration.schema.json` (E5) — JSON Schema for freezing pilot
experimental design before running assays. Required fields: preregistration_id,
packet_id, registered_at, registered_by, assay_types (min 1), pass_criteria (array
with metric/threshold/direction, min 1), control_conditions (min 1), sample_size
(min 1), blinding, primary_endpoint, secondary_endpoints, statistical_analysis_plan
(min 20 chars), amendment_policy, pipeline_version_locked. Prevents HARKing by
freezing pass/fail criteria pre-assay — amendment_policy must be explicit.
- `scripts/generate_review_packet.py` (E6) — CLI script that generates a skeleton
external review packet JSON that validates against E1 schema. Flags: --pipeline-version,
--git-sha, --candidate-count, --proof-ladder-level, --out, --validate.
- `Makefile` — Added `generate-review-packet` target.
- `tests/evidence/test_safety_release_decision_schema.py` — 18 tests covering valid
decision, agent_authored=true rejection, missing/empty safety_checks, dry_lab_only
enforcement, decision enum, rationale length, decided_by pattern, dissent optional.
- `tests/evidence/test_pilot_preregistration_schema.py` — 14 tests covering valid
preregistration, empty assay_types/pass_criteria/control_conditions rejection,
negative sample_size, invalid direction enum, statistical plan length, blinding type.
- `tests/test_generate_review_packet.py` — 7 tests covering CLI output, schema
validation, --validate flag, required fields, invalid args.
- `tests/evidence/test_negative_result_schema.py` — Updated TestPilotPreregistrationSchema
to match new schema fields.
- `docs/evidence/METRICS_CURRENT.md` — v0.5.73 changelog. Pipeline version bumped.
Test count: 2679.
- `tests/test_test_count_regression.py` — baseline updated to 2679.

Honest boundaries:
- The safety release schema enforces human-gating on release decisions but does not
validate the quality or completeness of the safety review itself.
- The pilot pre-registration schema prevents post-hoc pass-criteria changes but relies
on human discipline to follow the amendment policy.
- The review packet generator creates a skeleton only — all fields (benchmark results,
candidate data, safety attestations) must be updated before use.
- A schema-valid safety release decision can still be wrong. The schema verifies
structure, not correctness.

## v0.5.72 — Loop 71: External Review Packet Schemas (Phase E, E1-E3) ✓ (2026-07-09)

External credibility infrastructure: machine-checkable schemas that let external
Expand Down
134 changes: 108 additions & 26 deletions schemas/pilot_preregistration.schema.json
Original file line number Diff line number Diff line change
@@ -1,41 +1,123 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "Pilot Pre-Registration",
"description": "Schema for pre-registered pilot selection logic. Freezes rules before assay results are known.",
"$id": "https://openamp-foundry.org/schemas/pilot_preregistration.schema.json",
"title": "OpenAMP Pilot Pre-Registration",
"description": "JSON Schema for freezing pilot experimental design before running assays. Pre-registration prevents HARKing (Hypothesizing After Results Known): once registered, pass/fail criteria cannot be changed post-hoc. Amendment policy must be documented explicitly.",
"type": "object",
"required": [
"pilot_name", "preregistered_at", "preregistered_by",
"candidate_pool_source", "selection_rules", "exclusion_criteria",
"pass_fail_criteria"
"preregistration_id",
"packet_id",
"registered_at",
"registered_by",
"assay_types",
"pass_criteria",
"control_conditions",
"sample_size",
"blinding",
"primary_endpoint",
"secondary_endpoints",
"statistical_analysis_plan",
"amendment_policy",
"pipeline_version_locked"
],
"properties": {
"pilot_name": {"type": "string", "description": "Human-readable pilot name (e.g., 'Wave 1 Pilot')"},
"preregistered_at": {"type": "string", "format": "date-time", "description": "ISO 8601 timestamp"},
"preregistered_by": {"type": "string", "description": "Person or agent who created the registration"},
"candidate_pool_source": {"type": "string", "description": "Path or description of the candidate pool"},
"candidate_pool_hash": {"type": "string", "description": "SHA-256 hash of the pool CSV"},
"selection_rules": {
"type": "object",
"description": "Machine-readable rules used to select candidates"
},
"exclusion_criteria": {
"type": "array",
"items": {"type": "string"},
"description": "Criteria that would cause a candidate to be excluded"
"preregistration_id": {
"type": "string",
"description": "Unique identifier for this pre-registration (e.g. 'PPR-2026-07-09-001')"
},
"packet_id": {
"type": "string",
"description": "Identifier of the external review packet this pre-registration refers to"
},
"registered_at": {
"type": "string",
"format": "date-time",
"description": "ISO 8601 timestamp when the experimental design was frozen"
},
"pass_fail_criteria": {
"type": "object",
"description": "Criteria for determining pilot success or failure"
"registered_by": {
"type": "string",
"description": "Name and role of the person who registered this design"
},
"revision_history": {
"assay_types": {
"type": "array",
"minItems": 1,
"items": {
"type": "string",
"description": "Type of assay to be performed (e.g. 'MIC', 'hemolysis_RBC', 'serum_stability', 'cytotoxicity_mammalian')"
},
"description": "Types of assays that will be performed. Must have at least one assay type."
},
"pass_criteria": {
"type": "array",
"minItems": 1,
"items": {
"type": "object",
"required": ["metric", "threshold", "direction"],
"properties": {
"date": {"type": "string", "format": "date"},
"reason": {"type": "string"}
}
}
"metric": {
"type": "string",
"description": "The metric against which pass/fail is judged (e.g. 'MIC_50', 'HC50', 'selectivity_index')"
},
"threshold": {
"type": "number",
"description": "The numerical threshold value for this criterion"
},
"direction": {
"type": "string",
"enum": ["above", "below", "equals"],
"description": "Whether passing requires the metric to be above, below, or equal to the threshold"
},
"notes": {
"type": "string",
"description": "Optional context or justification for this criterion"
}
},
"description": "A single pass/fail criterion with metric, threshold, and direction"
},
"description": "Pre-registered pass/fail criteria. These MUST NOT be changed after assays are run. If changes are needed, use the amendment_policy mechanism."
},
"control_conditions": {
"type": "array",
"minItems": 1,
"items": {
"type": "string",
"description": "Description of a control condition (e.g. 'Melittin positive control (hemolytic)', 'Vehicle-only negative control')"
},
"description": "Experimental control conditions that will be used. At least one control is required."
},
"sample_size": {
"type": "integer",
"minimum": 1,
"description": "Number of biological replicates per condition"
},
"blinding": {
"type": "boolean",
"description": "Whether the experimenters will be blinded to candidate identity during assay execution"
},
"primary_endpoint": {
"type": "string",
"description": "The primary outcome measure that will determine the study's main conclusion"
},
"secondary_endpoints": {
"type": "array",
"items": {
"type": "string",
"description": "A secondary outcome measure"
},
"description": "Secondary outcome measures (can be empty if none)"
},
"statistical_analysis_plan": {
"type": "string",
"minLength": 20,
"description": "Detailed plan for statistical analysis of the results. Must be at least 20 characters."
},
"amendment_policy": {
"type": "string",
"description": "Documented policy for how amendments to this pre-registration are handled. Must be explicit about what changes are allowed, who can authorize them, and how they are recorded."
},
"pipeline_version_locked": {
"type": "string",
"description": "The exact pipeline version used to generate candidate scores for this pilot (e.g. 'v0.5.72'). Prevents version drift from invalidating selection criteria."
}
}
}
97 changes: 97 additions & 0 deletions schemas/safety_release_decision.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://openamp-foundry.org/schemas/safety_release_decision.schema.json",
"title": "OpenAMP Safety Release Decision",
"description": "JSON Schema for the human-review decision on whether to release a candidate panel externally. Safety release decisions CANNOT be made by agents — agent_authored must be absent or false. This ensures release review is auditable and human-gated.",
"type": "object",
"required": [
"decision_id",
"packet_id",
"decided_at",
"decided_by",
"decision",
"rationale",
"safety_checks_passed",
"novelty_confirmed",
"dry_lab_only_acknowledged",
"next_steps"
],
"properties": {
"decision_id": {
"type": "string",
"description": "Unique identifier for this release decision (e.g. 'SRD-2026-07-09-001')"
},
"packet_id": {
"type": "string",
"description": "Identifier of the external review packet this decision refers to"
},
"decided_at": {
"type": "string",
"format": "date-time",
"description": "ISO 8601 timestamp when the decision was made"
},
"decided_by": {
"type": "string",
"pattern": "^[A-Za-z][A-Za-z .,'()-]+$",
"minLength": 3,
"description": "Name and/or role of the human who made this decision (e.g. 'Dr. Jane Smith, Safety Lead'). Must be a human, NOT an agent."
},
"decision": {
"type": "string",
"enum": ["release", "hold", "reject"],
"description": "The release decision: release (approved for external sharing), hold (requires more information), reject (denied release)"
},
"rationale": {
"type": "string",
"minLength": 20,
"description": "Human-written rationale for the decision. Must be at least 20 characters to ensure meaningful justification."
},
"safety_checks_passed": {
"type": "object",
"required": ["toxicity_screened", "hemolysis_screened", "dual_use_reviewed"],
"properties": {
"toxicity_screened": {
"type": "boolean",
"description": "Whether candidates were screened for general toxicity signals"
},
"hemolysis_screened": {
"type": "boolean",
"description": "Whether hemolysis assay risk was assessed for all candidates"
},
"dual_use_reviewed": {
"type": "boolean",
"description": "Whether dual-use implications were reviewed by a qualified human"
},
"additional_checks": {
"type": "object",
"description": "Optional additional safety checks beyond the three required ones",
"additionalProperties": { "type": "boolean" }
}
},
"description": "Record of which safety checks have been completed and passed"
},
"novelty_confirmed": {
"type": "boolean",
"description": "Whether candidate novelty has been confirmed by human review against current literature and databases"
},
"dry_lab_only_acknowledged": {
"type": "boolean",
"enum": [true],
"description": "REQUIRED: Must be true. Decision acknowledges that all outputs are dry-lab computational hypotheses only and are not biological proof."
},
"dissent": {
"type": "string",
"description": "Optional field documenting any reviewer disagreement or dissenting opinion. Required if any reviewer objected to the decision."
},
"next_steps": {
"type": "string",
"minLength": 10,
"description": "Description of next steps following this decision (e.g., 'Prepare release summary packet', 'Request additional safety data', 'Escalate to external review board')"
},
"agent_authored": {
"type": "boolean",
"enum": [false],
"description": "SAFETY CONSTRAINT: Must be false or absent. Safety release decisions cannot be made by agents."
}
}
}
Loading
Loading