code wiki / (root) / nx_browser_buyguard.nx

nx_browser_buyguard.nx

buildroot/runtime/nx_browser_buyguard.nx

6557 B136 linesdepth 5pulls 9 transitivereach 4 importersview sourcekind librarytopic browser
docsdependenciesstructsconstsfunctions

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

nx_syscalls.nx nx_money.nx nx_debt_payoff.nx nx_adhd.nx nx_html_to_text.nx nx_price_extract.nx nx_purchase.nx nx_browser_buyguard.nx nx_browser.nx nx_browser_buyguard_gate.nx

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

17const BGW_AVAIL: i64 = 0 // available discretionary cash (cents)
18const BGW_BAL: i64 = 1 // highest-interest debt balance (cents)
19const BGW_APR: i64 = 2 // its APR (scaled)
20const BGW_PAY: i64 = 3 // monthly payment (cents)
21const BGW_WAGE: i64 = 4 // hourly wage (cents)
22const BGW_GOAL: i64 = 5 // savings/buffer goal (cents)
23const BGW_THRESH: i64 = 6 // impulse pause threshold (cents)

functions

25func bgw_cat(out: *u8, off: i64, s: *u8) -> i64
called by 1: bgw_scan
30func bgw_n(out: *u8, off: i64, v: i64) -> i64
called by 2: bgw_moneybgw_scan calls 1: sys_mmap
38func bgw_money(out: *u8, off: i64, cents: i64) -> i64
called by 1: bgw_scan calls 1: bgw_n
53func bgw_scan(html: *u8, html_len: i64, prof: *i64, out: *u8, cap: i64) -> i64
91func bgw_find_body(raw: *u8, raw_len: i64) -> i64
called by 1: bgw_inject
115func bgw_inject(raw: *u8, raw_len: i64, prof: *i64, out: *u8, cap: i64) -> i64