code wiki / _hdl_build / nx_frontier_board.nx
nx_frontier_board.nx
buildroot/runtime/_hdl_build/nx_frontier_board.nx
about
nx_frontier_board.nx -- F-202: the FRONTIER BOARD / CPM engine (operator 2026-07-17:
"get us to mcp and api and workstreams and tools and agents ... we should use tsv";
TSV col3 = dur -> "computes ES/EF/LS/LF, total float, and the critical path FROM this
single source; float is DERIVED, never stored").
Reads the 9-col frontier_queue.tsv (id title w dur owner status deps milestone lane),
runs a forward/backward CPM pass over the dependency DAG, derives DONE/READY/BLOCKED/
EXTERNAL, and EMITS machine-readable JSON (the interchange for the API route, the MCP
tool, and agents) or an HTML board -- big-rocks-first.
argv[1] = queue path (default knowledge/registry/frontier_queue.tsv)
argv[FB_IDX_MODE] = mode "json"(default->stdout) | "html"(->argv[FB_IDX_OUT] or stdout)
Column/dep semantics MIRROR nx_frontier.nx byte-for-byte so the board never disagrees.
INPUT (store-law): reads the SOVEREIGN seg-store (knowledge/store/frontier-) by default via
frs_load; a .tsv path may be passed as argv[1] for staging/gate fixtures only.
license_tier: ORIGINAL No hw writes (Rule 26). expect_exit: 0
dependencies 2 imports · 0 importers
imports: nx_frontier_store.nxnx_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
| 18 | const FB_TAB: i64 = 9 |
| 19 | const FB_NL: i64 = 10 |
| 20 | const FB_HASH: i64 = 35 |
| 21 | const FB_DASH: i64 = 45 |
| 22 | const FB_COMMA: i64 = 44 |
| 23 | const FB_D: i64 = 68 |
| 24 | const FB_X: i64 = 88 |
| 25 | const FB_ZERO: i64 = 48 |
| 26 | const FB_NINE: i64 = 57 |
| 27 | const FB_HTMLH: i64 = 104 |
| 28 | const FB_S: i64 = 115 // 's' of "store" -- argv[1] source selector |
| 29 | const FB_QCAP: i64 = 1048576 |
| 30 | const FB_OUTCAP: i64 = 262144 |
| 31 | const FB_MAXN: i64 = 1024 // envelope: raised 256->1024 (seq639; store was 491 rows and the old cap silently dropped 235) |
| 32 | const FB_EMIT_READY: i64 = 80 // DECLARED emit envelope: top-N ready by weight |
| 33 | const FB_EMIT_BLK: i64 = 80 // DECLARED emit envelope: blocked rows |
| 34 | const FB_EMIT_TASKS: i64 = 260 // DECLARED emit envelope: CPM task rows |
| 35 | const FB_TITLE_MAX: i64 = 140 // per-title emit bound -- long titles blew the 64KiB tools/call cap |
| 36 | const FB_I64: i64 = 8 // sizeof(i64) -- array element / pointer-slot stride |
| 37 | const FB_NCOL: i64 = 9 // the TSV has exactly 9 tab-separated columns |
| 38 | const FB_PAIR: i64 = 2 // fb_cols stores each column as a (start,end) pair |
| 39 | const FB_SP_BYTES: i64 = 160 // scratch for the 9 (start,end) column pairs |
| 40 | const FB_TMP_BYTES: i64 = 28 // fb_puti decimal scratch |
| 41 | const FB_U_BYTES: i64 = 16 // first-unmet (start,end) out slot |
| 42 | const FB_WMAX: i64 = 9 // top weight bucket (big-rocks-first scan) |
| 43 | const FB_MODE: i64 = 0x1a4 // 0644 -- html output file perms |
| 44 | const FB_QSLACK: i64 = 16 // read cap headroom under FB_QCAP |
| 45 | const FB_STDERR: i64 = 2 // stderr fd |
| 46 | const FB_BASE10: i64 = 10 // decimal base for int<->string |
| 48 | const FB_EXT: i64 = 0 // external-blocked (status X) |
| 49 | const FB_DONE: i64 = 1 // done (status D) |
| 50 | const FB_READY: i64 = 2 // todo, all deps done |
| 51 | const FB_BLK: i64 = 3 // todo, a dep unmet |
| 53 | const FB_IDX_MODE: i64 = 2 // argv[FB_IDX_MODE] = mode |
| 54 | const FB_IDX_OUT: i64 = 3 // argv[FB_IDX_OUT] = html out path |
| 55 | const FB_ARGC_MODE: i64 = 3 // >= this -> mode arg present |
| 56 | const FB_ARGC_OUT: i64 = 4 // >= this -> out-path arg present |
| 58 | const COL_ID_A: i64 = 0 |
| 59 | const COL_ID_B: i64 = 1 |
| 60 | const COL_TITLE_A: i64 = 2 |
| 61 | const COL_TITLE_B: i64 = 3 |
| 62 | const COL_W_A: i64 = 4 |
| 63 | const COL_W_B: i64 = 5 |
| 64 | const COL_DUR_A: i64 = 6 |
| 65 | const COL_DUR_B: i64 = 7 |
| 66 | const COL_OWN_A: i64 = 8 |
| 67 | const COL_OWN_B: i64 = 9 |
| 68 | const COL_STAT_A: i64 = 10 |
| 69 | const COL_DEP_A: i64 = 12 |
| 70 | const COL_DEP_B: i64 = 13 |
| 71 | const COL_LANE_A: i64 = 16 |
| 72 | const COL_LANE_B: i64 = 17 |
functions
| 74 | func fb_puts(buf: *u8, off: i64, s: *u8) -> i64 called by 1: main |
| 80 | func fb_werr(s: *u8) -> i64 |
| 86 | func fb_putsl(buf: *u8, off: i64, q: *u8, a: i64, b: i64) -> i64 |
| 92 | func fb_puttitle(buf: *u8, off: i64, q: *u8, a: i64, b: i64) -> i64 |
| 97 | func fb_puti(buf: *u8, off: i64, v: i64) -> i64 |
| 109 | func fb_read(path: *u8, buf: *u8, cap: i64) -> i64 |
| 123 | func fb_cols(q: *u8, ls: i64, le: i64, sp: *i64) -> i64 called by 1: main |
| 138 | func fb_slice_eq(q: *u8, s: i64, e: i64, bs: i64, be: i64) -> i64 called by 1: fb_resolve |
| 144 | func fb_slice_int(q: *u8, a: i64, b: i64) -> i64 called by 1: main |
| 155 | func fb_resolve(q: *u8, ida: *i64, idb: *i64, n: i64, da: i64, db: i64) -> i64 |
| 161 | func fb_dep_maxef(q: *u8, a: i64, b: i64, ida: *i64, idb: *i64, n: i64, efv: *i64) -> i64 |
| 175 | func fb_has_dep_on(q: *u8, a: i64, b: i64, ida: *i64, idb: *i64, n: i64, target: i64) -> i64 |
| 188 | func fb_first_unmet(q: *u8, a: i64, b: i64, ida: *i64, idb: *i64, n: i64, statv: *i64, u: *i64) -> i64 |
| 205 | func fb_class(q: *u8, i: i64, depa: *i64, depb: *i64, ida: *i64, idb: *i64, n: i64, statv: *i64) -> i64 |
| 214 | func main(argc: i64, argv: *i64) -> i64 |