- Status: proposed
- Date: 2026-02-21
Recurgent has enough runtime infrastructure to begin automated simulation, but current validation evidence shows a gap between infrastructure maturity and scenario-level semantic stability.
Current state:
- Reliability and lifecycle infrastructure exists (ADR 0023), role/profile continuity exists (ADR 0024), authority boundaries exist (ADR 0025), and response-content continuity exists (ADR 0026).
- Phase validation reports show tests are consistently green while example semantics still fluctuate by phase and run conditions.
- External-data scenarios (news/movies/recipe) are noisy due to upstream variability, while closed-world scenarios (calculator) expose deterministic correctness gaps.
Without a simulation-preparedness contract, Recursim risks producing high-volume but low-quality evidence (flaky signals, unclear causality, weak regression attribution).
This ADR defines a readiness gate layer that must be satisfied before simulation is treated as a primary evolution control loop.
Adopt a Simulation Preparedness contract with explicit readiness gates and phased activation policy.
Readiness is measured across six gates:
G0 Contracted Scenarios: scenario packs have machine-checkable oracles and scoring contracts.G1 Replayability: fixed-seed reruns are replay-stable in fixture/replay mode.G2 Score Consistency: scoring output is deterministic and diffable across runs.G3 Trace Integrity: logs validate against machine-readable schema and required trace-linkage fields.G4 Baseline Diffs: each run is compared to a pinned baseline with actionable deltas.G5 Operationalization: simulation harness runs in CI/nightly with pass/fail policy.
Gate dependency rule:
- Gates are sequentially dependent, not independently satisfiable.
G0must pass beforeG2is considered meaningful.G1must pass beforeG4is considered actionable.
Simulation classes are activated incrementally:
- Class 1 (
self-contained, calculator-centric) must passG0-G5first. - Class 2+ (
inter-connected,interactive,networked) remain non-gating until class 1 stability is sustained.
simulation_preparedness:
version: 1
gates:
G0: scenario_contracts
G1: replayability
G2: score_consistency
G3: trace_integrity
G4: baseline_diffs
G5: ci_operationalization
activation_policy:
class_1: require [G0, G1, G2, G3, G4, G5]
class_2_plus: advisory_until_class_1_stableid: calculator-core-v1
class: self_contained
oracle:
type: deterministic
assertions:
- add_chain_correct
- multiply_chain_correct
- sqrt_expected_precision
scoring:
profile: calculator_core_v1
correctness_weight: 0.7
contract_adherence_weight: 0.15
repair_efficiency_weight: 0.1
reuse_weight: 0.05
replay:
mode: fixture
seeds: [11, 19, 23, 31, 43, 59, 71, 97]Scoring profile rule:
- Weight sets are scenario-class specific, not universal defaults.
- Closed-world calculator packs prioritize correctness dominance.
- Open-world assistant/debate packs may rebalance toward continuity, provenance, and orchestration coherence.
- Tests are stable, but examples are not uniformly stable:
- ADR-0024 rollup reports full suite pass across phases with calculator regressions in multiple phases (
docs/reports/adr-0024-phase-validation-rollup.md).
- ADR-0024 rollup reports full suite pass across phases with calculator regressions in multiple phases (
- External-data scenarios remain variable:
- news/movies/recipe flows show capability and source variability across phases/runs (
docs/reports/adr-0023-phase-validation-report.md,docs/reports/adr-0024-phase-validation-rollup.md).
- news/movies/recipe flows show capability and source variability across phases/runs (
- Observability is strong but not yet used as a strict simulation gate:
- trace docs exist (
docs/observability.md) and log schemas now exist (specs/contract/v1/recurgent-log-entry.schema.json,specs/contract/v1/recurgent-log-stream.schema.json), but simulator-run gating is not enforced.
- trace docs exist (
- Replay stability:
- fixed-seed fixture runs achieve
>= 99%identical score vectors across repeated executions of the same commit.
- fixed-seed fixture runs achieve
- Regression attribution speed:
- reduce mean time to identify primary regression source from manual multi-hour trace inspection to
<= 1 CI cyclevia baseline diffs.
- reduce mean time to identify primary regression source from manual multi-hour trace inspection to
- Signal quality:
- reduce external-drift-induced false regressions in gating scenarios by
>= 70%through fixture/replay first policy.
- reduce external-drift-induced false regressions in gating scenarios by
- Scenario coverage:
- establish at least 3 machine-scored scenario packs for initial gate:
- calculator core arithmetic/composition,
- assistant continuity/source-follow-up,
- debate role/orchestration coherence.
- establish at least 3 machine-scored scenario packs for initial gate:
- This ADR does not change runtime semantics by itself (no automatic fixes to calculator/news behavior).
- This ADR does not authorize autonomous policy mutation (ADR 0025 authority boundary remains intact).
- This ADR does not replace acceptance tests or runtime contract suites; it adds simulation governance on top.
- Tests:
- existing Ruby suite remains green (
bundle exec rspec,bundle exec rubocop). - simulation harness tests validate scenario loading, scoring determinism, replay controls.
- existing Ruby suite remains green (
- Traces/logs:
- each simulation run emits JSONL logs with
trace_id,call_id,parent_call_id,depth,outcome_status. - logs validate against
specs/contract/v1/recurgent-log-stream.schema.json.
- each simulation run emits JSONL logs with
- Thresholds:
G1: replay stability>= 99%.G2: score diff reproducibility100%for same seed/config.G3: schema validation pass rate100%for simulation-generated logs.G4: baseline diff report generated for every simulation run.G5: CI gate enforces readiness policy on class-1 packs.
- Observation window:
- minimum
20consecutive class-1 runs across at least5seeds,2sessions, and3calendar days before class-1 gate is considered stable.
- minimum
- If replay stability drops below
95%for class-1 fixture scenarios:- freeze promotion of new simulator classes and remediate determinism leaks first.
- If schema validation failures exceed
0in simulation-run logs:- fail readiness gate and fix observability contract before accepting run results.
- If baseline diff noise remains high (
> 20%runs with non-actionable deltas):- tighten scenario contracts and scoring definitions before broadening scenario set.
In scope:
- readiness-gate contract for simulation activation,
- scenario contract/oracle requirements,
- replay/baseline/diffability requirements,
- CI/nightly gate criteria for class-1 simulation.
Out of scope:
- full Recursim implementation details (separate product spec and implementation plan),
- autonomous recommendation enactment,
- class-2/3/4 simulation gating.
- Simulation runs become falsifiable engineering evidence instead of anecdotal demos.
- Regression diagnosis becomes faster and more mechanical.
- Evolution claims become measurable against explicit readiness thresholds.
- Adds up-front contract/scoring work before broad simulation rollout.
- Requires fixture management and baseline maintenance discipline.
- Slows scope expansion until class-1 gate stability is demonstrated.
- Start large-scale simulation immediately without readiness gates.
- Rejected: high risk of noisy and non-actionable results.
- Continue manual examples as primary evolution mechanism.
- Rejected: insufficient coverage and weak repeatability.
- Limit to calculator-only simulation without shared readiness contract.
- Rejected: useful for bootstrap, but does not create reusable governance model for other scenario classes.
- Phase 1: Define simulation contract surface.
- publish scenario-pack schema/oracle/scoring interfaces,
- define fixture/replay modes and baseline snapshot format.
- Phase 2: Implement class-1 harness MVP.
- calculator-first packs + deterministic scorer + run ledger.
- Phase 3: Wire readiness gates.
- implement
G0-G5checks, schema validation, baseline-diff reporting.
- implement
- Phase 4: Operationalize.
- add CI/nightly runs for class-1 packs,
- publish run health dashboard/reporting.
- Phase 5: Expand cautiously.
- add assistant/debate packs under advisory mode, promote to gating only after meeting gate thresholds.
- Do not treat live-network variability as primary gating evidence; fixture/replay evidence is authoritative for readiness decisions.
- Keep scenario scoring contracts explicit and machine-checkable; avoid prose-only pass/fail criteria.
- Keep simulation pressure separate from runtime mutation authority (observe/propose/enact boundaries remain explicit).
- Avoid overfitting to one scenario: require multi-pack evidence before claiming class-level readiness.
- Do not use simulation outputs to justify runtime/policy mutations until the observation window is satisfied.
Add these terms to docs/ubiquitous-language.md:
Simulation PreparednessReadiness GateScenario PackOracle ContractReplay StabilityBaseline Diff