code wiki / _hdl_build / nx_role_queue.nx
nx_role_queue.nx
buildroot/runtime/_hdl_build/nx_role_queue.nx
about
nx_role_queue.nx -- the ROLE-PARAMETERIZED serialized work intake (generalizes nx_doctor_queue so the SAME
mechanism serves EVERY change-applying role: Doctor=fix, Engineer=optimize, ... each with its OWN isolated
queue/ledger/lock). A role SUBMITs a change request; the role PUMPs its own queue one-at-a-time under its
per-role lock, applying each via the gated graceful doc_apply_mem (lock + exact-context-match + atomic), then
flips the line to APPLIED/CONFLICT/AMBIGUOUS + ledgers. Idempotent. Per-role isolation = roles never compete.
queue line: status<TAB>ts<TAB>role<TAB>requester<TAB>target<TAB>oldstr-path<TAB>newstr-path
usage: nx_role_queue <role> submit <target> <oldfile> <newfile> <requester>
nx_role_queue <role> pump
license_tier: ORIGINAL
dependencies 4 imports · 3 importers
imports: nx_syscalls.nxnx_arbiter.nxnx_doctor_apply.nxnx_role_store.nx
imported by: nx_pm.nxnx_pm_gate.nxnx_role_store_gate.nx
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| 15 | const RQ_MAGIC_4096: i64 = 4096 |
| 16 | const RQ_MAGIC_100000: i64 = 100000 |
| 17 | const RQ_MAGIC_1024: i64 = 1024 |
| 18 | const RQ_MAGIC_2048: i64 = 2048 |
| 20 | const RQ_DIR: *u8 = "knowledge/roles" |
functions
| 22 | func rq_w(s: *u8) -> i64 { return sys_write(1, s, da_slen(s)) } |
| 23 | func rq_streq(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 } |
| 24 | func rq_cat(dst: *u8, off: i64, s: *u8) -> i64 { var o: i64=off; var i: i64=0; while s[i]!=(0 as u8){ dst[o]=s[i]; o=o+1; i=i+1 } return o } |
| 25 | func rq_n(dst: *u8, off: i64, v: i64) -> i64 { var o: i64=off; var m: i64=v; if m<0{dst[o]=45 as u8;o=o+1;m=0-m} let t: *u8=sys_mmap(24); var k: i64=0; if m==0{t[0]=48 as u8;k=1} while m>0{t[k]=(48+(m-(m/10)*10)) as u8;m=m/10;k=k+1} var i: i64=0; while i<k{dst[o+i]=t[k-1-i];i=i+1} return o+k } |
| 26 | func rq_field(line: *u8, len: i64, idx: i64, out: *u8, outcap: i64) -> i64 |
| 32 | func rq_path(role: *u8, suffix: *u8, out: *u8) -> i64 calls 1: rq_cat |
| 40 | func rq_submit(role: *u8, target: *u8, oldp: *u8, newp: *u8, requester: *u8) -> i64 |
| 58 | func rq_pump(role: *u8) -> i64 |
| 101 | func main(argc: i64, argv: *i64) -> i64 |