code wiki / _hdl_build / nx_inputprobe.nx

nx_inputprobe.nx

buildroot/runtime/_hdl_build/nx_inputprobe.nx

10323 B191 linesdepth 3pulls 3 transitivereach 0 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

about

nx_inputprobe.nx -- WOULD THIS PRODUCER MEASURE A REAL WORLD FROM HERE? ★WHY (earned the hard way 2026-08-08, TWICE IN ONE SESSION, the second time after writing the law down). A producer that reads CWD-RELATIVE resource paths does not fail loudly when run from the wrong context -- it writes a CONFIDENT FALSE MEASUREMENT, and every freshness instrument then certifies that false row as healthy: nx_security_census wrote coverage_permil=87 over a true 456 (security FUNCTIONAL->TOY, 450->442) because sc_have was a bare relative open. nx_game_gen2 wrote types_available=0 verdict=RED over a true 6/GREEN because gg_build_fsm reads knowledge/specs/build_<typ>.spec. Both were caught only AFTER they had appended to the very log the maturity rollup grades from. ★★A STALE-BUT-TRUE ROW IS WORTH MORE THAN A FRESH-BUT-FALSE ONE, AND ONLY A PRECHECK CAN TELL YOU WHICH ONE YOU ARE ABOUT TO WRITE. Refreshing evidence is not automatically an improvement. So: extract every relative path literal from a producer's SOURCE and ask ar_resolve -- the estate's ONE artifact-root resolver -- whether it resolves FROM THIS PROCESS'S WORKING DIRECTORY, which is the same context the producer will run in. ⚠SCOPE, STATED RATHER THAN HIDDEN: this CANNOT distinguish an INPUT the organ must read from an OUTPUT it will create -- an append target legitimately need not exist yet. It therefore reports EVERY relative path with its status and leaves the judgement to the caller. Erring toward flagging is deliberate: the failure it prevents is a false PUBLISHED GRADE; the cost of a false flag is one human read. ⚠It reads the SOURCE, so it sees literals, not computed paths. A path assembled at runtime from pieces is invisible to it. That is a floor on what it can catch, not a claim of completeness. nx_inputprobe <source.nx> exit: 0 ALL-RESOLVE | 1 UNRESOLVED (do not trust a measurement written from here) 2 usage | 3 NO-CONCLUSION (source unreadable, or the literal cap was hit -- never reported clean) license_tier: ORIGINAL No hw writes (Rule 26).

dependencies 2 imports · 0 importers

nx_syscalls.nx nx_artifact_root.nx nx_inputprobe.nx

imports: nx_syscalls.nxnx_artifact_root.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main ip_puts sys_write sys_exit 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 ↻ ar_read sys_openat_rd sys_read sys_close ip_is_relpath ar_exists sys_openat_rd ↻ sys_close ↻ ar_resolve ar_resolve_with ar_exists ↻ sys_mmap ↻ ar_read ↻ ip_putn sys_write ↻ sys_mmap ↻

structs

none

consts

33const IP_SRC_CAP: i64 = 1048576
34const IP_PATH_CAP: i64 = 512
35const IP_MAX_LIT: i64 = 1024
36const IP_EXIT_UNRESOLVED: i64 = 1
37const IP_EXIT_USAGE: i64 = 2
38const IP_EXIT_NOCONCLUDE: i64 = 3

functions

40func ip_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 calls 1: sys_write
41func ip_putn(v: i64) -> i64
called by 1: main calls 2: sys_writesys_mmap
57func ip_is_relpath(s: *u8, n: i64) -> i64
called by 1: main
77func main(argc: i64, argv: *i64) -> i64