AOS / Docs

Signal programs

Crucible signal programs describe deterministic causes. A signal is a typed, versioned node in a directed acyclic graph; a binding samples one or more exported nodes and maps their values into a typed fault effect. The same model covers constants, time-varying waveforms, recorded measurements, spatial fields, stochastic processes, and checkpointed state machines.

This guide explains how to choose and compose signals. The exact TOML field catalog remains in the reference, and bindings covers the cause-to-effect bridge.

#Evaluation model

Each [[plan.signal]] row declares:

FieldContract
idUnique stable identity used by downstream inputs and bindings.
domainCoordinate on which the node changes: virtual_time, node_counter, operation, spatial, event, or state.
exportedWhether a binding may consume this node; defaults to true.
value_typeExact shape, including enum schema, event payload, vector scalar, or byte schema where applicable.
unitPhysical unit carried through validation and arithmetic.
scale_decimal_exponentExact decimal scale in -18..=18; default 0.
inputsOrdered upstream IDs. Ordering matters for subtraction, selection, and other noncommutative operators.
kind and kind-specific fieldsOne flattened source, pure specification, or stateful specification.

Stateful rows also require positive state_bytes, their bounded checkpoint allocation. Source and pure rows do not accept it.

Admission rejects missing inputs, cycles, incompatible domains, shapes, units, or operator arity. Evaluation is integer/rational and explicit about rounding and overflow. It does not depend on host floating-point behavior.

Only exported outputs may be consumed by bindings. State, history, stochastic draw positions, and telemetry delay state become part of checkpoints and replay evidence; restoring a checkpoint does not restart a process from its initial state.

#Values, units, and arithmetic policy

The closed value types are bool, i64, u64, ratio, duration_nanos, rate_per_second, probability_millionths, enum, event, vector2, vector3, and bytes. Parameterized shapes must carry the same schema on both sides of an operator. Probability values are integers from 0 through 1,000,000.

Units prevent accidental comparisons such as time against temperature. The catalog includes dimensionless, virtual time, distance/area/velocity, orientation, temperature, electrical power and energy, RF quantities, frequency, rates, ratios, acceleration, and precipitation. See the unit table for canonical names. Use unit_convert for an explicit compatible affine conversion.

Every operation that can discard precision or exceed its representation names its policy:

  • rounding: floor, ceiling, toward_zero, away_from_zero, or nearest_ties_to_even.
  • overflow: error or saturate. error fails the evaluation rather than silently wrapping.
  • interpolation: exact, hold_previous, nearest, or linear; linear carries rounding and overflow policy.
  • boundary behavior: error, hold, constant, repeat, or inactive.
  • missing-sample behavior: error, hold, interpolate, or inactive.

#Source catalog

The 21 source kinds below are the complete version-1 vocabulary.

#Analytic and event sources

KindRequired configurationUse
constantvalueAn immutable typed literal.
stepordered points, beforeA piecewise-constant schedule. Points must be canonical and strictly ordered.
pulsestart, duration, inactive, activeOne exact half-open active interval. Duration is positive.
periodic_pulseepoch, positive period, width, phase, inactive/active valuesRepeating exact intervals; width and phase must fit the period.
rampstart/end coordinates and values, roundingOne exact linear transition.
triangleepoch, period, phase, min/max, roundingA repeating rise-and-fall waveform.
sawtoothepoch, period, phase, min/max, roundingA repeating ramp with an exact reset boundary.
event_sequenceordered eventsTyped events. Same-coordinate ordering is retained and stable.

Use analytic sources when the cause is part of the experiment definition. They are easiest to minimize because every transition is declared directly in the scenario.

#Recorded and telemetry sources

KindRequired configurationUse and constraints
tracenormalized artifact, raw_provenance, channel, interpolation/boundary/missing policies; optional quality and time mappingReplays an imported channel. The normalized object and raw provenance are both retained.
telemetryadapter, target, field, boundary_delay = 1Reads production adapter telemetry one boundary late, preventing an instantaneous feedback loop.

Import recorded data before authoring a trace source. The importer validates ordering, units, quality, interpolation policy, and time mapping and writes a content-addressed normalized artifact. Follow Recorded signals for that workflow. Telemetry fields are adapter-defined and must be supported by the selected target and packaged capability contract.

#Spatial sources

KindRequired configurationUse and constraints
point_setartifact, coordinate frame, interpolation, outside policyIrregular named samples.
regular_gridartifact, frame, origin, positive cell size, dimensions, interpolation, outside policyDense three-dimensional grid.
tiled_gridmanifest, frame, tile size, interpolation, outside policyBounded content-addressed tiles loaded through a manifest.
zone_mapartifact, frame, boundary and overlap policiesPolygon or polyhedron membership.
path_profileartifact, path, interpolation, before/after policiesQuantity indexed by distance along a declared path.
seeded_fieldseed domain, frame, quantization, correlation, distribution and parametersDeterministic correlated field keyed by quantized coordinates.
transmitter_fieldtransmitter, frame, position signal, model, lookup and environment signals; optional orientationCalibrated path loss plus antenna and environmental contributions.

