Skip to content

Engine Updates

Track the evolution of Identity OS's behavioral runtime engine.


v4.0 — SelfModel + IdentityAdapter (Current)

Latest Release

This is the current production engine. View benchmark data →

Released: March 2026

What Changed

  • SelfModel — Higher-order self-knowledge: stress_resilience (EMA of recovery speed), trait_stability (EMA from drift magnitude). Computed via SelfModelLayer implementing MemoryLayer[SelfModel].
  • IdentityAdapter — Translates self-model into behavioral adjustments:
    • Path A: Low resilience → restrict risky actions at MED stress
    • Path B: Low resilience → override decision_style to risk=averse, tempo=measured
  • 5 capability fixes — All previously untriggered mechanisms now active:
    • Stress sensitivity: OVER threshold + LR dampening for experienced agents
    • Energy conservation: partial floor during STRESS state
    • Adapter threshold: 0.35 → 0.45 (covers natural resilience distribution)
    • trait_stability → drift D0 threshold (stable agents detect smaller deviations)
  • self_model_context on ExecutionContract — 4 signals exposed to consumers.

How stress_resilience Works

stress_entered (cycle 20) → stress_exited (cycle 60) → duration = 40 cycles
  → resilience_score = 0.5^(40/50) = 0.57 (exponential decay, halflife=50)
  → EMA update: new_resilience = old * 0.7 + score * 0.3

Two-episode validation:

After episode 1 (long recovery):  resilience = 0.455  ("I'm not very resilient")
After episode 2 (long recovery):  resilience = 0.411  ("confirmed, I recover slowly")

Version Comparison (320-cycle scenario)

Version          Act C1  Act C2  Delta  Comfort C2  Risk      Self-Model
v3.1 engine       4.08    4.12  +0.04      0%       moderate    —
v3.3 +feedback    4.08    4.32  +0.24      8%       moderate    —
v4.0b +adapter    4.08    4.32  +0.24      8%       averse     resilience=0.402

Numbers

Metric v3.4 v4.0
Self-model fields 5 (2 active, 1 placeholder, 2 bookkeeping)
Identity adapter paths 2 (Path A: actions, Path B: style)
Mechanisms triggering in benchmark 1/5 5/5
v3.1→v4.0b action delta improvement +0.04 +0.24 (6x)
Tests passing 506 542

v3.4 — CycleRecord Architecture

Released: March 2026

What Changed

  • CycleRecord — Frozen Pydantic model (13 fields, 5 convenience properties) capturing one cycle's raw input + derived signals in a single immutable struct. Assembled in the service layer from previous_state + new_state + drift_result.
  • MemoryLayer Protocol — Generic Protocol[T] with update(current: T, record: CycleRecord) -> T interface. run_memory_layers() composes layers sequentially.
  • Feature-gatedCYCLE_RECORD_ENABLED = False (default). Zero overhead when disabled. ProcessResult.cycle_record is None.
  • Zero behavioral change — Pure infrastructure. All 488 v3.3 tests pass unchanged + 18 new CycleRecord tests.

Architecture

engine.process(state, observation)
    └── return (new_state, drift_result)
    ════════════╪══════════ service layer ══════════
    service._build_cycle_record()  ← assembles once per cycle
                └── ProcessResult.cycle_record: Optional[CycleRecord]
                    future: EpisodicMemoryLayer ─────┤  (Phase 2)
                    future: NarrativeMemoryLayer ────┤
                    future: SelfModelLayer ──────────┘

Numbers

Metric v3.3 v3.4
CycleRecord fields 13 fields, 5 properties
MemoryLayer protocol Generic Protocol[T]
Behavioral change Feedback loop None (infrastructure)
Tests passing 488 506

v3.3 — Memory Feedback Loop

Released: March 2026

What Changed

  • Memory→Pipeline feedback loop — Memory data from previous cycles now adjusts pipeline parameters in the current cycle. Three feedback mechanisms:
    1. Stress sensitivity: Agents with 2+ prior stress spikes detect HIGH stress earlier (lowered threshold)
    2. Energy conservation: Agents that experienced near-depletion maintain a higher energy floor
    3. Recovery learning: Agents that recovered from stress preserve COMFORT action under HIGH stress
  • Y3 validated: First experimental proof that memory produces measurable behavioral adaptation. Experienced agents show wider action space (avg 4.2 vs 4.0 actions) during second crisis compared to memory-less agents.
  • Feature-gated: MEMORY_FEEDBACK_ENABLED = True (default). When disabled, all v3.2 behavior is preserved.

