code wiki / (root) / nx_purchase_gate.nx

nx_purchase_gate.nx

buildroot/runtime/nx_purchase_gate.nx

4551 B81 linesdepth 5pulls 7 transitivereach 0 importersview sourcekind gate/proof
docsdependenciesstructsconstsfunctions

about

nx_purchase_gate.nx -- R4 GATE: proves the Nishi browser's "before you buy" pipeline end-to-end. A product page -> detect the price -> show WHAT YOU HAVE vs WHAT IT TRULY COSTS + the OPPORTUNITY COST, all exact. Scenario: a $200 gadget while carrying $20,000 of 24% debt ($600/mo), $500 discretionary, $25/hr, $1,000 buffer goal. Exact anchor: putting $200 (or more) on the debt clears interest exactly (R4-gated nx_debt). Exits 0 iff ALL pass. license_tier: ORIGINAL

dependencies 6 imports · 0 importers

nx_syscalls.nx nx_money.nx nx_debt_payoff.nx nx_adhd.nx nx_purchase.nx nx_price_extract.nx nx_purchase_gate.nx

imports: nx_syscalls.nxnx_money.nxnx_debt_payoff.nxnx_adhd.nxnx_purchase.nxnx_price_extract.nx

imported by: nobody (leaf or entry point)

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

main sys_mmap mny_rate_from_pct mny_div_round mny_div_floor chk g_puts sys_write g_putn sys_write ↻ sys_mmap ↻ pur_affordable pur_interest_saved sys_mmap ↻ dbt_payoff_months mny_rate_monthly mny_div_round ↻ mny_apply_rate mny_div_round ↻ mny_add g_puts ↻ g_putn ↻ pur_true_cost mny_add ↻ pur_hours adhd_hours_cost mny_div_round ↻ pur_pct_of_goal adhd_pct_of_goal mny_div_round ↻ pur_recommend adhd_spend_decision slen px_find_price px_parse_at px_dig

structs

none

consts

none

functions

13func g_puts(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 }
called by 2: chkmain calls 1: sys_write
14func g_putn(v: i64) -> i64
called by 2: chkmain calls 2: sys_writesys_mmap
23func chk(name: *u8, got: i64, want: i64, st: *i64) -> i64
called by 1: main calls 2: g_putsg_putn
28func slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
called by 1: main
30func main() -> i64