Testing bench: credit_spend_front

The credit-spend decider: may this spend proceed? Never in arrears, never beyond the balance, and never beyond the remaining refund-window velocity allowance — so the worst-case fraud loss inside the window is a known number by construction, not a convention. The judgement is the proven Credit_Grant_Pkg.May_Spend; this front is its forged argv shell. Nothing in the portal consumes it yet — that gap is stated on its note, not papered over.

Binary: wired (named by CREDIT_SPEND_DECIDER; the path comes only from the server's environment, never from this page)

Theorems the proven core carries

Run it yourself

Space-separated tokens, at most 8, each at most 32 characters of [A-Za-z0-9_]. Malformed tokens are allowed through on purpose: the front's own refusal of them — exit status 3 — is part of what this bench exists to show you.

The truth table — worked examples, re-runnable

These are the rows the forge's harness graded before this artifact was admitted. Running them here re-executes each one against the wired binary, live, and grades the match in front of you.

Exampleargvexpected stdoutexpected exit
balance covers it, window open — spend proceeds 1000 false 200 500 0 true 0
NO-SPEND-IN-ARREARS — an account in arrears spends nothing 1000 true 200 500 0 false 0
NO-OVERDRAW — amount beyond balance refuses 100 false 200 500 0 false 0
zero balance spends nothing — balance must be positive 0 false 0 500 0 false 0
VELOCITY-BOUNDS-LOSS — 400 exceeds the remaining 300 of the window 1000 false 400 500 200 false 0
velocity edge — exactly the remaining allowance is permitted 1000 false 300 500 200 true 0
EXHAUSTED-WINDOW-SPENDS-NOTHING — one penny past a spent window refuses 1000 false 1 500 500 false 0
honest edge: a ZERO spend is permitted even with an exhausted window (0 <= 0, by construction) 1000 false 0 500 500 true 0
EXHAUSTED-IS-ZERO — drawn past the cap leaves nothing, refuses 1000 false 1 500 600 false 0
malformed number — the front itself refuses (exit 3) banana false 200 500 0 (no output) 3
wrong arity — the front itself refuses (exit 3) 1000 false 200 (no output) 3

The inspector's note

Authored by the seat, 2026-08-13 — grades from evidence, narrated not invented.

Proof inventory — proven

Proof inventory — NOT proven

Open issues — raised, standing until closed

Security checklist — graded from evidence

ItemGradeEvidence
Memory safety by constructioncore: yes, by construction; front shell: not establishedSPARK expression functions over Natural with discharged obligations; the .adb shell is compile-gated Ada
Proof coveragecore: all obligations discharged; front shell: nonegnatprove logs in wu-credit-grant/edge-spend; the shell carries no proof obligations
Fail-closed doors witnessedwitnessed on this bench onlyexit-3 refusals on malformed numbers and wrong arity graded in the 11/11 table and re-runnable here; no production door consults this front yet, so no production refusal has ever been witnessed — the honest limit of the grade
Adversarial passnot yetno adversarial pass recorded — stated, not hidden
Dependency surface0 external modules beyond the GNAT runtimewith-clauses: Ada.Command_Line, Ada.Text_IO, the core package; no third-party code
Provenance chainintactprose spec -> prove logs -> provenance JSONs in wu-credit-grant/edge-spend; unconsumed in production, so the chain ends at delivery rather than at a wired door

The fitting bench

fitting evidence: none yet — no artifact has been fitted to a customer environment

Back to the zone