pub enum Stmt<'a> {
Show 86 variants
Let {
var: Symbol,
ty: Option<&'a TypeExpr<'a>>,
value: &'a Expr<'a>,
mutable: bool,
},
Set {
target: Symbol,
value: &'a Expr<'a>,
},
Swap {
a: Symbol,
b: Symbol,
},
Call {
function: Symbol,
args: Vec<&'a Expr<'a>>,
},
If {
cond: &'a Expr<'a>,
then_block: Block<'a>,
else_block: Option<Block<'a>>,
},
While {
cond: &'a Expr<'a>,
body: Block<'a>,
decreasing: Option<&'a Expr<'a>>,
},
Repeat {
pattern: Pattern,
iterable: &'a Expr<'a>,
body: Block<'a>,
},
Return {
value: Option<&'a Expr<'a>>,
},
Break,
Assert {
proposition: &'a LogicExpr<'a>,
},
Trust {
proposition: &'a LogicExpr<'a>,
justification: Symbol,
},
RuntimeAssert {
condition: &'a Expr<'a>,
hard: bool,
dim: Option<Dimension>,
reason: Option<&'a Expr<'a>>,
},
Fail {
reason: &'a Expr<'a>,
},
Give {
object: &'a Expr<'a>,
recipient: &'a Expr<'a>,
},
Show {
object: &'a Expr<'a>,
recipient: &'a Expr<'a>,
},
SetField {
object: &'a Expr<'a>,
field: Symbol,
value: &'a Expr<'a>,
},
StructDef {
name: Symbol,
fields: Vec<(Symbol, Symbol, bool)>,
is_portable: bool,
},
FunctionDef {
name: Symbol,
generics: Vec<Symbol>,
params: Vec<(Symbol, &'a TypeExpr<'a>)>,
body: Block<'a>,
return_type: Option<&'a TypeExpr<'a>>,
is_native: bool,
native_path: Option<Symbol>,
is_exported: bool,
export_target: Option<Symbol>,
opt_flags: OptimizationConfig,
},
TestDef {
name: Symbol,
skip: Option<Symbol>,
capabilities: TestCapabilities,
budget: Option<u64>,
cases: Option<CaseTable<'a>>,
body: Block<'a>,
},
Expect {
condition: &'a Expr<'a>,
},
ExpectFail {
message: Option<Symbol>,
body: Block<'a>,
},
ExpectOutput {
expected: ExpectedOutput,
},
AdvanceTime {
millis: &'a Expr<'a>,
},
GivenFile {
path: Symbol,
content: Symbol,
},
Observe {
category: ObsCategory,
message: Symbol,
payloads: Vec<(Symbol, &'a Expr<'a>)>,
sample: Option<u64>,
},
During {
label: Symbol,
body: Block<'a>,
},
ForAll {
vars: Vec<Symbol>,
domain: PropDomain,
constraint: Option<&'a Expr<'a>>,
body: Block<'a>,
},
Inspect {
target: &'a Expr<'a>,
arms: Vec<MatchArm<'a>>,
has_otherwise: bool,
},
Push {
value: &'a Expr<'a>,
collection: &'a Expr<'a>,
},
Pop {
collection: &'a Expr<'a>,
into: Option<Symbol>,
},
Add {
value: &'a Expr<'a>,
collection: &'a Expr<'a>,
},
Remove {
value: &'a Expr<'a>,
collection: &'a Expr<'a>,
},
SetIndex {
collection: &'a Expr<'a>,
index: &'a Expr<'a>,
value: &'a Expr<'a>,
},
Splice {
body: Block<'a>,
},
Reversibly {
body: Block<'a>,
},
Zone {
name: Symbol,
capacity: Option<usize>,
source_file: Option<ZoneSource>,
body: Block<'a>,
},
Concurrent {
tasks: Block<'a>,
},
Parallel {
tasks: Block<'a>,
},
ReadFrom {
var: Symbol,
source: ReadSource<'a>,
},
WriteFile {
content: &'a Expr<'a>,
path: &'a Expr<'a>,
},
Spawn {
agent_type: Symbol,
name: Symbol,
},
SendMessage {
message: &'a Expr<'a>,
destination: &'a Expr<'a>,
compression: Option<CompressionCodec>,
cached: bool,
unchecked: bool,
layout: Option<SendLayout>,
shared: bool,
computed: bool,
indexed: bool,
deduped: bool,
unreliable: bool,
},
AwaitMessage {
source: &'a Expr<'a>,
into: Symbol,
view: bool,
stream: bool,
},
StreamMessage {
values: &'a Expr<'a>,
destination: &'a Expr<'a>,
},
MergeCrdt {
source: &'a Expr<'a>,
target: &'a Expr<'a>,
},
JoinCrdt {
source: &'a Expr<'a>,
target: &'a Expr<'a>,
},
IncreaseCrdt {
object: &'a Expr<'a>,
field: Symbol,
amount: &'a Expr<'a>,
},
DecreaseCrdt {
object: &'a Expr<'a>,
field: Symbol,
amount: &'a Expr<'a>,
},
AppendToSequence {
sequence: &'a Expr<'a>,
value: &'a Expr<'a>,
},
ResolveConflict {
object: &'a Expr<'a>,
field: Symbol,
value: &'a Expr<'a>,
},
Check {
subject: Symbol,
predicate: Symbol,
is_capability: bool,
object: Option<Symbol>,
source_text: String,
span: Span,
},
Listen {
address: &'a Expr<'a>,
secure: Option<SecurePad<'a>>,
},
Serve {
port: &'a Expr<'a>,
handler: &'a Expr<'a>,
},
ConnectTo {
address: &'a Expr<'a>,
secure: Option<SecurePad<'a>>,
},
LetPeerAgent {
var: Symbol,
address: &'a Expr<'a>,
},
Sleep {
milliseconds: &'a Expr<'a>,
},
Sync {
var: Symbol,
topic: &'a Expr<'a>,
},
Ui(UiStmt<'a>),
Fetch {
method: FetchMethod,
url: &'a Expr<'a>,
body: Option<&'a Expr<'a>>,
as_type: &'a TypeExpr<'a>,
then: Symbol,
},
Replay {
actions: Vec<Symbol>,
},
ServeFetches,
GivenFetch {
method: Symbol,
url: &'a Expr<'a>,
status: &'a Expr<'a>,
body: &'a Expr<'a>,
},
ComponentDef(Box<ComponentDef<'a>>),
DirectiveDef {
name: Symbol,
params: Vec<(Symbol, &'a TypeExpr<'a>)>,
body: Block<'a>,
removed: Option<Block<'a>>,
},
RouteDef {
method: Symbol,
path: Symbol,
params: Vec<(Symbol, &'a TypeExpr<'a>)>,
return_type: Option<&'a TypeExpr<'a>>,
body: Box<RouteBody<'a>>,
span: Span,
},
MiddlewareDef {
param: (Symbol, &'a TypeExpr<'a>),
body: Block<'a>,
},
RedirectDef {
from: Symbol,
to: Symbol,
},
Mount {
var: Symbol,
path: &'a Expr<'a>,
},
LaunchTask {
function: Symbol,
args: Vec<&'a Expr<'a>>,
},
LaunchTaskWithHandle {
handle: Symbol,
function: Symbol,
args: Vec<&'a Expr<'a>>,
},
CreatePipe {
var: Symbol,
element_type: Symbol,
capacity: Option<u32>,
},
SendPipe {
value: &'a Expr<'a>,
pipe: &'a Expr<'a>,
},
ReceivePipe {
var: Symbol,
pipe: &'a Expr<'a>,
},
TrySendPipe {
value: &'a Expr<'a>,
pipe: &'a Expr<'a>,
result: Option<Symbol>,
},
TryReceivePipe {
var: Symbol,
pipe: &'a Expr<'a>,
},
StopTask {
handle: &'a Expr<'a>,
},
CloseChannel {
channel: &'a Expr<'a>,
},
AwaitTask {
handle: &'a Expr<'a>,
result: Option<Symbol>,
},
Select {
branches: Vec<SelectBranch<'a>>,
},
Theorem(TheoremBlock<'a>),
Definition(DefinitionBlock<'a>),
Axiom(AxiomBlock),
Theory(TheoryBlock),
Escape {
language: Symbol,
code: Symbol,
span: Span,
},
Require {
crate_name: Symbol,
version: Symbol,
features: Vec<Symbol>,
span: Span,
},
Site(u32),
}Variants§
Let
Variable binding: Let x be 5. or Let x: Int be 5.
Set
Mutation: Set x to 10.
Swap
Reversible register exchange: Swap x and y. — the canonical ZERO-GARBAGE reversible
primitive (Op::RevSwap, its own inverse), the first LOGOS surface that emits the abelian
reversible ISA. Exchanges the two variables’ values with no history-tape cost.
Call
Function call as statement: Call process with data.
If
Conditional: If condition: ... Otherwise: ...
While
Loop: While condition: ... or While condition (decreasing expr): ...
Fields
Repeat
Iteration: Repeat for x in list: ... or Repeat for i from 1 to 10: ...
Return
Return: Return x. or Return.
Break
Break: Break. — exits the innermost while loop.
Assert
Bridge to Logic Kernel: Assert that P.
Trust
Documented assertion with justification.
Trust that P because "reason".
Semantics: Documented runtime check that could be verified statically.
RuntimeAssert
Runtime assertion with imperative condition.
Assert that condition. (hard: false → debug_assert!, a development check)
Require that condition. (hard: true → assert!, an enforced invariant that
survives release — the form a proven property lowers to).
dim is the physical dimension of a range contract whose literal quantity bounds the
parser folded to SI magnitudes (Assume v is between 0.2 volts and 0.7 volts.) —
metadata for static consumers (the analog lane); None for ordinary conditions.
reason is the , otherwise <text> clause: why the contract exists, reported verbatim when
it breaks and evaluated ONLY then. None reports Assertion failed.
Fail
Fail with <reason>. — raise an error. With no Result to return it into and no Try:
region around it, the program stops with reason as its report.
Give
Ownership transfer (move): Give x to processor.
Semantics: Move ownership of object to recipient.
Show
Immutable borrow: Show x to console.
Semantics: Immutable borrow of object passed to recipient.
SetField
Field mutation: Set p's x to 10.
StructDef
Struct definition for codegen.
FunctionDef
Function definition.
Fields
generics: Vec<Symbol>Generic type parameters: empty for monomorphic functions, e.g. [T, U] for polymorphic.
native_path: Option<Symbol>Rust path for user-defined native functions (e.g., “reqwest::blocking::get”). None for system native functions (read, write, etc.) which use map_native_function().
export_target: Option<Symbol>Export target: None = C ABI (#[no_mangle] extern “C”), Some(“wasm”) = #[wasm_bindgen].
opt_flags: OptimizationConfigPer-function optimization config: each ## No <X> annotation clears
that optimization’s bit (default: all enabled).
TestDef
A ## Test: <prose sentence> block — an independent test entry point.
The prose name is the
test’s identity everywhere; duplicates in a module are a parse error.
Ignored by normal execution; collected by the largo test runner.
Fields
capabilities: TestCapabilitiesCapability sentences granting real-world access (sealed by default).
Expect
Test-only assertion: Expect that <condition>. — records the failure
and CONTINUES (a test reports every failed expectation, not just the
first). Refused outside ## Test/## Example blocks.
ExpectFail
Expect this to fail [with "<message>"]: — the only error-expectation
form; the test FAILS if the block succeeds.
ExpectOutput
Expect output: — byte-exact stdout snapshot (in-document or golden file).
Fields
expected: ExpectedOutputAdvanceTime
Advance time by <duration>. — moves the sealed world’s virtual clock
(test-only; the statement that makes every timeout test instant).
GivenFile
Given a file "<path>" containing "<content>". — pre-seeds the sealed
world’s in-memory filesystem (test-only).
Observe
An observation statement: `Note/Warn/Record that and ]`. The that-clause is
captured as the rendered `message`; payloads are the named values that
travel with the event. Legal anywhere; emission is Wave 7.
Fields
category: ObsCategoryDuring
During <gerund>: — a lexical trace span (no imperative start/stop, so
a span can never leak). The body is ordinary code.
Fields
ForAll
For all <domain> <vars> [where <cond>]: — a property test.
The runner generates seeded
cases, binds the vars, runs the body, and shrinks any counterexample.
Test-only (like Expect).
Fields
domain: PropDomainInspect
Pattern matching on sum types.
Push
Push to collection: Push x to items.
Pop
Pop from collection: Pop from items. or Pop from items into y.
Add
Add to set: Add x to set.
Remove
Remove from set: Remove x from set.
SetIndex
Index assignment: Set item N of X to Y.
Splice
A SCOPE-TRANSPARENT statement sequence — parser-desugar output, never
written by users. One surface statement can lower to several primitive
statements (a nested place-write Set item j of (item i of grid) to v
becomes read → copy-on-write element write → write-back; a multi-push
Push a, b, c to xs becomes one Push per element). The body runs in
the ENCLOSING scope with no block of its own: temporaries inside are
gensym’d (__place_*), so they can never collide with user names, and
engines that execute blocks with scoping must NOT scope this one.
Reversibly
A REVERSIBLE / UNCOMPUTE block: Reversibly: (alias Uncompute:) introducing an
indented body. Semantically TRANSPARENT — the body runs in the enclosing scope and
produces byte-identical OUTPUT to the same statements outside the block. The only
difference is the LOWERING: an IN-PLACE ABELIAN scalar update inside the body compiles
to the zero-garbage reversible ISA (Op::RevAdd/RevSub/RevXor/RevNeg) instead of
the plain journaling op, so Vm::run_reverse can undo the whole region with NO history
tape (the adiabatic charge-recovery contract). Recognized in-place forms — where x is a
local and e provably never observes x:
Set x to x + e → RevAdd, Set x to x - e → RevSub,
Set x to x xor e → RevXor, Set x to -x → RevNeg.
Anything else in the body lowers exactly as it would outside the block.
Zone
Memory arena block (Zone). “Inside a new zone called ‘Scratch’:” “Inside a zone called ‘Buffer’ of size 1 MB:” “Inside a zone called ‘Data’ mapped from ‘file.bin’:”
Fields
source_file: Option<ZoneSource>Optional backing file for memory-mapped zones (literal path or runtime variable)
Concurrent
Concurrent execution block (async, I/O-bound). “Attempt all of the following:” Semantics: All tasks run concurrently via tokio::join! Best for: network requests, file I/O, waiting operations
Parallel
Parallel execution block (CPU-bound). “Simultaneously:” Semantics: True parallelism via rayon::join or thread::spawn Best for: computation, data processing, number crunching
ReadFrom
Read from console or file.
Read input from the console. or Read data from file "path.txt".
WriteFile
Write to file.
Write "content" to file "output.txt".
Spawn
Spawn an agent.
Spawn a Worker called "w1".
SendMessage
Send message to agent.
Send Ping to "agent"., Send compressed Ping to "agent".,
Send cached Point to "agent"., or Send cached compressed Report to "agent".
Fields
compression: Option<CompressionCodec>The wire compression codec. None for a plain Send; Some(codec) for
Send compressed [with <codec>] (bare compressed = deflate). Kept only
if it actually shrinks the body.
cached: boolSend cached … — use the connection’s schema dictionary, so a struct
schema is transmitted once and referenced thereafter (content-addressed,
footgun-free). false for a plain Send.
unchecked: boolSend unchecked … — drop the wire integrity checksum for the fastest path
(latency↔safety dial). false keeps the default checksum.
layout: Option<SendLayout>Send fast|compact|packed … — the wire LAYOUT (size↔speed dial). None is
the default (compact / varint). The sender picks for their link.
Send shared … — OPT-IN type-id elision: drop struct/enum NAMES off the wire
(ship a small registry id both ends derive from their shared program type
defs). Only safe when the receiver runs the same program, so it is OFF by
default — the default Send stays self-describing for any peer / relay.
computed: boolSend computed f … — COMPUTE-SHIPPING: when the message is a pure single-arg
function, lower it to a sandboxed generator and ship the COMPUTATION, not data.
The receiver evaluates it in the bounded sandbox (never arbitrary code). OFF by
default; a non-lowerable function under computed is rejected at send.
indexed: boolSend indexed … (alias addressable) — encode a record list in the random-access
struct-view LAYOUT (row + field offset tables), so the receiver reaches any
(row, field) in O(1) without decoding the rest — Cap’n Proto’s home turf. Composes
with the other knobs (compressed, cached, shared, unchecked). OFF by default
(the dense columnar form is smaller); opt in when the peer does random field reads.
deduped: boolSend deduped … — Rc-DEDUP: a subtree the same value reaches more than once ships ONCE
(the first occurrence) plus a tiny backref for every repeat, and the receiver rebuilds the
SHARING (one aliased value, not N copies). OFF by default; opt in when the message has
shared sub-structure (a lookup table referenced by many records, one object aliased
across the payload). Self-describing by tag, so any peer decodes it.
AwaitMessage
Await response from agent.
Await response from "agent" into result.
Fields
StreamMessage
Stream a batch of values to a peer in one framed message.
Stream readings to "sink". — frames each element of values length-delimited so the
receiver (Await stream from …) deframes them incrementally; one relay publish ships the
whole batch (Kafka-style streaming that amortizes per-message overhead).
MergeCrdt
Merge CRDT state.
Merge remote into local. or Merge remote's field into local's field.
JoinCrdt
Converge CRDT state by the IDEMPOTENT lattice join — the sibling of Stmt::MergeCrdt.
Converge remote into local. A bare-Int field takes per-field MAX (not ADD), so applying a
redelivered state twice equals applying it once; counter/other fields defer to the same rule as
Merge (already idempotent / last-writer-wins).
IncreaseCrdt
Increment GCounter.
Increase local's points by 10.
DecreaseCrdt
Decrement PNCounter (Tally).
Decrease game's score by 5.
AppendToSequence
Append to SharedSequence (RGA).
Append "Hello" to doc's lines.
ResolveConflict
Resolve MVRegister conflicts.
Resolve page's title to "Final".
Check
Security check - mandatory runtime guard.
Check that user is admin.
Check that user can publish the document.
Semantics: NEVER optimized out. Panics if condition is false.
Fields
Listen
Listen on network address.
Listen on "/ip4/127.0.0.1/tcp/8000".
Semantics: Bind to address, start accepting connections via libp2p
Fields
Serve
Serve HTTP requests on a port with a handler function.
Serve on port 8080 with handleRequest.
Semantics: bind an HTTP server on the port and, per request, invoke the
handler (a Request -> Response function) and write back its response.
ConnectTo
Connect to remote peer.
Connect to "/ip4/127.0.0.1/tcp/8000".
Semantics: Dial peer via libp2p
Fields
LetPeerAgent
Create PeerAgent remote handle.
Let remote be a PeerAgent at "/ip4/127.0.0.1/tcp/8000".
Semantics: Create handle for remote agent communication
Sleep
Sleep for milliseconds.
Sleep 1000. or Sleep delay.
Semantics: Pause execution for N milliseconds (async)
Sync
Sync CRDT variable on topic.
Sync x on "topic".
Semantics: Subscribe to GossipSub topic, auto-publish on mutation, auto-merge on receive
Ui(UiStmt<'a>)
One of the English things a component action DOES: an element verb, navigation,
persistence, feedback, a store call, or a timer (UiStmt). First-class: every tier
implements it natively rather than receiving a desugared builtin call.
Fetch
A typed request: Get URL as T, then action. / Post <body> to URL as T, then action.
The completion action receives Result of T and HttpError — the decode is derived from
as_type, and a non-2xx status becomes the Err side. No implicit retry.
Fields
method: FetchMethodReplay
Replay these actions: a, b, c. — re-run a sequence of the page’s actions, in order.
The journal’s reason for existing: a bug report becomes a test by naming the actions that produced it, and the dev panel’s time travel is this with a slider on it. Each one is a REAL TURN — it rolls back if it traps, it is journalled, and the page repaints — because a replay that bypassed the turn machinery would reproduce a different bug from the one being investigated.
ServeFetches
Serve fetches with routes. — answer the page’s requests from the program’s OWN routes.
The full-stack loop with no network: a Get "/api/todo" is answered by the matching
## Route, through the derived encoder on the way out and the derived decoder on the way
back. That round trip is the only thing that can catch the two halves of the wire
contract drifting apart — a stub answers with whatever the test author typed, which
agrees with itself no matter what the encoder does.
A DECISION a test makes, never a default: a page whose fetches were silently answered by the local route table would pass tests that a deployed page fails, because in a browser nothing local answers anything.
GivenFetch
Given that METHOD "/url" answers STATUS with BODY. — how a test answers a fetch.
The sealed-world rule the rest of the suite follows: a page test must not depend on a network, and a page whose data never arrives is a page that proves nothing. Matched by method AND url together, because a stub that answered the wrong request is how a test ends up proving something nobody asked for.
ComponentDef(Box<ComponentDef<'a>>)
An LGX page / component / store / error page — the component model, first-class
(see crate::ast::component). Every tier implements it natively.
DirectiveDef
## Directive name (el: Element) and (value: T): — a custom attribute behavior:
body runs when the attribute appears on an element and whenever its value changes;
removed (a When removed: block) runs when the element leaves.
Fields
RouteDef
## Route METHOD /path (params) -> T: — a typed HTTP route.
Fields
body: Box<RouteBody<'a>>★ BOXED, AND THE REASON IS THE WHOLE NODE’S SIZE. RouteBody is 88 bytes, which made
RouteDef 144 — the single widest Stmt variant, and therefore the size of EVERY Stmt.
compiler_stack_safety_lock::ast_nodes_stay_small holds the node to 128 bytes because the
compiler walk keeps many per frame, so widening it multiplies stack use across every tier.
A route’s body is the rare payload and does not belong inline; ComponentDef next door is
boxed for the same reason.
MiddlewareDef
## Before each request (request: Request) -> Option of Response: — middleware.
RedirectDef
## Redirect /from -> /to.
Mount
Mount persistent CRDT from journal file.
Mount counter at "data/counter.journal".
Semantics: Load or create journal, replay operations to reconstruct state
Fields
LaunchTask
Launch a fire-and-forget task (green thread).
Launch a task to process(data).
Semantics: tokio::spawn with no handle capture
LaunchTaskWithHandle
Launch a task with handle for control.
Let worker be Launch a task to process(data).
Semantics: tokio::spawn returning JoinHandle
Fields
CreatePipe
Create a bounded channel (pipe).
Let jobs be a new Pipe of Int.
Semantics: tokio::sync::mpsc::channel(32)
Fields
SendPipe
Blocking send into pipe.
Send value into pipe.
Semantics: pipe_tx.send(value).await
ReceivePipe
Blocking receive from pipe.
Receive x from pipe.
Semantics: let x = pipe_rx.recv().await
TrySendPipe
Non-blocking send (try).
Try to send value into pipe.
Semantics: pipe_tx.try_send(value) - returns immediately
Fields
TryReceivePipe
Non-blocking receive (try).
Try to receive x from pipe.
Semantics: pipe_rx.try_recv() - returns Option
Fields
StopTask
Cancel a spawned task.
Stop worker.
Semantics: handle.abort()
CloseChannel
Close a channel (pipe).
Close ch. or Close the pipe ch.
Semantics: mark the channel closed so pending/future receivers wake with the
closed signal (Op::ChanClose). Buffered values stay receivable; a later send
is the error. The deterministic-scheduler sibling of Stop for tasks.
AwaitTask
Await a spawned task handle’s completion.
Await worker. or Wait for worker. (optionally … into result).
Semantics: park until the task finishes, taking its result (Op::TaskAwait).
The join sibling of Stop (which cancels) — this waits for and observes the
child’s completion.
Fields
Select
Select on multiple channels/timeouts.
Await the first of:
Receive x from ch:
...
After 5 seconds:
...
Semantics: tokio::select! with auto-cancel
Fields
branches: Vec<SelectBranch<'a>>The branches to select from
Theorem(TheoremBlock<'a>)
Theorem block.
## Theorem: Name
Given: Premise.
Prove: Goal.
Proof: Auto.
Definition(DefinitionBlock<'a>)
## Define block — a vernacular-logic predicate definition (Rung 0a).
x is a bachelor if and only if x is unmarried and x is a man.
Non-executable: like Stmt::Theorem, it is a declaration the proof
layer consumes, not code the VM/AOT runs.
Axiom(AxiomBlock)
## Axiom block — a named first-order axiom in formal notation. Registers a
shared premise for later theorems (the seam for an axiomatic base like Tarski).
Theory(TheoryBlock)
## Theory block — a named development grouping formal axioms and theorems.
Escape
Escape hatch: embed raw foreign code.
Escape to Rust: followed by an indented block of raw code.
Variables from the enclosing LOGOS scope are available in the
escape block as their generated Rust types. The raw code is
emitted verbatim inside a { ... } block in the generated Rust.
Fields
Require
Dependency declaration from ## Requires block.
The “serde” crate version “1.0” with features “derive”.
Site(u32)
★ A RUNTIME FAILURE-SITE MARKER (Wave 3: “runtime failures carry a location”) — no Stmt
variant carries a span (this one included: its OWN payload is an opaque id, not a span), so
a trap deep inside an action’s body has never been able to say WHERE in the source it
happened. This is the fix, and it is a MARKER rather than a span field on every Stmt
variant on purpose: giving every variant a span is a schema change touching every
constructor and every exhaustive match in the workspace for a span most of them never need
(a Let inside a ## Main that never fails costs nothing to leave unmarked). A Site(id)
is inserted as its OWN statement, immediately before the sentence it marks, by
Parser::parse_indented_block whenever Parser::site_tracking names a component and
action — so it travels through the ordinary statement pipeline into every backend’s own
compiled form (bytecode, wasm, C, …) exactly like any other statement, which a parse-time-
only side table (Parser::stmt_spans) cannot: that table is gone by the time a COMPILED
program traps at runtime, and stmt_spans covers only top-level statements besides.
id indexes Parser::failure_sites (built as each marker is inserted) for the
(file, span, component, action) it names. Every backend that runs a Stmt must accept
this variant in an EXPLICIT arm, not a wildcard — this file’s own doc history is full of
wildcard arms that silently swallowed a case nobody noticed was reachable; a backend with
nothing to do here yet says so by name (Stmt::Site(_) => {} or equivalent), so the day it
DOES need to do something, the compiler — not a bug report — is what tells whoever adds a
new backend that this one still needs it. The tree-walker’s job with it is the simplest one
there is: current site = id (FailureSite’s own doc comment says why this is enough for a
location); every OTHER backend, not yet given a reason to do more, ignores it explicitly and
moves on.