From 6cacbdebc59d7d42d170ddb3cc8ac726d80ae419 Mon Sep 17 00:00:00 2001 From: Prakash Chand Jain Date: Fri, 20 Nov 2026 14:23:40 +0530 Subject: [PATCH 01/11] Add LoopBench Manifold AI platform work sample --- projects/loopbench-manifold/README.md | 36 +++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100644 projects/loopbench-manifold/README.md diff --git a/projects/loopbench-manifold/README.md b/projects/loopbench-manifold/README.md new file mode 100644 index 0000000..f15ac24 --- /dev/null +++ b/projects/loopbench-manifold/README.md @@ -0,0 +1,36 @@ +# LoopBench — Prospective Evidence & Evaluation Workbench + +Independent AI-platform work sample inspired by Manifold Bio's public mBER-2 report. + +Open [the interactive prototype](./index.html). Read the [product memo](./PRODUCT_MEMO.md), [evaluation charter](./evaluation-charter.md), and [candidate outcome schema](./candidate-outcome.schema.json). + +## Product thesis +As AI design and experimental throughput increase, the platform challenge is making every candidate, model version, physical construct, assay readout, uncertainty and next decision traceable—and distinguishing retrospective results from prospective evaluation. + +## Public report facts +The September 22, 2026 mBER-2 technical report describes 56 targets, 1,298,334 designs ordered, 584,450 high-signal designs, 26,026 specific on-design hits across formats, 55/56 targets with at least one hit pooled across formats, and 430 binder–antigen pairs tested by BLI. + +| Format | Overall hit rate | Retrospective top-100 | +|---|---:|---:| +| VHH | 8.6% | 16.8% | +| Minibinder | 4.64% | 8.62% | +| Microbinder | 0.93% | 3.55% | + +**The top-100 rates are retrospective selections, not prospective holdout performance.** The product opportunity is to make that distinction operational and enforceable. + +## Guardrails +- Keep development, retrospective and prospective results distinct. +- Freeze model/scorer/configuration before unblinding an untouched holdout. +- Check target, epitope, campaign, time and assay-batch overlap. +- Keep PASS, FAIL, REVIEW and missing outcomes explicit. +- Report denominators, QC attrition, target-level variation and uncertainty. +- Do not treat binding as proof of in-vivo distribution, PK or therapeutic function. + +## Scope and safety +This is an independent concept using public aggregate metrics and synthetic examples. It uses no protein sequences, internal Manifold data, patient data or wet-lab protocols. It does not make biological predictions, rank actual targets or recommend experiments. The workflow is a hypothesis to pressure-test with scientists, not a claim about Manifold's internal infrastructure. + +## Sources +- [mBER-2 technical report](https://manifold-bio-public.s3.us-east-2.amazonaws.com/mBER-2_technical_report_v20260922.pdf) +- [Manifold mBER-2 announcement](https://www.manifold.bio/news/mber-2-scaling-ai-protein-design-to-learn-from-living-systems) +- [mBER-open repository](https://github.com/manifoldbio/mber-open) +- [AI Platform & Partnerships role](https://job-boards.greenhouse.io/manifoldbio/jobs/5127283007) From 24e5a652f4505719816fe2e634a561411c3d883f Mon Sep 17 00:00:00 2001 From: Prakash Chand Jain Date: Fri, 20 Nov 2026 14:23:53 +0530 Subject: [PATCH 02/11] Add LoopBench product memo --- projects/loopbench-manifold/PRODUCT_MEMO.md | 64 +++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 projects/loopbench-manifold/PRODUCT_MEMO.md diff --git a/projects/loopbench-manifold/PRODUCT_MEMO.md b/projects/loopbench-manifold/PRODUCT_MEMO.md new file mode 100644 index 0000000..5ef2ca3 --- /dev/null +++ b/projects/loopbench-manifold/PRODUCT_MEMO.md @@ -0,0 +1,64 @@ +# LoopBench — Product & Evaluation Memo + +## Executive thesis +With high-throughput design and experimental loops, the platform challenge is not only generating more candidates. It is ensuring every candidate, prediction, physical measurement and downstream decision can be compared, reproduced and audited—and knowing when a retrospective metric is not a prospective result. + +## Product hypothesis +A lightweight evidence operating layer could make this chain queryable and decision-ready: + +**Model run → design record → construct ID → assay batch → readout → scientific decision** + +Every transition carries a stable ID, timestamp, source reference, version and accountable owner. Corrections append events rather than silently overwriting history. + +## Public evidence motivating the concept +Manifold's 22 September 2026 mBER-2 report describes 56 targets. It reports 1,298,334 designs ordered, 584,450 high-signal designs, 26,026 specific on-design hits across formats, pooled hit coverage of 55/56 targets, and 430 binder–antigen pairs tested by BLI. + +Reported hit rates: +- VHH: 8.6% overall; 16.8% for retrospectively selected top-100 designs per target. +- Minibinder: 4.64% overall; 8.62% top-100 retrospective. +- Microbinder: 0.93% overall; 3.55% top-100 retrospective. + +The top-100 rates are retrospective, not a prospective holdout claim. That distinction can become operational: store the evaluation regime with every metric, prevent retrospective results from being labelled prospective, and require a frozen scorer plus untouched holdout for a generalisation claim. + +## Product surfaces +### 1. Evidence graph +Versioned model run, design intent, construct identity, assay batch, readout, QC and decision records. Each object has a canonical ID and immutable event history. + +### 2. Evaluation guardrails +- Split manifests for target, epitope, campaign, time and assay-batch boundaries. +- Import-time checks for duplicate identifiers and development/holdout overlap. +- Frozen model, scorer, feature-pipeline, code-commit and configuration hashes. +- Explicit retrospective/prospective labels and pre-registered thresholds. +- Reports with denominators, QC attrition, missingness and target/format heterogeneity. + +### 3. Decision-aware scorecards +Each scorecard begins with the decision it supports. A binding hit is not a claim about in-vivo distribution. Distribution is not proof of therapeutic function. Evidence maturity and missing evidence should be explicit. + +### 4. Partner collaboration surface +Export an approved, schema-versioned evidence package with data rights, permitted uses, IP, retention, access controls and derivative-use boundaries stated. + +## Metrics worth discussing +**Data reliability:** lineage completeness, duplicate rate, missingness, QC attrition, batch coverage, data latency and correction rate. + +**Model evaluation:** per-target/per-format top-k enrichment, target-level hit coverage, calibration/Brier score where probabilities are meaningful, held-out-target/epitope/time performance, ranking stability, epitope breadth and uncertainty intervals. + +**Workflow impact:** time from readout to decision, share of decisions with complete evidence, experiment-to-model feedback latency, scientist review burden and repeat use. + +## A 30-day validation plan +**Week 1 — Discover.** Interview 3–5 scientists, AI/ML researchers and programme owners. Map actual handoffs, identifiers, recurring failures and decision points. Do not assume this prototype's schema is correct. + +**Week 2 — Contract.** Agree one low-risk, permitted data slice. Define event IDs, versioning, QC semantics, evaluation splits, source of truth and export boundaries. + +**Week 3 — Integrate.** Connect one approved read-only dataset or a partner-approved synthetic sandbox. Add lineage and leakage checks. + +**Week 4 — Evaluate.** Run a pre-registered holdout. Measure reproducibility, missing lineage, time-to-review, evaluation quality and scientist usefulness. Expand, redesign or stop based on evidence. + +## Main risks +- False confidence from pooled metrics: mitigate with stratified reporting and uncertainty. +- Retrospective metrics presented as prospective lift: mitigate with holdout custody, split manifests and frozen scoring. +- Binding interpreted as biodistribution or therapeutic effect: mitigate with evidence maturity levels. +- Partner data rights: mitigate with explicit access, retention, IP and derivative-use controls. +- Added metadata burdens scientists: derive identifiers where possible and measure review burden. + +## Scope boundary +This is an independent product/evaluation concept using public aggregate figures and synthetic examples. It is not protein design software, a biological model, a wet-lab planner or a claim about Manifold's internal infrastructure. Every workflow hypothesis requires validation with the people who use the real system. From 3c614e776d2065628663413f87361305fd5900bd Mon Sep 17 00:00:00 2001 From: Prakash Chand Jain Date: Fri, 20 Nov 2026 14:24:02 +0530 Subject: [PATCH 03/11] Add prospective evaluation charter --- .../loopbench-manifold/evaluation-charter.md | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 projects/loopbench-manifold/evaluation-charter.md diff --git a/projects/loopbench-manifold/evaluation-charter.md b/projects/loopbench-manifold/evaluation-charter.md new file mode 100644 index 0000000..24373aa --- /dev/null +++ b/projects/loopbench-manifold/evaluation-charter.md @@ -0,0 +1,41 @@ +# Prospective Evaluation Charter — Draft Template + +## Claim to test +Does a frozen scoring model improve candidate selection on an untouched future or target-held-out campaign, compared with a pre-defined baseline? + +## Split strategy +Choose and document one primary split before looking at holdout outcomes: +- Unseen targets (target-held-out). +- Unseen epitopes within known targets. +- Future campaign / temporal holdout. +- Independent assay batch or site holdout. + +Document the unit of randomisation and why the split matches the intended deployment setting. + +## Frozen artefacts +Record the model checkpoint/version, scorer and feature-pipeline version, code commit/configuration hash, candidate eligibility rules, exclusions, thresholds, assay protocol version, controls and outcome semantics. + +## Primary metric +Choose one metric tied to the decision: +- Target-stratified top-k enrichment vs unfiltered baseline. +- Target-level hit coverage at fixed experimental budget. +- Calibration/Brier score, only where scores represent probabilities. +- Epitope breadth at fixed experimental budget. + +## Pre-analysis gates +1. Holdout labels are controlled by an evaluator not involved in model tuning. +2. Split manifest checked for target, epitope, campaign, time and assay-batch leakage. +3. Model, scorer, feature pipeline, code and configuration are frozen. +4. Hit definition, controls, QC exclusions and missingness semantics are approved. +5. Primary metric, denominator and uncertainty analysis are specified before unblinding. +6. Scientific owner signs off on interpretation and defines which decision the metric informs. + +## Reporting rules +- Keep development, retrospective and prospective results separate. +- Retain FAIL, REVIEW and missing as explicit states; do not silently recode. +- Report denominators and attrition at every stage. +- Do not generalise binding results to in-vivo distribution, PK or therapeutic function. +- Report target-level variance, not only a pooled score. +- Record protocol deviations and every exclusion. + +No experiment or biological recommendation is authorised by this template. Relevant scientific and platform owners must approve the protocol, data access and interpretation. From 39356185a2f700f7fb0abf582693388a463523ee Mon Sep 17 00:00:00 2001 From: Prakash Chand Jain Date: Fri, 20 Nov 2026 14:24:10 +0530 Subject: [PATCH 04/11] Add candidate outcome JSON schema --- .../candidate-outcome.schema.json | 87 +++++++++++++++++++ 1 file changed, 87 insertions(+) create mode 100644 projects/loopbench-manifold/candidate-outcome.schema.json diff --git a/projects/loopbench-manifold/candidate-outcome.schema.json b/projects/loopbench-manifold/candidate-outcome.schema.json new file mode 100644 index 0000000..7fe0108 --- /dev/null +++ b/projects/loopbench-manifold/candidate-outcome.schema.json @@ -0,0 +1,87 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "title": "LoopBench Candidate Outcome Record", + "type": "object", + "additionalProperties": false, + "required": [ + "design_id", + "target_id", + "epitope_id", + "binder_format", + "model_version", + "campaign_id", + "assay_batch", + "predicted_score", + "observed_hit", + "qc_status", + "evaluation_split", + "evidence_ref" + ], + "properties": { + "design_id": { + "type": "string", + "minLength": 1 + }, + "target_id": { + "type": "string", + "minLength": 1 + }, + "epitope_id": { + "type": "string", + "minLength": 1 + }, + "binder_format": { + "type": "string", + "enum": [ + "VHH", + "Minibinder", + "Microbinder", + "Other" + ] + }, + "model_version": { + "type": "string", + "minLength": 1 + }, + "campaign_id": { + "type": "string", + "minLength": 1 + }, + "assay_batch": { + "type": "string", + "minLength": 1 + }, + "predicted_score": { + "type": "number", + "minimum": 0, + "maximum": 1 + }, + "observed_hit": { + "type": "integer", + "enum": [ + 0, + 1 + ] + }, + "qc_status": { + "type": "string", + "enum": [ + "PASS", + "FAIL", + "REVIEW" + ] + }, + "evaluation_split": { + "type": "string", + "enum": [ + "development", + "prospective_holdout", + "retrospective" + ] + }, + "evidence_ref": { + "type": "string", + "minLength": 1 + } + } +} \ No newline at end of file From 6fe42b7536e5617cbf184d21b04ecdfa61659e64 Mon Sep 17 00:00:00 2001 From: Prakash Chand Jain Date: Fri, 20 Nov 2026 14:24:48 +0530 Subject: [PATCH 05/11] Add interactive LoopBench workbench --- projects/loopbench-manifold/index.html | 41 ++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 projects/loopbench-manifold/index.html diff --git a/projects/loopbench-manifold/index.html b/projects/loopbench-manifold/index.html new file mode 100644 index 0000000..cea722f --- /dev/null +++ b/projects/loopbench-manifold/index.html @@ -0,0 +1,41 @@ + +LoopBench — Evidence & Evaluation + +
LOOPBENCH
Evidence → evaluation → decision
INDEPENDENT CONCEPT
+

