ADR-036: Simulation and Replay Architecture

Status

Accepted

Context

SEA-Forge™ requires deterministic “what-if” scenario execution capabilities to:

  1. Validate policy changes before production rollout
  2. Test semantic model changes against historical data
  3. Generate evidence for governance audit trails
  4. Train Pattern Oracle on simulated outcomes

Current state:

Decision

Adopt a Deterministic Simulation Kernel architecture with:

  1. Snapshot Isolation — Simulations operate on immutable snapshots of semantic state
  2. Manifest-Driven Execution — All simulation inputs derive from canonical manifests
  3. Evidence-First Results — Every simulation run produces structured evidence artifacts
  4. Pattern Oracle Integration — Results feed temporal memory for pattern learning

Core Invariants

Architecture Pattern

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
┌─────────────────────────────────────────────────────────────┐
│                    Simulation Kernel                         │
├─────────────────────────────────────────────────────────────┤
│  ┌─────────────┐  ┌─────────────┐  ┌─────────────────────┐  │
│  │ Snapshot    │  │ Scenario    │  │ Execution           │  │
│  │ Manager     │→ │ Parser      │→ │ Engine              │  │
│  └─────────────┘  └─────────────┘  └─────────────────────┘  │
│         │               │                    │               │
│         ▼               ▼                    ▼               │
│  ┌─────────────────────────────────────────────────────────┐│
│  │              Evidence Collector                          ││
│  └─────────────────────────────────────────────────────────┘│
│         │               │                    │               │
│         ▼               ▼                    ▼               │
│  ┌─────────────┐  ┌─────────────┐  ┌─────────────────────┐  │
│  │ SDS-047     │  │ SDS-015     │  │ SDS-030             │  │
│  │ GovernedSpd │  │ Pattern     │  │ Observability       │  │
│  └─────────────┘  │ Oracle      │  └─────────────────────┘  │
│                    └─────────────┘                           │
└─────────────────────────────────────────────────────────────┘

Constraints

  1. MUST use existing manifest schema (REF-011) for simulation inputs
  2. MUST produce evidence compatible with SDS-047 Risk & Evidence
  3. MUST support comparison against production traces from SDS-030
  4. SHOULD leverage NATS JetStream for event replay when applicable (ADR-032)

Consequences

Positive

Negative

Risks

Risk Mitigation
Snapshot drift from production Periodic snapshot refresh + staleness alerts
Simulation/production divergence Confidence scoring + explicit uncertainty bounds
Resource exhaustion from heavy simulations Rate limiting + resource quotas
Type ID Document
ADR ADR-029 Observability Stack Architecture
ADR ADR-032 NATS JetStream Messaging
SDS SDS-015 Temporal Database Service
SDS SDS-030 Semantic Observability
SDS SDS-047 GovernedSpeed™ Governance Runtime
REF REF-011 Manifest Schema

References