code wiki / _hdl_build / nx_discover_loop.nx

nx_discover_loop.nx

buildroot/runtime/_hdl_build/nx_discover_loop.nx

3743 B81 linesdepth 5pulls 7 transitivereach 0 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

about

nx_discover_loop.nx -- the DURABILITY primitive for auto-discovery: refresh the LIVE registry from disk AND verify completeness in one shot, so a scheduler (pulse beat / Stop-hook) has ONE self-checking entry point and the 427-arc integration can never silently rot (the failure that started this whole arc). Unlike nx_ws_discover_gate (which proves the mechanism on a SCRATCH prefix), this checks the ACTUAL live registry the board reads: every project-*.md on disk must resolve in knowledge/store/ws-. Idempotent (re-run registers 0 when nothing changed). RED if the live registry is missing any arc = a real drift alarm. Sovereign. license_tier: ORIGINAL

dependencies 6 imports · 0 importers

nx_ws_ingest.nx nx_ws_index_lib.nx nx_workstream_store.nx nx_seg_store.nx nx_framed_append.nx nx_syscalls.nx nx_discover_loop.nx

imports: nx_ws_ingest.nxnx_ws_index_lib.nxnx_workstream_store.nxnx_seg_store.nxnx_framed_append.nxnx_syscalls.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main sys_mmap nxa_die sys_write sys_exit nxa_lock_take nxa_lock_addr sys_write ↻ nxa_lock_give nxa_lock_addr ↻ nxa_report_overrun sys_write ↻ nxa_dump_printable sys_write ↻ nxa_dump_sizes sys_write ↻ dl_live_coverage sys_mmap ↻ ss_open ss_open2 ss_open3 sys_now_us sys_mmap ↻ sys_clock_gettime_mono sys_mmap ↻ ss_manifest_dyn ss_manifest_file_dyn ss3_admit ss3_ann sys_now_us ↻ ss3_streq ss3_docs_size ss3_load_range ss_cat ss_loadfile ss_load_aux2 ssl_total_keys_mask ss_r32 ss3_ann ↻ ss_close_seg

structs

none

consts

15const DL_MEMDIR: *u8 = "/mnt/c/Users/elder/.claude/projects/C--Users-elder/memory"
16const DL_LOG: *u8 = "knowledge/status/discover_loop.log"
17const DL_CAP: i64 = 8192

functions

19func dp(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 1: main calls 1: sys_write
20func dn(v: i64) -> i64
called by 1: main calls 2: sys_mmapsys_write
31func dl_live_coverage(memdir: *u8, disk_out: *i64) -> i64
called by 1: main calls 3: sys_mmapss_openss_hget
53func main(argc: i64, argv: *i64) -> i64