Make scientific AI evaluation decision-grade.

A product concept inspired by Manifold Bio's public mBER-2 report. This is an evidence and evaluation layer—not a protein design system.

+
+
+
55 / 56Targets with a hit, pooled
26,026Specific on-design hits
584,450High-signal designs
430Binder–antigen pairs tested by BLI
+

Evidence loop

01 · Model run02 · Design intent03 · Construct ID04 · Assay batch05 · Readout + QC06 · Human decision

Critical distinction: the public top-100 hit-rate lift is retrospective. It is not prospective holdout performance.

+

Evidence maturity ladder

Level 1 · Computational design / ranking
Level 2 · In-vitro binding
Level 3 · In-vivo distribution / PK
Level 4 · Functional / therapeutic evidence

A binding result does not establish biodistribution or therapeutic function.

Product hypotheses

  • Every readout links to its exact model and design version.
  • Failed, ambiguous and missing records remain visible.
  • Holdout boundaries are enforced before scoring.
  • Metrics connect to a named scientific decision owner.
+
+

mBER-2 reported hit rates

Shared 0–20% scale. Top-100 values are retrospective.

Retrospective candidate selection cannot be presented as prospective model generalisation. Freeze the score and test on an untouched campaign.

Source: mBER-2 technical report.

+

Import de-identified outcomes CSV

Required: design_id, target_id, epitope_id, binder_format, model_version, campaign_id, assay_batch, predicted_score, observed_hit, qc_status, evaluation_split, evidence_ref

No dataset loaded.

Validation

Upload a CSV to check IDs, lineage and split overlap.
+

Prospective holdout diagnostic

—Baseline hit rate
—Top-k hit rate
—Descriptive enrichment
—Eligible rows

No holdout data loaded.

+
+

Minimum provenance chain

Model runDesign recordConstruct IDAssay batchReadoutDecision

Validation gates

Identity uniqueness and canonical IDs
Frozen model/scorer/pipeline versions
Explicit PASS / FAIL / REVIEW / missing states
Target, epitope, campaign and batch split checks

Decision gates

Claim-to-evidence matching
Scientific owner sign-off
Partner data rights, IP and retention boundary
Append-only audit trail and corrections
+

Pre-register an evaluation

