nx_browser_buyguard.nx
buildroot/runtime/nx_browser_buyguard.nx
about
nx_browser_buyguard.nx -- the Nishi BROWSER's "before you buy" pass, on REAL page HTML (operator: "part
of the nishi browser ... showing what you have vs what it will cost and help with the opportunity costs").
Composes the browser's ACTUAL pipeline organ nx_html_to_text (fetch -> html_to_text -> render): the browser
hands this the page HTML; the pass strips it to text (the real renderer path), finds the price
(px_find_price), runs the grounded purchase-decision engine (nx_purchase: opportunity cost EXACT via
nx_debt), and emits a zero-JS overlay the browser shows -- WHAT YOU HAVE vs WHAT IT TRULY COSTS. Advisory
only (autonomy). No price on the page -> ALLOW + empty overlay (does nothing). license_tier: ORIGINAL
dependencies 7 imports · 2 importers
imports: nx_syscalls.nxnx_money.nxnx_debt_payoff.nxnx_adhd.nxnx_html_to_text.nxnx_price_extract.nxnx_purchase.nx
imported by: nx_browser.nxnx_browser_buyguard_gate.nx
structs
| none |
consts
| 17 | const BGW_AVAIL: i64 = 0 // available discretionary cash (cents) |
| 18 | const BGW_BAL: i64 = 1 // highest-interest debt balance (cents) |
| 19 | const BGW_APR: i64 = 2 // its APR (scaled) |
| 20 | const BGW_PAY: i64 = 3 // monthly payment (cents) |
| 21 | const BGW_WAGE: i64 = 4 // hourly wage (cents) |
| 22 | const BGW_GOAL: i64 = 5 // savings/buffer goal (cents) |
| 23 | const BGW_THRESH: i64 = 6 // impulse pause threshold (cents) |
functions
| 25 | func bgw_cat(out: *u8, off: i64, s: *u8) -> i64 called by 1: bgw_scan |
| 30 | func bgw_n(out: *u8, off: i64, v: i64) -> i64 |
| 38 | func bgw_money(out: *u8, off: i64, cents: i64) -> i64 |
| 53 | func bgw_scan(html: *u8, html_len: i64, prof: *i64, out: *u8, cap: i64) -> i64 called by 2: bgw_injectmain calls 10: sys_mmapnx_html_to_textpx_find_pricepur_interest_savedpur_true_costpur_hours+4 |
| 91 | func bgw_find_body(raw: *u8, raw_len: i64) -> i64 called by 1: bgw_inject |
| 115 | func bgw_inject(raw: *u8, raw_len: i64, prof: *i64, out: *u8, cap: i64) -> i64 |