code wiki / _hdl_build / nx_work_pulse_register.nx

nx_work_pulse_register.nx source

↩ module page · 43 lines · 3252 B

1// nx_work_pulse_register.nx -- records the standing work loop + the live shape-15 sync the pulse 2// beat forced. Engineer gate = work-pulse 9/9 + library 5/5 + classifier 21/21 + sync GREEN + 3// warden 8/8. Registered via Librarian alloc + dual-write. license_tier: ORIGINAL 4import "nx_cap_register.nx" 5import "nx_capreg_librarian.nx" 6import "nx_syscalls.nx" 7 8func wpr_run(path: *u8) -> i64 { 9 let pid: i64 = sys_fork() 10 if pid == 0 { 11 let dn: i64 = sys_openat_wr("/dev/null" as *u8, 0x1a4) 12 if dn >= 0 { sys_dup3(dn, 1, 0); sys_dup3(dn, 2, 0) } 13 let argv: *i64 = sys_mmap(32) as *i64; argv[0] = path as i64; argv[1] = 0 14 let envp: *i64 = sys_mmap(16) as *i64; envp[0] = 0 15 sys_execve(path, argv, envp); sys_exit(127) 16 } 17 let st: *i64 = sys_mmap(16) as *i64 18 sys_wait4(pid, st, 0) 19 return st[0] 20} 21 22func main() -> i64 { 23 var allok: i64 = 1 24 if wpr_run("/tmp/_wpt.sov.elf" as *u8) != 0 { allok = 0 } 25 if wpr_run("/tmp/_plt.elf" as *u8) != 0 { allok = 0 } 26 if wpr_run("/tmp/_plc.sov.elf" as *u8) != 0 { allok = 0 } 27 if wpr_run("/tmp/_css.elf" as *u8) != 0 { allok = 0 } 28 if wpr_run("/tmp/_wbt.sov.elf" as *u8) != 0 { allok = 0 } 29 cr_w(1, "ENGINEER: work-pulse + library + classifier + sync + warden all-pass=" as *u8); cr_wn(1, allok); cr_w(1, "\n" as *u8) 30 let eng: i64 = ig_engineer(1, 1, 1, allok) 31 let dec: i64 = ig_decision(eng, ig_council(eng, 1, 1, 2), 1) 32 if dec != IG_INGEST { cr_w(1, "HELD\n" as *u8); sys_exit(1) } 33 if cr_can_register(5, 2, 6, dec) != 1 { cr_w(1, "REFUSED\n" as *u8); sys_exit(1) } 34 let lp: *u8 = "/tmp/nishi_cap_registry.log" as *u8 35 let jp: *u8 = "knowledge/status/cap_registry_durable.log" as *u8 36 let idx: i64 = cl_next_idx(lp, jp) 37 let ok: i64 = cl_register_dual(lp, jp, idx, 5, 38 2, "CON WORK-PULSE (the standing work loop: the backlog FILE now drives the team mechanically) -- nx_work_pulse parses knowledge/library/research_backlog.txt (topic|priority|hits|status rows; comments/prose/malformed skipped -- a file parsed by NOBODY until now) -> the RESEARCHER's own rb_next gap math picks the target -> durable WORKNEXT directive in knowledge/status/work_next.log. PROVEN 9/9 (synthetic-file hazards + gap-beats-priority policy) + PRODUCTION: 32 real rows parsed, first derived directive = 'photoresist (spin-coat/develop)' priority=9 hits=0 gap=9000, library_coverage=90 permil honest. WIRED as Conductor pulse step alongside nx_classifier_sync -- whose FIRST PULSE BEAT caught REAL drift (emit10 WIRE_MARKER shape 15 shipped by the concurrent arc minutes after the 14-sync) -> synced same-beat (library 15 + classifier trait IN_MARKED + row + Warden dispatch pe10) -> all gates GREEN at 15 (library 5/5, classifier 21/21, sync 15/15/15, warden 8/8 incl. _wb_jpeg JPEG-marker walker ADMITTED-HANDS-OFF one-command, autonomy 857). The drift gate paid for itself within minutes of being wired. Composes research_backlog(229)/classifier_sync(290)/warden_build(275)/emit10 (concurrent arc)" as *u8) 39 if ok != 1 { cr_w(1, "DUAL-WRITE FAILED\n" as *u8); sys_exit(1) } 40 cr_w(1, "CAPREG idx=" as *u8); cr_wn(1, idx); cr_w(1, " REGISTERED -- the backlog file drives the team\n" as *u8) 41 sys_exit(0) 42 return 0 43}