code wiki / (root) / nx_debt_triple.nx

nx_debt_triple.nx

buildroot/runtime/nx_debt_triple.nx

20193 B478 linesdepth 5pulls 7 transitivereach 0 importersview sourcekind tooltopic debt
docsdependenciesstructsconstsfunctions

about

nx_debt_triple.nx -- THE FEEDER THE SOVEREIGN RANKER LACKS. It maps every OPEN debt row to the (value, momentum, cost) triple nx_dr_ocm consumes, and it holds the position->row_id map that the ranker itself does not carry. Built 2026-09-03 to retire a break-glass laptop script: the ranking DECISION was already sovereign, the feature extraction was not, so the ordering was not reproducible without one seat's scratchpad. WHY A FEEDER AT ALL, AND WHY NOT SEVERITY. Severity on this board is a SELF-DECLARED argv byte, validated only for the range '1'..'9' -- no derivation anywhere. Measured over the board 2026-09-03, eaten-share by declared severity is FLAT AND NON-MONOTONIC across sev4..sev8 (205, 219, 416, 300, 328 permil) which is 2588 of 2846 open rows = 909 permil of the population, separating only at sev9. A severity-ranked drain therefore produces a CONFIDENT MEANINGLESS ORDER. This organ never reads it. THE FEATURES ARE COUNTS OF OTHER ROWS, i.e. investigation cost other seats have ALREADY PAID: VALUE = 1 + min(lane_rows,DT_CLAMP) + min(organ_reach,DT_CLAMP) lane_rows = open rows sharing this row's first scope path segment organ_reach= open rows naming the same nx_ organ this row names MOMENTUM = freshness bucket of the LANE's newest row id (ids are epochs): <=7d 7, <=30d 5, <=60d 3, else 1 COST = DT_COST_BASE, minus DT_CHEAP_STEP per self-carried remedy marker (a row that names its own fix is cheap to work), plus DT_DEAR_STEP per expense marker, clamped to [1,DT_CLAMP] ★THE SATURATION GUARD IS THE POINT, AND IT WAS EARNED THE HARD WAY. A first cut of this feeder split the scope on '_' so every nx_* scope collapsed to the token "nx": lane_rows read 147 on nearly every row and momentum then sat at ONE VALUE for 830 permil of the board. A RANKER FED A SATURATED FEATURE RETURNS A CONFIDENT ORDER BUILT ON NOISE, and nothing downstream can tell. So this organ MEASURES each feature's mode share and REFUSES to emit ranker arguments when any feature ties a strict majority. THE BAR IS DERIVED, NOT PICKED: at >500 permil one value holds more than half the population, so the feature cannot order a majority against itself. That is a property of ordering, not a taste. nx_debt_triple emit [debt-prefix] -> one TSV row per open debt + saturation + envelope nx_debt_triple args <budget> <n> [debt-prefix] -> "<budget> v m c ..." for nx_dr_ocm, + the pos->id map nx_debt_triple selftest -> teeth, exit 0 GREEN / 1 RED Exit: 0 ok | 1 SATURATED (args refused) | 2 usage | 3 UNREADABLE plane. verdict= is the last token. license_tier: ORIGINAL. Reads the debt plane and writes only stdout. No hw writes (Rule 26).

dependencies 3 imports · 0 importers

nx_syscalls.nx nx_rowparse_lib.nx nx_store_seed_lib.nx nx_debt_triple.nx

imports: nx_syscalls.nxnx_rowparse_lib.nxnx_store_seed_lib.nx

imported by: nobody (leaf or entry point)

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

main rp_lit_eq rp_slen rp_slen ↻ sys_write sys_exit rp_num 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 ↻ rp_put rp_slen ↻ rp_le rp_col_tab rp_col dt_lane_end dt_cost dt_find_ci rp_slen ↻ dt_mode_permil rp_putn sys_mmap ↻ sts_load_fit sts_mm sys_mmap ↻ sts_werr sys_write ↻ sys_exit ↻

structs

none

consts

38const DT_EXIT_OK: i64 = 0
39const DT_EXIT_SAT: i64 = 1
40const DT_EXIT_USAGE: i64 = 2
41const DT_EXIT_UNREAD: i64 = 3
42const DT_SPAN: i64 = 8
43const DT_OUT: i64 = 1048576
44const DT_MAXROWS: i64 = 8192
45const DT_TAB: i64 = 9
46const DT_NL: i64 = 10
47const DT_CLAMP: i64 = 40
48const DT_COST_BASE: i64 = 10
49const DT_CHEAP_STEP: i64 = 2
50const DT_DEAR_STEP: i64 = 4
51const DT_COST_MIN: i64 = 1
53const DT_SAT_PERMIL: i64 = 500
54const DT_PERMIL: i64 = 1000
55const DT_DAY: i64 = 86400
56const DT_M_FRESH: i64 = 7
57const DT_M_WARM: i64 = 5
58const DT_M_COOL: i64 = 3
59const DT_M_COLD: i64 = 1
60const DT_D_FRESH: i64 = 7
61const DT_D_WARM: i64 = 30
62const DT_D_COOL: i64 = 60
63const DT_STATE_COL: i64 = 3
64const DT_SCOPE_COL: i64 = 5
65const DT_BIGPOP: i64 = 500
66const DT_BIGPOP_STEP: i64 = 3

functions

70func dt_find_ci(b: *u8, s: i64, e: i64, lit: *u8) -> i64
called by 2: dt_organdt_cost calls 1: rp_slen
90func dt_lane_end(b: *u8, s: i64, l: i64) -> i64
called by 1: main
100func dt_lane_eq(b: *u8, a_s: i64, a_l: i64, c_s: i64, c_l: i64) -> i64
called by 1: main
111func dt_organ(b: *u8, s: i64, e: i64, out: *i64) -> i64
called by 1: main calls 1: dt_find_ci
130func dt_cost(b: *u8, s: i64, e: i64) -> i64
called by 1: main calls 1: dt_find_ci
167func dt_mode_permil(a: *i64, n: i64) -> i64
called by 1: main
184func main(argc: i64, argv: **u8) -> i64