code wiki / _hdl_build / nx_discovery_register.nx
nx_discovery_register.nx source
↩ module page · 56 lines · 5130 B
1// nx_discovery_register.nx -- GOVERNED registration of the wall-triage organ,
2// the link-extraction kernel, and the crawler-driven entity-discovery gate.
3// Engineer gate = the three gates re-run THIS invocation all exit 0 (links KAT
4// offline; wall triage + discovery LIVE w/ control); Council admits; Librarian
5// allocs via cl_next_idx + dual-writes live+journal. license_tier: ORIGINAL
6import "nx_cap_register.nx"
7import "nx_capreg_librarian.nx"
8import "nx_syscalls.nx"
9
10func drr_run(path: *u8) -> i64 {
11 let pid: i64 = sys_fork()
12 if pid == 0 {
13 let dn: i64 = sys_openat_wr("/dev/null" as *u8, 0x1a4)
14 if dn >= 0 { sys_dup3(dn, 1, 0); sys_dup3(dn, 2, 0) }
15 let argv: *i64 = sys_mmap(32) as *i64; argv[0] = path as i64; argv[1] = 0
16 let envp: *i64 = sys_mmap(16) as *i64; envp[0] = 0
17 sys_execve(path, argv, envp); sys_exit(127)
18 }
19 let st: *i64 = sys_mmap(16) as *i64
20 sys_wait4(pid, st, 0)
21 return st[0]
22}
23
24func main() -> i64 {
25 var allok: i64 = 1
26 if drr_run("/tmp/nx_html_links_test.sov.elf" as *u8) != 0 { allok = 0 }
27 if drr_run("/tmp/nx_wall_triage.sov.elf" as *u8) != 0 { allok = 0 }
28 if drr_run("/tmp/nx_entity_discover.sov.elf" as *u8) != 0 { allok = 0 }
29 cr_w(1, "ENGINEER: links KAT + wall triage(live) + entity discovery(live) all-pass=" as *u8); cr_wn(1, allok); cr_w(1, "\n" as *u8)
30 let eng: i64 = ig_engineer(1, 1, 1, allok)
31 let dec: i64 = ig_decision(eng, ig_council(eng, 1, 1, 2), 1)
32 if dec != IG_INGEST { cr_w(1, "HELD\n" as *u8); sys_exit(1) }
33 if cr_can_register(5, 2, 6, dec) != 1 { cr_w(1, "REFUSED\n" as *u8); sys_exit(1) }
34 let lp: *u8 = "/tmp/nishi_cap_registry.log" as *u8
35 let jp: *u8 = "knowledge/status/cap_registry_durable.log" as *u8
36
37 let idx1: i64 = cl_next_idx(lp, jp)
38 let ok1: i64 = cl_register_dual(lp, jp, idx1, 5,
39 2, "GEN WALL-TRIAGE organ (arc=SREACH; Doctor verb DIAGNOSE). nx_wall_triage + _wt_probe_one child = staged refusal probe (exit code = nx_https_get stage) under nx_guarded_run: HTTP-REACHED(status recorded) / CONNECT-REFUSED(DNS-TCP) / TLS-REFUSED(ClientHello-fingerprint suspect, auto-files BROWSER-lane finding row to pm_plan_durable) / FETCH-FAIL(TLS up, HTTP died) / TIMEOUT-REAPED; example.com CONTROL row makes the run self-trusting (control red = OUR stack sick, not the target). FIRST RUN ANSWERED the census walls -- TWO DIFFERENT DISEASES: archive.ph = TLS-REFUSED (fingerprint block CONFIRMED, browser-lane row auto-filed) vs rumble.com = FETCH-FAIL (TLS handshake SUCCEEDS, HTTP send/read dies -- ALPN/h2-only suspect, NOT a fingerprint wall); bitchute = HTTP 200 (thin text = JS-shell finding, no wall). Durable rows wall_triage.log. Reusable on any future walled host" as *u8)
40 if ok1 != 1 { cr_w(1, "DUAL-WRITE-1 FAILED\n" as *u8); sys_exit(1) }
41 cr_w(1, "CAPREG idx=" as *u8); cr_wn(1, idx1); cr_w(1, " REGISTERED -- wall-triage organ\n" as *u8)
42
43 let idx2: i64 = cl_next_idx(lp, jp)
44 let ok2: i64 = cl_register_dual(lp, jp, idx2, 5,
45 2, "GEN HTML-LINKS kernel (arc=SREACH; the crawler discovery primitive). nx_html_links = href= extraction (case-insensitive, single/double-quoted, absolute-https-only -- the validated-HTTPS-web policy at the parse layer; relative/http/fragment skipped; dedupe = caller crawl policy not parse policy). KAT gate nx_html_links_test: 3/3 construction-known links extracted exactly (incl uppercase HREF + single-quote) with http/relative/fragment/unquoted decoys rejected and an unterminated href DROPPED not corrupted. Proven live same session: 208 links harvested from 2 real seed pages (wikidata 121, wikipedia 87)" as *u8)
46 if ok2 != 1 { cr_w(1, "DUAL-WRITE-2 FAILED\n" as *u8); sys_exit(1) }
47 cr_w(1, "CAPREG idx=" as *u8); cr_wn(1, idx2); cr_w(1, " REGISTERED -- html-links kernel\n" as *u8)
48
49 let idx3: i64 = cl_next_idx(lp, jp)
50 let ok3: i64 = cl_register_dual(lp, jp, idx3, 5,
51 2, "GEN ENTITY-DISCOVERY gate (arc=SREACH R3b; operator line 'never hand-curated' CLOSED). nx_entity_discover + _ed_fetch_html child = crawler-driven: seed hub pages our index already reaches (wikidata Q283504 + en.wikipedia) -> nx_html_links harvest (208) -> filter cross-host entity-named deduped (8 DISCOVERED) -> guarded fetch each over sovereign stack -> OUR inverted index -> entity retrieval. FIRST RUN: 5/8 retrieved (bars 3 discovered/1 retrieved, conservative for anon walls) -- and the FINDS are the operator thesis itself: babesdirectory.online entity-tf=130 (the ignored-host class), film.ru + ivi.tv (RUSSIAN-locale reach Google buries -- the Yandex-class edge), fashionmodeldirectory.com + lezwatchtv.com (independent long-tail); instagram + sbs WALLED named-not-faked; NONE of the 8 appears in ANY captured incumbent SERP. Durable evidence search_discovery.log. NEXT: feed discovered docs into the live SERP corpus + measured content value from fetched bytes" as *u8)
52 if ok3 != 1 { cr_w(1, "DUAL-WRITE-3 FAILED\n" as *u8); sys_exit(1) }
53 cr_w(1, "CAPREG idx=" as *u8); cr_wn(1, idx3); cr_w(1, " REGISTERED -- entity discovery R3b\n" as *u8)
54 sys_exit(0)
55 return 0
56}