Coordinate frames must match, or be connected by an explicitly declared transform. Outside, boundary, and overlap behavior are never inferred. Spatial artifacts are part of the transitive object closure retained for replay.

#Stochastic sources

KindRequired configurationResult
bernoulliprobability, key domain, optional opportunity filterStable keyed Boolean draw.
uniform_integerinclusive minimum/maximum, key domain, optional filterUnbiased stable keyed integer.
exponential_waitrate, sampler version/table, key domain, optional maximumExact integer inverse-CDF wait.
weibull_waitshape, scale, sampler version/table, key domain, optional maximumExact integer inverse-CDF wait.

The key domain is opportunity, transition, or coordinate. Choose it by the identity that should keep a draw stable: a concrete adapter opportunity, a state transition, or a signal coordinate. Adding an unrelated opportunity must not renumber prior draws. Sampler version and table identities are replay contracts, not tuning hints.

#Pure operators

Pure nodes derive an output only from inputs and coordinates. They have no hidden mutable state. The 36 operators are grouped below by authoring purpose.

FamilyOperatorsImportant rules
Arithmeticadd, subtract, multiply_ratio, divide_ratio, absolute, negate, min, max, clampInputs must have compatible shape/unit. Ratio arithmetic declares exact ratio, rounding, and overflow.
Comparisonequal, not_equal, less, less_equal, greater, greater_equalOrdered comparisons require compatible ordered values and produce Boolean.
Boolean/selectionall, any, not, selectselect uses a Boolean condition and equal-shaped branches.
Transferlookup_step, piecewise_linear, enum_map, unit_convertBreakpoints are strictly ordered; enum mapping is exhaustive; conversions are explicit.
Historydelay, sample_hold, window_min, window_max, window_meanDeclare positive cadence/window and a finite retained-sample limit. Mean declares rounding/overflow.
Spatialdistance, zone_contains, field_sample, orientation_deltaInputs share a coordinate frame; metric/convention is explicit.
Eventsedge_rising, edge_falling, merge_events, gate_eventsEdge operators consume Boolean; merge has a positive source-sequence limit; gating preserves event identity.

The wire specification kind is sometimes broader than the operator name: parameter-free operators use simple; multiplication/division use ratio_arithmetic; all three windows use window. Exact specification fields are in the pure specification table.

#Stateful operators

Stateful nodes own checkpointed state and have explicit bounded work/history.

KindState and behaviorRequired bounds or policy
hysteresisBoolean latch with separate set/clear predicatesInitial value and minimum residence.
debounceCommits an input only after it remains stableInitial value and residence interval.
integratorExact accumulated input over timeInitial value, cadence or change-driven mode, time unit, rounding, overflow.
leaky_integratorFixed-cadence integration with rational decayPositive cadence/time unit, catch-up limit, decay, rounding, overflow.
finite_state_machineClosed states with event, guard, and timer transitionsNonempty states, valid initial state, exhaustive transition policy, unmatched-event policy.
markov_chainExact-probability state transitionsStates, initial state, opportunity identity, rows summing exactly to the probability scale.
burst_processCorrelated two-state good/bad processInitial state, exact transition probabilities, opportunity identity.
counterBounded typed-event countInitial value, maximum, overflow behavior, optional reset event.
queue_modelBounded backlog evolutionPositive capacity, discipline, and overflow behavior.

Finite-state timers use an explicit arm/cancel operation and are represented in checkpoint state. On restore, pending timers retain their declared deadlines and stable ordering.

#Resource limits and admission

Signal resource limits are scenario-owned values capped by compiled hard ceilings. They cover node count, graph edges, depth, exported outputs, state bytes, retained samples/events, spatial artifacts, stochastic tables, and per-evaluation work. Admission computes the complete graph and object closure before a VM starts. A scenario that exceeds a limit fails closed; it is not silently truncated.

Practical authoring rules:

  1. Give every cause a physical type and unit before choosing operators.
  2. Keep source coordinates in the domain that supplies their stable identity.
  3. Declare rounding, overflow, missing, and boundary behavior at every lossy boundary.
  4. Bound history, catch-up, queues, event merges, and search candidates.
  5. Export only nodes that bindings consume or that evidence must retain.
  6. Run admission before a campaign and retain the canonical scenario hash.

#Checkpoints, replay, and evidence

The evaluator checkpoint includes semantic versions, stateful node payloads, retained histories, pending timers, stochastic position/key state, and imported object identities. Restore validates these against the admitted program. A shape, version, graph, object, or state mismatch is a hard error.

The canonical trace records sampled coordinates and digests according to each binding's observability policy. Reproduction artifacts authenticate the transitive signal-object closure, including normalized traces, sampler tables, spatial data, and search mutations. Use Reproduction to resume or replay and Debugging to inspect evaluation evidence.