-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathEnginecorev2.1.py
More file actions
35 lines (27 loc) · 1.25 KB
/
Enginecorev2.1.py
File metadata and controls
35 lines (27 loc) · 1.25 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
"""
AAIS Engine Core v2.1 — Race-Car Tuned
======================================
Deterministic, event-sourced, pure-rule workflow engine for AAIS lanes.
Minimal, traceable, and fully replayable.
"""
from __future__ import annotations
import json
from dataclasses import dataclass
from typing import Any, Dict, List, Tuple
# ─────────────────────────────────────────────
# Event Model
# ─────────────────────────────────────────────
@dataclass
class Event:
type: str
payload: Dict[str, Any]
seq: int = 0 # optional sequencing for replay/debugging
# ─────────────────────────────────────────────
# Deterministic State
# ─────────────────────────────────────────────
class DeterministicState:
def __init__(self) -> None:
self.data: Dict[str, Any] = {}
self.events: List[Event] = []
self.seq_counter = 0
def apply(self, event: Event) ->