- Status: draft
- Date: 2026-02-22
- Scope: ADR 0028 live-shadow simulation lane on top of ADR 0027 deterministic readiness lane
Operationalize ADR 0028 so Recurgent can measure runtime semantic behavior (live-shadow) without degrading deterministic readiness reliability.
Primary outcomes:
- Add a live-shadow simulation lane that executes scripted real agent calls in run-scoped isolation.
- Preserve deterministic lane as primary class-1 gating signal.
- Capture lane-aware evidence (scores, gates, isolation health, usage telemetry) in one ledger/reporting surface.
- Simulation runner is deterministic-oracle only (
runtimes/ruby/lib/recurgent/simulation_runner.rb) and does not execute live runtime flows. - Phase-7 evidence confirms deterministic infrastructure maturity but ongoing semantic instability in live examples (
docs/baselines/2026-02-22/adr-0027/phase-7b-validation-report.md). - Run ledger currently captures gate/score evidence, but not live-shadow lane metadata and token/cost telemetry for runtime-executed calls.
- Live semantic signal coverage:
- from manual ad hoc example analysis to machine-scored live-shadow packs for calculator and assistant.
- Isolation confidence:
- run-scope contamination checks reach
100%pass across seed/session matrix.
- run-scope contamination checks reach
- Evidence completeness:
- lane metadata and usage telemetry fields present on
100%live-shadow ledger entries (with explicitunknownvalues when provider does not return data).
- lane metadata and usage telemetry fields present on
- Regression attribution:
- lane-split reports identify deterministic-only vs live-shadow-only vs cross-lane regressions in one artifact.
- This plan does not auto-repair failing runtime semantics.
- This plan does not promote live-shadow to gating before explicit promotion decision criteria are met.
- This plan does not relax ADR 0025 authority boundaries (
observe/propose/enactseparation remains unchanged).
- Tests/specs:
- full Ruby suite remains green,
- new unit/integration specs for lane selection, isolation, script execution, live oracles, and telemetry mapping.
- Traces/logs:
- live-shadow step records include trace linkages (
trace_id,call_id,depth,outcome_status), - ledger includes lane metadata and usage telemetry.
- live-shadow step records include trace linkages (
- Thresholds:
- deterministic lane class-1 gate behavior remains unchanged,
- isolation contamination checks
100%pass, - live-shadow step execution coverage
100%for scripted steps, - oracle evaluation coverage
100%for pack oracles, - live-shadow replay comparability is oracle-verdict-based (not raw payload-string identity),
- telemetry field presence
100%for live-shadow ledger entries.
- Observation window:
- live-shadow remains advisory for at least
20runs across>= 5seeds and>= 3UTC days before promotion decision.
- live-shadow remains advisory for at least
- Any deterministic-lane class-1 gate regression introduced by live-shadow changes -> pause live-shadow rollout and restore deterministic baseline first.
- Any cross-run contamination in state/tool/artifact namespaces -> block further live-shadow phases until isolation defect is fixed.
- Missing live-shadow usage telemetry fields in ledger -> block promotion decisions until telemetry coverage is restored.
- Advisory noise above
20%ambiguous regressions -> tighten live-shadow scenario/oracle contracts before adding new packs.
- Replacing deterministic simulation lane.
- Enabling autonomous runtime mutations from simulation output.
- Broad open-world/networked scenario gating in first live-shadow iteration.
- Isolation-first sequencing: implement and prove run-scoped isolation before executor implementation.
- Run-scoped isolation must include state, tool registry, artifact store, pattern memory, role profile registry, and proposals.
- Durable writes outside run scope are blocked by default unless scenario pack explicitly opts in.
- Lane semantics are explicit in contracts and ledger; no hidden lane inference.
- Deterministic lane remains the control baseline throughout rollout.
- Schema changes must be versioned and validated before CI/nightly adoption.
- Replay comparison semantics are lane-specific:
- deterministic lane: payload identity,
- live-shadow lane: oracle verdict reproducibility with tolerance-aware numeric checks.
Goals:
- Extend simulation scenario-pack contract for lane and script metadata.
- Extend run-ledger schema for lane + usage telemetry.
Implementation:
- Update scenario-pack schema (
specs/contract/v1/simulation-scenario-pack.schema.json):execution.lane(deterministic|live_shadow),execution.isolation(run_scoped),scenario.role,scenario.script[]fields for live-shadow.
- Update run-ledger schema (
specs/contract/v1/simulation-run-ledger.schema.json):execution_lane,run_scope_id,usage_telemetryobject (provider,model,input_tokens,output_tokens,total_tokens,estimated_cost_usd,availability).
- Update
Agent::SimulationPackContractfor new validation rules.
Phase Improvement Contract:
- Baseline snapshot: no lane metadata in pack/ledger contracts.
- Expected delta: lane + telemetry contract surfaces are machine-validated.
- Observed delta: to be filled after phase validation.
Exit criteria:
- Schema and contract tests cover new fields and reject invalid payloads.
- Existing deterministic packs validate under updated contract.
Goals:
- Introduce run-scoped namespace builder for live-shadow runs.
- Prove no cross-run leakage across all runtime stores.
Implementation:
- Add
SimulationRunScopeutility that creates per-run roots (e.g.tmp/simulation/live-shadow/<run_scope_id>/<seed>/...). - Inject run-scoped paths for runtime stores used during live-shadow execution.
- Add isolation specs:
- run A forges tool/artifact/state entries,
- run B starts clean with same seed/config,
- assert no inherited state/tool/artifact/proposal/profile contamination.
- Add teardown policy and crash-safe cleanup strategy.
Phase Improvement Contract:
- Baseline snapshot: no formal isolation harness for simulation runs.
- Expected delta: isolation contamination checks pass deterministically.
- Observed delta: to be filled after phase validation.
Exit criteria:
- Isolation test matrix passes
100%. - Leak detector assertions fail fast with explicit diagnostics.
Goals:
- Execute scripted role calls through real runtime path.
- Capture step-level outcomes and trace references.
Implementation:
- Add lane selector in
SimulationRunner:- deterministic path (existing),
- live-shadow path (new).
- Implement live-shadow step runner:
- instantiate role (
Agent.for(role)), - execute ordered
scenario.scriptcalls, - capture
{ step_id/call, args, kwargs, outcome_summary, trace_ref }.
- instantiate role (
- Store per-seed live execution payload in fixture/replay format compatible with scorer.
- Add replay comparator semantics for live-shadow:
- compare oracle verdict stability by oracle id,
- compare numeric expectations via declared tolerances,
- do not require raw generated payload or prose identity.
Phase Improvement Contract:
- Baseline snapshot: no live runtime execution in simulation.
- Expected delta: scripted call sequences execute and emit structured step outcomes with lane-correct replay comparator behavior.
- Observed delta: to be filled after phase validation.
Exit criteria:
- Live-shadow pack executes end-to-end for at least one calculator script.
- Per-seed payloads are persisted and replay-comparable using oracle-verdict reproducibility.
Goals:
- Add oracle kinds that evaluate live step outcomes/log conditions.
- Keep deterministic and live oracle evaluation under one interface.
Implementation:
- Extend oracle evaluator with live kinds:
live_outcome_value,live_outcome_error,live_provenance_envelope,live_continuity_ref_resolution.
- Support step addressing (
step,step_index, optional aliases). - Emit failure details with explicit failure typing (
semantic_regression,contract_mismatch,trace_integrity_failure).
Phase Improvement Contract:
- Baseline snapshot: evaluator handles deterministic-only kinds.
- Expected delta: live outcomes are machine-checkable via oracle contracts.
- Observed delta: to be filled after phase validation.
Exit criteria:
- Oracle evaluator specs cover deterministic + live kinds.
- Error diagnostics identify failing step, expectation, and observed value.
Goals:
- Integrate live-shadow output into shared scoring and gate pipeline.
- Persist lane-aware usage telemetry in ledger.
Implementation:
- Extend
SimulationRunnerledger payload with:execution_lane,run_scope_id,usage_telemetry.
- Collect usage telemetry from provider responses where available; populate explicit
unknownmarkers where unavailable. - Preserve ADR 0027 gate semantics; apply live-shadow in advisory mode by policy.
- Ensure baseline diff and trend reports include lane dimension.
Phase Improvement Contract:
- Baseline snapshot: ledger is lane-agnostic and telemetry-light.
- Expected delta: lane-aware and telemetry-aware evidence is complete and queryable.
- Observed delta: to be filled after phase validation.
Exit criteria:
100%live-shadow ledger entries include required telemetry keys.- Deterministic lane outputs remain schema-compatible and unchanged in behavior.
Goals:
- Introduce first operational live-shadow packs.
- Keep scope narrow and high-signal.
Implementation:
- Add
calculator-live-shadow-v1pack:- scripted arithmetic/continuity calls,
- deterministic value assertions.
- Add
assistant-live-shadow-v1advisory pack:- continuity follow-up behavior,
- boundary/provenance/error-shape assertions.
- Version and checksum packs under existing scenario-pack structure.
Phase Improvement Contract:
- Baseline snapshot: no live-shadow packs.
- Expected delta: calculator + assistant live-shadow evidence produced consistently.
- Observed delta: to be filled after phase validation.
Exit criteria:
- Both packs run in local advisory mode.
- Pack docs describe scripted steps and oracle intent.
Goals:
- Make dual-lane evidence understandable and operable.
- Provide lane-specific diagnostics and trend views.
Implementation:
- Extend advisory report tooling for lane-split summaries.
- Add operator commands for live-shadow runs and lane-comparison outputs.
- Update documentation:
docs/simulation-readiness.mdlive-shadow runbook,- docs indexes/plan maps,
- UL additions from ADR 0028.
Phase Improvement Contract:
- Baseline snapshot: reports emphasize deterministic lane only.
- Expected delta: operators can distinguish deterministic vs live-shadow regressions quickly.
- Observed delta: to be filled after phase validation.
Exit criteria:
- Lane-split report artifact generated from ledger.
- Runbook includes before/after expectations for live-shadow commands.
Goals:
- Run live-shadow automatically in advisory mode.
- Keep deterministic gating unchanged.
Implementation:
- Keep existing class-1 deterministic CI gate as required merge signal.
- Add live-shadow jobs as advisory artifacts (PR summary + nightly archives).
- Add budget controls (seed count, pack selection) to keep runtime/cost bounded.
Phase Improvement Contract:
- Baseline snapshot: no automated live-shadow advisory runs.
- Expected delta: continuous advisory evidence without gate instability.
- Observed delta: to be filled after phase validation.
Exit criteria:
- CI remains stable with deterministic gating unchanged.
- Nightly publishes lane-split deterministic + live-shadow artifacts.
Goals:
- Complete minimum live-shadow advisory observation window.
- Produce explicit promotion/no-promotion decision artifact.
Implementation:
- Run advisory window (
>= 20runs,>= 5seeds,>= 3days). - Publish decision record documenting:
- stability,
- unresolved risks,
- promotion recommendation.
- Keep promotion manual and explicit.
Phase Improvement Contract:
- Baseline snapshot: no formal live-shadow promotion decision evidence.
- Expected delta: promotion decision is evidence-backed and auditable.
- Observed delta: to be filled after phase validation.
Exit criteria:
- Decision record published under
docs/reports/. - Maintainer decision references explicit thresholds and artifacts.
Execute and archive these validations after each phase implementation:
- Entire Ruby test suite (
bundle exec rspec). - Calculator example run (
runtimes/ruby/examples/calculator.rb) with outcome correctness notes. - Personal assistant run with required prompts:
- top news (Google News, Yahoo! News, NYT),
- action-adventure movies in theaters,
- recipe for Jaffna Kool.
- Log/trace diagnosis for calculator + assistant runs:
- what happened,
- expected vs observed,
- what improved vs did not improve.
- Persist phase report and raw artifacts under dated baseline paths.
- Unit tests:
- pack/schema contract validation,
- isolation scope utilities,
- live oracle evaluators,
- telemetry extraction/mapping.
- Integration tests:
- live-shadow script execution through runtime,
- replay comparison across seeds,
- lane-aware ledger append and report generation.
- Acceptance tests:
- calculator live-shadow pack outcomes,
- assistant live-shadow advisory behavior.
- Regression tests:
- deterministic lane unchanged behavior,
- no cross-run contamination,
- no schema regressions in logs/ledger.
- Isolation leakage risk -> enforce Phase-1 isolation proofs before executor code.
- Deterministic lane regression risk -> keep deterministic lane as control and add blocking regression checks.
- Advisory noise risk -> tighten live pack scripts/oracles before expanding scope.
- Cost/runtime expansion risk -> emit telemetry + apply seed/pack budget caps in CI/nightly.
- ADR 0028 phases 0-8 complete with phase-by-phase validation artifacts.
- Dual-lane evidence is produced in a shared ledger with complete lane + telemetry fields.
- Deterministic class-1 gating remains healthy and unchanged.
- Live-shadow advisory promotion decision is documented and auditable.