code wiki / _hdl_build / nx_engineer_triage.nx

nx_engineer_triage.nx

buildroot/runtime/_hdl_build/nx_engineer_triage.nx

11164 B238 linesdepth 2pulls 2 transitivereach 0 importersview sourcekind tooltopic engineer
docsdependenciesstructsconstsfunctions

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

nx_syscalls.nx nx_engineer_triage.nx

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

main _p sys_write sys_mmap et_read_all sys_openat_rd sys_read sys_close sys_exit sys_openat_append et_token et_last_line_with et_slice_contains et_len et_slice_contains ↻ et_drill et_slice_contains ↻ _fp sys_write ↻ sys_write ↻ et_cat et_id_in_queue et_len ↻ et_file_row sys_openat_append ↻ _fp ↻ et_tab sys_mmap ↻ sys_write ↻ sys_close ↻ et_log_arc _fp ↻ _fn sys_mmap ↻ sys_write ↻ _p ↻ _fp ↻ _fn ↻ sys_now_realtime_sec sys_mmap ↻

structs

none

consts

22const K_MAGIC_65536: i64 = 65536
23const K_MAGIC_65520: i64 = 65520
24const K_MAGIC_1048576: i64 = 1048576
25const K_MAGIC_1048560: i64 = 1048560
26const K_MAGIC_16384: i64 = 16384
27const K_MAGIC_1048592: i64 = 1048592

functions

28func _p(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 }
called by 2: et_log_arcmain calls 1: sys_write
29func _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 }
30func _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 }
called by 2: et_log_arcmain calls 2: sys_mmapsys_write
31func et_len(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
32func 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
33func et_tab(fd: i64) -> i64 { let b: *u8 = sys_mmap(4); b[0] = 9 as u8; sys_write(fd, b, 1); return 0 }
called by 1: et_file_row calls 2: sys_mmapsys_write
34func et_read_all(path: *u8, buf: *u8, cap: i64) -> i64
called by 1: main calls 3: sys_openat_rdsys_readsys_close
43func et_slice_contains(hay: *u8, a: i64, b: i64, pat: *u8) -> i64
56func et_last_line_with(hay: *u8, n: i64, pat: *u8, out: *i64) -> i64
called by 1: main calls 1: et_slice_contains
71func et_token(conf: *u8, pos: i64, le: i64, pool: *u8, poff: *i64) -> i64
called by 1: main
82func et_id_in_queue(q: *u8, qn: i64, ids: *u8) -> i64
called by 1: main calls 1: et_len
102func et_drill(lb: *u8, ln: i64, anchor: *u8, lfd: i64) -> i64
called by 1: main calls 3: et_slice_contains_fpsys_write
135func et_file_row(qp: *u8, ids: *u8, arc: *u8) -> i64
154func et_log_arc(lfd: i64, arc: *u8, grade: i64, nf: i64, f: i64) -> i64
called by 1: main calls 3: _fp_fn_p
165func main(argc: i64, argv: *i64) -> i64