[Evaluation map]

How AXIS runs Pine: Flask Pro API, Worker proxy, in-browser Pyodide. AXIS does not import PyneTS and does not place HOOX orders.

Evaluation map

Abstract

AXIS is a charting PWA, not a language rewrite. Every Pine evaluation goes through an engine plugin. Built-ins are server (HTTP/WS to PYNE) and pyodide (in-browser Python wheel). Optional HOOX pyne-worker is just another Backend URL.

AXIS does not import @hoox-sh/pynets. AXIS does not call trade-worker. Drawing a strategy on the chart is research, not execution.

Conceptual model

Interface surface

PathImplementationNotes
Engine serversrc/engines/catalog.tsPrefer WS ws(s)://{endpoint}/ws/run (preferWs default true), else POST {endpoint}/run?mode= with { script, data, mode, inputs?, profiler?, libraries? }. Modes interpret | compile | auto. Timeout scales with bar count (45–180s). Default endpoint http://localhost:5002. Strategy HPO uses POST {endpoint}/optimize.
Engine pyodidesame fileSelf-hosted Pyodide 0.26.2 (/pyodide/v0.26.2/), wheels /vendor/pynescript-0.3.7-py3-none-any.whl + antlr4, runtime /pyodide/pynescript_runtime.py. Numba is not in Wasm; compile / auto is object-mode. Cold load ~20–30s.
AXIS Worker /api/runworker/src/runtime.tsPYODIDE_IN_WORKER=enabled scaffold; else proxy EXTERNAL_BACKEND/run; else 503 NO_BACKEND. Caps: 512 KiB script, 50k bars, 30 req/min/IP, 60s upstream.
HOOX pyne-workersrc/workers/catalog.tsNot a built-in engine. Paste origin as Backend URL. Distinct from the AXIS Worker (pynescript-axis).
PyneTSTypeScript library. PYNE docs. Not referenced in AXIS source.

Payloads follow the PYNE evaluate contract. Defaults: Flask POST /run uses mode auto. See modes.

Internals

PathRole
src/engines/catalog.tsserver + pyodide
src/workers/catalog.tsRuntimes Hub entries
worker/src/runtime.tsEdge /api/run
public/pyodide/Wasm runtime + wheel
scripts/sync-pyne-wheel.shRefresh vendored wheel

Invariants & edge cases

  1. AXIS ≠ engine (ADR-002). The shell never embeds a closed interpreter.
  2. AXIS ≠ execution. Strategy events on the Results panel are not HOOX orders. See AXIS and HOOX.
  3. No none stream plugin in src/streams/catalog.ts. Pausing live data is stopLive(), not a plugin id.
  4. Pyodide wheel version can lag PyPI (0.3.7 wheel vs hoox-pyne 0.3.9). Check vendor/.
  5. CORS: Worker allows localhost, *.hoox.sh, *.pynescript.ai, *.pynescript.online, *.pynescript-axis.pages.dev only.

Worked examples

Local desk

# terminal 1 — PYNE Pro API
cd pynescript && make run    # :5002

# terminal 2 — AXIS
cd axis && bun run dev

Manager → engine server, Backend URL http://localhost:5002.

Offline

Switch engine to pyodide. First run downloads/caches the self-hosted runtime. Do not expect Numba.

Edge proxy

Deploy AXIS Worker with EXTERNAL_BACKEND pointing at Flask or pyne-worker. Engine stays server; endpoint is the Worker origin. Still no trade-worker hop unless that backend forwards events.

Failure modes

SymptomCauseFix
503 NO_BACKENDWorker has no EXTERNAL_BACKEND and Pyodide-in-worker offSet backend or use browser Pyodide
Compile "slow / different" in PyodideNo NumbaUse Flask for numeric compile
Expecting pynets in the PWANot wiredImport @hoox-sh/pynets in your own app
Strategy PnL on chart, no CEX fillAXIS does not executepyne-worker live trading

See also