code wiki / _hdl_build / nx_tokroi.nx

nx_tokroi.nx

buildroot/runtime/_hdl_build/nx_tokroi.nx

8037 B166 linesdepth 5pulls 8 transitivereach 0 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

about

nx_tokroi.nx -- TOKEN-EFFICIENCY ROI LEDGER (operator 2026-07-21: 'a plan that X investment reduces Y token use with CLEAR EVIDENCE'). Per lever: reduction_per_use = baseline - after (MEASURED, byte/ tok evidence cited); daily_reduction = reduction * uses_per_day (uses = DECLARED assumption); payback_uses = investment / reduction. status REALIZED (live+measured) vs PROJECTED (built, not yet wired) kept SEPARATE so no fake realized totals. Composes nx_sovjson_lib (sj_*) from birth = OO, dogfoods the shared base. license_tier: ORIGINAL No hw writes (Rule 26). expect_exit: 0 report [roiprefix] -> ROI JSON | selftest [tmpprefix] -> gate T1..T5 tokroi- row = id lever status investment baseline after uses_per_day evidence (8-col plane).

dependencies 5 imports · 0 importers

nx_sovjson_lib.nx nx_store_seed_lib.nx nx_seg_store.nx nx_gate_verdict.nx nx_syscalls.nx nx_tokroi.nx

imports: nx_sovjson_lib.nxnx_store_seed_lib.nxnx_seg_store.nxnx_gate_verdict.nxnx_syscalls.nx

imported by: nobody (leaf or entry point)

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

main sj_werr sys_write sys_exit sj_lit_eq sj_vlen sys_mmap tr_report sys_mmap ↻ sts_load ss_open_cached ssc_init sys_mmap ↻ ssc_sig_of ss_cat sys_fstatat ssc_streq ss_open ss_open2 sys_mmap ↻ ss_manifest_dyn ss_cat ↻ ss_loadfile ss_load_aux2 ssl_total_keys ssl_pow2 ssl_build ss_r32 ssl_lookup ss_manifest_free sys_munmap ssc_retire_handle sts_mm sys_mmap ↻ sts_werr sys_write ↻ sys_exit ↻ ss_hget sys_mmap ↻ ss_idx_find

structs

none

consts

15const TR_CAP: i64 = 1048576
16const TR_OUT: i64 = 16384
17const TR_SPAN: i64 = 16
18const TR_USAGE: i64 = 2
19const TR_ESC: i64 = 90

functions

21func tr_report(prefix: *u8, out: *u8) -> i64
108func tr_selftest(base: *u8) -> i64
138func main(argc: i64, argv: *i64) -> i64