Architecture

Pipeline reads state.memory_summary (from previous cycle):
  state_machine.py → effective_high = HIGH_THRESHOLD + memory_adjustment
  energy.py        → effective_floor = ENERGY_FLOOR + memory_adjustment
  output.py        → COMFORT preserved if recovery learning active

Numbers

Metric v3.2 v3.3
Y3 Group B→C behavioral delta 0 (no difference) avg_actions +0.07
Feedback mechanisms 0 3 (stress, energy, recovery)
Memory signals 14 (read-only) 14 (read-write feedback)
Tests passing 467 488
All v3.2 behavior (FEEDBACK_ENABLED=False) Baseline Identical

Significance

v3.3 closes the fundamental gap identified in v3.2: memory was append-only telemetry, not a feedback loop. This is the first version where an agent's past experience changes its future behavior through deterministic parameter adjustment, not LLM prompting.


v3.2 — Episodic Memory

Released: March 2026

What Changed

  • Episodic Memory (MemorySummary) — Zero-query, incremental memory updated every cycle from in-memory state only. Tracks stress history, drift patterns, energy trends, and behavioral patterns across the full session lifetime.
  • memory_context on ExecutionContract — New optional output field exposing 14 memory-derived signals: spike counts, drift recency, energy trend, dominant mode, and a behavioral pattern classifier (stable, sustained_stress, recurring_stress, active_drift, mode_locked, volatile, energy_depleted).
  • Feature-gatedF6Config.MEMORY_ENABLED = True (default). When disabled, all v3.1 behavior is 100% preserved with zero overhead.
  • Persistencememory_summary stored as Optional JSONB in EngineState. Survives save/load cycles and version rollback (disable → enable resumes from last state).

Architecture

Observation → Mode EMA → Energy → State → Arbitration → Composite → Drift → Stability → Memory → Contract
                                                                                   MemorySummary
                                                                                   (pure arithmetic,
                                                                                    ~15 fields, <20μs)

Memory Signals

Signal Description
stress_spike_count Total LOW/MED→HIGH/OVER transitions
avg_spike_interval EMA of cycles between consecutive spikes
current_stress_streak Consecutive cycles at HIGH/OVER (0 if calm)
max_stress_streak Longest observed stress streak
d1_recent / d2_recent Decayed D1/D2 event counters (~100-cycle window)
turns_since_last_d2 Cycles since most recent D2+ event
energy_trend EMA of energy level (long-term direction)
energy_min_observed Lowest energy ever observed
dominant_mode Current EMA dominant mode name
dominant_mode_streak Consecutive cycles with same dominant
mode_switches_recent Decayed EMA mode switch counter
behavioral_pattern Classified pattern label

Numbers

Metric v3.1 v3.2
All v3.1 behavior (MEMORY_ENABLED=False) Baseline Identical
memory_context on contract N/A 14 signals
Behavioral pattern classification N/A 7 patterns
Per-cycle overhead (memory enabled) 0 <20μs
Per-cycle overhead (memory disabled) 0 0 (single bool check)
Tests passing 454 467

Known Limitations (v3.2.0)

  • Spike detection only counts LOW/MED→HIGH/OVER transitions; re-escalation during sustained stress is not captured (fix in v3.2.1)
  • Mode switch counter uses EMA dominant, not input mode_target — rapid input cycling may not register as volatility (fix in v3.2.1)

v3.1 — Stress Recovery & Action Restriction

Released: March 2026

What Changed

  • HIGH-level action restriction — Risky actions (execute, challenge, explore, pivot) are now removed when stress reaches HIGH, not just OVER. Reduces risky exposure under sustained pressure.
  • Conditional stress bleed-off — STRESS_RESPONSE mode only bleeds during calm input at HIGH/OVER, preventing premature recovery while preserving the exit path.
  • Stress spike safety improved to 98% risky action blocking during active stress periods.

Numbers

Metric v3.0 v3.1
Stress risky exposure (spike) Unrestricted at HIGH 0% (100% blocked)
Recovery score (spike) 0.79 0.44 (trade-off for tighter safety)
Steady state Unchanged Unchanged

v3.0 — Post-Stress Recovery & Energy Floor

Released: March 2026

What Changed

  • Post-stress mode recovery — After stress exits, suppressed modes are nudged back above activation threshold so the action space widens within 10 cycles instead of 50+.
  • STRESS_RESPONSE learning rate boost (4.5x) — The engine detects stress signals faster when they arrive intermixed with other modes.
  • Energy floor (0.20) — Non-stress states maintain a minimum energy reserve, preventing long sessions from draining to zero under normal multi-mode operation.

