code wiki / _hdl_build / nx_vizsla_bills_register.nx

nx_vizsla_bills_register.nx source

↩ module page · 45 lines · 4095 B

1// nx_vizsla_bills_register.nx -- registers the VIZSLA recurring-bills tracker 2// via the Librarian. ENGINEER evidence = the bills gate re-run from its DURABLE 3// home (12 KAT rows; missing-instrument tamper RED proven). 4// NOTE: build ONCE -- the smoke-run self-registers; do not re-run (LM lesson). 5// license_tier: ORIGINAL 6import "nx_cap_register.nx" 7import "nx_capreg_librarian.nx" 8import "nx_syscalls.nx" 9 10func vbreg_run(path: *u8, a1: *u8) -> i64 { 11 let pid: i64 = sys_fork() 12 if pid == 0 { 13 let dn: i64 = sys_openat_wr("/dev/null" as *u8, 0x1a4) 14 if dn >= 0 { sys_dup3(dn, 1, 0); sys_dup3(dn, 2, 0) } 15 let argv: *i64 = sys_mmap(32) as *i64 16 argv[0] = path as i64 17 var i: i64 = 1 18 if (a1 as i64) != 0 { argv[i] = a1 as i64; i = i + 1 } 19 argv[i] = 0 20 let envp: *i64 = sys_mmap(16) as *i64; envp[0] = 0 21 sys_execve(path, argv, envp); sys_exit(127) 22 } 23 let st: *i64 = sys_mmap(16) as *i64 24 sys_wait4(pid, st, 0) 25 return st[0] 26} 27 28func main() -> i64 { 29 var allok: i64 = 1 30 if vbreg_run("_offc/nx_vizsla_bills_gate.elf" as *u8, "_offc/nx_vizsla_bills.elf" as *u8) != 0 { allok = 0 } 31 cr_w(1, "ENGINEER: vizsla bills gate (12 KAT rows) pass=" as *u8); cr_wn(1, allok); cr_w(1, "\n" as *u8) 32 let eng: i64 = ig_engineer(1, 1, 1, allok) 33 let dec: i64 = ig_decision(eng, ig_council(eng, 1, 1, 2), 1) 34 if dec != IG_INGEST { cr_w(1, "HELD\n" as *u8); sys_exit(1) } 35 if cr_can_register(5, 2, 6, dec) != 1 { cr_w(1, "REFUSED\n" as *u8); sys_exit(1) } 36 let lp: *u8 = "/tmp/nishi_cap_registry.log" as *u8 37 let jp: *u8 = "knowledge/status/cap_registry_durable.log" as *u8 38 let idx: i64 = cl_next_idx(lp, jp) 39 let ok: i64 = cl_register_dual(lp, jp, idx, 5, 40 2, "GEN NISHI-VIZSLA-BILLS RECURRING-PAYABLES-TRACKER (arc=VIZSLA; operator directive 2026-06-14: manage all our bills). V1 budget tracks money HISTORY; nx_vizsla_bills tracks the recurring OBLIGATIONS -- what is due, when, how much, and whether THIS month is paid -- so a bill is never silently missed. Inherits CID-ledger + civil-date substrate from V4 nx_vizsla_relate. THEORY AS DATA bills.txt (CONF soon_days; BILL <id> <payee> <amount_cents> <due_day> MONTHLY <AUTO|MANUAL>; due_day 1..28; only MONTHLY this rung -- other cadences fail loud). load = PAID rows -> NXR1 -> CID bill: keys on seg_store (additive idempotent). status = per bill: paid-THIS-month (a PAID record dated in today's calendar month) -> PAID (next due=next month) else days_until(due_this_month - today): <0 OVERDUE / <=soon DUE / >soon UPCOMING; owed_cents = sum of every UNPAID bill; autopay shown (AUTO=no action). today via argv = deterministic. GATE nx_vizsla_bills_gate 12/12=1000 GREEN sovereign first-compile (loud-fail missing-bills + non-MONTHLY-cadence; load 2 seg-5001; idempotent dup_instore=2; rent PAID next-due 2026-07-01; electric DUE; water OVERDUE; phone UPCOMING; netflix DUE proving paid-this-month is month-SCOPED not last-month; verdict 5/1/1/2/1 owed_cents=24099; DATA-DRIVEN soon_days=14 -> phone DUE due=3 same binary; determinism) + missing-instrument tamper 0/12 RED + re-gated GREEN durable _offc. INTEGRATED into the V5 daily digest (nx_vizsla_digest BILLS_PREFIX+BILLS_FILE -> a BILLS section + bills_due/overdue/owed_cents in the consolidated verdict; digest gate grew 6->9 GREEN). LIVE: knowledge/vizsla/bills.txt + bill_log.txt templates + seeded bills- store + digest.conf wired. EXCEED (honest, feature): consumer bill apps silo reminders from the money ledger; here bills + budget + the relationship/notes brief share ONE additive tamper-evident substrate and surface together daily. Catalog product_catalog.tsv personal-assistant VIZSLA-BILLS; genealogy lineage.tsv nx_vizsla_bills. Blessed _offc/nx_vizsla_bills{,_gate}.elf; spec knowledge/specs/2026-06-10-nishi-vizsla-ladder.md" as *u8) 41 if ok != 1 { cr_w(1, "DUAL-WRITE FAILED\n" as *u8); sys_exit(1) } 42 cr_w(1, "CAPREG idx=" as *u8); cr_wn(1, idx); cr_w(1, " REGISTERED (NISHI VIZSLA recurring-bills tracker)\n" as *u8) 43 sys_exit(0) 44 return 0 45}