code wiki / (root) / nx_writehub_factcheck.nx

nx_writehub_factcheck.nx

buildroot/runtime/nx_writehub_factcheck.nx

11478 B224 linesdepth 3pulls 3 transitivereach 0 importersview sourcekind orphan librarytopic writehub
docsdependenciesstructsconstsfunctions

about

nx_writehub_factcheck.nx -- WRITING HUB rung R4: sovereign GROUNDED FACT-CHECK for non-fiction. Closes the field-wide gap: every AI book-writer ships a "fact-check agent" box that verifies NOTHING (undocumented). This organ GROUNDS a claim in the sovereign-banked corpus: extract the claim's distinctive terms -> scan each banked source for term co-occurrence -> corroborate with INDEPENDENCE (composes nx_research_corroborate: same source-class = ECHO; CONFIRMED needs >=2 DISTINCT classes) -> verdict CONFIRMED/SINGLE/UNSUPPORTED with CITED sources (provenance; no-delete). Data-driven corpus manifest (knowledge/registry/writehub_corpus.tsv). HONEST: this is keyword-grounded corroboration (terms attested across independent sources), NOT full semantic entailment -- but a REAL grounding rung that EXCEEDS "no grounding at all". Self-proves on a supported vs an unsupported claim (the discriminator gate). license_tier: ORIGINAL module: nishi-core.writehub.factcheck

dependencies 2 imports · 0 importers

nx_research_corroborate.nx nx_syscalls.nx nx_writehub_factcheck.nx

imports: nx_research_corroborate.nxnx_syscalls.nx

imported by: nobody (leaf or entry point)

structs

none

consts

12const K_MAGIC_4096: i64 = 4096
13const K_MAGIC_65536: i64 = 65536
14const K_MAGIC_2097152: i64 = 2097152
15const K_MAGIC_8192: i64 = 8192
16const K_MAGIC_8191: i64 = 8191

functions

18func fc_lower(c: i64) -> i64 { if c>=65 { if c<=90 { return c+32 } } return c }
19func fc_is_alpha(c: i64) -> i64 { let l: i64=fc_lower(c); if l>=97 { if l<=122 { return 1 } } return 0 }
20func fc_strlen(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n }
22func wp(fd: i64, s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); if fd>0 { sys_write(fd,s,n) } return 0 }
23func wn(fd: i64, v: i64) -> i64
31func fc_wordeq(claim: *u8, a: i64, b: i64, lit: *u8) -> i64
37func fc_is_stop(claim: *u8, a: i64, b: i64) -> i64
80func fc_extract(claim: *u8, cn: i64, termbuf: *u8, termoff: *i64, maxt: i64) -> i64
107func fc_has(hay: *u8, hn: i64, needle: *u8) -> i64
121func fc_parse_manifest(mbuf: *u8, mn: i64, srcpath: *i64, srcclass: *i64, maxsrc: i64) -> i64
148func fc_check(label: *u8, claim: *u8, srcpath: *i64, srcclass: *i64, nsrc: i64, srcbuf: *u8, srccap: i64, fd: i64) -> i64
190func main() -> i64