code wiki / (root) / nx_research_answer.nx

nx_research_answer.nx

buildroot/runtime/nx_research_answer.nx

5872 B115 linesdepth 21pulls 147 transitivereach 0 importersview sourcekind tooltopic research
docsdependenciesstructsconstsfunctions

about

nx_research_answer.nx -- GROUNDED, CITED research-answer primitive: "research that cannot hallucinate." The product face of the verification stack. Given a question's answer-pattern and a source URL, it FETCHES the source itself over sovereign TLS-1.3, extracts the PHRASE that follows the pattern (up to a natural delimiter), and returns a grounded answer WITH provenance -- or UNVERIFIABLE if the pattern is absent (it NEVER invents an answer). Unlike hosted answer engines that can fabricate, this returns only what the cited source actually says. usage: nx_research_answer <url> <answer_pattern> [maxlen] (run from a dir with data/mozilla_certdata.txt) e.g.: nx_research_answer https://arxiv.org/abs/1606.05250 "human performance (" -> ANSWER: 86.8 [grounded] license_tier: ORIGINAL expect_exit: 0

dependencies 5 imports · 0 importers

nx_syscalls.nx nx_itoa_lib.nx nx_x509_trust_store.nx nx_trust_store_load_from_certdata. nx_https_fetch_follow.nx nx_research_answer.nx

imports: nx_syscalls.nxnx_itoa_lib.nxnx_x509_trust_store.nxnx_trust_store_load_from_certdata.nxnx_https_fetch_follow.nx

imported by: nobody (leaf or entry point)

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

main ra_puts sys_write ra_int nx_trust_store_load_from_c sys_mmap sys_read_file sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_close nx_nss_certdata_parse sys_mmap ↻ _pat_class_cert _pat_value_octal _pat_end _find_newline _starts_with _parse_octal_line sys_mmap ↻ _is_space _decode_octal_escape _is_octal trust_store_alloc sys_mmap ↻ nx_x509_trust_store_load sys_mmap ↻ x509_parse sys_mmap ↻ asn1_cursor_init asn1_expect_tag sys_mmap ↻ asn1_read_tlv_header asn1_read_tag asn1_read_length asn1_read_length ↻ x509_read_tlv sys_mmap ↻ asn1_expect_tag ↻

structs

none

consts

14const K_MAGIC_4194304: i64 = 4194304
15const K_MAGIC_2000: i64 = 2000

functions

17func ra_puts(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 }
called by 1: main calls 1: sys_write
22func ra_putn(v: i64) -> i64 { nxi_out(v); return 0 }
called by 1: main calls 1: nxi_out
23func ra_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
called by 1: ra_find_after
24func ra_int(s: *u8) -> i64 { var v: i64=0; var i: i64=0; while s[i] != (0 as u8) { let c: i64=s[i] as i64; if c>=48 { if c<=57 { v=v*10+(c-48) } } i=i+1 } return v }
called by 1: main
26func ra_find_after(buf: *u8, blen: i64, pat: *u8) -> i64
called by 1: main calls 1: ra_slen
40func ra_isdelim(c: i64) -> i64
called by 1: main
52func main(argc: i64, argv: *i64) -> i64