nx_workflow_lib.nx
buildroot/runtime/nx_workflow_lib.nx
about
nx_workflow_lib.nx -- CONSOLIDATED workflow tool (MCP name: nx_workflow, tool #5 of the 15), LIBRARY
half. READ-ONLY first increment over the WMS registry SSOT (knowledge/store/ws-): the operator's
"workstreams callable from anywhere" ask -- a crash needs only this board + a resume trigger.
board <prefix> -> every workstream: state / empire / id / last_touched (+ per-state totals)
show <prefix> <id> -> one workstream, every field labeled
Composes the WMS store lib (ws_get_p / ws_field / WS record schema) -- no reinvention. spawn/dispatch/
resume = WRITE increments behind their own cap, after this read surface is proven.
license_tier: ORIGINAL
dependencies 3 imports · 2 importers
imports: nx_syscalls.nxnx_itoa_lib.nxnx_workstream_store.nx
imported by: nx_workflow.nxnx_workflow_gate.nx
structs
| none |
consts
| 13 | const WF_REC_CAP: i64 = 8192 // one ws:<id> record working buffer |
| 14 | const WF_IDS_CAP: i64 = 262144 // ws:ids index working buffer |
| 15 | const WF_FIELD_CAP: i64 = 1024 // one extracted field |
| 16 | const WF_KEY_CAP: i64 = 512 |
| 17 | const WF_ASCII_0: i64 = 48 // '0' |
| 18 | const WF_F_EMPIRE: i64 = 1 // record field slots (schema: id empire state last_touched memory code deps) |
| 19 | const WF_F_STATE: i64 = 2 |
| 20 | const WF_F_TOUCHED: i64 = 3 |
| 21 | const WF_F_MEMORY: i64 = 4 |
| 22 | const WF_F_CODE: i64 = 5 |
| 23 | const WF_SUM_MAX: i64 = 40 // summary caps the ACTIVE listing (loudly) -- agent-context-sized |
| 24 | const WF_F_DEPS: i64 = 6 |
functions
| 26 | func wf_puts(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 } |
| 31 | func wf_putn(v: i64) -> i64 { nxi_out(v); return 0 } |
| 32 | func wf_seq(a: *u8, b: *u8) -> i64 { var i: i64 = 0; while a[i] != (0 as u8) { if a[i] != b[i] { return 0 } i = i + 1 } if b[i] != (0 as u8) { return 0 } return 1 } |
| 34 | func wf_key(out: *u8, id: *u8, idlen: i64) -> i64 |
| 45 | func wf_show_field(rec: *u8, rlen: i64, f: i64, label: *u8) -> i64 |
| 54 | func wf_board(prefix: *u8) -> i64 |
| 112 | func wf_summary(prefix: *u8) -> i64 |
| 179 | func wf_show(prefix: *u8, id: *u8) -> i64 |