code wiki / _hdl_build / nx_attempt_loop.nx
nx_attempt_loop.nx source
↩ module page · 37 lines · 1819 B
1// nx_attempt_loop.nx -- the WARDEN's team-attempt loop over the assignment
2// queue (X-Q-003 rung 1; spec ADDENDUM Q3 "team-attempt loop"). NOTE the
3// basename nx_work_dispatcher that nx_assign_next's header reserved for Q3
4// was already taken 2026-06-05 by the governor-era policy lib (imported by
5// nx_assignments_run/nx_team_console), so Q3 ships under the spec's own
6// words instead -- the older lib is untouched.
7//
8// One call = one beat: route the Conductor's pick. EXEC-recipe rows are
9// attempted hands-off (durable lane build+run under a conf deadline,
10// hang-proof via nx_guarded_run) and judged ONLY by nx_reconcile's evidence
11// flip -- never by the recipe's exit code (the fake-green class dies here).
12// Uncovered rows are RAISED (TODO->NOVEL = the tutor batch, "a raised-hand
13// row instead of a silent stall") and the best covered row is attempted in
14// the same beat, so a raise never wastes a beat. ASSIGNRESULT rows append
15// to assign_next.log (one marching-order + outcomes stream).
16// Policy lives in nx_wd_core.nx; this is the thin real-paths main (the pulse
17// runs it arg-free; the gate drives the core on scratch paths).
18// exit 0 = healthy beat (attempt GREEN, raise, or idle)
19// exit 1 = attempt RED (row flipped RED; queue-health escalates)
20// exit 101 = queue missing
21// license_tier: ORIGINAL
22
23import "nx_wd_core.nx"
24
25func main() -> i64 {
26 let dl: i64 = wd_conf_deadline("knowledge/registry/attempt_loop.conf" as *u8)
27 let wcx: *i64 = wd_newwcx(
28 "knowledge/registry/assignment_queue.tsv" as *u8,
29 "knowledge/status/assign_next.log" as *u8,
30 "_offc/nx_sov_build_run.elf" as *u8,
31 "_offc/nx_reconcile.elf" as *u8,
32 "_offc/nx_auto_builder.elf" as *u8,
33 dl)
34 let rc: i64 = wd_beat(wcx)
35 sys_exit(rc)
36 return rc
37}