code wiki / _hdl_build / nx_sponsor_loop_register.nx
nx_sponsor_loop_register.nx source
↩ module page · 40 lines · 3276 B
1// nx_sponsor_loop_register.nx -- records the executive-sponsor loop.
2// Engineer gate = the 13-check sponsor lifecycle proof re-run GREEN at
3// register time. Registered via Librarian alloc + dual-write.
4// license_tier: ORIGINAL
5import "nx_cap_register.nx"
6import "nx_capreg_librarian.nx"
7import "nx_syscalls.nx"
8
9func slr_run(path: *u8) -> i64 {
10 let pid: i64 = sys_fork()
11 if pid == 0 {
12 let dn: i64 = sys_openat_wr("/dev/null" as *u8, 0x1a4)
13 if dn >= 0 { sys_dup3(dn, 1, 0); sys_dup3(dn, 2, 0) }
14 let argv: *i64 = sys_mmap(32) as *i64; argv[0] = path as i64; argv[1] = 0
15 let envp: *i64 = sys_mmap(16) as *i64; envp[0] = 0
16 sys_execve(path, argv, envp); sys_exit(127)
17 }
18 let st: *i64 = sys_mmap(16) as *i64
19 sys_wait4(pid, st, 0)
20 return st[0]
21}
22
23func main() -> i64 {
24 var allok: i64 = 1
25 if slr_run("/tmp/_sponsor_review_gate_authored.sov.elf" as *u8) != 0 { allok = 0 }
26 cr_w(1, "ENGINEER: sponsor lifecycle 13-check gate re-run all-pass=" as *u8); cr_wn(1, allok); cr_w(1, "\n" as *u8)
27 let eng: i64 = ig_engineer(1, 1, 1, allok)
28 let dec: i64 = ig_decision(eng, ig_council(eng, 1, 1, 2), 1)
29 if dec != IG_INGEST { cr_w(1, "HELD\n" as *u8); sys_exit(1) }
30 if cr_can_register(5, 2, 6, dec) != 1 { cr_w(1, "REFUSED\n" as *u8); sys_exit(1) }
31 let lp: *u8 = "/tmp/nishi_cap_registry.log" as *u8
32 let jp: *u8 = "knowledge/status/cap_registry_durable.log" as *u8
33 let idx: i64 = cl_next_idx(lp, jp)
34 let ok: i64 = cl_register_dual(lp, jp, idx, 5,
35 2, "SELF EXECUTIVE-SPONSOR-LOOP (operator doctrine 2026-06-11: viewpoint enters at exactly TWO points, objective work NEVER waits) -- statuses VIEW (subjective deliverable awaiting viewpoint; nx_reconcile flips ||ASK=result rows TODO->VIEW when their objective evidence is green, same-4-byte in-place) + KILLED (terminal business kill). nx_sponsor_review (policy nx_sponsor_core, composes wd_flip_status/an_load) applies sponsor_decisions.tsv each pulse beat with FOUR verbs, every reason captured to planning_prefs.tsv as TRAINING SIGNAL for the team system incl AI lanes (operator: train and improve including the ai pieces): APPROVE->DONE, REWORK->NOVEL(refine), RESTART->NOVEL(re-spec from zero), DENY->KILLED(duplicative/no-ROI). Illegal transitions REFUSED loud; fully idempotent; SPONSOR-SPEC census surfaces NOVEL ||ASK=spec rows = the sponsor+tutor co-spec batch. Gate 13/13 (objective-still-DONE control, ASK=result->VIEW, all four verbs incl KILLED, prefs capture all verbs, refusals, idempotency x2); attempt-loop 18/18 regression green after the reconcile change; pulse 29/30 with nx_sponsor_review step live; rung_gates R8 row added. LIVE: real co-spec batch surfaced R6-AN-003 (CALLOUT-001 analytics scope -- the worked example: census/panel rows objective TODO, scope row NOVEL ASK=spec, deliverable row ASK=result). Filed arc I (web intake X-I1, interpret-to-plan X-I2, plan+VIEW rendered actionable on nishifamily X-I3, approved-deploys X-I5) -- callouts.tsv registry seeded with CALLOUT-001" as *u8)
36 if ok != 1 { cr_w(1, "DUAL-WRITE FAILED\n" as *u8); sys_exit(1) }
37 cr_w(1, "CAPREG idx=" as *u8); cr_wn(1, idx); cr_w(1, " REGISTERED -- the sponsor loop is live\n" as *u8)
38 sys_exit(0)
39 return 0
40}