code wiki / (root) / nx_ivvguard.nx

nx_ivvguard.nx

buildroot/runtime/nx_ivvguard.nx

16383 B334 linesdepth 2pulls 2 transitivereach 2 importersview sourcekind library
docsdependenciesstructsconstsfunctions

about

nx_ivvguard.nx -- the PURE safety predicates of the IV+V beat, extracted so they can be PROVEN BEFORE any code that forks or deletes is written (2026-08-07). WHY THIS FILE EXISTS SEPARATELY. nx_ivv_beat.cron.sh is the only remaining clock wrapper that FORKS A BINARY NAMED IN A DATA PLANE and DELETES FILES BY PREFIX GLOB. Two shell case-patterns are the only things that make it safe to run at all: the exe must match dot-slash-nx-underscore-star-dot-elf or dot-slash-underscore-star-dot-elf, and the pre-wipe path must begin with slash-tmp-slash. (STAR)WHEN A BEAT TAKES ITS COMMANDS FROM DATA, THE ALLOWLIST IS NOT A FEATURE OF THE BEAT -- IT IS THE ONLY THING THAT MAKES THE BEAT SAFE TO RUN AT ALL. A subtle mis-anchor turns a monitoring beat into an execution primitive, and a wrong prefix test deletes by glob outside the temp directory. So the predicates ship FIRST, as pure functions over fabricated strings, gated with NEGATIVE cases that must REFUSE -- exactly the shape that let clk_edf_pick_free be proven before it was ever wired to a live dispatcher. license_tier: ORIGINAL No hw writes (Rule 26). Pure: no side effects.

dependencies 1 imports · 2 importers

nx_syscalls.nx nx_ivvguard.nx nx_ivvbeat.nx nx_ivvguard_gate.nx

imports: nx_syscalls.nx

imported by: nx_ivvbeat.nxnx_ivvguard_gate.nx

structs

none

consts

none

functions

17func ivg_len(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n }
19func ivg_starts(s: *u8, p: *u8) -> i64
25func ivg_ends(s: *u8, p: *u8) -> i64
called by 1: main calls 1: ivg_len
39func ivg_ends_n(s: *u8, sl: i64, p: *u8) -> i64
called by 1: ivv_cmd_allowed calls 1: ivg_len
56func ivv_exe_len(cmd: *u8) -> i64
called by 1: ivv_cmd_allowed
62func ivv_cmd_allowed(cmd: *u8) -> i64
78func ivv_wipe_allowed(pre: *u8) -> i64
called by 2: mainmain calls 2: ivg_startsivg_len
93func ivv_wipe_none(pre: *u8) -> i64
called by 2: mainmain
99func ivv_marker_hit(out: *u8, n: i64, marker: *u8) -> i64
137func ivv_isdigit(c: u8) -> i64
144func ivv_find_count(s: *u8, span: *i64) -> i64
called by 2: ivv_match_countedmain calls 1: ivv_isdigit
168func ivv_find_sub_n(hay: *u8, n: i64, from: i64, needle: *u8, nl: i64) -> i64
called by 1: ivv_match_counted
185func ivv_match_counted(out: *u8, n: i64, marker: *u8, res: *i64) -> i64
309func ivv_floor_ok(observed_total: i64, declared_total: i64) -> i64
called by 2: ivv_is_green2main
324func ivv_is_green2(rc: i64, out: *u8, n: i64, marker: *u8, res: *i64) -> i64
332func ivv_is_green(rc: i64, out: *u8, n: i64, marker: *u8) -> i64
called by 1: main calls 1: ivv_marker_hit