code wiki / (root) / nx_buildrun_verdict_lib.nx

nx_buildrun_verdict_lib.nx

buildroot/runtime/nx_buildrun_verdict_lib.nx

3060 B50 linesdepth 2pulls 2 transitivereach 6 importersview sourcekind library
docsdependenciesstructsconstsfunctions

about

nx_buildrun_verdict_lib.nx -- THE ONE RULE for "did this buildrun produce the artifact on disk?" (2026-09-05). Extracted from nx_hostctl cmd_buildrun so the decision is a PURE FUNCTION a gate can drive without a fixture build tree: the supervisor's paths are absolute by design (the safe choice for a supervisor, the wrong shape for a fixture). WHY IT EXISTS: cmd_buildrun used to probe _build/<name>.sov.elf WHATEVER the child did, so a builder that REFUSED under its own admission check (rc=4 in an I/O storm) left the PREVIOUS artifact to be validated, echoed as "BUILT size=", re-staged with a fresh mtime and promoted by every caller that trusted action=BUILT -- the false-green build class, measured live on nx_actlog 2026-09-05 (debt 1788634371, superseding the July "idempotency" story in 1785363417). Two conjuncts, both required, in this order: 1. the builder's exit status is 0 (a refusal is rc=4, a dead exec is 127) 2. its capture carries the builder's own success token, printed on a real compile AND on a cache hit POLL FOR THE POSITIVE MARKER, NEVER THE ABSENCE OF A NEGATIVE ONE. The token is matched EXACTLY and contiguously: the two words on separate lines are not the token (a neg-control in nx_hostctl_buildrun_gate pins that). license_tier: ORIGINAL No hw writes (Rule 26).

dependencies 1 imports · 2 importers

nx_syscalls.nx nx_buildrun_verdict_lib.nx nx_hostctl.nx nx_hostctl_buildrun_gate.nx

imports: nx_syscalls.nx

imported by: nx_hostctl.nxnx_hostctl_buildrun_gate.nx

structs

none

consts

16const BV_OK: i64 = 1 // this run produced the artifact on disk
17const BV_EXIT_NONZERO: i64 = 2 // the builder refused or died; the artifact on disk is a PREVIOUS build
18const BV_NO_TOKEN: i64 = 3 // exit 0 but no success token; nothing this run produced is on disk

functions

20func bv_token() -> *u8 { return "SOVEREIGN build" as *u8 }
called by 1: bv_verdict
22func bv_find(q: *u8, n: i64, lit: *u8) -> i64
called by 1: bv_verdict
38func bv_verdict(cexit: i64, cap: *u8, n: i64) -> i64
called by 1: main calls 2: bv_findbv_token
46func bv_reason(v: i64) -> *u8
called by 1: main