code wiki / _hdl_build / nx_vizsla_budget.nx

nx_vizsla_budget.nx

buildroot/runtime/_hdl_build/nx_vizsla_budget.nx

21540 B604 linesdepth 6pulls 7 transitivereach 0 importersview sourcekind orphan librarytopic vizsla
docsdependenciesstructsconstsfunctions

about

nx_vizsla_budget.nx -- NISHI VIZSLA V1: the family budget ledger. Fills finance/EDITOR (reconcile) and feeds finance/ARCHITECT (plan) from the V0 gap profile. Storage = the INFOMGMT seg_store substrate (append-only immutable segments, rename(2) commit point, fsync power-loss closure) with nx_canon_cid content addressing -- NO SQL, additive law: money history is never destroyed. Commands (argv[1]): load <txnfile> <prefix> [segid] parse TXN rows -> canonical records -> CID keys "txn:nxc1-..."; a record whose CID already exists in the store is a DUP not a rewrite = IDEMPOTENT RE-LOAD (law 10) by construction. segid defaults to sys_now_us(); the gate passes explicit ids for determinism. report <prefix> <envfile> [asof] per-category sums vs ENV envelopes. asof = max segment id to read (0 or absent = ALL) = TIME-TRAVEL: the ledger exactly as it stood at that commit, reconstructed from history. verify <prefix> recompute every record's CID and compare to its key = TAMPER-EVIDENCE. Any flipped byte names its segment. (no args) report on the durable family store knowledge/vizsla/ledger- with knowledge/vizsla/envelopes.txt. File formats (line records, # comments): TXN <date> <amount_cents> <category> <desc> (amount: digits only -- V1 scope is the expense ledger; credits/income = V1b, flagged not silent) ENV <category> <budget_cents> Determinism: stdout has no clocks; epoch header goes to "<prefix>budget.log" only (log path derived from the store prefix, so gate fixtures in /tmp can never pollute the family log). Loud-fail law: missing files, malformed TXN rows, non-digit amounts = exit 1 with a named reason. EXCEED vs consumer budget apps: additive history + as-of-commit time travel + content-address tamper evidence; none of Mint/YNAB-class tools prove any. spec: knowledge/specs/2026-06-10-nishi-vizsla-ladder.md license_tier: ORIGINAL

dependencies 3 imports · 0 importers

nx_syscalls.nx nx_canon_cid.nx nx_seg_store.nx nx_vizsla_budget.nx

imports: nx_syscalls.nxnx_canon_cid.nxnx_seg_store.nx

imported by: nobody (leaf or entry point)

structs

none

consts

43const K_MAGIC_2048: i64 = 2048
44const K_MAGIC_4096: i64 = 4096
45const K_MAGIC_65536: i64 = 65536

functions

47func vb_slen(s: *u8) -> i64
53func vb_p(s: *u8) -> i64
58func vb_eq(a: *u8, b: *u8) -> i64
69func vb_dup(s: *u8) -> *u8
77func vb_atoi(s: *u8) -> i64
89func vb_digits(s: *u8) -> i64
101func vb_isws(c: i64) -> i64
109func vb_tok(b: *u8, off: i64, lend: i64, dst: *u8, cap: i64) -> i64
131func vb_cat(dst: *u8, off: i64, s: *u8) -> i64
137func vb_catn(dst: *u8, off: i64, v: i64) -> i64
151func vb_find(list: *i64, n: i64, s: *u8) -> i64
161func vb_kmemeq(b: *u8, off: i64, n: i64, s: *u8) -> i64
172func vb_field(rec: *u8, rl: i64, want: *u8, out: *u8, cap: i64) -> i64
200func vb_istxn(b: *u8, koff: i64, kl: i64) -> i64
206func vb_logpath(prefix: *u8, out: *u8) -> i64
215func vb_log(prefix: *u8, tag: *u8, rep: *u8, o: i64) -> i64
235func vb_acc(rec: *u8, rl: i64, st: *i64) -> i64
258func vb_cmd_load(argc: i64, argv: *i64) -> i64
377func vb_cmd_verify(argc: i64, argv: *i64) -> i64
444func vb_cmd_report(prefix: *u8, epath: *u8, asof: i64) -> i64
588func main(argc: i64, argv: *i64) -> i64