code wiki / (root) / nx_provcensus.nx

nx_provcensus.nx

buildroot/runtime/nx_provcensus.nx

18188 B334 linesdepth 6pulls 9 transitivereach 0 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

about

nx_provcensus.nx -- THE FLEET PROVENANCE-DRIFT CENSUS (2026-08-26). nx_organ_ship consults nx_provcheck so a gate is rebuilt when its import CLOSURE drifted even with no import edge to notice. Two gates were caught DRIFTED by hand the day that shipped. NOBODY HAD MEASURED THE FLEET, so nobody knew how many ships had already proved the wrong subject -- and a rate nobody has measured is not a small number, it is an unknown one. This organ measures it. POPULATION: every "<name>_gate.provenance" sidecar in the estate root -- exactly "the gates that have a provenance record" -- enumerated from ONE directory via nx_dir_list rather than a tree walk. That is deliberate and measured: nx_shelltool find AND glob both return matches=0 with corpus_complete=0 over this root for sidecars that demonstrably exist (2026-08-26), because the walk exhausts its budget in the subtrees before it reports the root's own files. A tree scanner cannot establish this population at all, and only its coverage envelope stops the zero being published as absence. PARTITION -- each bucket its own remedy, printed with the count, and the parts are SUMMED against the population rather than assumed to agree: CURRENT | DRIFTED | UNRECORDED | NOSIDECAR | UNREADABLE (+ SKIPPED-OVER-BUDGET, reconciled too) NO-RECORD is reported BESIDE the partition, never inside it: it counts "<name>_gate.elf" at the root with no sidecar at all. That is a different question with a different denominator, and folding it in would silently break the reconciliation -- a bucket that overlaps a partition must be a separate axis. Composes nx_provcheck per row instead of re-deriving CURRENT/DRIFTED, so there stays exactly ONE definition of the verdict in the estate and this inherits every future fix to it. All judgement lives in nx_provcensus_lib.nx so the gate can mutation-prove it in-process. license_tier: ORIGINAL No hw writes (Rule 26). expect_exit: 0

dependencies 3 imports · 0 importers

nx_dir.nx nx_tool_run.nx nx_provcensus_lib.nx nx_provcensus.nx

imports: nx_dir.nxnx_tool_run.nxnx_provcensus_lib.nx

imported by: nobody (leaf or entry point)

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

main pv_puts pv_cat nx_dir_list nx_openat nx_dirent_read nx_dirent_iter nx_dir_is_dotlike nx_dir_name_strlen nx_dir_arena_copy_name nx_dir_verdict_name pv_num nx_dir_row_at nx_dir_row_is_regular_file pcx_ends_with pcx_slen pcx_roster_rows pcx_row_begin pcx_is_ws pcx_row_end pcx_is_ws ↻ pcx_slen ↻ tr_run_capture_to tr_run_capture_tr tr_run_capture_core tr_run_capture_core_owned tr_run_capture_core_eviden sys_mmap_shared tr_clock_ms sys_munmap sys_pipe2 sys_fork sys_close sys_default_signal sys_bind_parent_lifetime sys_exit sys_setpgid tr_capture_redirect sys_chdir sys_close_inherited

structs

none

consts

33const PV_MAXENT: i64 = 262144
34const PV_ROWBYTES: i64 = 32
35const PV_ARENA: i64 = 16777216
36const PV_RESBYTES: i64 = 40
37const PV_CAP: i64 = 262144
38const PV_TMO: i64 = 90000 // per child, matching nx_provcheck's own child timeout
39const PV_PATHMAX: i64 = 1024
40const PV_MAXCLASS: i64 = 16384
41const PV_COUNTS: i64 = 40 // PCX_NBUCKET slots of 8
42const PV_ARGVSLOTS: i64 = 64
43const PV_NUMSCRATCH: i64 = 32
44const PV_B10: i64 = 10
45const PV_ZERO: i64 = 48
46const PV_LENSLOT: i64 = 16 // one i64 out-parameter slot for sys_read_file's length
51const PV_BUDGET_MS: i64 = 1200000

functions

53func pv_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 1: main
54func pv_num(v: i64) -> i64
called by 1: main
64func pv_cat(d: *u8, o: i64, s: *u8) -> i64 { var p: i64 = o; var i: i64 = 0; while s[i] != (0 as u8) { d[p] = s[i]; p = p + 1; i = i + 1 } return p }
called by 1: main
66func main(argc: i64, argv: *i64) -> i64