Weave computes a static cost certificate for a program — its complexity class read from the program's type, before a single step runs. Wired into the box-and-box governance kernel, a program the budget can’t afford is annihilated (0̲) — refused provably, ahead of execution.
The finding
An agent had to pick one of four plans under a fixed budget. The highest-utility plan was a trap: an exponential tower. Weave certified each plan’s cost class statically; the kernel annihilated the unaffordable classes; the survivor ran to a real answer. Then we ran the refused tower anyway — it detonated, vindicating a refusal made with no execution.
How the stack composes
The author writes ordinary-looking Elixir. The analyzer (Weave) reads the IR and certifies cost. The kernel (box-and-box) governs. Execution is the last step — and only for what survived the floor.
fn / fold syntax → Weave IR.End to end · the actual transcript
elixir surface/weave_govern.exs — Elixir surface → Weave certificate →
box-and-box kernel → execution. Every rank below is the real Weave.classify verdict;
the floor decision is real box-and-box; the values are real reductions.
① Weave authors (defweave) + STATICALLY certifies each plan — no execution: sum_small (fold + [1..5]) util= 5 → certificate: rank 1 polynomial sum_big (fold + [1..20]) util= 7 → certificate: rank 1 polynomial pow (c3 c2) util= 9 → certificate: rank 2 exponential blast (c2^5 tower) util=12 → certificate: rank 2 exponential ⚠ a naive utility-maximizer would pick the highest util: "blast" (util 12). ② box-and-box governs the certificate (admit rung ≤ 1; floor-then-gradient): ▸ verdict: sum_big (fold + [1..20]) (margin 2 over runner-up) ranking (affordable, by utility): 7 sum_big (fold + [1..20]) 5 sum_small (fold + [1..5]) annihilated by the floor (0̲): ✗ pow (c3 c2) (raw util 9 → 0̲) σ: cost:exponential@rung2 ✗ blast (c2^5 tower) (raw util 12 → 0̲) σ: cost:exponential@rung2 ledger (closed/conserved): funded 5 → spent 3 on the verdict → 2 remain. ③ The [&] agent RUNS the governed choice — a real answer, cheaply: ▸ sum_big (fold + [1..20]) normal ⇒ 210 (157 interactions) ④ VINDICATION — run the refused, highest-utility plan anyway: ▸ blast (c2^5 tower) 💥 OVER-SPACE — DETONATED after 623 interactions (budget blown). The certificate refused it STATICALLY — Weave never had to run it to know. ══════════════════════════════════════════════════════════════════════ naive agent → 💥 detonation. [&] agent → 210. Cost is a type, and the type decided. ══════════════════════════════════════════════════════════════════════
blast (utility 12).over-space, budget blown.The mechanism
A budget admits a cost class (here: polynomial and below). A program in a higher class isn’t “expensive” — it’s a class the budget can’t price, so it carries an unresolved conflict and the bridge’s floor sends it to 0̲. No utility, however large, resurrects it. This is the same floor pattern box-and-box already uses for forbidden actions.
box-and-box is the eight-rung [&] governance kernel; this demo lives on its resource rung (the affine ledger). box-and-box’s rung is a runtime ledger — “what was spent.” Weave supplies the missing piece: the static certificate — “what can be spent, in what class, with termination guaranteed.”
New · the lego layer
Weave’s certificate is one input to a bigger move: in box-and-box (the [&]
governance kernel, now npm i box-and-box)
a capability is a Brick — a holder, a |> contract, a modal value, a Weave cost
certificate, and CC2 quantities, all in one object. Bricks snap together two ways, and the same
absorbing floor 0̲ you just met keeps every composite honest.
A brick of bricks is a brick.
Run capabilities together. Commutative, idempotent,
identity &none; holders flatten to one provenance set. retrieve & certify
= both, once.
Run capabilities in phase order. Associative, NOT
commutative, identity id; quantities follow the CC2 semiring
(confidence ∏ · cost Σ · latency max).
A backward phase, a type mismatch, an uncertified child, or a cyclic κ collapses the whole composite to 0̲. Utility cannot resurrect a floored branch — exactly the Weave refusal, generalized.
graphonomous ▸ weave ▸ box-and-box composes itself: retrieve, then certify (the Weave
certificate), then govern (floor-then-gradient) — and survives. Swap in an uncertified step and the
pipe floors. The same three rungs that decide a one-shot verdict now decide a composite one.
# the kernel + the compose runtime, one zero-dep package import { Brick, composeAnd, composePipe, ZERO } from "box-and-box/compose"; # a coalition (&) and a pipeline (|>) const team = composeAnd(retrieve, certify); // run together const line = composePipe(retrieve, certify, govern); // run in phase # an uncertified child poisons the composite to the floor composePipe(retrieve, uncertified) === ZERO; // 0̲ ✓
OutcomeSignal (learn) + *.pulse.json (the 5
PULSE phases) so a composite plugs straight into the loop.Proof you can check without running anything
The repo’s proofs/
holds the exact stdout of every script and a by-hand-checkable receipts bundle (finite differences,
column scans, integer equality). If a committed file differs from what you regenerate, the proof
was fabricated. It isn’t.
The honest ledger
Carried into the proof, not buried.
classify’s rank is a validated proxy; EAL upgrades it to a certificate only on the inferable fragment, and abstains elsewhere — never “proven non-elementary.”