code wiki / _hdl_build / nx_loop_monitor.nx

nx_loop_monitor.nx

buildroot/runtime/_hdl_build/nx_loop_monitor.nx

2224 B41 linesdepth 2pulls 2 transitivereach 4 importersview sourcekind librarytopic loop
docsdependenciesstructsconstsfunctions

about

nx_loop_monitor.nx -- the MONITOR/HANDLER organ: the "someone on the team watching the loop and handling its output" that was MISSING (operator caught it: the overnight loop ran 484 beats banking 0 wins on a DRY vein, with nobody noticing or re-tasking). This organ consumes the beat stream and classifies the loop's PRODUCTIVITY, then HANDLES it -- continue / re-task to a new opportunity / restart a stalled process. It is the feedback that turns "motion" into "progress". license_tier: ORIGINAL Feeds nx_opportunity_loop (re-task -> re-scan) and nx_spec_ingest (productive -> spec).

dependencies 1 imports · 3 importers

nx_syscalls.nx nx_loop_monitor.nx nx_loop_monitor_test.nx nx_parallel_runner.nx nx_research_auto.nx

imports: nx_syscalls.nx

imported by: nx_loop_monitor_test.nxnx_parallel_runner.nxnx_research_auto.nx

structs

none

consts

10const LM_PRODUCTIVE: i64 = 1 // banking new wins recently -> keep going
11const LM_DRY: i64 = 2 // log advancing but 0 wins for a long streak -> the vein is exhausted
12const LM_STALL: i64 = 3 // log NOT advancing -> the process is hung/blocked
14const LM_CONTINUE: i64 = 1
15const LM_RETASK: i64 = 2 // hand back to the opportunity loop to pick a different space
16const LM_RESTART: i64 = 3 // kill + relaunch the worker

functions

23func lm_classify(recent_wins: i64, advancing: i64, zero_streak: i64, dry_threshold: i64) -> i64
called by 3: mainmainra_tick
31func lm_action(verdict: i64) -> i64
called by 2: mainra_tick
38func lm_wasted_beats(zero_streak: i64, dry_threshold: i64) -> i64
called by 1: main