Problem
Counterfactual sub-epic phase 2. The replay harness needs its input shaped: from a labeled corpus, select and shape exactly the cases that are replayable under the design contract — pure selection, no AI calls, no IO.
Requirements
⚠️ Required pattern. Engine-pure module in packages/loopover-engine/src/calibration/, mirroring the corpus builders' discipline (#8083 shape); root vitest mirror suite per the engine blind-spot rule. Implements the fixture/sampling contract types from the design issue verbatim — do not invent alternatives.
Deliverables
Links & Resources
The sub-epic (parent), the design issue (blocked-by), packages/loopover-engine/src/calibration/backtest-corpus.ts
Boundaries
Pure only. No fetches, no model calls, no store reads.
Problem
Counterfactual sub-epic phase 2. The replay harness needs its input shaped: from a labeled corpus, select and shape exactly the cases that are replayable under the design contract — pure selection, no AI calls, no IO.
Requirements
assembleCounterfactualFixtures(cases, contract): filters to replayable (diff present + bounded, label present), applies the SEEDED deterministic sample when over budget, and emits fixtures carrying {targetKey, label, boundedInputs, provenance} — provenance distinguishes live-captured vs backfilled raw context (calibration: backfill phase 2 — GitHub-truth reversed labels (retro successor scan) + raw-context re-fetch #8170's tags) so results can be segmented by capture era.Deliverables
Links & Resources
The sub-epic (parent), the design issue (blocked-by), packages/loopover-engine/src/calibration/backtest-corpus.ts
Boundaries
Pure only. No fetches, no model calls, no store reads.