Skip to main content

Module context

Module context 

Source
Expand description

Context state nodes: non-deterministic, session-scoped values.

These nodes produce values from the execution environment rather than the coordinate space. They break the deterministic model and should be used deliberately.

SRD-80b Phase E migration. All authoring goes through #[polydat_node]. Three shapes appear here:

  • Pure clock / OS reads (current_epoch_millis, thread_id) — plain body, marked Nondeterministic.
  • Construction-frozen captures (session_start_millis, elapsed_millis, tmp_dir, env_or) — use #[poly_const(setup_fn, from = ())] (or from = <const_arg> when the capture depends on a const) to compute the cached value once at construction. The body just reads the cache.
  • Fallible construction (env) — body returns Result<String, String>. The macro emits try_new and propagates Err as a workload-compile error via the build closure.

Structs§

Counter
Monotonic counter (non-deterministic). SRD-80 PR B.11 migration.
CurrentEpochMillis
Current wall-clock time in epoch milliseconds.
CursorLimit
Cursor limit node: passes through the input value unchanged.
ElapsedMillis
Elapsed milliseconds since session start.
Env
Environment variable read, frozen at construction.
EnvOr
Environment variable read with default, frozen at construction.
SessionStartMillis
Session start time in epoch milliseconds, frozen at construction.
ThreadId
Current OS thread numeric identifier.
TmpDir
System temp directory, frozen at construction.

Functions§

signatures
Signature for the cursor-limit passthrough.