code wiki / _hdl_build / nx_vizsla_budget.nx
nx_vizsla_budget.nx
buildroot/runtime/_hdl_build/nx_vizsla_budget.nx
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
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
structs
| none |
consts
| 43 | const K_MAGIC_2048: i64 = 2048 |
| 44 | const K_MAGIC_4096: i64 = 4096 |
| 45 | const K_MAGIC_65536: i64 = 65536 |
functions
| 47 | func vb_slen(s: *u8) -> i64 |
| 53 | func vb_p(s: *u8) -> i64 |
| 58 | func vb_eq(a: *u8, b: *u8) -> i64 |
| 69 | func vb_dup(s: *u8) -> *u8 |
| 77 | func vb_atoi(s: *u8) -> i64 |
| 89 | func vb_digits(s: *u8) -> i64 |
| 101 | func vb_isws(c: i64) -> i64 called by 1: vb_tok |
| 109 | func vb_tok(b: *u8, off: i64, lend: i64, dst: *u8, cap: i64) -> i64 |
| 131 | func vb_cat(dst: *u8, off: i64, s: *u8) -> i64 |
| 137 | func vb_catn(dst: *u8, off: i64, v: i64) -> i64 |
| 151 | func vb_find(list: *i64, n: i64, s: *u8) -> i64 |
| 161 | func vb_kmemeq(b: *u8, off: i64, n: i64, s: *u8) -> i64 |
| 172 | func vb_field(rec: *u8, rl: i64, want: *u8, out: *u8, cap: i64) -> i64 |
| 200 | func vb_istxn(b: *u8, koff: i64, kl: i64) -> i64 |
| 206 | func vb_logpath(prefix: *u8, out: *u8) -> i64 |
| 215 | func vb_log(prefix: *u8, tag: *u8, rep: *u8, o: i64) -> i64 |
| 235 | func vb_acc(rec: *u8, rl: i64, st: *i64) -> i64 |
| 258 | func vb_cmd_load(argc: i64, argv: *i64) -> i64 |
| 377 | func vb_cmd_verify(argc: i64, argv: *i64) -> i64 |
| 444 | func vb_cmd_report(prefix: *u8, epath: *u8, asof: i64) -> i64 |
| 588 | func main(argc: i64, argv: *i64) -> i64 |