Refusal Contracts & SHA-256 Provenance
A Refusal Is a Result, Not a Crash
Section titled “A Refusal Is a Result, Not a Crash”In Dock2MD, anticipated chemical, structural, or configuration faults never produce a raw Python traceback and never silently proceed. Instead, Dock2MD stops with:
- Non-zero exit code (
1) - Structured diagnostic block on stderr:
ERROR:concise root causeExpected:what the contract requiresFound:what the actual input containedSuggestion:exact actionable fix
- Machine-readable outcome marker (
DOCK2MD_OUTCOME: <category>) so scripts, batch orchestrators, and autonomous LLM agents can distinguish a typed refusal from an unexpected crash.
In multi-compound library runs (batch, interactions, run), a single failing compound is logged with its exact stage and exception type in interactions.summary.csv and run_manifest.json while the rest of the library continues cleanly.
Three Contract Surfaces
Section titled “Three Contract Surfaces”| Surface | Trigger Point | What It Guards |
|---|---|---|
| Surface 1 · Configuration Contracts | Load time (validate-config, command preflight) |
Unknown YAML keys, unedited A:*** / CHEMBL*** placeholders, mistyped receptor residues, invalid profile_csv bands, engine/metric mismatches, empty docking boxes, invalid MD timesteps |
| Surface 2 · Realised Ligand Chemistry | reconstruct-ligand, prepare-complex, build |
Missing reference in --mode md, atom/graph mismatch, tetrahedral R/S & E/Z inversions, planar/twisted stereo ambiguity, wrong-face explicit hydrogens |
| Surface 3 · Pre-MD Receptor & System Integrity | md prepare, md run |
Backbone chain gaps (NEG-003), covalent ligand–protein contacts (NEG-004), non-standard residues like MSE (NEG-005), unsupported metal ions (NEG-006), severe ligand–protein steric clashes (X1), stretched ligand bonds (X2), missing side-chain atoms (X3), exact plip==3.0.0 environment pin |
Creation-Time Provenance & Reproducibility
Section titled “Creation-Time Provenance & Reproducibility”Every configured workflow writes auditable artifacts alongside scientific outputs:
run_manifest.json— Resolved configuration (including effective normalized ranking weights), stage funnel counts, failure-reason tallies, timings, and SHA-256 fingerprints of inputs/outputs.PROVENANCE.md— Human-readable Methods summary recording invoked dependency versions (RDKit,PLIP 3.0.0,Open Babel,GROMACS, etc.) and protocol parameters.CITATION.txt— Ready-to-cite software list covering only the tools actually invoked during that run.- Crash-safe resume (
md run) — Atomic checkpointing verified acrossSIGINT/SIGKILLinterruptions.