nx_analyze.nx
buildroot/runtime/nx_analyze.nx
about
nx_analyze.nx -- THE ANALYST FRONT DOOR. Everything else in this arc is a library with no runnable
main: an agent could run the gates but could not actually analyse a dataset over MCP. This is the one
registered, cap-gated, verb-driven CLI that makes the whole stack callable -- by a human, an agent, or a
workflow step -- and it answers in STRUCTURED JSON so the caller parses fields, not prose.
DESIGN, against the operator's checklist:
MCP / API : one organ, one tool_allowlist row, driven entirely through the sovereign mgmt API.
AGENTIC : output is a single JSON object; every honesty flag (significant, family_significant,
truncated, degenerate, survives) is a machine field a planner can branch on.
WORKFLOW : verbs are orthogonal primitives -- `sig`/`ci` are pure and cheap for fan-out, `report`
is the composed pipeline. A workflow calls exactly the piece it needs.
COMPOSED : it owns no statistics of its own; it wires nx_dataframe -> nx_analyst_multi ->
nx_analyst_infer (significance / Bonferroni / CI / partial) over nx_analyst_store's
sharded loader. One seam, the pieces stay single-responsibility.
SCALE : reads REAL seg_store data across key shards <keybase>:0/:1/... past the 256 version
window, and DECLARES loaded-row count + truncation in the envelope rather than quietly
analysing a slice.
VERBS
nx_analyze sig <r_permille> <n>
nx_analyze ci <r_permille> <n> [alpha_permille=50]
nx_analyze report <prefix> <keybase> <target_idx> <nmax> <maxshards> <name0> <name1> ...
license_tier: ORIGINAL No hardware writes (Rule 26).
dependencies 4 imports · 1 importers
imports: nx_syscalls.nxnx_analyst_store.nxnx_analyst_causal.nxnx_analyst_insight.nx
imported by: nx_analyze_gate.nx
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| 28 | const AZ_MAGIC_2048: i64 = 2048 |
| 30 | const AZ_MAXCOL: i64 = 32 |
| 31 | const AZ_OUT: i64 = 65536 |
| 32 | const AZ_ALPHA_05: i64 = 50 |
| 33 | const AZ_EXIT_USAGE: i64 = 2 |
functions
| 35 | func az_err(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(2, s, n); return 0 } |
| 36 | func az_vlen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n } |
| 37 | func az_streq(a: *u8, b: *u8) -> i64 |
| 43 | func az_atoi(s: *u8) -> i64 |
| 57 | func az_raw(out: *u8, o: i64, s: *u8) -> i64 { var i: i64 = 0; while s[i] != (0 as u8) { out[o] = s[i]; o = o + 1; i = i + 1 } return o } |
| 58 | func az_num(out: *u8, o: i64, v: i64) -> i64 |
| 71 | func az_str(out: *u8, o: i64, s: *u8) -> i64 |
| 88 | func az_sig(rp: i64, n: i64, out: *u8) -> i64 |
| 108 | func az_ci(rp: i64, n: i64, alpha: i64, out: *u8) -> i64 |
| 132 | func az_report(prefix: *u8, keybase: *u8, tidx: i64, nmax: i64, maxsh: i64, names: *i64, ncol: i64, out: *u8) -> i64 called by 3: az_askmainmain calls 11: az_rawsys_mmapasr_load_field_shardedaz_numaz_stram_pearson_milli+5 |
| 255 | func az_kind_name(k: i64) -> *u8 called by 1: az_mine |
| 264 | func az_mine(prefix: *u8, keybase: *u8, nmax: i64, maxsh: i64, names: *i64, ncol: i64, out: *u8) -> i64 called by 3: az_askmainmain calls 8: az_rawsys_mmapasr_load_field_shardedai_mine_scanins_confaz_num+2 |
| 347 | func az_lc(c: i64) -> i64 { if c >= 65 { if c <= 90 { return c + 32 } } return c } called by 1: az_has_ci |
| 348 | func az_has_ci(hay: *u8, needle: *u8) -> i64 |
| 365 | func az_nums(s: *u8, nums: *i64, want: i64) -> i64 called by 1: az_ask |
| 391 | func az_resolve_target(question: *u8, names: *i64, ncol: i64) -> i64 |
| 400 | func az_embed(out: *u8, o: i64, tmp: *u8, tn: i64) -> i64 called by 1: az_ask |
| 407 | func az_ask(question: *u8, dsargs: *i64, nds: i64, out: *u8) -> i64 |
| 464 | func main(argc: i64, argv: *i64) -> i64 |