code wiki / _hdl_build / nx_ws_miner.nx
nx_ws_miner.nx
buildroot/runtime/_hdl_build/nx_ws_miner.nx
about
nx_ws_miner.nx -- F217-class HISTORIC WORKSTREAM MINER (ws=ws-intel, 2026-07-20).
Mines the append-only ws_sync journal (the ecosystem's workstream HISTORY) into
machine-readable intelligence: per-lane lifecycle (kickoffs/beats/dones, first/last ts,
distinct actors, DONE|ACTIVE|STALE|ABANDONED), per-actor engagement, honest totals.
The journal IS the historic record -- this organ makes it QUERYABLE (JSON verb) and
PUBLISHABLE (HTML page verb) so monitoring parallel + historic workstreams is a live
ecosystem surface, not Claude-context archaeology. Sibling of nx_ws_kickoff_sync
(the writer) and nx_ws_cycle (evidence-derived phase). Composes -- does not duplicate.
SCALE LAW: reads windowed + envelope DECLARED in output (window_bytes / truncated /
lanes_capped / actors_capped) -- silent capping forbidden by construction.
license_tier: ORIGINAL No hw writes (Rule 26).
mine <journal> [stale_sec] [abandoned_sec] -> JSON to stdout
page <journal> <outfile> [stale_sec] [abandoned_sec] -> HTML file + marker line
selftest <scratch-journal> -> gate T1..T9 (caller pre-cleans path)
dependencies 2 imports · 0 importers
imports: nx_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
structs
| none |
consts
| 17 | const WM_MAGIC_4096: i64 = 4096 |
| 18 | const WM_MAGIC_2000: i64 = 2000 |
| 19 | const WM_MAGIC_3000: i64 = 3000 |
| 20 | const WM_MAGIC_7200: i64 = 7200 |
| 22 | const WM_WIN: i64 = 4194304 |
| 23 | const WM_OUT: i64 = 262144 |
| 24 | const WM_SOFT: i64 = 40960 |
| 25 | const WM_SOFT2: i64 = 57344 |
| 26 | const WM_PAGE_SOFT: i64 = 245760 |
| 27 | const WM_NOTE_MAX: i64 = 160 |
| 28 | const WM_NAME_MAX: i64 = 120 |
| 29 | const WM_STALE_DEF: i64 = 3600 |
| 30 | const WM_ABAND_DEF: i64 = 604800 |
functions
| 33 | func wm_cat(d: *u8, o: i64, s: *u8) -> i64 { var p: i64=o; var i: i64=0; while s[i]!=(0 as u8){ d[p]=s[i]; p=p+1; i=i+1 } return p } |
| 34 | func wm_catn(d: *u8, o: i64, v: i64) -> i64 |
| 46 | func wm_vlen(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n } |
| 47 | func wm_atoi_z(s: *u8) -> i64 { var v: i64=0; var i: i64=0; while s[i]!=(0 as u8){ let c: i64=s[i] as i64; if c>=48 { if c<=57 { v=v*10+(c-48) } } i=i+1 } return v } called by 1: main |
| 48 | func wm_read(path: *u8, buf: *u8, cap: i64) -> i64 |
| 58 | func wm_append(journal: *u8, ts: i64, verb: *u8, ws: *u8, actor: *u8, note: *u8) -> i64 called by 1: wm_selftest calls 7: sys_now_realtime_secsys_mmapwm_catnwm_catsys_openat_appendsys_write+1 |
| 79 | func wm_le(q: *u8, i: i64, n: i64) -> i64 |
| 85 | func wm_col(q: *u8, ls: i64, le: i64, c: i64, out: *i64) -> i64 |
| 101 | func wm_lit_eq(q: *u8, s: i64, e: i64, lit: *u8) -> i64 |
| 107 | func wm_span_eq(q: *u8, s1: i64, e1: i64, s2: i64, e2: i64) -> i64 |
| 113 | func wm_atoi(q: *u8, s: i64, e: i64) -> i64 |
| 119 | func wm_frames(q: *u8, n: i64) -> i64 |
| 127 | func wm_first_kick(q: *u8, upto: i64, ws_s: i64, ws_e: i64) -> i64 |
| 140 | func wm_has(q: *u8, n: i64, verb: *u8, ws_s: i64, ws_e: i64) -> i64 |
| 153 | func wm_count_verb(q: *u8, cx: *i64, verb: *u8, ws_s: i64, ws_e: i64) -> i64 |
| 168 | func wm_first_ts(q: *u8, cx: *i64, ws_s: i64, ws_e: i64) -> i64 |
| 182 | func wm_last_ts(q: *u8, cx: *i64, ws_s: i64, ws_e: i64) -> i64 called by 4: wm_statewm_emit_lanewm_page_htmlwm_selftest calls 5: sys_mmapwm_lewm_colwm_span_eqwm_atoi |
| 197 | func wm_note_span(q: *u8, cx: *i64, ws_s: i64, ws_e: i64, out: *i64) -> i64 |
| 214 | func wm_ws_actors(q: *u8, cx: *i64, ws_s: i64, ws_e: i64) -> i64 |
| 243 | func wm_state(q: *u8, cx: *i64, ws_s: i64, ws_e: i64) -> i64 |
| 252 | func wm_state_name(st: i64) -> *u8 |
| 258 | func wm_lanes_total(q: *u8, cx: *i64, t: *i64) -> i64 called by 3: wm_mine_jsonwm_page_htmlwm_selftest calls 6: sys_mmapwm_lewm_colwm_lit_eqwm_first_kickwm_state |
| 277 | func wm_ws_span_lit(q: *u8, cx: *i64, ws: *u8, out: *i64) -> i64 |
| 288 | func wm_actor_span_lit(q: *u8, cx: *i64, actor: *u8, out: *i64) -> i64 |
| 301 | func wm_actor_seen(q: *u8, upto: i64, a_s: i64, a_e: i64) -> i64 |
| 311 | func wm_actors_distinct(q: *u8, cx: *i64) -> i64 |
| 323 | func wm_actor_frames(q: *u8, cx: *i64, a_s: i64, a_e: i64) -> i64 |
| 335 | func wm_actor_ws(q: *u8, cx: *i64, a_s: i64, a_e: i64) -> i64 |
| 365 | func wm_jesc(d: *u8, o: i64, q: *u8, s: i64, e: i64, maxb: i64) -> i64 |
| 379 | func wm_key(d: *u8, o: i64, name: *u8) -> i64 |
| 389 | func wm_qlit(d: *u8, o: i64, s: *u8) -> i64 |
| 396 | func wm_emit_lane(d: *u8, o: i64, q: *u8, cx: *i64, ws_s: i64, ws_e: i64) -> i64 |
| 447 | func wm_emit_actor(d: *u8, o: i64, q: *u8, cx: *i64, a_s: i64, a_e: i64) -> i64 |
| 465 | func wm_mine_json(q: *u8, cx: *i64, d: *u8) -> i64 |
| 583 | func wm_hesc(d: *u8, o: i64, q: *u8, s: i64, e: i64, maxb: i64) -> i64 |
| 597 | func wm_td_n(d: *u8, o: i64, v: i64) -> i64 |
| 604 | func wm_page_html(q: *u8, cx: *i64, d: *u8) -> i64 |
| 692 | func wm_find(d: *u8, dn: i64, lit: *u8) -> i64 |
| 707 | func wm_selftest(journal: *u8) -> i64 |
| 789 | func main(argc: i64, argv: *i64) -> i64 |