nx_spendgate.nx
buildroot/runtime/nx_spendgate.nx
about
nx_spendgate.nx -- ASK BEFORE YOU SPEND. The gate between "I should build X" and building X.
WHY IT EXISTS. On 2026-08-07 I built `nx_strdiff` when `nx_contentdiff` already existed and did the
same job better, wrote `ss_khash` when `nx_web_shard_compact` already carried the identical hash
dedup, and ran a 649-row `nx_stalecensus` that DUPLICATED a sibling seat's completed run -- the
third of those saturated the mgmt API for ~25 minutes and bought nothing. Every one of those was
preventable by a single query against tooling that already existed and worked.
★★★★★★"I DIDN'T KNOW IT EXISTED" IS A RETRIEVAL FAILURE, NOT A DISCOVERY.
A line in a doc did not stop me. An exit code is branched on; an advisory is skipped.
COMPOSES THE INCUMBENTS, never reimplements them (building a fourth duplicate to prevent duplicates
would be its own punchline):
nx_presubmit <name> -- is the NAME taken or dual-copied? MECHANICAL, decidable
nx_capsearch <intent words> -- what already does something like this? RANKED, NOT decidable
⛔WHY THERE IS NO SIMILARITY THRESHOLD, AND WHY ADDING ONE WOULD BE A LIE. Measured over four
queries whose ground truth I knew, because I had just lived each one:
DUPLICATE (nx_contentdiff existed) top=nx_route_diff score=499998
NOVEL (fixture ratchet) top=nx_govern_sweep score=421048
DUPLICATE (nx_capsearch existed) top=nishi_search score=470584
NOVEL (no pre-spend gate) top=nx_adnet_recbeat score=500000 <-- HIGHEST OF ALL FOUR
The highest score in the set belongs to a NOVEL case, and in BOTH duplicate cases the true incumbent
ranked SECOND, not first. Any cutoff would have blocked the novel work and waved the duplicates
through -- the precise inversion of the tool's purpose.
★★★★★★A RULER THAT SCORES A NOVEL THING HIGHEST OF ALL CANNOT BE THRESHOLDED -- PUBLISH THE LIST,
NOT A VERDICT. ★★★★★TOP-1 IS NOT THE ANSWER; THE LIST IS.
So this gate automates ONLY what is mechanically decidable and REFUSES to synthesise the rest. It
prints the candidates and makes you look. That is the honest maximum.
It does NOT create anything. A gate that performs the act it authorises cannot be re-run to audit
its own decision -- the same rule nx_adoptgate states for promotion.
nx_spendgate <proposed-name> <intent words...>
-> SPEND-GATE name=<n> presubmit=FREE|TAKEN verdict=REVIEW|BLOCKED
exit 0 REVIEW (name is free; READ the candidates before spending) | 1 BLOCKED (name taken) | 3 usage
license_tier: ORIGINAL No hw writes (Rule 26). expect_exit: 0
dependencies 1 imports · 0 importers
imports: nx_tool_run.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
| 39 | const SG_HOST: *u8 = "/volume1/homes/elderwesto/nishihost" |
| 40 | const SG_PRESUB: *u8 = "/volume1/homes/elderwesto/nishihost/nx_presubmit.elf" |
| 41 | const SG_CAPSEARCH: *u8 = "/volume1/homes/elderwesto/nishihost/nx_capsearch.elf" |
| 42 | const SG_CAP: i64 = 262144 |
| 43 | const SG_TMO: i64 = 60000 |
| 44 | const SG_AVCAP: i64 = 512 |
functions
| 46 | func sgp(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 |
| 47 | func sgw(b: *u8, n: i64) -> i64 { sys_write(1, b, n); return 0 } called by 1: main |
| 52 | func sgfind(buf: *u8, n: i64, ndl: *u8) -> i64 called by 1: main |
| 70 | func main(argc: i64, argv: *i64) -> i64 |