Skip to content

counterfactual: the replay harness CLI — score a prompt/model variant against historical judgments #8221

Description

@JSONbored

Problem

Counterfactual sub-epic phase 3. The actual runner: given a fixture set and a judge variant (prompt version + provider/model/effort), replay offline, map outputs through the scoring contract, and print the same comparison report every other backtest uses.

Requirements

⚠️ Required pattern. Pure-core/thin-IO split exactly like backtest-corpus-export: all mapping/aggregation logic in a unit-tested core; the wrapper owns provider IO. Budget + cursor discipline from the design contract (partial runs persist scores + resume). Local ollama is the smoke path; BYOK providers behind explicit flags.

  • tsx scripts/counterfactual-replay.ts --fixtures <file> --variant <prompt-version|model spec> [--budget N] [--baseline <scores file>] → runs the variant, scores with scoreBacktest via the contract's classifier mapping, and with --baseline prints compareBacktestScores' Pareto-floored comparison + the shared renderer's report.
  • Abstentions counted per the contract; per-fixture raw outputs cached to a local artifacts dir (never committed) so re-scoring is free.
  • Never posts anywhere; exit code reflects operational success only, never verdict (the Scaffold the advisory backtest CI workflow + threshold-only comparison, and persist each run's result #8138 advisory guarantee).

Deliverables

  • Core (100% covered) + wrapper + docs section with a worked ollama example
  • A recorded first comparison on the production fixture set posted to this issue

Links & Resources

The sub-epic (parent), the design + assembler issues (blocked-by), scripts/backtest-corpus-export.ts (the split to mirror)

Boundaries

Offline only; spend-capped; no GitHub writes; artifacts stay local.

maintainer-only — model spend + judgment-layer evaluation.

Metadata

Metadata

Assignees

Labels

maintainer-onlyOwner-only work — yields no Gittensor points.roadmapOn the Wave-2 agent-layer roadmap board (project 9)

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions