code wiki / _hdl_build / nx_harnessmine.nx

nx_harnessmine.nx

buildroot/runtime/_hdl_build/nx_harnessmine.nx

15422 B324 linesdepth 3pulls 4 transitivereach 0 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

about

nx_harnessmine.nx -- HARNESS-CLASS MINER over the gate-outcome journal (miner-sota F1012, 2026-07-23). The census (nx_minecov MC09) measured the harness class at ZERO evidence: 953+ gates run constantly and NOTHING recorded an outcome, so flake and erosion were structurally invisible. nx_gate_verdict now self-records one actlog-grammar frame per verdict (fail-soft); this mines that history for the two signals a pass/fail count cannot give: FLAKE = the same gate has produced BOTH outcomes (non-determinism -- the gate cannot be trusted) EROSION = a gate that was GREEN later went RED (a BANKED WIN LOST -- the ratchet law's RED). A gate that went RED then GREEN is a FIX, explicitly NOT erosion; the distinction is the point. Order matters, so frames are walked in journal order per gate. now INJECTABLE for deterministic tests. Composes nx_sovjson_lib (sj_*). Read-only. No hw writes (Rule 26). mine <journal> [minruns] [now] -> JSON per-gate + totals (green_permil, flaky, eroded) selftest <scratch-prefix> -> gate T1..T8 frame cols: ts TAB ws TAB gate TAB verb TAB outcome(GREEN|RED) TAB passed/total license_tier: ORIGINAL

dependencies 3 imports · 0 importers

nx_sovjson_lib.nx nx_syscalls.nx nx_gate_verdict.nx nx_harnessmine.nx

imports: nx_sovjson_lib.nxnx_syscalls.nxnx_gate_verdict.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main sj_puts sys_write sys_exit sj_vlen sj_lit_eq hm_selftest gv_ctr sys_mmap gv_head gv_puts sys_write ↻ sys_mmap ↻ sj_cat sj_catn sys_mmap ↻ sys_now_realtime_sec sys_mmap ↻ sys_clock_gettime_real sys_openat_wr sys_write ↻ sys_close hm_mine_json sys_mmap ↻ hm_read sys_openat_rd sys_read sys_close ↻ sj_le sj_col sj_lit_eq ↻ hm_digits sj_atoi_span hm_key sj_cat ↻ sj_catn ↻ sj_cat ↻ sj_cat_esc sj_vlen ↻ gv_check

structs

none

consts

18const HM_MAGIC_1785000000: i64 = 1785000000
19const HM_MAGIC_4088: i64 = 4088
21const HM_WIN: i64 = 4194304
22const HM_OUT: i64 = 65536
23const HM_PATH: i64 = 512
24const HM_GATES: i64 = 512
25const HM_TOPN: i64 = 30
26const HM_PERMIL: i64 = 1000
27const HM_DAY: i64 = 86400
28const HM_NAME_MAX: i64 = 120
29const HM_MODE_644: i64 = 420

functions

31func hm_read(path: *u8, buf: *u8, cap: i64) -> i64
40func hm_find(q: *u8, n: i64, lit: *u8) -> i64
called by 1: hm_selftest calls 1: sj_vlen
53func hm_key(d: *u8, o: i64, name: *u8) -> i64
called by 1: hm_mine_json calls 1: sj_cat
63func hm_digits(q: *u8, s: i64, e: i64) -> i64
called by 1: hm_mine_json
69func hm_mine_json(jpath: *u8, minruns: i64, now: i64, d: *u8) -> i64
238func hm_selftest(prefix: *u8) -> i64
300func main(argc: i64, argv: *i64) -> i64