code wiki / (root) / nx_dr_chain_cli.nx

nx_dr_chain_cli.nx

buildroot/runtime/nx_dr_chain_cli.nx

7857 B161 linesdepth 5pulls 10 transitivereach 0 importersview sourcekind tooltopic dr
docsdependenciesstructsconstsfunctions

about

nx_dr_chain_cli.nx -- ONE CALL runs the whole sovereign deep-research loop (DR-CHAIN). judge (tokenize+containment of every source vs the shared groundtruth insight set) -> conduct (verify-yield -> Elo tournament -> opportunity-cost budget dispatch) -> score (insight-recall of what was actually selected, vs what was achievable) nx_dr_chain <threshold_permil> <budget> <n_insights> <insight_1..n> <cost_1> <doc_1> ... e.g. nx_dr_chain 600 3 3 "alpha one" "beta two" "gamma three" \ 2 "alpha one beta two" 3 "gamma three extra words here" 1 "alpha one" -> {"recall_all_permil":1000,"recall_selected_permil":666,"budget_cost_permil":334,...} The recall_all vs recall_selected delta is the MEASURED COST of the opportunity-cost constraint -- the number no single-agent research tool reports. license_tier: ORIGINAL No hw writes (Rule 26). expect_exit: 0

dependencies 6 imports · 0 importers

nx_dr_chain.nx nx_itoa_lib.nx nx_dr_run.nx nx_dr_conductor.nx nx_dr_drbench.nx nx_syscalls.nx nx_dr_chain_cli.nx

imports: nx_dr_chain.nxnx_itoa_lib.nxnx_dr_run.nxnx_dr_conductor.nxnx_dr_drbench.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 ch_puts sys_write ch_key ch_q sys_mmap sys_write ↻ ch_puts ↻ ch_q ↻ sys_exit ch_atoi sys_mmap ↻ drr_tokenize drr_hash drr_strlen chain_judge_all dv_entail dv_contains chain_sel_cov dr_frac dr_sum cond_run cond_quality el_make_etab sys_mmap ↻ sys_mmap ↻ el_run_tournament el_expected el_update ocm_priority ocm_rank sys_mmap ↻ ocm_select ch_num nxi_out nxi_fd sys_mmap ↻ ccz_cat_num sys_write ↻ sys_munmap

structs

none

consts

18const K_MAGIC_8192: i64 = 8192
19const K_MAGIC_1024: i64 = 1024
20const K_MAGIC_65536: i64 = 65536

functions

22func ch_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 2: ch_keymain calls 1: sys_write
23func ch_q() -> i64 { let b: *u8 = sys_mmap(1); b[0] = 34 as u8; sys_write(1, b, 1); return 0 }
called by 2: ch_keymain calls 2: sys_mmapsys_write
24func ch_key(name: *u8) -> i64 { ch_q(); ch_puts(name); ch_q(); ch_puts(":" as *u8); return 0 }
called by 1: main calls 2: ch_qch_puts
29func ch_num(v: i64) -> i64 { nxi_out(v); return 0 }
called by 1: main calls 1: nxi_out
30func ch_atoi(a: *u8) -> i64
called by 1: main
40func main(argc: i64, argv: *i64) -> i64