code wiki / _hdl_build / nx_dp_leak_gate.nx
nx_dp_leak_gate.nx
buildroot/runtime/_hdl_build/nx_dp_leak_gate.nx
about
nx_dp_leak_gate.nx -- STANDING "RED on leak" guarantee for rung 0: the PUBLIC corpus must carry NO document
bearing an internal/SECRET marker. Dual-mode:
(gate) no args -> hermetic 3-tooth proof in a fresh nonce domain (seed leak -> detect -> reclassify -> clean)
(live) `scan <domain>` -> run leak_scan against the REAL store (search-level closure proof)
leak_scan(domain): for each internal marker, dss_search (the LIVE consent-filtered search) returns BM25
candidates; each candidate's doc bytes are re-read (dp_read) and the LITERAL marker string is re-confirmed
in the bytes (dss_search tokenizes -- the literal re-confirm kills false positives). Distinct leaking cids
are summed. 0 = clean. NOTE: the markers' dashes are word-internal (preceded by a token char) so dss_search
treats them as inert separators, NOT as -NOT operators -- the markers tokenize into positive OR terms.
STANDALONE check organ -- imports only; modifies/redeploys NO daemon. license_tier: ORIGINAL
dependencies 3 imports · 0 importers
imports: nx_dp_reclassify.nxnx_docportal_search_seg.nxnx_docportal_lib.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
| 16 | const LK_MAXR: i64 = 512 // dss_search candidate cap per marker (leaking internal docs rank high on rare markers) |
functions
| 18 | func g_puts(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 } |
| 19 | func g_num(v: i64) -> i64 |
| 25 | func g_w(fd: i64, s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(fd, s, n); return 0 } called by 1: main |
| 26 | func g_wn(fd: i64, v: i64) -> i64 called by 1: main |
| 32 | func g_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n } |
| 33 | func g_cat(out: *u8, o: i64, s: *u8) -> i64 { var i: i64 = 0; while s[i] != (0 as u8) { out[o] = s[i]; o = o + 1; i = i + 1 } return o } called by 1: main |
| 34 | func g_catnum(out: *u8, o: i64, v: i64) -> i64 called by 1: main |
| 40 | func lk_streq(a: *u8, b: *u8) -> i64 called by 1: main |
| 47 | func lk_contains(hay: *u8, hn: i64, needle: *u8, nn: i64) -> i64 called by 1: leak_scan |
| 63 | func leak_scan(domain: *u8) -> i64 |
| 111 | func main(argc: i64, argv: *i64) -> i64 |