nx_gatefresh.nx
buildroot/runtime/nx_gatefresh.nx
about
nx_gatefresh.nx -- "I just ran that gate and it said GREEN. Can I believe it?" ONE target, cheap, now.
THE GAP IT FILLS, and why it is not a fourth copy of anything:
nx_stale_check <t> REBUILDS and byte-compares _offc/<t>.elf -- authoritative, but O(one build) and a
DIFFERENT subject (the _offc build tree, not the deploy root that gate_run executes).
nx_rebuild_plan walks the transitive closure for the WHOLE fleet and names the trigger file -- the
right instrument for a census, far too heavy to ask about one gate.
nx_gatebuilt_gate censuses every authored gate and reports stale_built, but its list is CAPPED at 25,
so the gate you actually care about is usually NOT in the output.
None of them answer the per-target question in one call, which is the question an agent has RIGHT AFTER
reading a verdict. All the arithmetic is nx_srcfresh (live, gated 10/10) -- this organ is only resolution
plus an exit code, so it cannot drift from the predicate the gate proved.
WHY IT MATTERS (measured 2026-08-07): /api/gate_run served exit 0 verdict=GREEN pass=23/23 for
nx_fsops_gate from a 2026-07-29 binary whose source declared 28 checks, and I reported "no regression" on
that GREEN. A gate ELF statically links its libs, so a verdict is a claim about the tree AS OF ITS BUILD.
Fleet-wide: 715 gates have a binary and only 176 are current with their own source.
A GATE VERDICT IS EVIDENCE ABOUT THE SOURCE ONLY IF THE GATE WAS BUILT FROM IT.
SCOPE IS DECLARED IN THE OUTPUT, never implied: OWN-SOURCE mtime only. A gate invalidated by a shared dep
reads FRESH here, and mtime proves a source MOVED, not that codegen CHANGED (a comment-only edit moves it
and leaves the binary byte-identical). So FRESH is a floor, not a guarantee, and the payload says so.
nx_gatefresh <name>
-> exit 0 FRESH | 1 STALE | 3 UNBUILT (no <name>.elf) | 4 NO-SOURCE | 2 usage
license_tier: ORIGINAL Read-only: it stats two paths and writes nothing. (Rule 26)
dependencies 1 imports · 0 importers
imports: nx_srcfresh.nx
imported by: nobody (leaf or entry point)
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| 28 | const GF_PATHCAP: i64 = 512 |
| 29 | const GF_RC_STALE: i64 = 1 |
| 30 | const GF_RC_USAGE: i64 = 2 |
| 31 | const GF_RC_UNBUILT: i64 = 3 |
| 32 | const GF_RC_NOSRC: i64 = 4 |
| 33 | const GF_RC_LIB: i64 = 5 |
| 34 | const GF_SCAN: i64 = 262144 // bounded source scan for the entry-point probe |
| 35 | const GF_DIR_RT: *u8 = "buildroot/runtime/" |
| 36 | const GF_DIR_HDL: *u8 = "buildroot/runtime/_hdl_build/" |
functions
| 38 | func gf_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 |
| 39 | func gf_putn(v: i64) -> i64 called by 1: main |
| 52 | func gf_cat(d: *u8, at: i64, s: *u8) -> i64 called by 1: main |
| 62 | func gf_at(buf: *u8, i: i64, n: i64, needle: *u8) -> i64 called by 1: gf_has_main |
| 78 | func gf_has_main(path: *u8) -> i64 |
| 98 | func main(argc: i64, argv: *i64) -> i64 |