code wiki / (root) / nx_featassert.nx

nx_featassert.nx

buildroot/runtime/nx_featassert.nx

4494 B108 linesdepth 5pulls 5 transitivereach 0 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

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

nx_syscalls.nx nx_strconv.nx nx_featassert.nx

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

main fa_puts sys_write sys_mmap nxa_die sys_write ↻ sys_exit nxa_lock_take nxa_lock_addr sys_write ↻ nxa_lock_give nxa_lock_addr ↻ nxa_report_overrun sys_write ↻ nxa_dump_printable sys_write ↻ nxa_dump_sizes sys_write ↻ sys_read_file sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_munmap sys_close fa_i sys_mmap ↻ sys_write ↻ nx_strconv_format_i64 fa_find fa_len sys_write ↻

structs

none

consts

none

functions

31func fa_puts(s: *u8) -> i64
called by 1: main calls 1: sys_write
36func fa_len(s: *u8) -> i64
called by 1: main
41func fa_i(v: i64) -> i64
48func fa_find(hay: *u8, n: i64, needle: *u8, m: i64) -> i64
called by 1: main
64func main(argc: i64, argv: *i64) -> i64