Batch 13 of expansion-v2. Makes the global-dynamics/control engine reachable
from the CLI and the hosted API, and adds a verified end-to-end scenario.
crates/lawsynth-cli: new `lyapunov` (spectrum + KY dimension + chaos flag),
`basins` (attractors + basin fractions + escaped/undetermined), `network`
(directed coupling edge list), and `mpc` (regulate to a setpoint) commands —
all with --json and honest caveats (lyapunov time-averaged; basins fixed-point
attractors only; network correlational-not-causal; mpc successive-linearization
LQR). 135 lib + 9 new integration tests.
python/lawsynth-server: POST /v1/worlds/{id}/analysis/stability mirroring the
simulations resource (auth scope, idempotency key, events). Reaches the engine
the same way the SDK does (native build_world -> save -> CLI-backed stability),
not re-implemented. Honest cases: inconclusive kept, empty box is 200, bad
request 422, engine-absent 503, engine-failure 5xx. 36 passed / 5 skipped
(engine absent), 39 passed with the engine.
examples/20-stability-and-forecast: verified scenario — a conservative oscillator
discovered, then stability finds a center (inconclusive) that invariants explains
via H = 0.25·imbalance² + mid², then forecast. Real captured output; matches the
gallery format; pytest examples 21/21. Honest that bifurcation/sensitivity need
declared parameters.
13 lines
347 B
Python
13 lines
347 B
Python
#!/usr/bin/env python3
|
|
"""simulate workflow for Frictionless order book."""
|
|
from pathlib import Path
|
|
import sys
|
|
|
|
EXAMPLES = Path(__file__).resolve().parents[1]
|
|
if str(EXAMPLES) not in sys.path:
|
|
sys.path.insert(0, str(EXAMPLES))
|
|
from _workflow import cli
|
|
|
|
if __name__ == "__main__":
|
|
raise SystemExit(cli("simulate", Path(__file__).parent))
|