code wiki / _hdl_build / nx_vizsla_budget_gate.nx
nx_vizsla_budget_gate.nx
buildroot/runtime/_hdl_build/nx_vizsla_budget_gate.nx
about
nx_vizsla_budget_gate.nx -- VIZSLA V1 gate: the budget ledger is gate-proven
against a HAND-TOTALED fixture month (construction-known sums; the oracle is
arithmetic done by hand in this file's comments, not the module under test).
Fixture store lives under an epoch-unique /tmp prefix => every run starts on
a virgin store AND the module's prefix-derived log keeps fixtures out of the
family ledger log (isolation by construction).
month1 (segid 1001), hand-totaled:
rent 120000 | groceries 4500+6250+3250=14000 | dining 2200+5800=8000 | fun 999
=> total txns=7 spent=142999; env rent=120000 OK(0), groceries=15000 OK(+1000),
dining=7500 OVER(-500); fun UNBUDGETED(-999)
month2 (segid 1002): rent 120000 + groceries 5100 + dining 1500 = 126600
=> ALL: groceries 19100, txns=10, spent=269599
Rows:
1 loud-fail missing txn file => exit 1
2 load-month1 scanned=7 new=7 committed seg-1001
3 hand-totaled groceries row exact + TOTAL txns=7 spent=142999
4 envelope-over dining delta=-500 state=OVER
5 unbudgeted fun named state=UNBUDGETED (never silently dropped)
6 idempotent re-load month1 => new=0 dup_instore=7 segment=none (law 10)
7 additive-month2 month2 lands; ALL report groceries=19100 txns=10
8 TIME-TRAVEL report asof=1001 AFTER month2 == byte-identical pre-month2 report
9 determinism ALL report twice => byte-identical
10 verify-clean CID recompute over 10 entries => verdict=CLEAN exit 0
11 TAMPER-EVIDENCE one flipped byte in seg-1002.docs => verdict=TAMPERED exit 1
Evidence: VIZSLA-BUDGET-GATE line -> stdout + knowledge/status/vizsla_gate.log;
exit 0 iff 11/11.
spec: knowledge/specs/2026-06-10-nishi-vizsla-ladder.md license_tier: ORIGINAL
dependencies 1 imports · 0 importers
imports: nx_syscalls.nx
imported by: nobody (leaf or entry point)
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| none |
functions
| 32 | func bg_slen(s: *u8) -> i64 |
| 38 | func bg_p(s: *u8) -> i64 |
| 43 | func bg_cat(dst: *u8, off: i64, s: *u8) -> i64 called by 1: main |
| 49 | func bg_catn(dst: *u8, off: i64, v: i64) -> i64 |
| 62 | func bg_write(path: *u8, content: *u8) -> i64 |
| 70 | func bg_readall(path: *u8, szout: *i64) -> *u8 |
| 88 | func bg_run(elf: *u8, a1: *u8, a2: *u8, a3: *u8, a4: *u8, outpath: *u8) -> i64 |
| 115 | func bg_has(path: *u8, needle: *u8) -> i64 |
| 134 | func bg_fileeq(p1: *u8, p2: *u8) -> i64 |
| 150 | func bg_flip(path: *u8, fromend: i64) -> i64 |
| 164 | func bg_row(name: *u8, pass: i64) -> i64 |
| 171 | func main(argc: i64, argv: *i64) -> i64 |