code wiki / _hdl_build / nx_vizsla_bills_gate.nx
nx_vizsla_bills_gate.nx
buildroot/runtime/_hdl_build/nx_vizsla_bills_gate.nx
about
nx_vizsla_bills_gate.nx -- VIZSLA bills gate: the recurring-payables tracker
proven against a HAND-COMPUTED fixture (oracle = this header). No mocks:
drives the real organ over real seg_store PAID records + civil-date math.
bills (soon_days=7): rent $1800 due-1 MANUAL; electric $120 due-15 MANUAL;
netflix $15.99 due-20 AUTO; water $45 due-10 MANUAL; phone $60 due-25 MANUAL.
paid: PAID rent 2026-06-02 (June); PAID netflix 2026-05-20 (MAY, not June).
today=2026-06-14:
rent paid this month -> PAID, next due 2026-07-01
electric due-15 unpaid, 1d off -> DUE (<=soon) owed 12000
netflix due-20 unpaid (May!=Jun)-> DUE (6d) owed 1599
water due-10 unpaid, -4d -> OVERDUE owed 4500
phone due-25 unpaid, 11d>7 -> UPCOMING owed 6000
=> bills=5 paid=1 upcoming=1 due=2 overdue=1 owed_cents=24099
DATA-DRIVEN soon_days=14: phone 11d<=14 -> DUE => due=3 upcoming=0 (owed same).
Rows:
1 loud-fail-missing-bills status on absent file => exit 1
2 loud-fail-bad-cadence a non-MONTHLY bill => malformed => exit 1
3 load-paid scanned=2 new=2 segment=seg-5001
4 idempotent-reload new=0 dup_instore=2 segment=none (law 10)
5 bill-paid rent PAID, next due 2026-07-01
6 bill-due electric DUE due=2026-06-15
7 bill-overdue water OVERDUE
8 bill-upcoming phone UPCOMING
9 paid-this-month-scoped netflix DUE (its PAID was MAY, not June)
10 status-verdict 5/1/1/2/1 owed_cents=24099
11 data-driven-soon-days soon_days=14 => due=3 upcoming=0, same binary
12 status-determinism byte-identical twice
Evidence: VIZSLA-BILL-GATE -> stdout + knowledge/status/vizsla_gate.log; exit 0 iff 12/12.
Tamper: bogus instrument argv[1] => all rows FAIL => RED.
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
| 35 | func rg_slen(s: *u8) -> i64 |
| 41 | func rg_p(s: *u8) -> i64 |
| 46 | func rg_cat(dst: *u8, off: i64, s: *u8) -> i64 called by 1: main |
| 52 | func rg_catn(dst: *u8, off: i64, v: i64) -> i64 |
| 65 | func rg_write(path: *u8, content: *u8) -> i64 |
| 73 | func rg_readall(path: *u8, szout: *i64) -> *u8 |
| 90 | func rg_run(elf: *u8, a1: *u8, a2: *u8, a3: *u8, a4: *u8, outpath: *u8) -> i64 |
| 117 | func rg_has(path: *u8, needle: *u8) -> i64 |
| 136 | func rg_fileeq(p1: *u8, p2: *u8) -> i64 |
| 151 | func rg_row(name: *u8, pass: i64) -> i64 |
| 158 | func main(argc: i64, argv: *i64) -> i64 |