code wiki / (root) / nx_paperbench_cli.nx

nx_paperbench_cli.nx

buildroot/runtime/nx_paperbench_cli.nx

10599 B207 linesdepth 3pulls 4 transitivereach 0 importersview sourcekind bench
docsdependenciesstructsconstsfunctions

about

nx_paperbench_cli.nx -- callable MCP/API surface for the sovereign manuscript grader (AS-0). nx_paperbench score <slack> <bar> <axes_csv> [weights_csv] [mask_csv] axes = 7 permille scores in canonical order: claim_evidence,reproducibility,controls,limitations,baseline,data_provenance,stat_honesty e.g. nx_paperbench score 250 600 1000,1000,200,1000,1000,1000,1000 -> capped 450 nx_paperbench scan <path> <slack> <bar> reads a REAL manuscript off disk and derives the axes mechanically: claim_evidence = provenance tokens "[ev:" per numeric claim (digit run) the other six = presence of the canonical section heading HONEST SCOPE: section-presence is a REPORTING signal, not a quality signal. REFORMS (arXiv:2308.07832) is itself a *reporting* standard, so this is the right tier -- but a present-and-empty section scores the same as a good one. Judging section CONTENT is the referee stage (AS-2), not the ruler. license_tier: ORIGINAL No hw writes (Rule 26). expect_exit: 0

dependencies 3 imports · 0 importers

nx_paperbench.nx nx_itoa_lib.nx nx_syscalls.nx nx_paperbench_cli.nx

imports: nx_paperbench.nxnx_itoa_lib.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 pc_puts sys_write pc_key pc_q sys_mmap sys_write ↻ pc_puts ↻ pc_q ↻ sys_exit sys_mmap ↻ pb_is_scan pc_atoi pc_read sys_openat_rd sys_read sys_close pb_offset pb_claims pb_find pb_axis pc_sec pb_find ↻ pc_num nxi_out nxi_fd sys_mmap ↻ ccz_cat_num sys_write ↻ sys_munmap pc_emit pb_composite pb_weighted pb_min_masked sys_mmap ↻ pb_tier pb_weakest pc_key ↻ pc_puts ↻ pc_q ↻

structs

none

consts

21const K_MAGIC_1048576: i64 = 1048576
22const K_MAGIC_1048560: i64 = 1048560

functions

24func pc_puts(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 }
25func pc_q() -> i64 { let b: *u8 = sys_mmap(1); b[0] = 34 as u8; sys_write(1, b, 1); return 0 }
called by 3: pc_keypc_emitmain calls 2: sys_mmapsys_write
26func pc_key(name: *u8) -> i64 { pc_q(); pc_puts(name); pc_q(); pc_puts(":" as *u8); return 0 }
called by 2: pc_emitmain calls 2: pc_qpc_puts
31func pc_num(v: i64) -> i64 { nxi_out(v); return 0 }
called by 3: pc_axis_namepc_emitmain calls 1: nxi_out
32func pc_strlen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
called by 1: pc_parse_csv
33func pc_atoi(a: *u8) -> i64
called by 1: main
42func pc_parse_csv(s: *u8, out: *i64, maxn: i64) -> i64
called by 1: main calls 1: pc_strlen
54func pc_axis_name(i: i64) -> i64
called by 1: pc_emit calls 2: pc_putspc_num
65func pc_tier_name(t: i64) -> i64
called by 1: pc_emit calls 1: pc_puts
73func pc_read(path: *u8, buf: *u8, cap: i64) -> i64
called by 1: main calls 3: sys_openat_rdsys_readsys_close
88func pc_sec(buf: *u8, n: i64, pat: *u8) -> i64
called by 1: main calls 1: pb_find
92func pc_emit(axes: *i64, w: *i64, mk: *i64, slack: i64, bar: i64) -> i64
120func main(argc: i64, argv: *i64) -> i64