code wiki / _hdl_build / nx_analyst.nx
nx_analyst.nx
buildroot/runtime/_hdl_build/nx_analyst.nx
about
nx_analyst.nx -- the NISHI ANALYST organ (the market-researcher RENAMED + given its real job).
Operator: "determine why it is so expensive to get an AC when its simpler than a computer and get
REAL answers, not regurgitated common wisdoms filled in the media... trace the supply chain costs,
the labor cycle, benchmark, to see where all the shenanigans like corruption/inflation are."
RACI: the RESEARCHER gathers + corroborates evidence (V_RESEARCH); the ANALYST EXPLAINS it
(V_ANALYZE) -- decomposes a measured price into a TRACED COST LEDGER and quantifies what the
trace CANNOT explain. The verdict mechanism that kills common-wisdom answers:
- a cost claim with no corroborated source is a NARRATIVE node: it is NEVER admitted as a cost,
it becomes a fetch-task for the Researcher (media answers are narrative nodes -> 0 admitted);
- the ledger must CLOSE arithmetically (children sum to parent within tolerance) -- a story
whose numbers don't add up is a defect, not an explanation;
- the UNEXPLAINED RESIDUAL (price minus traced costs) is computed and NAMED, never smoothed
over: that residual is exactly where margin-stacking / rent-seeking / "shenanigans" live;
- verdicts are DETERMINISTIC: same ledger, same verdict, every run (an LLM one-shot varies).
Honest boundary (same as nx_researcher.nx): FETCH+EXTRACT of source prose into numbers is the
one delegated step; everything that makes the analysis RIGOROUS the team owns and runs.
LAWS: struct-free, integer-only (cents / permil / ppm / q10), no &&/||. license_tier: ORIGINAL
dependencies 1 imports · 5 importers
imports: nx_syscalls.nx
imported by: nx_analyst_case_ac.nxnx_analyst_case_sources.nxnx_analyst_gate.nxnx_analyst_serve.nxnx_ledger_data.nx
structs
| none |
consts
| 20 | const AN_MAGIC_1000000: i64 = 1000000 |
| 21 | const AN_MAGIC_1024: i64 = 1024 |
| 24 | const AN_NARRATIVE: i64 = 0 // claim with NO corroborated source ("everyone knows installs are pricey") |
| 25 | const AN_MEASURED: i64 = 1 // value from >=2 independent sources (Researcher rd_corroborated rule) |
| 26 | const AN_DERIVED: i64 = 2 // computed from measured children (sum/share), provenance inherited |
| 29 | const AN_EXPLAINED: i64 = 1 // coverage high, residual small -> the price IS its traced costs |
| 30 | const AN_SHENANIGAN: i64 = 2 // ledger closes, coverage high, residual LARGE -> unexplained money, NAMED |
| 31 | const AN_UNDERTRACED: i64 = 3 // coverage too low to call -> honest "don't know yet" + fetch tasks owed |
| 32 | const AN_BROKEN: i64 = 4 // arithmetic does not close, or narrative admitted -> not an explanation |
functions
| 38 | func an_children_sum(parent: *i64, value: *i64, n: i64, node: i64) -> i64 |
| 49 | func an_is_leaf(parent: *i64, n: i64, node: i64) -> i64 |
| 59 | func an_closure_ppm(node_value: i64, csum: i64) -> i64 called by 1: an_closure_fails |
| 67 | func an_closure_fails(parent: *i64, value: *i64, n: i64, tol_ppm: i64) -> i64 |
| 82 | func an_narrative_admitted(kind: *i64, value: *i64, n: i64) -> i64 |
| 94 | func an_fetch_tasks_owed(kind: *i64, n: i64) -> i64 called by 1: main |
| 105 | func an_traced_cents(parent: *i64, value: *i64, kind: *i64, n: i64) -> i64 |
| 118 | func an_traced_permil(price_cents: i64, traced_cents: i64) -> i64 |
| 124 | func an_residual_cents(price_cents: i64, traced_cents: i64) -> i64 |
| 128 | func an_residual_permil(price_cents: i64, traced_cents: i64) -> i64 |
| 136 | func an_verdict(closure_fails: i64, narrative_admitted: i64, traced_permil: i64, |
| 147 | func an_ledger_verdict(parent: *i64, value: *i64, kind: *i64, n: i64, |
| 159 | func an_price_per_complexity(price_cents: i64, complexity_units: i64) -> i64 |
| 167 | func an_paradox_q10(price_a: i64, cx_a: i64, price_b: i64, cx_b: i64) -> i64 |
| 175 | func an_is_reproducible(parent: *i64, value: *i64, kind: *i64, n: i64, |