Numbers

Metric v2.0 v3.0
Recovery score (stress spike) 0.00 0.79
Gradual shift final energy 0.00 0.20
Gradual shift turns below critical 132 0
Steady state energy 1.0 1.0 (unchanged)

v2.0 — Drift Detection Overhaul

Released: March 2026

What Changed

  • Delayed drift anchor — Anchor initialization waits until after EMA warm-up (20 cycles), eliminating cold-start false positives.
  • Adaptive anchor refresh — Anchor only refreshes when drift magnitude is below D0 threshold, preventing anchor resets during active drift.
  • L2-normalized drift magnitude — Switched from average absolute deviation to L2 norm, making the system sensitive to single-mode spikes.
  • Recalibrated thresholds — D0=0.08, D1=0.24, D2=0.40 (tuned against 1,200 adversarial turns).
  • Lowered energy cost — Active mode cost reduced from 0.05 to 0.02, fixing steady-state energy drain.

Numbers

Metric v1.0 v2.0
Steady state false drift alerts 16 D1 + 1 D2 0
Gradual shift drift detection 15 D1 only 50 D1 + 131 D2
Chaotic drift detection 64 D1 only 133 D1 + 133 D2
Steady state energy drain Dropped to 0.0 Maintained at 1.0
Steady state turns below critical 284 0

v1.0 — Initial Release

Released: March 2026

The foundational engine with:

  • 7-mode EMA activation (Perception, Exploration, Order, Assertion, Connection, Identity, Stress Response)
  • 4-level stress model (LOW → MED → HIGH → OVER)
  • Drift detection with D0-D3 classification and auto-rollback on D3
  • Energy management with cost/recovery dynamics
  • ExecutionContract output with allowed/forbidden actions, decision style, hard locks
  • 192/192 forbidden action blocking across all scenarios

Baseline Numbers

Metric v1.0
Forbidden action blocking 192/192 (100%)
Throughput 594 cycles/sec
Automated tests 433 passing
Steady state drift false positives 16 D1 + 1 D2 (cold-start issue)
Steady state energy Drained to 0.0 over 300 turns

Version Summary

v1.0 v2.0 v3.0 v3.1 v3.2 v3.3 v3.4 v4.0
Forbidden blocking 192/192 192/192 192/192 192/192 192/192 192/192 192/192 192/192
Drift false positives (steady) 17 0 0 0 0 0 0 0
Drift events detected (chaotic) 64 266 266 266 266 266 266 266
Steady state energy 0.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0
Episodic memory 14 signals 14 signals 14 signals 14 signals
Memory feedback 3 mechanisms 3 mechanisms 3 mechanisms
Self-model resilience + stability
Identity adapter Path A + B
Mechanisms active in benchmark 4 4 5 5 5 5 5 9
Tests passing 433 444 448 454 467 488 506 542

Design Principles (All Versions)

  1. Zero-copy pipeline — Each stage receives state, mutates copy, returns. No shared mutable state.
  2. Feature gating — New capabilities gated behind config booleans. Disabled = zero overhead.
  3. Backward compatibility — All existing tests must pass unchanged on every version bump.
  4. No I/O in hot path — The engine pipeline (process()) never hits disk or network.
  5. Deterministic — Same input + same state = same output. No randomness in the pipeline.

Benchmark Infrastructure

Benchmark What It Measures Script
Baseline Comparison Identity OS vs static action filter across 4 scenarios benchmark/run_baseline_comparison.py
6-Baseline Guardrails Identity OS vs 5 alternative architectures (B0-B5) benchmark/run_guardrails_comparison.py
Drift Ground Truth Precision/recall/F1 of drift detection across 5 scenarios benchmark/run_drift_ground_truth.py
Product/UX Audit 79-check quality audit (API, edge cases, perf, DX) benchmark/run_product_ux_test.py

Latest Aggregate Scores (v3.2)

System Safety Utility Adaptivity Overall
B0 NoGuardrails 0.300 0.975 0.000 0.413
B1 StaticFilter 0.700 0.925 0.000 0.557
B2 ThresholdGating 0.829 0.918 0.091 0.635
B3 ClassifierGuard 0.935 0.651 0.201 0.629
B4 PolicyDSL 0.952 0.604 0.094 0.590
B5 Identity OS 0.925 0.494 0.578 0.692
Drift Detection Value
Aggregate Precision 0.712
Aggregate Recall 0.942
Aggregate F1 0.811