code wiki / _hdl_build / nx_engineer_triage.nx
nx_engineer_triage.nx
buildroot/runtime/_hdl_build/nx_engineer_triage.nx
about
nx_engineer_triage.nx -- the ENGINEER's regression-to-defect-row organ (PURE-NISHI
loop: the TEAM triages its own red pulse -- the tutor stops bash-prompting solutions).
ONE command, sub-10s. PLAIN LANGUAGE: when the team's health check goes red, this
tool reads the same scoreboard the Examiner grades, finds WHICH test rows failed,
copies their exact failure lines as evidence, and files ONE work order for the
Doctor. Nobody greps logs by hand; the next person sees a named, evidenced task.
1. reads knowledge/status/examiner_arcs.conf (the Examiner's own arc table -- zero
duplicated knowledge; add an arc there = the Engineer triages it too)
2. re-derives each arc's grade from its gate log's LAST anchor line (same doctrine)
3. for every RED or ABSENT arc: drills the SAME log for row-level failures (lines
holding the anchor + verdict=FAIL; the last <=4 copied verbatim as ENGINEER-ROW
evidence -- exit codes included, the Doctor's input, never re-derived by a human)
4. files ONE idempotent Doctor assignment: id=ENG-<arc> w=8 owner=Doctor TODO
(an existing id of ANY status is never re-filed; reconcile owns the lifecycle)
Durable: ENGINEER-ROW + ENGINEER-TRIAGE lines -> knowledge/status/engineer_triage.log.
Exit 0 = triage duty DONE (clean, or defects filed+named); exit 1 = the organ itself
could not read its world (conf/queue/log) -- fail loud, never silently green.
RACI: Engineer FINDS+FILES, Doctor root-causes, Builder ships the ten-second probe,
the pulse re-proves. argv[1]=arcs-conf argv[2]=queue argv[3]=triage-log (gates: scratch).
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
| 22 | const K_MAGIC_65536: i64 = 65536 |
| 23 | const K_MAGIC_65520: i64 = 65520 |
| 24 | const K_MAGIC_1048576: i64 = 1048576 |
| 25 | const K_MAGIC_1048560: i64 = 1048560 |
| 26 | const K_MAGIC_16384: i64 = 16384 |
| 27 | const K_MAGIC_1048592: i64 = 1048592 |
functions
| 28 | func _p(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } |
| 29 | func _fp(fd: i64, s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(fd,s,n); return 0 } |
| 30 | func _fn(fd: i64, v: i64) -> i64 { let bb: *u8=sys_mmap(28); var m: i64=v; if m<0{m=0-m}; let t: *u8=sys_mmap(28); var k: i64=0; if m==0{t[0]=48 as u8;k=1}; while m>0{t[k]=(48+(m%10)) as u8;m=m/10;k=k+1}; var i: i64=0; while i<k{bb[i]=t[k-1-i];i=i+1}; sys_write(fd,bb,k); return 0 } |
| 31 | func et_len(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n } |
| 32 | func et_cat(dst: *u8, off: i64, s: *u8) -> i64 { var i: i64 = 0; while s[i] != (0 as u8) { dst[off+i] = s[i]; i = i + 1 } return off + i } called by 1: main |
| 33 | func et_tab(fd: i64) -> i64 { let b: *u8 = sys_mmap(4); b[0] = 9 as u8; sys_write(fd, b, 1); return 0 } |
| 34 | func et_read_all(path: *u8, buf: *u8, cap: i64) -> i64 |
| 43 | func et_slice_contains(hay: *u8, a: i64, b: i64, pat: *u8) -> i64 |
| 56 | func et_last_line_with(hay: *u8, n: i64, pat: *u8, out: *i64) -> i64 |
| 71 | func et_token(conf: *u8, pos: i64, le: i64, pool: *u8, poff: *i64) -> i64 called by 1: main |
| 82 | func et_id_in_queue(q: *u8, qn: i64, ids: *u8) -> i64 |
| 102 | func et_drill(lb: *u8, ln: i64, anchor: *u8, lfd: i64) -> i64 |
| 135 | func et_file_row(qp: *u8, ids: *u8, arc: *u8) -> i64 |
| 154 | func et_log_arc(lfd: i64, arc: *u8, grade: i64, nf: i64, f: i64) -> i64 |
| 165 | func main(argc: i64, argv: *i64) -> i64 |