code wiki / (root) / nx_selfsuff.nx

nx_selfsuff.nx

buildroot/runtime/nx_selfsuff.nx

66348 B1182 linesdepth 5pulls 5 transitivereach 0 importersview sourcekind orphan library
docsdependenciesstructsconstsfunctions

about

nx_selfsuff.nx -- THE SOVEREIGNTY LEDGER: outside DEPENDENCY measured per /compare domain and per organ, so "self sufficiency" is a number with a worklist instead of a feeling. Operator 2026-08-20: "where would be the best investment that drives the most self sufficiency down". Recorded interpretation (feedback-foundation-and-autonomous-frontier-2026-08-20): drive outside DEPENDENCY down / sovereignty UP, across three measurable kinds. TWO of the three are measured HERE. The third -- outside TOOLS -- already has an incumbent (nx_claude_harvest ch_gauge_json) and a second ruler for it would be the duplicate-ruler defect, so this organ does not compute it and SAYS SO rather than quietly leaving a gap. (b) outside SERVICES -- what breaks with no internet, DERIVED FROM WHAT THE CODE CALLS. Every "scheme://host" occurrence that sits INSIDE A STRING LITERAL and OUTSIDE A COMMENT is a host the organ dials. Both halves of that predicate are load-bearing: a scanner that does not skip comments measures the DOCUMENTATION, not the code (measured law 2026-08-06), and a scanner that skips strings measures NOTHING, because the URL *is* a string. Hosts classify against the conf's sovereign= prefixes; everything else is OUTSIDE and is NAMED in the ledger, never only counted. TWO SEPARATE ANSWERS, because they answer two different questions and merging them would silently re-price the whole estate: outside_dep -- distinct outside hosts an organ dials ITSELF, plus distinct carriers it touches at ONE HOP. Sparse and exact; this is the RANKER's coefficient, and it is held at one hop deliberately so a measurement change cannot re-price every rung behind the reader's back. net_dep -- does this organ reach the network AT ALL: DIRECT (a socket primitive in its own code, or a host it dials itself) or VIA-HELPER (it reaches one over the TRANSITIVE import/fork closure). This is the honest answer to "what breaks with no internet", and it needed the closure: an organ that reaches the network through a helper carries NO url literal and NO ".elf" literal, so a same-organ test reports every well-factored caller as sovereign. THAT ERROR LOOKS LIKE GOOD NEWS, which is why it survived a whole build. The closure walks import edges as well as fork edges, seeds itself from the matrix organs and pulls in whatever they reach; lane F proved the import graph ACYCLIC (0 nontrivial SCCs over 18,945 nodes), so the fixpoint terminates. Nodes the closure pulls in are EVIDENCE, not subjects: they are never published in the host partition, the ledger or the roll-up. (c) CLAUDE-IN-THE-LOOP -- an organ whose capability only exists while a seat drives it: absent from every clock row and every roster/registry the conf names, AND forked by nothing in the scanned corpus. When no autonomy source loads, seat_only is -1 UNOBSERVED: an axis that cannot see must ABSTAIN, not acquit. ⚠ SCOPE, STATED BECAUSE IT SETS THE DIRECTION OF THE ERROR: the fork-edge corpus is drawn

dependencies 2 imports · 0 importers

nx_syscalls.nx nx_tool_run.nx nx_selfsuff.nx

imports: nx_syscalls.nxnx_tool_run.nx

imported by: nobody (leaf or entry point)

structs

none

consts

