code wiki / _hdl_build / _research_run.nx
_research_run.nx source
↩ module page · 24 lines · 1618 B
1// _research_run.nx -- end-to-end research pipeline runner (the SOVEREIGN half).
2// The Playwright TOOL fetched + rendered the page to knowledge/fetched/wiki_web_dev.txt;
3// this drives the TEAM's mechanical extract organ (nx_claim_extract, deterministic) over it.
4// Fetch = tool; extract = Nishi. Composes ce_read_file + ce_extract (the team owns the extract).
5import "nx_claim_extract.nx"
6import "nx_syscalls.nx"
7
8func rr_puts(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 }
9func rr_putn(v: i64) -> i64 { let bb: *u8=sys_mmap(28); var m: i64=v; if m<0{m=0-m;sys_write(1,"-" as *u8,1)} 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 }
10
11func main() -> i64 {
12 let buf: *u8 = sys_mmap(262144)
13 let n: i64 = ce_read_file("knowledge/fetched/wiki_web_dev.txt" as *u8, buf, 262143)
14 if n <= 0 { rr_puts("NISHI-EXTRACT: fetched file not found/empty\n" as *u8); sys_exit(1); return 1 }
15 let out: *i64 = sys_mmap(64) as *i64
16 let facts: i64 = ce_extract(buf, n, out)
17 rr_puts("NISHI-EXTRACT (team organ, deterministic) over tool-fetched page:\n bytes=" as *u8); rr_putn(n)
18 rr_puts(" sentences=" as *u8); rr_putn(out[0])
19 rr_puts(" fact_claims(number+unit)=" as *u8); rr_putn(out[1])
20 rr_puts(" first_claim_value=" as *u8); rr_putn(out[2])
21 rr_puts("\n (mechanical = measurable facts; qualitative FEATURE extraction = the LLM/semantic residual nx_deep_research names)\n" as *u8)
22 sys_exit(0)
23 return 0
24}