Effects, C99 Sandbox, Quotas & Trace Replay
Conservative MIR effect auditing (wysna explain), compiled C99 runtime capability guards (--sandbox), deterministic execution quotas (W4004), and offline effect trace replay.
Wysna ships explicit execution governance primitives so you can audit what a program touches, constrain its runtime capabilities and resource budgets, and reproduce I/O deterministically offline.
1. Static Transitive Effect Analysis (wysna explain)
Section titled “1. Static Transitive Effect Analysis (wysna explain)”wysna explain lowers source through verified MIR (without running the program or loading external libraries) and computes a conservative fixed point of direct and transitive effects (wysna.effect-report/1, wysna.effects-model/1):
wysna explain src/main.wysnawysna explain src/main.wysna --function sync_batch --output-format=json-v1wysna explain src/main.wysna --manifest wysna.toml --frozenCapability Taxonomy
Section titled “Capability Taxonomy”| Effects | Capability Name |
|---|---|
stdio.write |
stdio |
arguments.read |
arguments |
environment.read |
environment |
clock.read |
clock |
filesystem.read |
filesystem.read |
filesystem.write |
filesystem.write |
network.http |
network |
process.spawn, process.wait |
processes |
process.exit |
process-control |
ffi.native |
native-ffi |
| Unresolved call / external FFI | unknown (complete_within_model: false) |
2. Safety Facts (wysna.safety-facts/1) & Capability Policy Gates ([W5006])
Section titled “2. Safety Facts (wysna.safety-facts/1) & Capability Policy Gates ([W5006])”-
Machine-readable safety summary (
wysna check):Terminal window wysna check --output-format=json-v1 src/main.wysnaReturns a top-level
safety_factsobject (schema_version: "wysna.safety-facts/1") across Seed, Selfhost, Native SDK, and MCPwysna_checkreportingmemory_model("arc+cow"),checked,capabilities,untrusted_externs,arc_cycles(W6002),contracts(verifiedrequires/ensures), and optionalpolicyverification status. -
Explicit capability gates on
check(Seed, Native SDK & MCP):Terminal window wysna check --deny=filesystem.read,network src/main.wysna --output-format=json-v1wysna check --allow=stdio,arguments src/main.wysnaOr in MCP
wysna_check, passallow_capabilities/deny_capabilities. Violations fail closed with[W5006]and populatesafety_facts.policy(passed: false,violations: [...]). -
Interpreted pre-execution gate (Seed):
Terminal window wysna run --deny=network,processes src/main.wysnawysna run --allow=stdio,filesystem.read src/main.wysnaConservatively refuses execution with
[W5006]if the program violates the policy or ifcomplete_within_modelisfalse. -
Compiled C99 runtime sandbox guards (Seed):
Terminal window wysna build --sandbox --deny=network,processes src/main.wysna -o appwysna emit-c --sandbox --allow=stdio,filesystem.read src/main.wysna -o app.cEmits
#define WYSNA_DENY_CAP_*guards into the compiled C99 runtime ABI so disallowed host operations trap immediately with[W5006].
3. Deterministic Execution Quotas ([W4004])
Section titled “3. Deterministic Execution Quotas ([W4004])”Bound instruction steps and heap allocation budgets to prevent runaway loops or memory exhaustion in automated pipelines:
# Via CLI flagswysna run --max-steps=1000000 --max-heap-mb=32 src/main.wysna
# In compiled native binaries via environment variablesWYSNA_MAX_STEPS=500000 WYSNA_MAX_HEAP_BYTES=16777216 ./appExceeding either budget terminates execution deterministically with [W4004].
4. Offline Effect Cassette Replay (wysna.effect.trace/1)
Section titled “4. Offline Effect Cassette Replay (wysna.effect.trace/1)”Record external I/O (HTTP responses, wall clock, filesystem reads) during a live run and replay bit-identically offline in CI without network access:
# Record external effectswysna run --record-trace=trace.json src/sync.wysna
# Replay bit-identically offlinewysna run --replay-trace=trace.json src/sync.wysna