code wiki / _hdl_build / nx_depstack_census.nx

nx_depstack_census.nx source

↩ module page · 97 lines · 8464 B

1// nx_depstack_census.nx -- HONEST measured census of the COMMERCIAL DEPENDENCY STACK every published deep-research 2// system rides on (OpenAI/Firecrawl/Milvus/Serper/Jina) vs OUR sovereign replacement for each. Operator 2026-07-02: 3// "OpenAI/Firecrawl/Milvus/Serper/Jina ... nishi research and census this". Answers the ecosystem-placement question: 4// which paid dependencies have we ALREADY replaced sovereignly, and which are the open gaps? Verdict COMPUTED by 5// xcd_verdict; AHEAD liar-killed unless all criteria met; [FLOOR]=sovereignty win (no billing/dep) SEPARATED from 6// the capability gap. Bars grounded in knowledge/fetched/dep_*.raw (banked by nx_depstack_research). Mirrors the 7// honest nx_researcher_exceed_census. Run SOLO after nx_depstack_research. Scale: 2=full 1=partial 0=absent. 8// license_tier: ORIGINAL expect_exit: 0 9import "nx_cms_exceed.nx" // XCD_* + xcd_verdict + xcd_referee_ok + xcd_vname + sys_* (transitive) 10 11func sw(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } 12func sn(v: i64) -> i64 { let bb: *u8=sys_mmap(28); var m: i64=v; if m<0{m=0} let t: *u8=sys_mmap(28); var k: i64=0; if m==0{t[0]=48 as u8;k=1} while m>0{t[k]=(48+(m%10)) as u8;m=m/10;k=k+1} var i: i64=0; while i<k{bb[i]=t[k-1-i];i=i+1} sys_write(1,bb,k); return 0 } 13func have(path: *u8) -> i64 { let fd: i64=sys_openat_rd(path); if fd<0 { return 0 } sys_close(fd); return 1 } 14 15// tot: [0]=BEHIND [1]=PARITY [2]=AHEAD [3]=INVALID [4]=AHEAD-FLOOR [5]=AHEAD-CAPABILITY [6]=UNGROUNDED 16func row(dom: *u8, cap: *u8, our_c: i64, inc_c: i64, n: i64, ev: *u8, ground: *u8, floor: i64, tot: *i64) -> i64 { 17 let v: i64 = xcd_verdict(our_c, inc_c) 18 let ok: i64 = xcd_referee_ok(v, our_c, n) 19 let g: i64 = have(ground) 20 sw(" [" as *u8); sw(dom); sw("] " as *u8); sw(cap); sw(" -> " as *u8); sw(xcd_vname(v)) 21 sw(" (us " as *u8); sn(our_c); sw("/" as *u8); sn(n); sw(") " as *u8); sw(ev) 22 if floor==1 { sw(" [FLOOR: sovereignty -- no billing/3rd-party dep]" as *u8) } 23 if ok==0 { sw(" <== INVALID: AHEAD without meeting all criteria (LIAR-KILL)" as *u8); tot[3]=tot[3]+1 } 24 if g==0 { sw(" [UNGROUNDED: source not banked -- run nx_depstack_research]" as *u8); tot[6]=tot[6]+1 } 25 sw("\n" as *u8) 26 if v==XCD_BEHIND { tot[0]=tot[0]+1 } 27 if v==XCD_PARITY { tot[1]=tot[1]+1 } 28 if v==XCD_AHEAD { tot[2]=tot[2]+1; if floor==1 { tot[4]=tot[4]+1 } else { tot[5]=tot[5]+1 } } 29 return 0 30} 31 32func main() -> i64 { 33 let tot: *i64 = sys_mmap(128) as *i64 34 var z: i64=0; while z<7 { tot[z]=0; z=z+1 } 35 let OA: *u8 = "knowledge/fetched/dep_openai.raw" as *u8 36 let FC: *u8 = "knowledge/fetched/dep_firecrawl.raw" as *u8 37 let MV: *u8 = "knowledge/fetched/dep_milvus.raw" as *u8 38 let SP: *u8 = "knowledge/fetched/dep_serper.raw" as *u8 39 let JN: *u8 = "knowledge/fetched/dep_jina.raw" as *u8 40 41 sw("=== nx_depstack_census -- the deep-research COMMERCIAL DEPENDENCY STACK vs OUR sovereign replacements ===\n" as *u8) 42 sw("every published system (DeepResearcher/Tongyi/DeepSearcher/multimodal-DR/dzhng) rides on paid APIs. which have we replaced?\n" as *u8) 43 sw("verdict COMPUTED by xcd_verdict(us,bar); AHEAD liar-killed; [FLOOR]=sovereignty win (no dep). Scale 2=full 1=partial 0=absent.\n" as *u8) 44 45 sw("\n-- 1. LLM / REASONING (OpenAI: GPT/o-series -> synthesis + generation) --\n" as *u8) 46 row("LLM" as *u8, "sovereign LLM reasoning/generation for synthesis" as *u8, 0,2,2, "{OpenAI = the reasoning dep ALL 6 ride; our no-float LLM lane is NOT wired to the researcher -> census R1}" as *u8, OA, 0, tot) 47 48 sw("\n-- 2. WEB SCRAPE + CRAWL (Firecrawl: URL->markdown, JS-render, site crawl) --\n" as *u8) 49 row("CRWL" as *u8, "web fetch + open-web crawl + HTML->clean text" as *u8, 2,2,2, "[ev: nx_crawl_web + nx_https_fetch_follow + nx_html_to_text -- REPLACED]" as *u8, FC, 0, tot) 50 row("FLR" as *u8, "sovereignty of scrape (own TLS-1.3, no Firecrawl API/billing)" as *u8, 1,0,1, "[ev: nishi-hs; Firecrawl is a paid SaaS]" as *u8, FC, 1, tot) 51 row("CRWL" as *u8, "headless JS-render + crawl-at-SCALE (1000s of pages)" as *u8, 1,2,2, "{Firecrawl renders JS + crawls at scale; ours bounded ~12-16 pages (certloop), no JS-render -> R7}" as *u8, FC, 0, tot) 52 53 sw("\n-- 3. VECTOR DB / dense ANN (Milvus/Zilliz: embedding store + similarity search) --\n" as *u8) 54 row("VDB" as *u8, "dense-vector store + ANN retrieval (embeddings)" as *u8, 0,2,2, "{deep-searcher rides Milvus; our researcher path is LEXICAL BM25 -- no dense store wired (sov-vector-backend is partial/separate) -> R3}" as *u8, MV, 0, tot) 55 56 sw("\n-- 4. WEB SEARCH API (Serper: Google SERP as a service) --\n" as *u8) 57 row("SRCH" as *u8, "search over own indexed corpus (BM25 inverted)" as *u8, 2,2,2, "[ev: nx_search_inverted + federated 24 idx -- REPLACED for own corpus]" as *u8, SP, 0, tot) 58 row("FLR" as *u8, "sovereignty of search (own index, no Serper/Google dep)" as *u8, 1,0,1, "[ev: nx_search_cli own index; Serper is paid Google SERP]" as *u8, SP, 1, tot) 59 row("SRCH" as *u8, "OPEN-WEB live search breadth (whole-web index/freshness)" as *u8, 1,2,2, "{Serper = Google's whole index; ours = own corpus + bounded crawl, not web-scale live SERP -> R7}" as *u8, SP, 0, tot) 60 61 sw("\n-- 5. READER + EMBEDDINGS (Jina: r.jina.ai URL->text + Jina Embeddings) --\n" as *u8) 62 row("RDR" as *u8, "URL -> clean LLM-ready text (reader)" as *u8, 2,2,2, "[ev: nx_html_to_text / rf_strip (OOM-fixed) -- REPLACED]" as *u8, JN, 0, tot) 63 row("FLR" as *u8, "sovereignty of reader (own strip, no Jina Reader dep)" as *u8, 1,0,1, "[ev: rf_strip; Jina Reader is a hosted service]" as *u8, JN, 1, tot) 64 row("EMB" as *u8, "text embeddings (dense semantic vectors)" as *u8, 0,2,2, "{Jina Embeddings; we have NO sovereign trained embedder (lexical only) -> R3}" as *u8, JN, 0, tot) 65 66 sw("\n=== SUMMARY ===\n" as *u8) 67 sw("BEHIND = " as *u8); sn(tot[0]); sw(" (the LLM / dense-vector / embeddings / open-web-search + scale layers we LOSE)\n" as *u8) 68 sw("PARITY = " as *u8); sn(tot[1]); sw(" (fetch/crawl + reader + own-corpus search -- REPLACED, capability matches)\n" as *u8) 69 sw("AHEAD = " as *u8); sn(tot[2]); sw(" all FLOOR(sovereignty)=" as *u8); sn(tot[4]); sw(" capability=" as *u8); sn(tot[5]); sw("\n" as *u8) 70 sw("INVALID (liar-killed) = " as *u8); sn(tot[3]); sw(" UNGROUNDED = " as *u8); sn(tot[6]); sw("\n" as *u8) 71 let cells: i64 = tot[0]+tot[1]+tot[2] 72 sw("TOTAL GRADED CELLS = " as *u8); sn(cells); sw("\n" as *u8) 73 74 sw("\n-- NEG-CONTROL (must be CAUGHT) -- fabricated 'sovereign LLM already AHEAD of OpenAI' (us 0/1) -> " as *u8) 75 let neg_ok: i64 = xcd_referee_ok(XCD_AHEAD, 0, 1) 76 var neg_caught: i64 = 0 77 if neg_ok==0 { sw("REJECTED (liar-kill fired)\n" as *u8); neg_caught=1 } else { sw("ACCEPTED (BROKEN)\n" as *u8) } 78 79 sw("\n=== ECOSYSTEM PLACEMENT (which paid deps are already sovereign, which are the open gaps) ===\n" as *u8) 80 sw(" REPLACED (sovereign, PARITY + FLOOR): Firecrawl->nx_crawl_web/fetch_follow . Jina-Reader->nx_html_to_text . Serper(own-corpus)->nx_search_inverted. We pay $0 and depend on nobody for the FETCH/READ/OWN-SEARCH layer.\n" as *u8) 81 sw(" OPEN GAPS (map onto the researcher options ladder):\n" as *u8) 82 sw(" OpenAI (reasoning) -> R1 no-float sovereign LLM synth+refute (also closes SYNTHESIS/ADVERSARIAL).\n" as *u8) 83 sw(" Milvus + Jina-Embeddings -> R3 sovereign DENSE retriever (trained bi-encoder embeddings + ANN store).\n" as *u8) 84 sw(" Serper open-web breadth -> R7 (NEW) open-web search: scale the crawler/SREACH or a sovereign web index.\n" as *u8) 85 86 sw("\n=== VERDICT ===\n" as *u8) 87 var green: i64 = 1 88 if tot[3] != 0 { green = 0 } 89 if neg_caught != 1 { green = 0 } 90 if green==1 { 91 sw("GREEN -- honest: 0 fabricated exceeds, liar-kill armed. TRUTH: of the 5 commercial deps, the FETCH/READ/OWN-SEARCH layer is SOVEREIGNLY REPLACED (" as *u8); sn(tot[1]); sw(" PARITY + " as *u8); sn(tot[4]); sw(" FLOOR).\n" as *u8) 92 sw(" BEHIND on " as *u8); sn(tot[0]); sw(" layers = LLM(OpenAI) + dense-vector(Milvus) + embeddings(Jina) + open-web-search/scale(Serper/Firecrawl). Those are exactly R1 (LLM) + R3 (dense retriever) + R7 (open-web search).\n" as *u8) 93 return 0 94 } 95 sw("RED -- liar-kill integrity failed\n" as *u8) 96 return 1 97}