code wiki / (root) / nx_crashresume_census.nx

nx_crashresume_census.nx

buildroot/runtime/nx_crashresume_census.nx

8957 B208 linesdepth 4pulls 4 transitivereach 0 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

about

nx_crashresume_census.nx -- ONE-SHOT crash-resume census CLI (CR-R0, crash-resume->SOTA roadmap 2026-07-15). Measures whether the workstream capture plane is LIVE so a crash costs minutes, not hand archaeology: HEARTBEAT staleness + REGISTRY staleness + CAPTURE lag (sessions vs captured state) + MEMORY lag (sessions vs banked memory). Prints per-cell verdicts + permille and appends one summary line to knowledge/status/crashresume_census.log (append-only journal). usage: nx_crashresume_census [conf] [hb_log] [reg_path] [sessions_dir] [memory_dir] conf rows: "hb_window_sec N" / "reg_window_sec N" / "cap_window_sec N" / "mem_window_sec N" ('#' comments; malformed rows dropped fail-safe). No conf -> documented defaults below (the conf is the rule-11 lever; defaults exist so a read-only census still runs on a bare tree). Missing evidence -> UNKNOWN, never fabricated. ALWAYS exits 0 (a census must never fail its caller); the verdict lives in the output + journal. Read-only apart from the journal append. license_tier: ORIGINAL expect_exit: 0

dependencies 2 imports · 0 importers

nx_syscalls.nx nx_crashresume_census_core.nx nx_crashresume_census.nx

imports: nx_syscalls.nxnx_crashresume_census_core.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 ccz_read sys_openat_rd sys_read sys_close ccz_num_at c_word_is ccz_slen sys_now_realtime_sec sys_mmap ↻ sys_clock_gettime_real ccz_max_epoch sys_mmap ↻ ccz_num_at ↻ sys_munmap ccz_stale_verdict ccz_mtime sys_mmap ↻ sys_fstatat sys_munmap ↻ ccz_newest_mtime_ext sys_openat_rd ↻ sys_mmap ↻ sys_getdents64 dirent_reclen dirent_name ccz_ends_with ccz_slen ↻ ccz_mtime ↻ sys_close ↻ sys_munmap ↻ ccz_max ccz_lag_verdict c_puts sys_write c_putn sys_mmap ↻ ccz_cat_num sys_write ↻

structs

none

consts

15const K_MAGIC_86400: i64 = 86400
16const K_MAGIC_3600: i64 = 3600
17const K_MAGIC_8192: i64 = 8192
18const K_MAGIC_8191: i64 = 8191
19const K_MAGIC_262144: i64 = 262144
20const K_MAGIC_262143: i64 = 262143
21const K_MAGIC_1024: i64 = 1024

functions

23func c_puts(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 2: c_cellmain calls 1: sys_write
25func c_putn(v: i64) -> i64
32func c_vname(v: i64) -> *u8
called by 2: c_cellmain
39func c_word_is(buf: *u8, ws: i64, we: i64, key: *u8) -> i64
called by 1: main calls 1: ccz_slen
48func c_cell(name: *u8, ts: i64, now: i64, w: i64, v: i64) -> i64
called by 1: main calls 3: c_putsc_putnc_vname
63func main(argc: i64, argv: *i64) -> i64