---
name: spectralbio-canonical-replay-and-portability-audit
description: Execute the frozen TP53 canonical replay, verify machine-checkable outputs, and inspect replay-ready portability surfaces across TP53, BRCA2, TSC2, and CREBBP, with BRCA1 and MSH2 preserved as negative guardrails. Reproduces the package's executable validation anchor and its final claim boundary: strengthened target-level portability with mixed model-level holdout/control closure.
allowed-tools: Bash(git *), Bash(python *), Bash(uv *), Bash(ls *), Bash(test *)
package_manager: uv
repo_url: https://github.com/DaviBonetto/SpectralBio
repo_root: .
python_version: ">=3.10"
---
TP53remains the default executable validation anchor.BRCA2is the flagship non-anchor canonical replay surface.TSC2andCREBBPare replay-ready transfer surfaces.BRCA1andMSH2remain explicit negative guardrails.- replay is CPU-only, frozen, fast, and machine-checkable.
- the final holdout/control closure boundary remains mixed.
- not a universal upgrade
- not full closure
- not plug-and-play for any gene
- not a cross-protein law
- not a claim that covariance always helps
- not a claim that all replay-ready surfaces are equal
- run from the repository root
- Python
>=3.10 uvis the public package manager and entrypoint surface- replay is designed for CPU-only and offline use once assets are present
| Goal | Command |
|---|---|
| Check environment before anything else | uv run spectralbio preflight --json --cpu-only --offline |
| Run the validation anchor only | uv run spectralbio replay --target tp53 --json --cpu-only --offline |
| Run the strongest non-anchor replay surface | uv run spectralbio replay --target brca2 --json --cpu-only --offline |
| Run all replay surfaces quickly | uv run spectralbio replay-audit --json --cpu-only --offline |
| Verify one replay target | uv run spectralbio verify --target <target> --json --cpu-only --offline |
| Validate the older legacy bounded contract | uv run spectralbio verify-legacy |
| Use the backward-compatible older legacy verify entrypoint | uv run spectralbio verify |
| Rebuild deterministic paper-grade outputs | uv run spectralbio reproduce-all --json --cpu-only --offline |
| Diagnose problems | uv run spectralbio doctor --json --cpu-only --offline |
Approximate local runtimes measured on the current frozen repository bundle:
| Command | Expected mode | Typical local runtime | Notes |
|---|---|---|---|
preflight |
CPU/offline | ~1.3 s | environment, asset, and schema checks |
doctor |
CPU/offline | ~1.3 s | structured diagnosis over the same health surface |
replay --target tp53 |
CPU/offline | ~1.5 s | validation anchor replay |
replay --target brca2 |
CPU/offline | ~1.3 s | flagship non-anchor replay |
replay-audit |
CPU/offline | ~1.9 s | all replay targets plus aggregate check |
reproduce-all |
CPU/offline | ~1.9 s | frozen deterministic paper-bundle materialization, not raw heavyweight recomputation |
These are bounded replay/regeneration timings over frozen artifacts, not live heavyweight retraining or model download timings.
uv sync --frozen
uv run spectralbio preflight --json --cpu-only --offline
uv run spectralbio replay-audit --json --cpu-only --offlineThis path validates the frozen public claim surface and is not the heavy raw scientific recomputation path.
If you only need the validation anchor:
uv run spectralbio replay --target tp53 --json --cpu-only --offline| Target | Role | Command | Output |
|---|---|---|---|
TP53 |
validation_anchor |
uv run spectralbio replay --target tp53 --json --cpu-only --offline |
outputs/replay/tp53/ |
BRCA2 |
flagship_non_anchor_canonical_target |
uv run spectralbio replay --target brca2 --json --cpu-only --offline |
outputs/replay/brca2/ |
TSC2 |
replay_ready_transfer_surface |
uv run spectralbio replay --target tsc2 --json --cpu-only --offline |
outputs/replay/tsc2/ |
CREBBP |
replay_ready_transfer_surface |
uv run spectralbio replay --target crebbp --json --cpu-only --offline |
outputs/replay/crebbp/ |
Each replay bundle writes:
summary.jsonverification.jsonprovenance.jsonmanifest.jsonmetrics.jsonchecksums.jsonstatus.json
verify has two distinct meanings and they should not be collapsed.
Legacy verify:
uv run spectralbio verify-legacy
uv run spectralbio verifyMeaning:
- validates the original TP53 canonical plus bounded BRCA1 transfer contract
- associated with
outputs/canonical/andoutputs/transfer/ - preserves the older bounded executable validation surface
verify-legacyis the preferred explicit legacy commandverifywithout--targetremains supported for backward compatibility
Target replay verify:
uv run spectralbio verify --target tp53 --json --cpu-only --offline
uv run spectralbio verify --target brca2 --json --cpu-only --offline
uv run spectralbio verify --target tsc2 --json --cpu-only --offline
uv run spectralbio verify --target crebbp --json --cpu-only --offlineMeaning:
- validates the newer replay target bundle for that specific target
- uses the replay bundle schema, checksum, provenance, and verification layer
Use this when you want the fastest public multi-target route:
uv run spectralbio replay-audit --json --cpu-only --offlineThis runs:
- TP53 replay
- BRCA2 replay
- TSC2 replay
- CREBBP replay
- aggregate replay verification
The merged summary is written to:
outputs/replay/replay_audit_summary.json
The older public commands still work and remain supported:
uv run spectralbio canonical
uv run spectralbio transfer
uv run spectralbio verifyThose commands preserve the original bounded executable contract:
TP53canonical output directory:outputs/canonical/BRCA1_transfer100bounded auxiliary output directory:outputs/transfer/
Use them when you need the legacy TP53+BRCA1 contract specifically. Use replay for the stronger modern public route.
uv run spectralbio doctor --json --cpu-only --offlineThis command:
- inspects environment health
- checks replay asset availability
- checks schema and contract presence
- emits a structured diagnosis bundle
- recommends the next recovery action
Doctor writes:
outputs/status/<run_id>/status.jsonoutputs/status/<run_id>/diagnosis.jsonoutputs/status/<run_id>/stdout.logoutputs/status/<run_id>/stderr.logoutputs/status/<run_id>/command.txt
Mirrored latest bundle:
outputs/status/latest/
BRCA1remains an explicit bounded auxiliary and anti-case surface in the legacy transfer path.MSH2remains an explicit negative portability guardrail in the final claim boundary.- These negatives are part of the result and must not be erased or flattened into universal generalization.
When you need deterministic paper-grade audit bundles rather than the fastest replay route:
uv run spectralbio regenerate --target tp53 --json --cpu-only --offline
uv run spectralbio regenerate --target brca2 --json --cpu-only --offline
uv run spectralbio regenerate --surface scale-repair --json --cpu-only --offline
uv run spectralbio regenerate --surface portability --json --cpu-only --offline
uv run spectralbio regenerate --surface holdout-control --json --cpu-only --offline
uv run spectralbio reproduce-all --json --cpu-only --offlineRegeneration writes under:
outputs/regeneration/outputs/paper/
reproduce-all materializes:
outputs/paper/tables/outputs/paper/figures/outputs/paper/contracts/outputs/paper/checksums.jsonoutputs/paper/provenance.jsonoutputs/paper/reproduction_report.json
Structured stats:
uv run spectralbio stats-report --target tp53 --json --cpu-only --offline
uv run spectralbio stats-report --target brca2 --json --cpu-only --offlineBounded sensitivity:
uv run spectralbio sensitivity --target tp53 --json --cpu-only --offline
uv run spectralbio sensitivity --target brca2 --json --cpu-only --offlineBounded onboarding scaffold:
uv run spectralbio adapt --gene TSC2 --variants path/to/variants.csv --reference path/to/reference.fasta --jsonBounded applicability diagnostics:
uv run spectralbio applicability --gene TSC2 --variants path/to/variants.csv --reference path/to/reference.fasta --jsonadapt scaffolds a new target onboarding surface but does not validate that target as claim-bearing.
applicability emits bounded diagnostics only and does not certify transfer success.
A new target becomes claim-bearing only after it has its own independently frozen benchmark surface, expected outputs, verification path, and bounded interpretation consistent with the manuscript.
validation_anchor: default executable validation centerflagship_non_anchor_canonical_target: strongest non-anchor replay targetreplay_ready_transfer_surface: bounded public portability witnessnegative_guardrail: explicit retained negative boundaryclosure_tribunal_surface: final harsh closure boundary surface
outputs/replay/<target>/- replay target bundlesoutputs/regeneration/- regeneration target and scientific surface bundlesoutputs/paper/- paper-grade deterministic outputsoutputs/status/<run_id>/- canonical per-run status bundlesoutputs/status/latest/- convenience mirror of the latest bundle, not the canonical record
Strict schemas live under schemas/:
status.schema.jsonsummary.schema.jsonverification.schema.jsonprovenance.schema.jsonstats_report.schema.jsondiagnosis.schema.jsonmanifest.schema.jsonbenchmark_contract.schema.json
Replay benchmark contracts live under:
benchmarks/tp53/benchmarks/brca2/benchmarks/tsc2/benchmarks/crebbp/benchmarks/benchmark_registry.json
Compatibility contract files remain under:
artifacts/expected/expected_metrics.jsonartifacts/expected/expected_files.jsonartifacts/expected/output_schema.jsonartifacts/expected/verification_rules.json
A command reports PASS only if:
- execution completed
- required artifacts were written
- schemas validated
- checksums matched when applicable
- contract tolerances passed when applicable
A command reports FAIL if any required contract check fails.
If replay fails:
- Run
uv run spectralbio doctor --json --cpu-only --offline - Inspect
outputs/status/latest/status.json - Inspect
outputs/status/latest/diagnosis.jsonwhen present - If the problem is a target bundle, rerun
uv run spectralbio replay --target <target> --json --cpu-only --offline
Common failure classes:
- missing offline replay asset
- checksum mismatch
- schema drift
- missing replay bundle before target verification
Minimum public success:
uv run spectralbio preflight --json --cpu-only --offline=>PASSuv run spectralbio replay --target tp53 --json --cpu-only --offline=>PASSuv run spectralbio replay --target brca2 --json --cpu-only --offline=>PASSuv run spectralbio replay --target tsc2 --json --cpu-only --offline=>PASSuv run spectralbio replay --target crebbp --json --cpu-only --offline=>PASSuv run spectralbio replay-audit --json --cpu-only --offline=>PASS
Compatibility success:
uv run spectralbio canonical=>PASSuv run spectralbio transfer=>PASSuv run spectralbio verify=>PASS
TP53remains the executable validation anchor.BRCA2is the next full canonicalization target and flagship non-anchor replay surface.TSC2andCREBBPstrengthen bounded portability as replay-ready transfer surfaces.BRCA1andMSH2remain negative guardrails.- Block 13 strengthens target-level portability.
- Block 14 keeps the final holdout/control tribunal mixed.
That boundary is part of the result. Do not flatten it into universal generalization.