Skip to content

Script ​

A bounded-total scripting language in one Canvas node: write custom factors, measures, and signals over whatever the wired upstream nodes produce. let / if / bounded for plus 22 builtins — small enough to learn in an afternoon, bounded enough to audit at a glance.

The complete language reference lives on its own page: Xlang — the formula language. This card covers the node contract and governance.

What (One-liner) ​

A Layer-1 glue node: consume the numeric outputs of any upstream nodes as named series/number inputs, evaluate a user-authored script, emit value / series / signal with full provenance (script source + SHA-256 + version + step count).

Node contract ​

Parameters

  • script (required) — the Xlang script; must declare at least one output.
  • input_map (optional) — one line per input: name = upstream[N].path | path | literal; # comments allowed; N is 0-based. Unmapped inputs bind automatically.

Binding — series inputs bind to wired upstreams in declaration order (first input …: series → first upstream exposing a usable series); number inputs search upstreams by their own name. Multiple series tail-align to the shortest; trimming is recorded and surfaced on the card.

Outputs — value (the Monitor-probe scalar), series (plotted), signal (label), plus meta: steps, eval_ms, xlang_version, script, script_sha256, input_bindings, alignment.

Guarantees ​

  • Total by construction: no while, no recursion, no I/O, no randomness, no clocks — rejected at parse time with teaching messages.
  • Capped: 5,000,000 steps · 20,000-point series · 200,000 allocated elements · 2 s wall clock. Overruns fail honestly, naming the cap.
  • Deterministic: same script + same inputs = same output, always.
  • Twin discipline: the browser dry-run evaluator and the nightly server evaluator are byte-identical, locked by a checksum test.
  • Fail-honest: a failed script shows line/col + source on the card; nightly readings record nodata + reason, never a stale value.

Qibo language desk ​

Qibo drafts scripts from one-sentence briefs and explains existing scripts in plain words. Drafts are verified server-side (parse + synthetic-input dry-run) before display; unverified drafts are never shown; adoption is an explicit user action.

Golden Test ​

tests/golden/fixtures/tier2/xlang_evaluator/ — 30 specification cases against an independent NumPy reference (tolerance 1e-9 absolute, 1e-12 relative), including the three worked examples from the language page, plus cross-lane parity against the platform's own indicator operators (sma 1e-9 full-series, ema 1e-6 tail with the seed-convention gap documented, corr 5e-5) and a coverage guard asserting all 22 builtins are exercised. Passing as of 2026-07-31.

Changelog ​

  • 1.0.0 (2026-07-31) — Initial release: evaluator twins, 22 builtins, engine + Canvas execution, binding/alignment, Qibo draft/explain desk, golden suite.

Verifiable intelligence for the decisions that demand scrutiny.