code wiki / _hdl_build / nx_ledger_data.nx
nx_ledger_data.nx
buildroot/runtime/_hdl_build/nx_ledger_data.nx
about
nx_ledger_data.nx -- LEDGER-AS-DATA (rung AN1): an Analyst case is a .led FILE, not code.
New question = new file, NO recompile (the vizsla archetype-matrix lesson). The file carries
SOURCE COLUMNS so the strict source-criticism re-grade is data too: every MEASURED leaf must
be backed by >=2 DISTINCT incentive classes or it is DEMOTED to DERIVED before the verdict.
Grammar (one record per line; '#'/blank = comment; integers only, space-separated):
T <tol_ppm> <min_traced_permil> <max_residual_permil> (exactly one)
C <class_a> <class_b> (opposed pair; 0..4 rows)
S <rel 1-6> <cred 1-6> <party 1-3> <method 1-5> <class> (source; idx = order)
N <parent> <value_cents> <kind 0/1/2> (node; idx = order; node 0 = root)
B <node> <src> (backing edge)
Any other line, bad field, bad grade, or bad reference fails LOUD (parse returns 0) -- a
ledger that cannot be read exactly is never half-answered. Composes nx_analyst (verdict math)
+ nx_source_grade (grades, independence, confidence). LAWS: struct-free, integer-only, flat
ifs, <=6 args (st-table for the parse state). license_tier: ORIGINAL
dependencies 3 imports · 4 importers
imports: nx_analyst.nxnx_source_grade.nxnx_syscalls.nx
imported by: nx_analyst_case_led.nxnx_analyst_html.nxnx_ledger_data_gate.nxnx_market_cmp.nx
structs
| none |
consts
| 19 | const LD_MAX_SRC: i64 = 64 |
| 20 | const LD_MAX_NODE: i64 = 64 |
| 21 | const LD_MAX_EDGE: i64 = 256 |
| 22 | const LD_MAX_OPP: i64 = 4 |
| 25 | const LD_REL: i64 = 0 // *i64[LD_MAX_SRC] |
| 26 | const LD_CRED: i64 = 1 |
| 27 | const LD_PARTY: i64 = 2 |
| 28 | const LD_METHOD: i64 = 3 |
| 29 | const LD_CLASS: i64 = 4 |
| 30 | const LD_PARENT: i64 = 5 // *i64[LD_MAX_NODE] |
| 31 | const LD_VALUE: i64 = 6 |
| 32 | const LD_KIND: i64 = 7 |
| 33 | const LD_BNODE: i64 = 8 // *i64[LD_MAX_EDGE] |
| 34 | const LD_BSRC: i64 = 9 |
| 35 | const LD_OPPA: i64 = 10 // *i64[LD_MAX_OPP] |
| 36 | const LD_OPPB: i64 = 11 |
| 37 | const LD_NS: i64 = 12 // counts |
| 38 | const LD_NN: i64 = 13 |
| 39 | const LD_NB: i64 = 14 |
| 40 | const LD_NC: i64 = 15 |
| 41 | const LD_TOL: i64 = 16 // thresholds |
| 42 | const LD_MINTP: i64 = 17 |
| 43 | const LD_MAXRP: i64 = 18 |
| 44 | const LD_NT: i64 = 19 // how many T rows seen (must end at exactly 1) |
functions
| 46 | func ld_alloc(st: *i64) -> i64 |
| 64 | func ld_line_end(b: *u8, i: i64, n: i64) -> i64 |
| 69 | func ld_skip(b: *u8, i0: i64, e: i64) -> i64 |
| 77 | func ld_int(b: *u8, j0: i64, e: i64, out: *i64) -> i64 |
| 96 | func ld_ints(b: *u8, i0: i64, e: i64, k: i64, out: *i64) -> i64 |
| 110 | func ld_line(b: *u8, i: i64, e: i64, st: *i64) -> i64 |
| 173 | func ld_parse(b: *u8, n: i64, st: *i64) -> i64 |
| 186 | func ld_parse_file(path: *u8, st: *i64) -> i64 |
| 196 | func ld_class_best(st: *i64, node: i64, c: i64) -> i64 |
| 220 | func ld_node_support(st: *i64, node: i64, out: *i64) -> i64 |
| 264 | func ld_strict_kinds(st: *i64, skind: *i64) -> i64 |
| 285 | func ld_eval(st: *i64, out: *i64) -> i64 |