nx_extllm_call.nx
buildroot/runtime/nx_extllm_call.nx
about
nx_extllm_call.nx -- RUNG XL3: the ONLY door through which estate bytes may reach an external model.
Every conjunct is checked BEFORE a socket is opened, and each refusal names the rule that fired.
1 TERMS xl_use_verdict on the pinned provider ledger. UNKNOWN refuses. An unpinned row admits nothing.
2 CLASSIFY every prompt byte must come from a file the operator DECLARED public, and whose sha256 still
matches that declaration. C by default; a stale hash admits nothing.
3 KEY read from a FILE, never argv -- argv is visible in /proc and in every transcript.
4 CALL our own TLS 1.3 + Mozilla trust store, the same send/recv core the InnerTube POST path uses.
5 LEDGER one appended row per call, so "how much has provider P seen, in total, across all time?" is a
read and not an investigation. This is the half a per-call check structurally cannot do.
The request sets provider.data_collection=deny and zdr=true, which the router documents as a per-request
switch -- belt and braces beside the terms row, never instead of it.
license_tier: ORIGINAL No hw writes (Rule 26). exit 0 ALLOW / 1 REFUSE / 3 UNKNOWN / 2 usage / 4 transport
dependencies 14 imports · 0 importers
diagram shows first 10 each side; +4 more imports, +0 more importers in the complete lists below.
imports: nx_extllm_lib.nxnx_estate_path.nxnx_sha256.nxnx_sovjson_lib.nxnx_gate_verdict.nxnx_x509_trust_store.nxnx_trust_store_load_from_certdata.nxnx_tls13_client_validate_certificate.nxnx_tls13_client_session_run.nxnx_https_url_for_fetch.nxnx_https_url_connect.nxnx_https_get_complete.nxnx_http_response_parse.nxnx_syscalls.nx
imported by: nobody (leaf or entry point)
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| 28 | const XC_RESP_CAP: i64 = 262144 |
| 29 | const XC_REQ_CAP: i64 = 65536 |
| 30 | const XC_PROMPT_CAP: i64 = 16384 |
| 31 | const XC_KEY_CAP: i64 = 4096 |
| 32 | const XC_PATH_CAP: i64 = 1024 |
| 33 | const XC_DIGEST_BYTES: i64 = 32 |
| 34 | const XC_HEX_PER_BYTE: i64 = 2 |
| 35 | const XC_CERT_ROOTS_MIN: i64 = 300 |
| 36 | const XC_CERT_ARENA: i64 = 4194304 |
| 37 | const XC_SOCK_TIMEOUT_S: i64 = 30 |
| 38 | const XC_TLS_RAND_BYTES: i64 = 32 |
| 39 | const XC_ESC_PROMPT: i64 = 12000 |
| 40 | const XC_ESC_FIELD: i64 = 128 |
| 41 | const XC_USAGE: i64 = 2 |
| 42 | const XC_TRANSPORT: i64 = 4 |
| 43 | const XC_ASCII_0: i64 = 48 |
| 44 | const XC_ASCII_a_MINUS_10: i64 = 87 |
| 45 | const XC_NIBBLE_HI_SHIFT: i64 = 16 |
| 46 | const XC_NIBBLE_MASK: i64 = 15 |
| 49 | const XC_LEDGER_MODE: i64 = 420 |
| 50 | const XC_HDR_SLOTS: i64 = 128 |
| 51 | const XC_BODY_CHUNKED: i64 = 2 |
| 52 | const XC_HTTP_OK: i64 = 200 |
| 58 | const XC_PROVIDER_REFUSED: i64 = 5 |
| 135 | const XC_BYTE_SLASH: i64 = 47 |
| 164 | const XE_EP_PROVIDER: i64 = 0 |
| 165 | const XE_EP_HOST: i64 = 1 |
| 166 | const XE_EP_PATH: i64 = 2 |
| 167 | const XE_EP_AUTHHDR: i64 = 3 |
| 168 | const XE_EP_AUTHSCHEME: i64 = 4 |
| 169 | const XE_EP_COLS: i64 = 6 |
| 170 | const XE_URL_CAP: i64 = 512 |
functions
| 60 | func xc_w(s: *u8) -> i64 { return sj_werr(s) } |
| 63 | func xc_hex(dig: *u8, out: *u8) -> i64 called by 1: xc_pin_of |
| 78 | func xc_pin_of(buf: *u8, n: i64, out: *u8) -> i64 |
| 86 | func xc_trim(buf: *u8, n: i64) -> i64 called by 1: xl_call |
| 99 | func xc_read_estate(p: *u8, out_len: *i64) -> *u8 |
| 106 | func xc_ledger_row(out: *u8, provider: *u8, tier: *u8, subsystem: *u8, bytes: i64, pin: *u8, verdict: *u8) -> i64 |
| 120 | func xc_ledger_append(path: *u8, row: *u8, n: i64) -> i64 |
| 136 | func xc_keypath_outside_estate(p: *u8) -> i64 called by 1: xl_call |
| 151 | func xc_skip_ws(b: *u8, n: i64) -> i64 called by 1: xl_call |
| 172 | func xc_endpoint_path() -> *u8 { return "knowledge/extllm_endpoint.conf" as *u8 } called by 1: xl_call |
| 174 | func xc_ep_row(q: *u8, n: i64, provider: *u8, out: *i64) -> i64 |
| 192 | func xc_ep_field(q: *u8, ls: i64, le: i64, col: i64, out: *u8) -> i64 |
| 204 | func xl_call(provider: *u8, tier: *u8, model: *u8, prompt_path: *u8, keypath: *u8, |
| 377 | func xc_selftest() -> i64 |
| 421 | func main(argc: i64, argv: *i64) -> i64 |