What (One-liner)
Library primitive: a single agent runs N RK4 steps of the 4D ODE with optional shock injection and per-step fracture detection. Not in the Canvas picker — wrapped by reflexivity_detector_v1.
How to use
Not a Canvas UI. Access via:
- Python directly:
from services.reflexivity import run_multi_step - REST endpoint:
POST /reflexivity/agent-simulate - Upstream: the
reflexivity_detector_v1Canvas node calls this endpoint to obtain its trajectory
Core formulas
See frontmatter formula. Key points:
- RK4 single step: classic k1/k2/k3/k4 → new state
- Shock semantics: at step=i, the shock is added AFTER the RK4 step (derivatives unchanged)
- Fracture: |w|>5 OR |dw/dt|>2 → warning
Assumptions & applicability
Assumptions: ODE non-stiff + reasonable dt + integer-step shocks + pinned numpy.
Applies to: backend of the reflexivity_detector_v1 Canvas node, paper reproduction, single-agent shock-response analysis.
Does not apply to: Canvas direct use, multi-agent scenarios, fractional-step shocks.
Known limitations
See frontmatter limitations. Seven key items: library primitive / fixed-step RK4 / shock after step / integer step / w_acc is actually first-order |dw/dt| / hard-coded thresholds / final_state.t float drift.
References
- Soros (1987) Alchemy of Finance — reflexivity
- Pangura Research Note 2026-03 (pending) — agent-state specification
Golden Test
tests/golden/fixtures/tier4/reflexivity_agent_simulate/ — numpy_manual (independent numpy RK4 reimplementation), 1e-10 tolerance. 10 tests:
5 Scenarios
- default_no_shocks / with_confidence_shock / multi_shock / long_horizon / fracture_inducing
5 Contract tests
- result_structure / determinism / step_continuity / shock_applied_after_rk4 / fracture_events_match_trajectory
Changelog
- 1.0.0 (2026-04-21) — First Active (Tier 4 batch 2.4)

