code wiki / _hdl_build / nx_ws_active_board.nx
nx_ws_active_board.nx
buildroot/runtime/_hdl_build/nx_ws_active_board.nx
about
nx_ws_active_board.nx -- the HONEST live workstream board, re-derived from the WORKLOG.
WHY: nx_ws_board renders the WMS-R1 registry SSOT, whose per-stream `state` was frozen at
populate-time and was never wired to live work -- so it reports active=3 while the real work
touched ~70 workstreams in the last days. The registry is also a DIFFERENT id-space (queue ids)
than the live project-*.md workstreams, so it cannot see them at all. The LIVE source of truth
for "what are we actually working on" is the worklog: every tool action appends one line
<epoch>\t<event>\t<tool>\t<target>
where <target> for a workstream edit is .../project-<NAME>.md. This organ derives the active set
straight from that log: distinct workstreams, last-touch epoch, edit count, ALIVE within a window.
ADDITIVE + SAFE: it READS the worklog and the registry SSOT is NEVER touched (no ws_put, no
rewrite) -- this is a new truthful VIEW beside the registry board, not a mutation of it.
NEGATIVE CONTROL: a built-in self-test runs the same parser over a synthetic fixture (2 real
project lines + a duplicate + 2 non-project lines) and asserts distinct=2 / dedup / non-project
ignored -- so GREEN means the parser discriminates, never a rubber stamp.
Sovereign: imports only nx_syscalls. license_tier: ORIGINAL
dependencies 1 imports · 0 importers
imports: nx_syscalls.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
| 19 | const WL_MAGIC_4096: i64 = 4096 |
| 21 | const WL_PATH: *u8 = "/mnt/c/Users/elder/.claude/projects/C--Users-elder/memory/worklog/worklog.tsv" |
| 22 | const WL_FBUF: i64 = 8388608 // 8MB: read the whole append-only worklog (~1MB today; headroom) |
| 23 | const AB_MAXW: i64 = 4096 // max distinct workstreams |
| 24 | const AB_SLOT: i64 = 256 // per-name byte slot |
| 25 | const AB_WINDOW: i64 = 172800 // 2 days: "ALIVE" if touched within this of the latest log epoch |
| 26 | const AB_TOPN: i64 = 50 // how many rows to list |
functions
| 28 | func ab_len(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n } |
| 29 | func ab_p(s: *u8) -> i64 { let n: i64 = ab_len(s); sys_write(1, s, n); return 0 } |
| 30 | func ab_pn(v: i64) -> i64 |
| 41 | func ab_streq(a: *u8, b: *u8) -> i64 called by 1: ab_selftest |
| 49 | func ab_cat(buf: *u8, off: i64, s: *u8) -> i64 called by 1: ab_selftest |
| 56 | func ab_read(path: *u8, buf: *u8, cap: i64) -> i64 |
| 70 | func ab_find(buf: *u8, from: i64, to: i64, pat: *u8) -> i64 |
| 84 | func ab_eqrange(buf: *u8, s: i64, e: i64, str: *u8) -> i64 called by 1: ab_scan |
| 94 | func ab_scan(buf: *u8, n: i64, names: *i64, epochs: *i64, counts: *i64, cap: i64, nowp: *i64) -> i64 |
| 161 | func ab_sort(names: *i64, epochs: *i64, counts: *i64, cnt: i64) -> i64 called by 1: main |
| 183 | func ab_selftest() -> i64 |
| 213 | func main() -> i64 |