The Precision Calibration Pipeline
Specification-faithful, multiple-testing-aware strategy calibration with independent re-derivation
Haneef R. Haqq, MBA · Quant7 Alpha, LLC Technical Whitepaper · v1.0 · June 30, 2026
Abstract
We describe the calibration pipeline used by Q7 AEGIS AI to take a strategy from a single canonical specification to a signed, deployable configuration set. The pipeline is organized around one premise: the dominant failure mode in systematic trading is not a weak signal but a specification–implementation divergence — the calibrated and executed system silently differs from its design — and this divergence must be eliminated before optimization, not diagnosed after deployment. We formalize the integrity preconditions, the optimization objective, the human-AI gating ensemble, the out-of-sample protocol (purged combinatorial cross-validation with embargo, evaluated under a deflated performance statistic), and the preventive risk construction. We then describe the producer/verifier separation that makes every shipped result independently reproducible. The pipeline issues calibrated, residual-risk-qualified verdicts; it never certifies optimality, and it states plainly what it does not address.
1. The failure we engineer against
Let S denote a strategy specification (the canonical charting source), C its calibration implementation, and E its execution implementation. Three pathologies dominate live underperformance, and conventional pipelines detect none of them with high power:
- Functional divergence
C ≢ S. The calibration backtester implements a strict subset of the specification's logic — a reduced exit ladder, an absent stop-governance layer, an engine whose entry condition was replaced by a proxy. The optimizer then converges on the global optimum of the wrong objective surface. BecauseE ≈ S, the deployed system is out-of-distribution relative to everything that was calibrated: train ≠ serve at the structural level. - Non-convergence under structural defect. A defective
Cdoes not converge within a sane evaluation budget; it either exhausts the budget without shipping or returns an overfit artifact. Additional compute is a symptom-level response. The relevant prior: a strategy in this program finalized as a hard block after 1,478 trials because engine×direction attribution was mis-wired upstream — a Stage-0 defect masquerading as a Stage-2 budget problem. - Presence-checking masquerading as fidelity-checking. A certification that verifies parameters are declared and consumed will pass an implementation that is a stripped shadow of its specification, because subset-implementation preserves the input signature. Structural-presence GREEN is necessary but not sufficient for formula faithfulness.
The pipeline is constructed so that (1)–(3) are caught with fail-closed gates prior to trial #1.
2. Operating axioms
- Specification authority.
Sis the sole source of truth. The admissible calibration set is exactly the declared input set ofS, less a signed exclusion list. Derived artifacts (caches, matrices, prior runs) carry no authority and cannot expand the search space. - Fail-closed evaluation.
FAIL ∪ UNKNOWN ∪ missing-artifactis terminal for the dependent check. Absence of evidence is never treated as evidence of correctness. - No silent narrowing. Full calibratable coverage, single mode, no top-k / sampling / freezing / "high-impact-only." Per-configuration evaluation is mandatory; cross-configuration uniformity is treated as a shortcut signature, not as a calibration result.
- Producer ≠ verifier. The agent that generates a result does not grade it. Verification is performed under separate credentials and is externally auditable.
- Honest-empty. Unevaluable checks are reported as such with a named missing artifact; no value, attribution, or metric is ever inferred, interpolated, or fabricated to clear a gate.
3. Stage 0 — Structural-integrity cornerstone (pre-optimization)
Before any search, an agent establishes C ≡ S ≡ E at the formula level across the tri-implementation (specification, calibration code, execution code). The cornerstone is a battery of fail-closed checks, of which the load-bearing ones are:
- Lint & compile of the canonical source; deterministic identifier resolution.
- Entry/engine liveness — every engine emits signals end-to-end, not merely declares them.
- Searched-dimension consumption — every searched dimension is consumed on a live code path; a searched-but-unconsumed dimension is a dead dimension and a fail (it inflates the multiple-testing burden while contributing nothing).
- Engine × direction attribution — per-engine, per-direction P&L attribution is correct end-to-end. This is the single most defect-prone wire and is scrutinized hardest.
- Formula-footprint parity — exit-ladder cardinality, stop-governance layers, sizing model, and gating logic are compared function-by-function against
S, not by input-signature coverage. This is the check that distinguishes a faithful port from a stripped shadow. - Runtime ship-smoke — the model imports, trades, and ships ≥ 1 live engine end-to-end. Static parity alone is insufficient.
Any FAIL or UNKNOWN renders the pipeline RED; all downstream calibration is advisory until the cornerstone is GREEN. The economic argument is direct: a structurally clean model converges within the evaluation budget, so the cheapest path to a trustworthy result is to pay the structural cost once, up front.
4. Stages 1–2 — Population, data, and concerted search
Population & data. The calibratable population is enumerated directly from S (per configuration), minus signed exclusions. The market-data snapshot is content-addressed and frozen; every downstream result is reproducible against a known hash, and any contaminated or stale snapshot forces re-certification rather than reuse.
Search. Every admissible dimension is optimized jointly. High dimensionality is addressed with a sequential model-based optimizer (Bayesian / tree-structured Parzen estimators) under a return-within-budget objective — a risk-adjusted return functional that rewards utilization of the drawdown budget rather than minimization of variance, which prevents the degenerate collapse to near-zero exposure that a naive ratio objective induces. The total evaluation count is capped (≤ 1000 per configuration); the cap is a convergence discipline, not a sampling shortcut — a clean model does not require more, and a model that does is re-routed to Stage 0. Crucially, the evaluation budget is fixed and disclosed, because it is an input to the multiple-testing correction applied downstream.
5. Stage 3 — The HAI tandem (train = serve)
Calibration is performed against the gated system that will actually be deployed. The Honest-AI overlay is a three-model ensemble evaluated per bar:
- a gradient-boosted directional classifier,
- a transformer-based sentiment estimator, and
- a market-regime classifier.
Each is trained in-cycle, per configuration, and the optimization objective scores the full HAI-gated equity curve — not the raw-signal curve. A neutral-stubbed gate (model trained but not consulted, or consulted ML-only with sentiment/regime stubbed) is a train ≠ serve violation and is forbidden. The gate is admitted only if it passes health constraints — an adversarial discriminability bound (the model must not be trivially separable from noise) and per-direction discriminability floors — and the model's content hash that gates live trades must equal the hash calibrated in-cycle. A configuration without a fresh, health-passing, hash-matched model is blocked, never traded gate-off.
6. Stages 4–5 — Robustness and the honest charter gate
Out-of-sample protocol. Robustness is assessed on the HAI-gated system using combinatorial purged cross-validation with embargo: training and testing folds are constructed combinatorially, observations whose labels overlap the test window are purged, and a temporal embargo removes post-test observations that could leak through serial correlation. This yields a distribution of out-of-sample paths rather than a single backtest, and the lower confidence bound of that distribution — not the point estimate — is the quantity that gates.
Multiple-testing correction. Because the search evaluates a large, disclosed number of configurations, the in-sample optimum is upward-biased by selection. We therefore evaluate against a deflated performance statistic: the observed Sharpe ratio is discounted by the expected maximum Sharpe attainable under the realized number of (effectively independent) trials and the higher-moment structure of the returns. A configuration clears Stage 5 only on the deflated statistic, under fixed (not co-optimized) risk constraints, against a binding five-criteria charter gate. This is the bar designed to reject configurations that are artifacts of search rather than evidence of edge.
7. Risk as a structural constraint
Risk is enforced preventively at the sizing layer rather than reactively at a kill-switch, because an overnight or weekend gap can render a reactive stop too late. Let P_t be the monotonically ratcheting all-time equity high (it never resets), Q_t current equity, D the hard drawdown ceiling, ℓ_u the worst-case adverse loss per unit (a function of the protective stop distance plus a per-instrument gap reserve estimated from the instrument's own history), and n the position size. Sizing solves
where n_pre is the pre-risk size from the specification's own sizing model. The construction guarantees that even a worst-case-in-data gap-through keeps realized drawdown, measured from the true peak, below D — by sizing, not by reaction. D is a structural constant of the strategy, implemented identically in S, C, and E; it is never a calibrated dimension. A reactive intrabar control remains as a backstop. The design target is capital efficiency for small accounts: the budget is utilized, not merely respected.
8. Stages 6–7 — Independent re-derivation and governance
Sign-off. Packaging produces a content-hashed dossier (configuration parameters, model hashes, data snapshot hash, compliance heat map). A configuration is marked ready only after an independent re-derivation on held-out partitions reproduces the result within tolerance, and a separate validator signs off on train=serve integrity — both under credentials distinct from the producer's. Promotion is gated on a signed certificate (GREEN ∧ hash-match), never on a claimed pass.
Governance. Seven chartered agents own the stages (Calibrator, Trainer, Validator, Sentinel, Researcher, Auditor, Adjudicator). Producer/verifier independence is enforced by per-agent key isolation, making the separation cryptographic and externally observable rather than procedural. The oversight role assigns lanes and adjudicates; it does not hand-run lanes or override gates. Binding rules are mechanized as fail-closed gates rather than restated, because a control that depends on recall is not a control.
9. Verdicts and residual risk
The pipeline emits three verdicts and never asserts optimality:
- GREEN (residual risk: …) — cornerstone clean, charter gate met on the deflated statistic, residual risks enumerated.
- AMBER (conditional on: …) — ships only after named conditions clear.
- RED (blocked by: …) — structural defect, unverifiable claim, compliance flag, or unresolved fail.
Every GREEN carries an explicit residual-risk statement — the failure modes that survive a passing grade — and the live evidence required to keep the grade valid.
10. Limitations (what the methodology does not solve)
Intellectual honesty requires stating the boundary of the claims:
- Non-stationarity and regime change. Purged CPCV and a deflated statistic bound in-sample selection bias; they do not immunize against structural breaks in the data-generating process after deployment. Out-of-sample here means out-of-sample within the certified history.
- Gap-reserve estimation risk. The preventive sizing bounds drawdown against the worst gap observed in the instrument's history. A future gap exceeding the historical envelope is a tail the construction does not cover; the reactive backstop and conservative reserve mitigation reduce, but do not eliminate, this risk.
- Model and data risk. Train=serve and health gates constrain the HAI overlay; they do not certify that the learned relationships are causal or durable.
- Execution, leverage, liquidity, and venue/regulatory risk are not eliminated by calibration integrity and remain in every residual-risk statement.
The pipeline's contribution is precise and bounded: it makes specification-implementation divergence and selection-biased validation structurally hard to ship, and it makes every shipped result independently reproducible. It does not — and does not claim to — predict the future.
Methodology disclaimer. This document describes a research and calibration methodology. It is not investment advice, an offer, or a solicitation. Nothing herein represents realized trading results or guarantees future performance; backtested and out-of-sample figures are research artifacts subject to the limitations inherent in historical simulation. Any performance representation or forward-looking statement intended for public distribution should be reviewed by qualified counsel prior to publication.