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 tooltopic 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)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main sys_openat_append wp sys_write sys_openat_rd sys_exit sys_mmap sys_read sys_close fc_parse_manifest wn wp ↻ sys_mmap ↻ sys_write ↻ fc_check fc_strlen sys_mmap ↻ fc_extract fc_is_alpha fc_lower fc_is_stop fc_wordeq fc_lower ↻ fc_lower ↻ wp ↻ wn ↻ nx_corrob_new sys_mmap ↻ sys_openat_rd ↻ sys_read ↻ sys_close ↻ fc_has fc_lower ↻ nx_corrob_assert _corr_at nx_corrob_confidence nx_corrob_independent_coun sys_mmap ↻ _corr_at ↻ nx_corrob_independent_coun ↻

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 }
called by 1: fc_extract calls 1: fc_lower
20func fc_strlen(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n }
called by 1: fc_check
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 }
called by 3: wnfc_checkmain calls 1: sys_write
23func wn(fd: i64, v: i64) -> i64
called by 2: fc_checkmain calls 3: wpsys_mmapsys_write
31func fc_wordeq(claim: *u8, a: i64, b: i64, lit: *u8) -> i64
called by 1: fc_is_stop calls 1: fc_lower
37func fc_is_stop(claim: *u8, a: i64, b: i64) -> i64
called by 1: fc_extract calls 1: fc_wordeq
80func fc_extract(claim: *u8, cn: i64, termbuf: *u8, termoff: *i64, maxt: i64) -> i64
107func fc_has(hay: *u8, hn: i64, needle: *u8) -> i64
called by 1: fc_check calls 1: fc_lower
121func fc_parse_manifest(mbuf: *u8, mn: i64, srcpath: *i64, srcclass: *i64, maxsrc: i64) -> i64
called by 1: main
148func fc_check(label: *u8, claim: *u8, srcpath: *i64, srcclass: *i64, nsrc: i64, srcbuf: *u8, srccap: i64, fd: i64) -> i64
190func main() -> i64