code wiki / (root) / nx_extllm_lib.nx

nx_extllm_lib.nx

buildroot/runtime/nx_extllm_lib.nx

13085 B292 linesdepth 3pulls 3 transitivereach 3 importersview sourcekind librarytopic extllm
docsdependenciesstructsconstsfunctions

about

nx_extllm_lib.nx -- THE EGRESS DECISION LIBRARY: may THESE BYTES leave, to THIS PROVIDER, for THIS USE? The CODE half of two conf files authored 2026-08-24 that have had no reader since (measured 2026-08-25: xl_egress matches=0 over 61,475 files, coverage_complete=1 corpus_complete=1). xl_class_of -- CLASSIFY AT THE DOOR over the operator's release manifest. C by default; U only on an explicit row whose sha256 still matches the file. A STALE row admits NOTHING. xl_use_verdict -- the provider terms ledger as data. UNKNOWN is a VALUE and REFUSES every gated use. xl_budget_* -- CUMULATIVE disclosure per provider. Splitting work into parts defeats a SINGLE call and NOT aggregation across calls: a provider holding a perpetual licence retains every fragment and reassembles at leisure. The bound is on the SUM, never on the call. WHY A NEW LIB RATHER THAN EXTENDING AN INCUMBENT (checked before building, 2026-08-25): the estate's three shipping classifiers cannot answer an OBJECT-side release question. ag_uid_to_level grades a READER (a 0..3 RBAC ladder, never a byte's sensitivity); nx_site_lock_lib slk_resolve returns 0 for an unmatched path and ag_allow turns that into ALLOW for everyone ("no match => PUBLIC"); the docportal consent bit is OPT-OUT (keep initialises to 1, so an undeclared document is SERVED). Two of the three default to release, so this decision must fail closed INDEPENDENTLY of all of them rather than compose one. Verdicts are exit-code shaped so a caller can branch without parsing. license_tier: ORIGINAL. No hw writes (Rule 26).

dependencies 2 imports · 3 importers

nx_syscalls.nx nx_sovjson_lib.nx nx_extllm_lib.nx nx_extllm.nx nx_extllm_call.nx nx_extllm_publish_guard.nx

imports: nx_syscalls.nxnx_sovjson_lib.nx

imported by: nx_extllm.nxnx_extllm_call.nxnx_extllm_publish_guard.nx

structs

none

consts

21const XL_ALLOW: i64 = 0
22const XL_REFUSE: i64 = 1
23const XL_UNKNOWN: i64 = 3
26const XL_CLASS_U: i64 = 0
27const XL_CLASS_C: i64 = 1
30const XL_USE_WORKER: i64 = 1
31const XL_USE_JUDGE: i64 = 2
32const XL_USE_DISTILL: i64 = 3
35const XL_BYTE_HASH: i64 = 35
36const XL_BYTE_PIPE: i64 = 124
37const XL_BYTE_NL: i64 = 10
40const XL_TC_PROVIDER: i64 = 0
41const XL_TC_TIER: i64 = 1
42const XL_TC_TRAINS_IN: i64 = 2
43const XL_TC_OUT_OURS: i64 = 3
44const XL_TC_PUBRESTRICT: i64 = 4
45const XL_TC_USES: i64 = 9
46const XL_TC_REFKEY: i64 = 10
47const XL_TC_PIN: i64 = 11
48const XL_TC_COLS: i64 = 12
51const XL_RC_PATH: i64 = 1
52const XL_RC_SHA: i64 = 2
53const XL_RC_COLS: i64 = 6
58const XL_PIN_MIN: i64 = 65
59const XL_BYTE_H: i64 = 104
65const XL_SPAN_SLOTS: i64 = 2
66const XL_SPAN_BYTES: i64 = 16
244const XL_LC_PROVIDER: i64 = 1
245const XL_LC_SUBSYSTEM: i64 = 3
246const XL_LC_BYTES: i64 = 4
247const XL_LC_COLS: i64 = 8

functions

68func xl_terms_path() -> *u8 { return "knowledge/extllm_terms.conf" as *u8 }
called by 3: mainxl_callmain
69func xl_release_path() -> *u8 { return "knowledge/extllm_release.conf" as *u8 }
called by 2: mainxl_call
72func xl_is_comment(q: *u8, ls: i64, le: i64) -> i64
79func xl_col(q: *u8, ls: i64, le: i64, c: i64, out: *i64) -> i64
97func xl_ncols(q: *u8, ls: i64, le: i64) -> i64
105func xl_use_name(use: i64) -> *u8
called by 1: xl_use_listed
112func xl_verdict_name(v: i64) -> *u8
118func xl_class_name(c: i64) -> *u8
called by 1: xe_emit_class
124func xl_row_find(q: *u8, n: i64, provider: *u8, tier: *u8, out: *i64) -> i64
148func xl_cell_is(q: *u8, ls: i64, le: i64, col: i64, lit: *u8) -> i64
155func xl_use_listed(q: *u8, ls: i64, le: i64, use: i64) -> i64
162func xl_pin_ok(q: *u8, ls: i64, le: i64) -> i64
called by 1: xl_use_verdict calls 2: sys_mmapxl_col
176func xl_use_verdict(q: *u8, n: i64, provider: *u8, tier: *u8, use: i64) -> i64
190func xl_trains_on_input(q: *u8, n: i64, provider: *u8, tier: *u8) -> i64
202func xl_release_row(q: *u8, n: i64, path: *u8, out: *i64) -> i64
220func xl_class_of(q: *u8, n: i64, path: *u8, actual_sha: *u8) -> i64
231func xl_release_rows(q: *u8, n: i64) -> i64
251func xl_spent(q: *u8, n: i64, provider: *u8, subsystem: *u8, all_subsystems: i64) -> i64
281func xl_budget_verdict(spent: i64, add: i64, bound: i64) -> i64
called by 1: xe_selftest
288func xl_budget_left(spent: i64, bound: i64) -> i64
called by 1: xe_selftest