64const SS_SRC_CAP: i64 = 524288 // one organ source; RANK_SRC_CAP's value, inherited not invented
65const SS_FILE_CAP: i64 = 262144 // one .matrix / regen.list / conf; the compare generator's cap
66const SS_MAX_DOM: i64 = 128 // regen.list carried 66 rows on 2026-08-20; ~2x headroom
67const SS_MAX_ORG: i64 = 24576 // matrix subjects PLUS every node the import/fork CLOSURE
72const SS_NAME_ARENA: i64 = 6291456 // SS_MAX_ORG * 256 B of node path, exactly
73const SS_HOST_MAX: i64 = 65536
74const SS_HOST_ARENA: i64 = 8388608
75const SS_EDGE_MAX: i64 = 1048576
76const SS_EDGE_ARENA: i64 = 33554432
77const SS_HTAB: i64 = 65536 // node-basename -> node index, power of two. NOT a tuning
83const SS_NET_ITER: i64 = 64 // fixpoint sweeps for transitive net-capability. The graph is
85const SS_AUTO_CAP: i64 = 2097152 // the concatenated autonomy corpus (planes + registries)
86const SS_JRNL_CAP: i64 = 4194304 // action-journal window; CH_JWIN's value, inherited
87const SS_LEDGER_CAP: i64 = 4194304
88const SS_TOK: i64 = 256
89const SS_FIELDS: i64 = 24
90const SS_FORK_CAP: i64 = 2097152 // captured stdout of one nx_store_put load; clocksched- resolved
94const SS_CH_NL: i64 = 10
95const SS_CH_TAB: i64 = 9
96const SS_CH_SP: i64 = 32
97const SS_CH_QUOTE: i64 = 34
98const SS_CH_HASH: i64 = 35
99const SS_CH_DOT: i64 = 46
100const SS_CH_SLASH: i64 = 47
101const SS_CH_SEMI: i64 = 59
102const SS_CH_COLON: i64 = 58
103const SS_CH_QMARK: i64 = 63
104const SS_CH_AT: i64 = 64
105const SS_CH_EQ: i64 = 61
106const SS_CH_BSLASH: i64 = 92
107const SS_CH_PIPE: i64 = 124
108const SS_CH_MINUS: i64 = 45
109const SS_CH_USCORE: i64 = 95
110const SS_CH_0: i64 = 48
111const SS_CH_9: i64 = 57
112const SS_CH_A: i64 = 65
113const SS_CH_Z: i64 = 90
114const SS_CH_a: i64 = 97
115const SS_CH_z: i64 = 122
204const SS_FNV_OFF: i64 = 2166136261 // FNV-1a 32-bit offset basis, the published constant
205const SS_FNV_PRIME: i64 = 16777619 // FNV-1a 32-bit prime, the published constant
206const SS_HMOD: i64 = 1073741824 // 2^30. Holding h under this EVERY step makes h*PRIME < 2^54,

functions

117func ss_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
118func ss_puts(s: *u8) -> i64 { sys_write(1, s, ss_slen(s)); return 0 }
called by 1: ss_pn calls 2: sys_writess_slen
119func ss_pn(v: i64) -> i64
129func ss_nl() -> i64 { let b: *u8 = sys_mmap(8); b[0] = SS_CH_NL as u8; sys_write(1, b, 1); return 0 }
130func ss_cat(d: *u8, o: i64, s: *u8) -> i64 { var i: i64 = 0; var oo: i64 = o; while s[i] != (0 as u8) { d[oo] = s[i]; oo = oo + 1; i = i + 1 } d[oo] = 0 as u8; return oo }
called by 1: ss_path
131func ss_catc(d: *u8, o: i64, c: i64) -> i64 { d[o] = c as u8; d[o+1] = 0 as u8; return o + 1 }
called by 1: ss_path
132func ss_catn(d: *u8, o: i64, v: i64) -> i64
calls 1: sys_mmap
144func ss_streq(a: *u8, b: *u8) -> i64 { var i: i64 = 0; while a[i] == b[i] { if a[i] == (0 as u8) { return 1 } i = i + 1 } return 0 }
called by 1: ss_hfind
145func ss_starts(s: *u8, p: *u8) -> i64 { var i: i64 = 0; while p[i] != (0 as u8) { if s[i] != p[i] { return 0 } i = i + 1 } return 1 }
called by 2: ss_hostclassss_scan
146func ss_read(path: *u8, b: *u8, cap: i64) -> i64
157func ss_eol(b: *u8, from: i64, n: i64) -> i64
called by 1: ss_scan
166func ss_split(s: *u8, fld: *i64, maxf: i64) -> i64
172func ss_base(path: *u8, out: *u8, cap: i64) -> i64
calls 1: ss_slen
189func ss_ends(s: *u8, sfx: *u8) -> i64
called by 1: ss_hostclass calls 1: ss_slen
209func ss_hash(s: *u8) -> i64
called by 2: ss_hfindss_hput
221func ss_hfind(tab: *i64, base: *u8, tok: i64, name: *u8) -> i64
calls 2: ss_hashss_streq
243func ss_hput(tab: *i64, base: *u8, tok: i64, idx: i64) -> i64
calls 1: ss_hash
278func ss_hostclass(h: *u8, sovp: *i64, nsov: i64, resp: *i64, nres: i64, ndp: *i64, nnd: i64) -> i64
292func ss_path(dst: *u8, root: *u8, rel: *u8) -> i64
calls 2: ss_catss_catc
298func ss_identch(c: i64) -> i64
312func ss_scan(buf: *u8, n: i64, harena: *u8, ho: *i64, hp: *i64, hn: *i64, hcapn: i64,
calls 2: ss_eolss_starts
489func main(argc: i64, argv: *i64) -> i64