code wiki / _hdl_build / nx_paper_emit.nx

nx_paper_emit.nx

buildroot/runtime/_hdl_build/nx_paper_emit.nx

4032 B50 linesdepth 4pulls 4 transitivereach 1 importersview sourcekind librarytopic paper
docsdependenciesstructsconstsfunctions

about

nx_paper_emit.nx -- the Scientist EMITS each proven result in TWO captured formats (operator: structure + capture the output both as DATA and as RESEARCH PAPER so the team can publish): a structured DATA RECORD (machine-parseable key=value, for re-analysis + the knowledge base) AND a PAPER (the publishable document with the scientific-method sections). Emission is GATED by the Scientist's review -- an OVERCLAIM is never captured as a paper (it would meet outside critics and fall). The Librarian persists both. license_tier: ORIGINAL Refs: nx_scientist (the gate); data+paper duality.

dependencies 1 imports · 1 importers

nx_scientist.nx nx_paper_emit.nx nx_paper_emit_test.nx

imports: nx_scientist.nx

imported by: nx_paper_emit_test.nx

structs

none

consts

none

functions

10func pe_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
11func pe_app(buf: *u8, s: *u8) -> i64 { var oi: i64 = 0; while buf[oi] != (0 as u8) { oi = oi + 1 } var j: i64 = 0; while s[j] != (0 as u8) { buf[oi]=s[j]; oi=oi+1; j=j+1 } buf[oi]=0 as u8; return 0 }
12func pe_appn(buf: *u8, v: i64) -> i64 { var oi: i64 = 0; while buf[oi] != (0 as u8) { oi = oi + 1 } let t: *u8 = sys_mmap(28); var m: i64=v; var k: i64=0; if m<0 {buf[oi]=45;oi=oi+1;m=0-m} if m==0 {t[0]=48;k=1} while m>0 {t[k]=48+(m%10); m=m/10; k=k+1} var z: i64=0; while z<k {buf[oi]=t[k-1-z]; oi=oi+1; z=z+1} buf[oi]=0 as u8; return 0 }
13func pe_contains(buf: *u8, needle: *u8) -> i64 { let n: i64 = pe_slen(buf); let m: i64 = pe_slen(needle); if m==0 {return 1} var i: i64=0; while i+m<=n { var j: i64=0; var ok: i64=1; while j<m { if buf[i+j]!=needle[j] {ok=0;j=m} else {j=j+1} } if ok==1 {return 1} i=i+1 } return 0 }
called by 1: main calls 1: pe_slen
16func pe_data_record(buf: *u8, cap: *u8, claim_tier: i64, metric: i64, baseline: i64, sota: i64, grade: i64, reproducible: i64) -> i64
called by 1: pe_publish calls 3: pe_apppe_appnpe_slen
29func pe_paper(buf: *u8, cap: *u8, claim: *u8, method: *u8, metric: i64, baseline: i64, sota: i64, grade_word: *u8, caveat: *u8, gate: *u8) -> i64
called by 1: pe_publish calls 3: pe_apppe_appnpe_slen
42func pe_publish(data_buf: *u8, paper_buf: *u8, complete: i64, no_overclaim: i64, reproducible: i64, cap: *u8, claim: *u8, method: *u8, claim_tier: i64, metric: i64, baseline: i64, sota: i64, grade: i64, grade_word: *u8, caveat: *u8, gate: *u8) -> i64