code wiki / (root) / nx_crashresume_census_core.nx

nx_crashresume_census_core.nx

buildroot/runtime/nx_crashresume_census_core.nx

6267 B162 linesdepth 3pulls 3 transitivereach 29 importersview sourcekind library
docsdependenciesstructsconstsfunctions

about

nx_crashresume_census_core.nx -- importable CORE of the crash-resume census (CR-R0 of the crash-resume->SOTA roadmap 2026-07-15): MEASURES whether the workstream capture plane is LIVE -- heartbeat staleness (max HBX epoch= in the log vs wall clock), registry/file mtime staleness (newfstatat), and session-activity vs capture LAG (newest transcript mtime vs newest captured state). Bank: registry+heartbeats sat DEAD 5 days at the 07-15 crash while 36 sessions worked -> resume cost ~5h of hand archaeology; this census makes that rot VISIBLE within a cron tick. PURE verdict funcs here (gate-locked). Cells NEVER fabricate: no evidence -> UNKNOWN; bounded reads bias STALE (a truncated log can only under-report freshness, never invent it). Read-only. license_tier: ORIGINAL

dependencies 2 imports · 13 importers

nx_syscalls.nx nx_itoa_lib.nx nx_crashresume_census_core.nx nx_capability_triage_core.nx nx_coindex_core.nx nx_crashresume_census.nx nx_crashresume_census_gate.nx nx_lock_reap_core.nx nx_memindex_budget_gate.nx nx_memindex_emit_gate.nx nx_memindex_put_gate.nx nx_opennet_posture_core.nx nx_shelltool_gate.nx

diagram shows first 10 each side; +0 more imports, +3 more importers in the complete lists below.

imports: nx_syscalls.nxnx_itoa_lib.nx

imported by: nx_capability_triage_core.nxnx_coindex_core.nxnx_crashresume_census.nxnx_crashresume_census_gate.nxnx_lock_reap_core.nxnx_memindex_budget_gate.nxnx_memindex_emit_gate.nxnx_memindex_put_gate.nxnx_opennet_posture_core.nxnx_shelltool_gate.nxnx_state_spool_core.nxnx_triage_ground.nxnx_ws_hygiene_core.nx

structs

none

consts

15const CCZ_EPBUF: i64 = 16
16const CCZ_STATBUF: i64 = 256
17const CCZ_STAT_MTIME_SLOT: i64 = 11
18const CCZ_DENTBUF: i64 = 65536
19const CCZ_PATHBUF: i64 = 2048
21const CR_RED: i64 = 0
22const CR_UNKNOWN: i64 = 1
23const CR_GREEN: i64 = 2

functions

25func ccz_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
27func ccz_max(a: i64, b: i64) -> i64 { if a > b { return a } return b }
called by 1: main
30func ccz_num_at(s: *u8, n: i64, off: i64, endp: *i64) -> i64
45func ccz_read(path: *u8, buf: *u8, cap: i64) -> i64
56func ccz_max_epoch(buf: *u8, n: i64) -> i64
77func ccz_mtime(path: *u8) -> i64
88func ccz_ends_with(name: *u8, ext: *u8) -> i64
called by 1: ccz_newest_mtime_ext calls 1: ccz_slen
98func ccz_newest_mtime_ext(dir: *u8, ext: *u8) -> i64
138func ccz_cat_str(buf: *u8, off: i64, s: *u8) -> i64
149func ccz_stale_verdict(ts: i64, now: i64, window: i64) -> i64
called by 2: mainmain
157func ccz_lag_verdict(src_ts: i64, cap_ts: i64, window: i64) -> i64
called by 2: mainmain