code wiki / (root) / nx_ledger_gate.nx

nx_ledger_gate.nx

buildroot/runtime/nx_ledger_gate.nx

8862 B186 linesdepth 8pulls 14 transitivereach 0 importersview sourcekind gate/prooftopic ledger
docsdependenciesstructsconstsfunctions

about

nx_ledger_gate.nx -- F981 INDEPENDENT GATE for the sovereign double-entry ledger. Imports the lib and proves its contract by BEHAVIOUR on a live seg-store plane. ★NON-VACUITY NOTE (stated plainly rather than dressed up): conservation is STRUCTURAL here -- one record carries BOTH legs (dr and cr), so a one-sided entry is INEXPRESSIBLE and a global "drift == 0" assertion would be a TAUTOLOGY. Asserting it alone would be fake rigor. So the measured tests are the ones that CAN fail: * per-account balances summed across every account must total 0 -- this cross-checks the per-account FILTER against global conservation; a broken match would break it. * exact expected deltas (not merely non-zero) -- a sign flip or a wrong field would fail. * every refusal path must refuse AND leave ZERO state change. All assertions are DELTAS against a pre-read baseline, so the gate is re-runnable on a plane that already holds history (append-only = prior runs persist by design). license_tier: ORIGINAL No hw writes (Rule 26). expect_exit: 0

dependencies 1 imports · 0 importers

nx_ledger_lib.nx nx_ledger_gate.nx

imports: nx_ledger_lib.nx

imported by: nobody (leaf or entry point)

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

main lg_id mt_catcopy mt_catn nxi_buf lg_puts led_xfer mt_streq mt_catn ↻ canon_encode sys_mmap nxa_die sys_write sys_exit nxa_lock_take nxa_lock_addr sys_write ↻ nxa_lock_give nxa_lock_addr ↻ nxa_report_overrun sys_write ↻ nxa_dump_printable sys_write ↻ nxa_dump_sizes sys_write ↻ cc_cmp cc_w32 cc_len sys_munmap reg_put reg_put_x sts_lock sts_mm sys_mmap ↻ sts_werr sys_exit ↻ ss_cat sys_openat_append sts_werr ↻ sys_flock

structs

none

consts

18const LG_PFX: i64 = 0

functions

20func lg_puts(s: *u8) -> i64
called by 2: lg_ckmain
26func lg_putn(v: i64) -> i64
called by 2: lg_ckmain
41func lg_ck(cnt: *i64, name: *u8, got: i64, want: i64) -> i64
called by 1: main calls 2: lg_putslg_putn
54func lg_id(tag: *u8, nonce: i64, out: *u8) -> i64
called by 1: main calls 2: mt_catcopymt_catn
61func main(argc: i64, argv: *i64) -> i64