Draft charter appears here.
+
Independent concept based on public Manifold Bio materials. Public aggregate figures are source-attributed; demo records are synthetic. No sequences, proprietary records, biological prediction, wet-lab protocol or experiment recommendation.
+
+ \ No newline at end of file From abd967d7af6a750805ae0d4febe15fb04f43a5fb Mon Sep 17 00:00:00 2001 From: Prakash Chand Jain Date: Fri, 20 Nov 2026 15:41:37 +0530 Subject: [PATCH 06/11] Add reproducible LoopBench CLI for validation and holdout evaluation --- projects/loopbench-manifold/loopbench.py | 230 +++++++++++++++++++++++ 1 file changed, 230 insertions(+) create mode 100644 projects/loopbench-manifold/loopbench.py diff --git a/projects/loopbench-manifold/loopbench.py b/projects/loopbench-manifold/loopbench.py new file mode 100644 index 0000000..f4a8e86 --- /dev/null +++ b/projects/loopbench-manifold/loopbench.py @@ -0,0 +1,230 @@ +#!/usr/bin/env python3 +"""LoopBench: validate provenance metadata and evaluate a frozen scorer on holdout rows. + +This tool handles de-identified metadata/outcome tables only. It does not design +proteins, interpret biology, generate protocols, or recommend experiments. +""" +from __future__ import annotations + +import argparse +import csv +import json +import random +import statistics +import sys +from collections import defaultdict +from pathlib import Path + +REQUIRED = ( + "design_id", "target_id", "epitope_id", "binder_format", "model_version", + "campaign_id", "assay_batch", "predicted_score", "observed_hit", + "qc_status", "evaluation_split", "evidence_ref", +) +QC_STATES = {"PASS", "FAIL", "REVIEW"} +SPLITS = {"development", "prospective_holdout", "retrospective"} + + +def load_csv(path: str) -> list[dict[str, str]]: + with open(path, newline="", encoding="utf-8-sig") as handle: + reader = csv.DictReader(handle) + missing = [field for field in REQUIRED if field not in (reader.fieldnames or [])] + if missing: + raise ValueError("Missing required columns: " + ", ".join(missing)) + return list(reader) + + +def validate(rows: list[dict[str, str]]) -> tuple[list[str], list[str]]: + errors: list[str] = [] + warnings: list[str] = [] + seen: set[str] = set() + + for line_no, row in enumerate(rows, start=2): + design_id = (row.get("design_id") or "").strip() + if not design_id: + errors.append(f"Row {line_no}: design_id is blank") + elif design_id in seen: + errors.append(f"Row {line_no}: duplicate design_id {design_id}") + seen.add(design_id) + + for field in ("target_id", "epitope_id", "model_version", "campaign_id", + "assay_batch", "evidence_ref"): + if not (row.get(field) or "").strip(): + errors.append(f"Row {line_no}: {field} is blank") + + try: + score = float(row["predicted_score"]) + if not 0.0 <= score <= 1.0: + errors.append(f"Row {line_no}: predicted_score must be between 0 and 1") + except (ValueError, TypeError, KeyError): + errors.append(f"Row {line_no}: predicted_score is not numeric") + + if str(row.get("observed_hit")) not in {"0", "1"}: + errors.append(f"Row {line_no}: observed_hit must be 0 or 1") + if row.get("qc_status") not in QC_STATES: + errors.append(f"Row {line_no}: qc_status must be PASS, FAIL or REVIEW") + if row.get("evaluation_split") not in SPLITS: + errors.append( + f"Row {line_no}: evaluation_split must be development, " + "prospective_holdout or retrospective" + ) + + development = [r for r in rows if r.get("evaluation_split") == "development"] + holdout = [r for r in rows if r.get("evaluation_split") == "prospective_holdout"] + if not holdout: + warnings.append("No prospective_holdout rows: prospective evaluation is blocked.") + if development and holdout: + for field, label in ( + ("target_id", "target"), ("epitope_id", "epitope"), + ("campaign_id", "campaign"), ("assay_batch", "assay batch"), + ): + overlap = {r.get(field) for r in development} & {r.get(field) for r in holdout} + if overlap: + warnings.append( + f"{label} overlap between development and holdout: " + f"{len(overlap)} shared value(s). Check the declared split strategy." + ) + if len(rows) < 30: + warnings.append("Fewer than 30 records: treat output as a small descriptive sample.") + return errors, warnings + + +def mean(values: list[int]) -> float | None: + return statistics.mean(values) if values else None + + +def cluster_bootstrap_topk( + by_target: dict[str, list[dict[str, str]]], + top_k: int, + iterations: int = 2000, + seed: int = 17, +) -> list[float] | None: + """Bootstrap targets as clusters, preserving the target as the sampling unit.""" + target_ids = list(by_target) + if len(target_ids) < 3: + return None + rng = random.Random(seed) + estimates: list[float] = [] + for _ in range(iterations): + sampled_targets = [rng.choice(target_ids) for _ in target_ids] + hits: list[int] = [] + for target in sampled_targets: + ranked = sorted( + by_target[target], + key=lambda item: float(item["predicted_score"]), + reverse=True, + )[:top_k] + hits.extend(int(item["observed_hit"]) for item in ranked) + if hits: + estimates.append(sum(hits) / len(hits)) + estimates.sort() + return [ + estimates[int(0.025 * len(estimates))], + estimates[min(len(estimates) - 1, int(0.975 * len(estimates)))], + ] + + +def evaluate(rows: list[dict[str, str]], top_k: int = 5) -> dict: + errors, warnings = validate(rows) + if errors: + return {"status": "BLOCKED", "reason": "Fix validation errors before evaluation.", "errors": errors} + if top_k < 1: + return {"status": "ERROR", "reason": "top_k must be >= 1"} + + eligible = [ + row for row in rows + if row.get("evaluation_split") == "prospective_holdout" + and row.get("qc_status") == "PASS" + ] + if not eligible: + return { + "status": "BLOCKED", + "reason": "No QC-PASS prospective_holdout records. Retrospective rows cannot substitute.", + "warnings": warnings, + } + + by_target: dict[str, list[dict[str, str]]] = defaultdict(list) + for row in eligible: + by_target[row["target_id"]].append(row) + + selected: list[dict[str, str]] = [] + per_target = [] + for target_id, group in sorted(by_target.items()): + ranked = sorted(group, key=lambda item: float(item["predicted_score"]), reverse=True) + top_rows = ranked[:top_k] + selected.extend(top_rows) + per_target.append({ + "target_id": target_id, + "eligible_qc_pass_rows": len(group), + "selected_rows": len(top_rows), + "baseline_hit_rate": mean([int(r["observed_hit"]) for r in group]), + "top_k_hit_rate": mean([int(r["observed_hit"]) for r in top_rows]), + }) + + baseline_rate = mean([int(r["observed_hit"]) for r in eligible]) + top_k_rate = mean([int(r["observed_hit"]) for r in selected]) + ci = cluster_bootstrap_topk(by_target, top_k) + + return { + "status": "DESCRIPTIVE_HOLDOUT_ONLY", + "disclaimer": ( + "Computed only from QC-PASS records explicitly labelled prospective_holdout. " + "This is a descriptive metric, not evidence of causal improvement, biological " + "efficacy or external validity. Confirm split design and outcome semantics." + ), + "dataset_rows": len(rows), + "prospective_holdout_qc_pass_rows": len(eligible), + "holdout_target_count": len(by_target), + "top_k_per_target": top_k, + "selected_rows": len(selected), + "baseline_holdout_hit_rate": baseline_rate, + "top_k_holdout_hit_rate": top_k_rate, + "descriptive_enrichment_lift": ( + top_k_rate / baseline_rate if baseline_rate not in (None, 0) else None + ), + "top_k_hit_rate_target_cluster_bootstrap_95ci": ci, + "uncertainty_note": ( + "Cluster bootstrap resamples targets as units; fewer than three holdout " + "targets returns no interval. This simple interval is a diagnostic, not a " + "replacement for a statistician-approved analysis plan." + ), + "validation_warnings": warnings, + "per_target": per_target, + } + + +def main() -> int: + parser = argparse.ArgumentParser(description="LoopBench metadata validator/evaluator") + subparsers = parser.add_subparsers(dest="command", required=True) + validate_parser = subparsers.add_parser("validate", help="Validate schema, IDs, QC and split overlap") + validate_parser.add_argument("csv") + eval_parser = subparsers.add_parser("evaluate", help="Evaluate only prospective holdout rows") + eval_parser.add_argument("csv") + eval_parser.add_argument("--top-k", type=int, default=5) + eval_parser.add_argument("--out", help="Optional JSON report destination") + args = parser.parse_args() + + try: + rows = load_csv(args.csv) + except (OSError, ValueError) as exc: + print(json.dumps({"status": "ERROR", "error": str(exc)}, indent=2)) + return 2 + + errors, warnings = validate(rows) + if args.command == "validate": + result = { + "status": "VALID" if not errors else "INVALID", + "record_count": len(rows), + "errors": errors, + "warnings": warnings, + } + else: + result = evaluate(rows, args.top_k) + if args.out: + Path(args.out).write_text(json.dumps(result, indent=2), encoding="utf-8") + + print(json.dumps(result, indent=2)) + return 1 if errors else 0 + + +if __name__ == "__main__": + raise SystemExit(main()) From 0c19650fc2b18748929a59a086b4e7838bd8ba70 Mon Sep 17 00:00:00 2001 From: Prakash Chand Jain Date: Fri, 20 Nov 2026 15:41:40 +0530 Subject: [PATCH 07/11] Add LoopBench unit tests for leakage and holdout guardrails --- .../tests/test_loopbench.py | 76 +++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 projects/loopbench-manifold/tests/test_loopbench.py diff --git a/projects/loopbench-manifold/tests/test_loopbench.py b/projects/loopbench-manifold/tests/test_loopbench.py new file mode 100644 index 0000000..7e144be --- /dev/null +++ b/projects/loopbench-manifold/tests/test_loopbench.py @@ -0,0 +1,76 @@ +import sys +import unittest +from pathlib import Path + +sys.path.insert(0, str(Path(__file__).resolve().parents[1])) +from loopbench import evaluate, validate + + +def record(design, target, split="prospective_holdout", score="0.9", + hit="1", campaign="H", batch="HB", qc="PASS"): + return { + "design_id": design, + "target_id": target, + "epitope_id": target + "-E1", + "binder_format": "VHH", + "model_version": "SYN-MODEL", + "campaign_id": campaign, + "assay_batch": batch, + "predicted_score": score, + "observed_hit": hit, + "qc_status": qc, + "evaluation_split": split, + "evidence_ref": "synthetic://" + design, + } + + +class LoopBenchTests(unittest.TestCase): + def test_duplicate_design_id_is_error(self): + errors, _ = validate([record("D1", "T1"), record("D1", "T2")]) + self.assertTrue(any("duplicate design_id" in item for item in errors)) + + def test_target_overlap_is_warning(self): + _, warnings = validate([ + record("D1", "T1", "development", "0.3", "0", "DEV", "DB"), + record("D2", "T1", "prospective_holdout", "0.8", "1", "HOLD", "HB"), + ]) + self.assertTrue(any("target overlap" in item for item in warnings)) + + def test_no_holdout_blocks_evaluation(self): + result = evaluate([record("D1", "T1", "development")]) + self.assertEqual(result["status"], "BLOCKED") + + def test_failed_qc_is_not_used(self): + rows = [ + record("D1", "T1", "prospective_holdout", "0.9", "1", qc="FAIL"), + record("D2", "T1", "prospective_holdout", "0.8", "0"), + record("D3", "T2", "prospective_holdout", "0.9", "0", "C2", "B2"), + ] + result = evaluate(rows, top_k=1) + self.assertEqual(result["prospective_holdout_qc_pass_rows"], 2) + self.assertEqual(result["selected_rows"], 2) + + def test_top_k_is_stratified_per_target(self): + rows = [ + record("D1", "T1", "prospective_holdout", "0.9", "1"), + record("D2", "T1", "prospective_holdout", "0.8", "1"), + record("D3", "T1", "prospective_holdout", "0.1", "0"), + record("D4", "T2", "prospective_holdout", "0.9", "0", "C2", "B2"), + record("D5", "T2", "prospective_holdout", "0.8", "0", "C2", "B2"), + record("D6", "T2", "prospective_holdout", "0.1", "1", "C2", "B2"), + ] + result = evaluate(rows, top_k=1) + self.assertEqual(result["selected_rows"], 2) + self.assertAlmostEqual(result["top_k_holdout_hit_rate"], 0.5) + + def test_cluster_interval_requires_three_targets(self): + rows = [ + record("D1", "T1", "prospective_holdout", "0.9", "1"), + record("D2", "T2", "prospective_holdout", "0.9", "0", "C2", "B2"), + ] + result = evaluate(rows, top_k=1) + self.assertIsNone(result["top_k_hit_rate_target_cluster_bootstrap_95ci"]) + + +if __name__ == "__main__": + unittest.main() From b3c36771fbe0d489e6012f0165f2ac008bd38c44 Mon Sep 17 00:00:00 2001 From: Prakash Chand Jain Date: Fri, 20 Nov 2026 15:41:44 +0530 Subject: [PATCH 08/11] Add clearly labelled synthetic LoopBench evaluation fixture --- .../data/synthetic_candidate_outcomes.csv | 97 +++++++++++++++++++ 1 file changed, 97 insertions(+) create mode 100644 projects/loopbench-manifold/data/synthetic_candidate_outcomes.csv diff --git a/projects/loopbench-manifold/data/synthetic_candidate_outcomes.csv b/projects/loopbench-manifold/data/synthetic_candidate_outcomes.csv new file mode 100644 index 0000000..5e98075 --- /dev/null +++ b/projects/loopbench-manifold/data/synthetic_candidate_outcomes.csv @@ -0,0 +1,97 @@ +design_id,target_id,epitope_id,binder_format,model_version,campaign_id,assay_batch,predicted_score,observed_hit,qc_status,evaluation_split,evidence_ref +SYN-D0001,SYN-T01,SYN-T01-E01,Minibinder,SYN-MODEL-0.3,SYN-DEV-CAMPAIGN,SYN-DEV-BATCH,0.4012,0,PASS,development,synthetic://SYN-DEV-CAMPAIGN/1 +SYN-D0002,SYN-T01,SYN-T01-E02,Microbinder,SYN-MODEL-0.3,SYN-DEV-CAMPAIGN,SYN-DEV-BATCH,0.2477,0,PASS,development,synthetic://SYN-DEV-CAMPAIGN/2 +SYN-D0003,SYN-T01,SYN-T01-E03,VHH,SYN-MODEL-0.3,SYN-DEV-CAMPAIGN,SYN-DEV-BATCH,0.7357,0,PASS,development,synthetic://SYN-DEV-CAMPAIGN/3 +SYN-D0004,SYN-T01,SYN-T01-E04,Minibinder,SYN-MODEL-0.3,SYN-DEV-CAMPAIGN,SYN-DEV-BATCH,0.5901,1,PASS,development,synthetic://SYN-DEV-CAMPAIGN/4 +SYN-D0005,SYN-T01,SYN-T01-E01,Microbinder,SYN-MODEL-0.3,SYN-DEV-CAMPAIGN,SYN-DEV-BATCH,0.6252,0,PASS,development,synthetic://SYN-DEV-CAMPAIGN/5 +SYN-D0006,SYN-T01,SYN-T01-E02,VHH,SYN-MODEL-0.3,SYN-DEV-CAMPAIGN,SYN-DEV-BATCH,0.6395,0,PASS,development,synthetic://SYN-DEV-CAMPAIGN/6 +SYN-D0007,SYN-T01,SYN-T01-E03,Minibinder,SYN-MODEL-0.3,SYN-DEV-CAMPAIGN,SYN-DEV-BATCH,0.4818,1,PASS,development,synthetic://SYN-DEV-CAMPAIGN/7 +SYN-D0008,SYN-T01,SYN-T01-E04,Microbinder,SYN-MODEL-0.3,SYN-DEV-CAMPAIGN,SYN-DEV-BATCH,0.8441,0,PASS,development,synthetic://SYN-DEV-CAMPAIGN/8 +SYN-D0009,SYN-T01,SYN-T01-E01,VHH,SYN-MODEL-0.3,SYN-DEV-CAMPAIGN,SYN-DEV-BATCH,0.8365,0,PASS,development,synthetic://SYN-DEV-CAMPAIGN/9 +SYN-D0010,SYN-T01,SYN-T01-E02,Minibinder,SYN-MODEL-0.3,SYN-DEV-CAMPAIGN,SYN-DEV-BATCH,0.1841,0,PASS,development,synthetic://SYN-DEV-CAMPAIGN/10 +SYN-D0011,SYN-T01,SYN-T01-E03,Microbinder,SYN-MODEL-0.3,SYN-DEV-CAMPAIGN,SYN-DEV-BATCH,0.9760,1,PASS,development,synthetic://SYN-DEV-CAMPAIGN/11 +SYN-D0012,SYN-T01,SYN-T01-E04,VHH,SYN-MODEL-0.3,SYN-DEV-CAMPAIGN,SYN-DEV-BATCH,0.6915,0,PASS,development,synthetic://SYN-DEV-CAMPAIGN/12 +SYN-D0013,SYN-T02,SYN-T02-E01,Microbinder,SYN-MODEL-0.3,SYN-DEV-CAMPAIGN,SYN-DEV-BATCH,0.4996,0,PASS,development,synthetic://SYN-DEV-CAMPAIGN/13 +SYN-D0014,SYN-T02,SYN-T02-E02,VHH,SYN-MODEL-0.3,SYN-DEV-CAMPAIGN,SYN-DEV-BATCH,0.3098,0,PASS,development,synthetic://SYN-DEV-CAMPAIGN/14 +SYN-D0015,SYN-T02,SYN-T02-E03,Minibinder,SYN-MODEL-0.3,SYN-DEV-CAMPAIGN,SYN-DEV-BATCH,0.4872,1,PASS,development,synthetic://SYN-DEV-CAMPAIGN/15 +SYN-D0016,SYN-T02,SYN-T02-E04,Microbinder,SYN-MODEL-0.3,SYN-DEV-CAMPAIGN,SYN-DEV-BATCH,0.6545,0,PASS,development,synthetic://SYN-DEV-CAMPAIGN/16 +SYN-D0017,SYN-T02,SYN-T02-E01,VHH,SYN-MODEL-0.3,SYN-DEV-CAMPAIGN,SYN-DEV-BATCH,0.8078,1,PASS,development,synthetic://SYN-DEV-CAMPAIGN/17 +SYN-D0018,SYN-T02,SYN-T02-E02,Minibinder,SYN-MODEL-0.3,SYN-DEV-CAMPAIGN,SYN-DEV-BATCH,0.7950,1,PASS,development,synthetic://SYN-DEV-CAMPAIGN/18 +SYN-D0019,SYN-T02,SYN-T02-E03,Microbinder,SYN-MODEL-0.3,SYN-DEV-CAMPAIGN,SYN-DEV-BATCH,0.6185,0,PASS,development,synthetic://SYN-DEV-CAMPAIGN/19 +SYN-D0020,SYN-T02,SYN-T02-E04,VHH,SYN-MODEL-0.3,SYN-DEV-CAMPAIGN,SYN-DEV-BATCH,0.7458,0,PASS,development,synthetic://SYN-DEV-CAMPAIGN/20 +SYN-D0021,SYN-T02,SYN-T02-E01,Minibinder,SYN-MODEL-0.3,SYN-DEV-CAMPAIGN,SYN-DEV-BATCH,0.4642,0,PASS,development,synthetic://SYN-DEV-CAMPAIGN/21 +SYN-D0022,SYN-T02,SYN-T02-E02,Microbinder,SYN-MODEL-0.3,SYN-DEV-CAMPAIGN,SYN-DEV-BATCH,0.4194,0,PASS,development,synthetic://SYN-DEV-CAMPAIGN/22 +SYN-D0023,SYN-T02,SYN-T02-E03,VHH,SYN-MODEL-0.3,SYN-DEV-CAMPAIGN,SYN-DEV-BATCH,0.4780,0,PASS,development,synthetic://SYN-DEV-CAMPAIGN/23 +SYN-D0024,SYN-T02,SYN-T02-E04,Minibinder,SYN-MODEL-0.3,SYN-DEV-CAMPAIGN,SYN-DEV-BATCH,0.4493,1,PASS,development,synthetic://SYN-DEV-CAMPAIGN/24 +SYN-D0025,SYN-T03,SYN-T03-E01,VHH,SYN-MODEL-0.3,SYN-DEV-CAMPAIGN,SYN-DEV-BATCH,0.8219,0,PASS,development,synthetic://SYN-DEV-CAMPAIGN/25 +SYN-D0026,SYN-T03,SYN-T03-E02,Minibinder,SYN-MODEL-0.3,SYN-DEV-CAMPAIGN,SYN-DEV-BATCH,0.8140,0,PASS,development,synthetic://SYN-DEV-CAMPAIGN/26 +SYN-D0027,SYN-T03,SYN-T03-E03,Microbinder,SYN-MODEL-0.3,SYN-DEV-CAMPAIGN,SYN-DEV-BATCH,0.5090,0,PASS,development,synthetic://SYN-DEV-CAMPAIGN/27 +SYN-D0028,SYN-T03,SYN-T03-E04,VHH,SYN-MODEL-0.3,SYN-DEV-CAMPAIGN,SYN-DEV-BATCH,0.3109,0,PASS,development,synthetic://SYN-DEV-CAMPAIGN/28 +SYN-D0029,SYN-T03,SYN-T03-E01,Minibinder,SYN-MODEL-0.3,SYN-DEV-CAMPAIGN,SYN-DEV-BATCH,0.7048,1,PASS,development,synthetic://SYN-DEV-CAMPAIGN/29 +SYN-D0030,SYN-T03,SYN-T03-E02,Microbinder,SYN-MODEL-0.3,SYN-DEV-CAMPAIGN,SYN-DEV-BATCH,0.6320,1,PASS,development,synthetic://SYN-DEV-CAMPAIGN/30 +SYN-D0031,SYN-T03,SYN-T03-E03,VHH,SYN-MODEL-0.3,SYN-DEV-CAMPAIGN,SYN-DEV-BATCH,0.5711,1,PASS,development,synthetic://SYN-DEV-CAMPAIGN/31 +SYN-D0032,SYN-T03,SYN-T03-E04,Minibinder,SYN-MODEL-0.3,SYN-DEV-CAMPAIGN,SYN-DEV-BATCH,0.3090,1,PASS,development,synthetic://SYN-DEV-CAMPAIGN/32 +SYN-D0033,SYN-T03,SYN-T03-E01,Microbinder,SYN-MODEL-0.3,SYN-DEV-CAMPAIGN,SYN-DEV-BATCH,0.2483,0,PASS,development,synthetic://SYN-DEV-CAMPAIGN/33 +SYN-D0034,SYN-T03,SYN-T03-E02,VHH,SYN-MODEL-0.3,SYN-DEV-CAMPAIGN,SYN-DEV-BATCH,0.3597,0,PASS,development,synthetic://SYN-DEV-CAMPAIGN/34 +SYN-D0035,SYN-T03,SYN-T03-E03,Minibinder,SYN-MODEL-0.3,SYN-DEV-CAMPAIGN,SYN-DEV-BATCH,0.2006,1,PASS,development,synthetic://SYN-DEV-CAMPAIGN/35 +SYN-D0036,SYN-T03,SYN-T03-E04,Microbinder,SYN-MODEL-0.3,SYN-DEV-CAMPAIGN,SYN-DEV-BATCH,0.1450,0,PASS,development,synthetic://SYN-DEV-CAMPAIGN/36 +SYN-D0037,SYN-T04,SYN-T04-E01,Minibinder,SYN-MODEL-0.3,SYN-DEV-CAMPAIGN,SYN-DEV-BATCH,0.5797,0,PASS,development,synthetic://SYN-DEV-CAMPAIGN/37 +SYN-D0038,SYN-T04,SYN-T04-E02,Microbinder,SYN-MODEL-0.3,SYN-DEV-CAMPAIGN,SYN-DEV-BATCH,0.6965,0,PASS,development,synthetic://SYN-DEV-CAMPAIGN/38 +SYN-D0039,SYN-T04,SYN-T04-E03,VHH,SYN-MODEL-0.3,SYN-DEV-CAMPAIGN,SYN-DEV-BATCH,0.5611,0,PASS,development,synthetic://SYN-DEV-CAMPAIGN/39 +SYN-D0040,SYN-T04,SYN-T04-E04,Minibinder,SYN-MODEL-0.3,SYN-DEV-CAMPAIGN,SYN-DEV-BATCH,0.5342,1,PASS,development,synthetic://SYN-DEV-CAMPAIGN/40 +SYN-D0041,SYN-T04,SYN-T04-E01,Microbinder,SYN-MODEL-0.3,SYN-DEV-CAMPAIGN,SYN-DEV-BATCH,0.2292,0,PASS,development,synthetic://SYN-DEV-CAMPAIGN/41 +SYN-D0042,SYN-T04,SYN-T04-E02,VHH,SYN-MODEL-0.3,SYN-DEV-CAMPAIGN,SYN-DEV-BATCH,0.5860,0,PASS,development,synthetic://SYN-DEV-CAMPAIGN/42 +SYN-D0043,SYN-T04,SYN-T04-E03,Minibinder,SYN-MODEL-0.3,SYN-DEV-CAMPAIGN,SYN-DEV-BATCH,0.2043,1,PASS,development,synthetic://SYN-DEV-CAMPAIGN/43 +SYN-D0044,SYN-T04,SYN-T04-E04,Microbinder,SYN-MODEL-0.3,SYN-DEV-CAMPAIGN,SYN-DEV-BATCH,0.2664,0,PASS,development,synthetic://SYN-DEV-CAMPAIGN/44 +SYN-D0045,SYN-T04,SYN-T04-E01,VHH,SYN-MODEL-0.3,SYN-DEV-CAMPAIGN,SYN-DEV-BATCH,0.2699,0,PASS,development,synthetic://SYN-DEV-CAMPAIGN/45 +SYN-D0046,SYN-T04,SYN-T04-E02,Minibinder,SYN-MODEL-0.3,SYN-DEV-CAMPAIGN,SYN-DEV-BATCH,0.4267,0,PASS,development,synthetic://SYN-DEV-CAMPAIGN/46 +SYN-D0047,SYN-T04,SYN-T04-E03,Microbinder,SYN-MODEL-0.3,SYN-DEV-CAMPAIGN,SYN-DEV-BATCH,0.2303,0,PASS,development,synthetic://SYN-DEV-CAMPAIGN/47 +SYN-D0048,SYN-T04,SYN-T04-E04,VHH,SYN-MODEL-0.3,SYN-DEV-CAMPAIGN,SYN-DEV-BATCH,0.3860,0,PASS,development,synthetic://SYN-DEV-CAMPAIGN/48 +SYN-D0049,SYN-T05,SYN-T05-E01,Microbinder,SYN-MODEL-0.3,SYN-HOLDOUT-CAMPAIGN,SYN-HOLDOUT-BATCH,0.7692,1,PASS,prospective_holdout,synthetic://SYN-HOLDOUT-CAMPAIGN/49 +SYN-D0050,SYN-T05,SYN-T05-E02,VHH,SYN-MODEL-0.3,SYN-HOLDOUT-CAMPAIGN,SYN-HOLDOUT-BATCH,0.7821,1,PASS,prospective_holdout,synthetic://SYN-HOLDOUT-CAMPAIGN/50 +SYN-D0051,SYN-T05,SYN-T05-E03,Minibinder,SYN-MODEL-0.3,SYN-HOLDOUT-CAMPAIGN,SYN-HOLDOUT-BATCH,0.7087,0,PASS,prospective_holdout,synthetic://SYN-HOLDOUT-CAMPAIGN/51 +SYN-D0052,SYN-T05,SYN-T05-E04,Microbinder,SYN-MODEL-0.3,SYN-HOLDOUT-CAMPAIGN,SYN-HOLDOUT-BATCH,0.2935,0,PASS,prospective_holdout,synthetic://SYN-HOLDOUT-CAMPAIGN/52 +SYN-D0053,SYN-T05,SYN-T05-E01,VHH,SYN-MODEL-0.3,SYN-HOLDOUT-CAMPAIGN,SYN-HOLDOUT-BATCH,0.4189,1,PASS,prospective_holdout,synthetic://SYN-HOLDOUT-CAMPAIGN/53 +SYN-D0054,SYN-T05,SYN-T05-E02,Minibinder,SYN-MODEL-0.3,SYN-HOLDOUT-CAMPAIGN,SYN-HOLDOUT-BATCH,0.7018,1,PASS,prospective_holdout,synthetic://SYN-HOLDOUT-CAMPAIGN/54 +SYN-D0055,SYN-T05,SYN-T05-E03,Microbinder,SYN-MODEL-0.3,SYN-HOLDOUT-CAMPAIGN,SYN-HOLDOUT-BATCH,0.3287,1,PASS,prospective_holdout,synthetic://SYN-HOLDOUT-CAMPAIGN/55 +SYN-D0056,SYN-T05,SYN-T05-E04,VHH,SYN-MODEL-0.3,SYN-HOLDOUT-CAMPAIGN,SYN-HOLDOUT-BATCH,0.3153,0,PASS,prospective_holdout,synthetic://SYN-HOLDOUT-CAMPAIGN/56 +SYN-D0057,SYN-T05,SYN-T05-E01,Minibinder,SYN-MODEL-0.3,SYN-HOLDOUT-CAMPAIGN,SYN-HOLDOUT-BATCH,0.7360,1,PASS,prospective_holdout,synthetic://SYN-HOLDOUT-CAMPAIGN/57 +SYN-D0058,SYN-T05,SYN-T05-E02,Microbinder,SYN-MODEL-0.3,SYN-HOLDOUT-CAMPAIGN,SYN-HOLDOUT-BATCH,0.3221,0,PASS,prospective_holdout,synthetic://SYN-HOLDOUT-CAMPAIGN/58 +SYN-D0059,SYN-T05,SYN-T05-E03,VHH,SYN-MODEL-0.3,SYN-HOLDOUT-CAMPAIGN,SYN-HOLDOUT-BATCH,0.6001,1,FAIL,prospective_holdout,synthetic://SYN-HOLDOUT-CAMPAIGN/59 +SYN-D0060,SYN-T05,SYN-T05-E04,Minibinder,SYN-MODEL-0.3,SYN-HOLDOUT-CAMPAIGN,SYN-HOLDOUT-BATCH,0.3782,0,PASS,prospective_holdout,synthetic://SYN-HOLDOUT-CAMPAIGN/60 +SYN-D0061,SYN-T06,SYN-T06-E01,VHH,SYN-MODEL-0.3,SYN-HOLDOUT-CAMPAIGN,SYN-HOLDOUT-BATCH,0.5626,0,PASS,prospective_holdout,synthetic://SYN-HOLDOUT-CAMPAIGN/61 +SYN-D0062,SYN-T06,SYN-T06-E02,Minibinder,SYN-MODEL-0.3,SYN-HOLDOUT-CAMPAIGN,SYN-HOLDOUT-BATCH,0.5456,0,PASS,prospective_holdout,synthetic://SYN-HOLDOUT-CAMPAIGN/62 +SYN-D0063,SYN-T06,SYN-T06-E03,Microbinder,SYN-MODEL-0.3,SYN-HOLDOUT-CAMPAIGN,SYN-HOLDOUT-BATCH,0.2596,0,REVIEW,prospective_holdout,synthetic://SYN-HOLDOUT-CAMPAIGN/63 +SYN-D0064,SYN-T06,SYN-T06-E04,VHH,SYN-MODEL-0.3,SYN-HOLDOUT-CAMPAIGN,SYN-HOLDOUT-BATCH,0.4619,1,PASS,prospective_holdout,synthetic://SYN-HOLDOUT-CAMPAIGN/64 +SYN-D0065,SYN-T06,SYN-T06-E01,Minibinder,SYN-MODEL-0.3,SYN-HOLDOUT-CAMPAIGN,SYN-HOLDOUT-BATCH,0.9016,1,PASS,prospective_holdout,synthetic://SYN-HOLDOUT-CAMPAIGN/65 +SYN-D0066,SYN-T06,SYN-T06-E02,Microbinder,SYN-MODEL-0.3,SYN-HOLDOUT-CAMPAIGN,SYN-HOLDOUT-BATCH,0.1704,0,PASS,prospective_holdout,synthetic://SYN-HOLDOUT-CAMPAIGN/66 +SYN-D0067,SYN-T06,SYN-T06-E03,VHH,SYN-MODEL-0.3,SYN-HOLDOUT-CAMPAIGN,SYN-HOLDOUT-BATCH,0.4680,1,PASS,prospective_holdout,synthetic://SYN-HOLDOUT-CAMPAIGN/67 +SYN-D0068,SYN-T06,SYN-T06-E04,Minibinder,SYN-MODEL-0.3,SYN-HOLDOUT-CAMPAIGN,SYN-HOLDOUT-BATCH,0.6977,1,PASS,prospective_holdout,synthetic://SYN-HOLDOUT-CAMPAIGN/68 +SYN-D0069,SYN-T06,SYN-T06-E01,Microbinder,SYN-MODEL-0.3,SYN-HOLDOUT-CAMPAIGN,SYN-HOLDOUT-BATCH,0.2531,0,REVIEW,prospective_holdout,synthetic://SYN-HOLDOUT-CAMPAIGN/69 +SYN-D0070,SYN-T06,SYN-T06-E02,VHH,SYN-MODEL-0.3,SYN-HOLDOUT-CAMPAIGN,SYN-HOLDOUT-BATCH,0.3566,0,PASS,prospective_holdout,synthetic://SYN-HOLDOUT-CAMPAIGN/70 +SYN-D0071,SYN-T06,SYN-T06-E03,Minibinder,SYN-MODEL-0.3,SYN-HOLDOUT-CAMPAIGN,SYN-HOLDOUT-BATCH,0.1034,0,PASS,prospective_holdout,synthetic://SYN-HOLDOUT-CAMPAIGN/71 +SYN-D0072,SYN-T06,SYN-T06-E04,Microbinder,SYN-MODEL-0.3,SYN-HOLDOUT-CAMPAIGN,SYN-HOLDOUT-BATCH,0.4646,0,PASS,prospective_holdout,synthetic://SYN-HOLDOUT-CAMPAIGN/72 +SYN-D0073,SYN-T07,SYN-T07-E01,Minibinder,SYN-MODEL-0.3,SYN-HOLDOUT-CAMPAIGN,SYN-HOLDOUT-BATCH,0.8538,0,PASS,prospective_holdout,synthetic://SYN-HOLDOUT-CAMPAIGN/73 +SYN-D0074,SYN-T07,SYN-T07-E02,Microbinder,SYN-MODEL-0.3,SYN-HOLDOUT-CAMPAIGN,SYN-HOLDOUT-BATCH,0.6046,1,PASS,prospective_holdout,synthetic://SYN-HOLDOUT-CAMPAIGN/74 +SYN-D0075,SYN-T07,SYN-T07-E03,VHH,SYN-MODEL-0.3,SYN-HOLDOUT-CAMPAIGN,SYN-HOLDOUT-BATCH,0.4045,1,PASS,prospective_holdout,synthetic://SYN-HOLDOUT-CAMPAIGN/75 +SYN-D0076,SYN-T07,SYN-T07-E04,Minibinder,SYN-MODEL-0.3,SYN-HOLDOUT-CAMPAIGN,SYN-HOLDOUT-BATCH,0.3649,0,PASS,prospective_holdout,synthetic://SYN-HOLDOUT-CAMPAIGN/76 +SYN-D0077,SYN-T07,SYN-T07-E01,Microbinder,SYN-MODEL-0.3,SYN-HOLDOUT-CAMPAIGN,SYN-HOLDOUT-BATCH,0.6853,0,REVIEW,prospective_holdout,synthetic://SYN-HOLDOUT-CAMPAIGN/77 +SYN-D0078,SYN-T07,SYN-T07-E02,VHH,SYN-MODEL-0.3,SYN-HOLDOUT-CAMPAIGN,SYN-HOLDOUT-BATCH,0.2726,0,PASS,prospective_holdout,synthetic://SYN-HOLDOUT-CAMPAIGN/78 +SYN-D0079,SYN-T07,SYN-T07-E03,Minibinder,SYN-MODEL-0.3,SYN-HOLDOUT-CAMPAIGN,SYN-HOLDOUT-BATCH,0.3810,0,PASS,prospective_holdout,synthetic://SYN-HOLDOUT-CAMPAIGN/79 +SYN-D0080,SYN-T07,SYN-T07-E04,Microbinder,SYN-MODEL-0.3,SYN-HOLDOUT-CAMPAIGN,SYN-HOLDOUT-BATCH,0.2111,0,PASS,prospective_holdout,synthetic://SYN-HOLDOUT-CAMPAIGN/80 +SYN-D0081,SYN-T07,SYN-T07-E01,VHH,SYN-MODEL-0.3,SYN-HOLDOUT-CAMPAIGN,SYN-HOLDOUT-BATCH,0.8047,1,PASS,prospective_holdout,synthetic://SYN-HOLDOUT-CAMPAIGN/81 +SYN-D0082,SYN-T07,SYN-T07-E02,Minibinder,SYN-MODEL-0.3,SYN-HOLDOUT-CAMPAIGN,SYN-HOLDOUT-BATCH,0.5933,0,PASS,prospective_holdout,synthetic://SYN-HOLDOUT-CAMPAIGN/82 +SYN-D0083,SYN-T07,SYN-T07-E03,Microbinder,SYN-MODEL-0.3,SYN-HOLDOUT-CAMPAIGN,SYN-HOLDOUT-BATCH,0.3638,0,REVIEW,prospective_holdout,synthetic://SYN-HOLDOUT-CAMPAIGN/83 +SYN-D0084,SYN-T07,SYN-T07-E04,VHH,SYN-MODEL-0.3,SYN-HOLDOUT-CAMPAIGN,SYN-HOLDOUT-BATCH,0.3397,1,PASS,prospective_holdout,synthetic://SYN-HOLDOUT-CAMPAIGN/84 +SYN-D0085,SYN-T08,SYN-T08-E01,Microbinder,SYN-MODEL-0.3,SYN-HOLDOUT-CAMPAIGN,SYN-HOLDOUT-BATCH,0.8330,1,PASS,prospective_holdout,synthetic://SYN-HOLDOUT-CAMPAIGN/85 +SYN-D0086,SYN-T08,SYN-T08-E02,VHH,SYN-MODEL-0.3,SYN-HOLDOUT-CAMPAIGN,SYN-HOLDOUT-BATCH,0.4239,0,PASS,prospective_holdout,synthetic://SYN-HOLDOUT-CAMPAIGN/86 +SYN-D0087,SYN-T08,SYN-T08-E03,Minibinder,SYN-MODEL-0.3,SYN-HOLDOUT-CAMPAIGN,SYN-HOLDOUT-BATCH,0.1650,0,PASS,prospective_holdout,synthetic://SYN-HOLDOUT-CAMPAIGN/87 +SYN-D0088,SYN-T08,SYN-T08-E04,Microbinder,SYN-MODEL-0.3,SYN-HOLDOUT-CAMPAIGN,SYN-HOLDOUT-BATCH,0.3600,0,PASS,prospective_holdout,synthetic://SYN-HOLDOUT-CAMPAIGN/88 +SYN-D0089,SYN-T08,SYN-T08-E01,VHH,SYN-MODEL-0.3,SYN-HOLDOUT-CAMPAIGN,SYN-HOLDOUT-BATCH,0.1564,1,PASS,prospective_holdout,synthetic://SYN-HOLDOUT-CAMPAIGN/89 +SYN-D0090,SYN-T08,SYN-T08-E02,Minibinder,SYN-MODEL-0.3,SYN-HOLDOUT-CAMPAIGN,SYN-HOLDOUT-BATCH,0.4917,0,PASS,prospective_holdout,synthetic://SYN-HOLDOUT-CAMPAIGN/90 +SYN-D0091,SYN-T08,SYN-T08-E03,Microbinder,SYN-MODEL-0.3,SYN-HOLDOUT-CAMPAIGN,SYN-HOLDOUT-BATCH,0.2956,0,PASS,prospective_holdout,synthetic://SYN-HOLDOUT-CAMPAIGN/91 +SYN-D0092,SYN-T08,SYN-T08-E04,VHH,SYN-MODEL-0.3,SYN-HOLDOUT-CAMPAIGN,SYN-HOLDOUT-BATCH,0.5692,0,PASS,prospective_holdout,synthetic://SYN-HOLDOUT-CAMPAIGN/92 +SYN-D0093,SYN-T08,SYN-T08-E01,Minibinder,SYN-MODEL-0.3,SYN-HOLDOUT-CAMPAIGN,SYN-HOLDOUT-BATCH,0.5997,1,FAIL,prospective_holdout,synthetic://SYN-HOLDOUT-CAMPAIGN/93 +SYN-D0094,SYN-T08,SYN-T08-E02,Microbinder,SYN-MODEL-0.3,SYN-HOLDOUT-CAMPAIGN,SYN-HOLDOUT-BATCH,0.6129,1,PASS,prospective_holdout,synthetic://SYN-HOLDOUT-CAMPAIGN/94 +SYN-D0095,SYN-T08,SYN-T08-E03,VHH,SYN-MODEL-0.3,SYN-HOLDOUT-CAMPAIGN,SYN-HOLDOUT-BATCH,0.5852,1,PASS,prospective_holdout,synthetic://SYN-HOLDOUT-CAMPAIGN/95 +SYN-D0096,SYN-T08,SYN-T08-E04,Minibinder,SYN-MODEL-0.3,SYN-HOLDOUT-CAMPAIGN,SYN-HOLDOUT-BATCH,0.4025,0,PASS,prospective_holdout,synthetic://SYN-HOLDOUT-CAMPAIGN/96 From c4a0ad942cd598bf4457de89a688c4e156a4ce43 Mon Sep 17 00:00:00 2001 From: Prakash Chand Jain Date: Fri, 20 Nov 2026 15:41:47 +0530 Subject: [PATCH 09/11] Record source-attributed public mBER-2 aggregate metrics --- .../data/public_mber2_aggregate.json | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 projects/loopbench-manifold/data/public_mber2_aggregate.json diff --git a/projects/loopbench-manifold/data/public_mber2_aggregate.json b/projects/loopbench-manifold/data/public_mber2_aggregate.json new file mode 100644 index 0000000..2b0b313 --- /dev/null +++ b/projects/loopbench-manifold/data/public_mber2_aggregate.json @@ -0,0 +1,18 @@ +{ + "source": "Manifold Bio mBER-2 technical report, 2026-09-22", + "source_url": "https://manifold-bio-public.s3.us-east-2.amazonaws.com/mBER-2_technical_report_v20260922.pdf", + "targets": 56, + "designs_ordered": 1298334, + "primary_on_panel_sequences": 1250720, + "high_signal_designs": 584450, + "specific_on_design_hits_all_formats": 26026, + "targets_with_any_hit_pooled": 55, + "targets_with_hits_on_at_least_two_predicted_epitope_clusters": 51, + "binder_antigen_pairs_tested_by_bli": 430, + "format_rates": [ + {"format":"VHH","overall_hit_rate_pct":8.6,"top100_retrospective_hit_rate_pct":16.8}, + {"format":"Minibinder","overall_hit_rate_pct":4.64,"top100_retrospective_hit_rate_pct":8.62}, + {"format":"Microbinder","overall_hit_rate_pct":0.93,"top100_retrospective_hit_rate_pct":3.55} + ], + "interpretation": "Top-100 rates are retrospective selections, not prospective holdout performance." +} \ No newline at end of file From 79c3970077b98a1892b0dcdedcc08aeeeddb08a0 Mon Sep 17 00:00:00 2001 From: Prakash Chand Jain Date: Fri, 20 Nov 2026 15:41:51 +0530 Subject: [PATCH 10/11] Run LoopBench validation and unit tests in CI --- .github/workflows/loopbench-tests.yml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 .github/workflows/loopbench-tests.yml diff --git a/.github/workflows/loopbench-tests.yml b/.github/workflows/loopbench-tests.yml new file mode 100644 index 0000000..d0ee804 --- /dev/null +++ b/.github/workflows/loopbench-tests.yml @@ -0,0 +1,25 @@ +name: LoopBench tests +on: + pull_request: + paths: + - "projects/loopbench-manifold/**" + - ".github/workflows/loopbench-tests.yml" + push: + branches: [main] + paths: + - "projects/loopbench-manifold/**" + - ".github/workflows/loopbench-tests.yml" +jobs: + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: "3.12" + - name: Validate synthetic fixture + run: python projects/loopbench-manifold/loopbench.py validate projects/loopbench-manifold/data/synthetic_candidate_outcomes.csv + - name: Run unit tests + run: python -m unittest discover -s projects/loopbench-manifold/tests -v + - name: Run holdout diagnostic + run: python projects/loopbench-manifold/loopbench.py evaluate projects/loopbench-manifold/data/synthetic_candidate_outcomes.csv --top-k 5 From b6b2cc7341bab2536d603617aa8ce70c893070c9 Mon Sep 17 00:00:00 2001 From: Prakash Chand Jain Date: Fri, 20 Nov 2026 15:42:38 +0530 Subject: [PATCH 11/11] Document LoopBench CLI usage, synthetic fixture, tests and CI --- projects/loopbench-manifold/README.md | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/projects/loopbench-manifold/README.md b/projects/loopbench-manifold/README.md index f15ac24..eb4b3c2 100644 --- a/projects/loopbench-manifold/README.md +++ b/projects/loopbench-manifold/README.md @@ -2,6 +2,7 @@ Independent AI-platform work sample inspired by Manifold Bio's public mBER-2 report. +## Open the prototype Open [the interactive prototype](./index.html). Read the [product memo](./PRODUCT_MEMO.md), [evaluation charter](./evaluation-charter.md), and [candidate outcome schema](./candidate-outcome.schema.json). ## Product thesis @@ -18,6 +19,25 @@ The September 22, 2026 mBER-2 technical report describes 56 targets, 1,298,334 d **The top-100 rates are retrospective selections, not prospective holdout performance.** The product opportunity is to make that distinction operational and enforceable. +## Included engineering components +- loopbench.py: standard-library CSV validator and prospective holdout diagnostic. +- data/synthetic_candidate_outcomes.csv: synthetic-only event-level fixture; every identifier is prefixed SYN-. +- data/public_mber2_aggregate.json: source-attributed public aggregate metrics. +- tests/test_loopbench.py: tests for duplicate IDs, split leakage, absent holdouts, QC filtering, target-stratified top-k and bootstrap boundary. +- .github/workflows/loopbench-tests.yml: CI validation and test workflow. +- candidate-outcome.schema.json: machine-readable record contract. + +### Run locally +Python 3.10+; no third-party packages required. + +```bash +python loopbench.py validate data/synthetic_candidate_outcomes.csv +python loopbench.py evaluate data/synthetic_candidate_outcomes.csv --top-k 5 --out report.json +python -m unittest discover -s tests -v +``` + +The CLI only computes holdout metrics from rows explicitly labelled prospective_holdout and with qc_status=PASS. It blocks if no eligible holdout rows exist. It warns about target, epitope, campaign or assay-batch overlap. The bootstrap resamples targets as clusters; for fewer than three holdout targets it reports no interval. This is a simple descriptive diagnostic, not a statistician-approved analysis plan or biological conclusion. + ## Guardrails - Keep development, retrospective and prospective results distinct. - Freeze model/scorer/configuration before unblinding an untouched holdout.