code wiki / _hdl_build / nx_vizsla_bills.nx

nx_vizsla_bills.nx

buildroot/runtime/_hdl_build/nx_vizsla_bills.nx

21737 B623 linesdepth 6pulls 7 transitivereach 0 importersview sourcekind tooltopic vizsla
docsdependenciesstructsconstsfunctions

about

nx_vizsla_bills.nx -- NISHI VIZSLA: the recurring BILLS / payables tracker. Operator directive 2026-06-14: "manage all our bills". V1 budget tracks money HISTORY; this tracks the recurring OBLIGATIONS -- what is due, when, how much, and whether THIS month is paid -- so a bill is never silently missed. Inherits the CID-ledger / civil-date substrate from V4 (nx_vizsla_relate). THEORY AS DATA (bills.txt): payees, amounts, due-days, autopay are all file content (law 11/25) -- adding/retuning a bill is an edit, never a recompile. Commands (argv[1]): load <bill_log> <prefix> [segid] PAID rows -> canonical records -> CID keys "bill:nxc1-..." on seg_store (additive, idempotent by construction). status <prefix> <bills> <today> per bill: next due date + is THIS month paid -> PAID / UPCOMING / DUE / OVERDUE, + owed_cents for everything unpaid. today via argv = deterministic. File formats (line records, # comments): bills: CONF soon_days <n> BILL <id> <payee> <amount_cents> <due_day> MONTHLY <AUTO|MANUAL> (due_day 1..28; only MONTHLY this rung -- other cadences fail loud) bill_log: PAID <date> <bill-id> <amount_cents> <note> (date YYYY-MM-DD) "Paid this month" = a PAID record for that bill dated in today's calendar month. due_this_month = (today.year, today.month, due_day). state: PAID (paid this month) -> next due = next month else days_until = due_this_month - today: days_until < 0 -> OVERDUE 0 <= days_until <= soon -> DUE days_until > soon -> UPCOMING owed_cents = sum of every UNPAID bill's amount (due+overdue+upcoming) = what you still owe this month. autopay shown (AUTO = no action) but money still counts as owed until recorded paid. Determinism: stdout has no clocks (today via argv). Loud-fail: missing files, cadence != MONTHLY, autopay not AUTO/MANUAL, malformed dates/days = exit 1. EXCEED (honest, feature-class): 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 in the daily digest.

dependencies 3 imports · 0 importers

nx_syscalls.nx nx_canon_cid.nx nx_seg_store.nx nx_vizsla_bills.nx

imports: nx_syscalls.nxnx_canon_cid.nxnx_seg_store.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main bl_p sys_write bl_slen bl_eq bl_cmd_load bl_p ↻ bl_atoi sys_now_us sys_mmap sys_clock_gettime_mono sys_mmap ↻ ss_readall sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_close ss_begin ss_begin_cap sys_mmap ↻ bl_tok bl_isws bl_eq ↻ bl_datedays sys_mmap ↻ canon_encode sys_mmap ↻ cc_cmp cc_w32 cc_len sys_munmap cid_of sys_mmap ↻ sha256_digest sys_mmap ↻ sha256_init sys_mmap ↻ sha256_k sha256_update

structs

none

consts

49const K_MAGIC_1970: i64 = 1970
50const K_MAGIC_146097: i64 = 146097
51const K_MAGIC_719468: i64 = 719468
52const K_MAGIC_4096: i64 = 4096
53const K_MAGIC_2048: i64 = 2048
54const K_MAGIC_65536: i64 = 65536

functions

56func bl_slen(s: *u8) -> i64
called by 3: bl_pbl_dupbl_kmemeq
62func bl_p(s: *u8) -> i64
67func bl_eq(a: *u8, b: *u8) -> i64
78func bl_dup(s: *u8) -> *u8
86func bl_find(list: *i64, n: i64, s: *u8) -> i64
called by 1: bl_cmd_load calls 1: bl_eq
95func bl_atoi(s: *u8) -> i64
106func bl_isws(c: i64) -> i64
called by 1: bl_tok
113func bl_tok(b: *u8, off: i64, lend: i64, dst: *u8, cap: i64) -> i64
called by 2: bl_load_billsbl_cmd_load calls 1: bl_isws
135func bl_cat(dst: *u8, off: i64, s: *u8) -> i64
141func bl_catn(dst: *u8, off: i64, v: i64) -> i64
154func bl_cat2(dst: *u8, off: i64, v: i64) -> i64
called by 1: bl_builddate calls 1: bl_catn
160func bl_kmemeq(b: *u8, off: i64, n: i64, s: *u8) -> i64
called by 2: bl_fieldbl_isbill calls 1: bl_slen
170func bl_field(rec: *u8, rl: i64, want: *u8, out: *u8, cap: i64) -> i64
called by 1: bl_cmd_status calls 2: ss_r32bl_kmemeq
197func bl_isbill(b: *u8, koff: i64, kl: i64) -> i64
called by 1: bl_cmd_status calls 1: bl_kmemeq
203func bl_datedays(s: *u8) -> i64
called by 2: bl_cmd_loadbl_cmd_status calls 1: sys_mmap
245func bl_ym(s: *u8) -> i64
called by 1: bl_cmd_status calls 1: sys_mmap
271func bl_builddate(y: i64, m: i64, d: i64, out: *u8) -> i64
called by 1: bl_cmd_status calls 2: bl_catnbl_cat2
282func bl_log(lpath: *u8, tag: *u8, rep: *u8, o: i64) -> i64
298func bl_prefixlog(prefix: *u8, out: *u8) -> i64
called by 2: bl_cmd_loadbl_cmd_status calls 1: bl_cat
308func bl_load_bills(cpath: *u8) -> *i64
370func bl_cmd_load(argc: i64, argv: *i64) -> i64
479func bl_paid_match(pid: *i64, pym: *i64, npaid: i64, billid: *u8, ym: i64) -> i64
called by 1: bl_cmd_status calls 1: bl_eq
489func bl_cmd_status(argc: i64, argv: *i64) -> i64
616func main(argc: i64, argv: *i64) -> i64