nx_featassert.nx
buildroot/runtime/nx_featassert.nx
about
nx_featassert.nx -- prove a feature is IN THE BUILT ARTIFACT, not just in the source you meant to edit.
WHY THIS EXISTS (operator, 2026-08-07: *"this is a bad bug"*). A whole feature -- writing the
gallery's enumerator index -- was never inserted into nx_gen_ingest. A scripted `str.replace`
anchor did not match (the source held a LITERAL newline where the pattern had `\n`), and
str.replace WITH NO MATCH IS A SILENT NO-OP THAT RETURNS THE ORIGINAL STRING. Then:
* the build SUCCEEDED -- absent code has no failure mode,
* the run printed 10 NEW / 10 idx:INSERTED -- everything still present worked perfectly,
* nothing anywhere in compile-or-test was watching for work that was never emitted.
★★★★★★ A MISSING FEATURE PRODUCES A CLEAN BUILD AND A GREEN RUN. YOU CANNOT TEST FOR THE ABSENCE
OF CODE BY RUNNING THE CODE.
The doctrine fix ("always assert your anchor matched") is the weak one: it relies on remembering,
and forgetting is exactly what happened. THE MECHANICAL FIX IS THAT A FEATURE MUST BE PROVABLE IN
THE ARTIFACT. A feature that was never compiled in has no marker string in the binary. So:
nx_featassert _build/nx_gen_ingest.sov.elf "view:ADDED"
is the one check that would have caught it, and it costs a substring scan.
A marker prefixed with '!' must be ABSENT -- which makes this prove a REMOVAL too, and gives the
tool its own negative control (a checker that returns PRESENT for everything scores 100%).
Usage: nx_featassert <artifact> <marker> [<marker> ...] '!marker' = must NOT be present
Exit 0 = every assertion held; 1 = at least one failed; 2 = usage; 3 = unreadable.
license_tier: ORIGINAL
dependencies 2 imports · 0 importers
imports: nx_syscalls.nxnx_strconv.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
| none |
functions
| 31 | func fa_puts(s: *u8) -> i64 |
| 36 | func fa_len(s: *u8) -> i64 called by 1: main |
| 41 | func fa_i(v: i64) -> i64 |
| 48 | func fa_find(hay: *u8, n: i64, needle: *u8, m: i64) -> i64 called by 1: main |
| 64 | func main(argc: i64, argv: *i64) -> i64 |