code wiki / _hdl_build / nx_subject_infer.nx
nx_subject_infer.nx
buildroot/runtime/_hdl_build/nx_subject_infer.nx
about
nx_subject_infer.nx -- DERIVE a gate's subject source by MEASUREMENT, not by naming convention.
The .gates 4th field (the subject a gate is judging) gates the whole non-vacuity apparatus: without it
nx_bite_sweep reports NO-SUBJECT and the domain can never be proven. 38 of 40 domains lack it. Filling
those by hand means GUESSING, and this session already measured what guessing costs: a guessed subject
that fails to open produces "no mutant killed", which reads identically to a vacuous gate -- so a wrong
guess does not merely fail, it SLANDERS a working gate.
★THE INSIGHT: a gate is not a black box about its own subject either. It IMPORTS what it tests, and it
NAMES the phrases it asserts on. Both are readable. So the subject can be DERIVED and then SCORED:
candidates = the gate's own `import "X.nx"` lines + the name-derived guess (nx_X_gate -> nx_X)
score(candidate) = how many of the gate's named prose needles actually appear in that file
The winner is the file the gate demonstrably talks about. A candidate that scores 0 is not the subject,
however much its name looks right -- which is exactly the nx_healthhelp_site_gate case, where the
name-derived guess WAS correct but a thin HTML assembler and the copy lived elsewhere.
★IT REFUSES RATHER THAN GUESSES. If no candidate scores above zero, it emits UNRESOLVED and says so.
An inferrer that always produces an answer is just a naming convention wearing a lab coat.
usage: nx_subject_infer <domain> (CWD = nxc2 root)
prints a suggested `.gates` row per declared gate; exit 0 = every gate resolved, 1 = at least one UNRESOLVED
license_tier: ORIGINAL
dependencies 2 imports · 0 importers
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
structs
| none |
consts
| 25 | const SI_MAGIC_4096: i64 = 4096 |
| 26 | const SI_MAGIC_4000: i64 = 4000 |
| 27 | const SI_MAGIC_65536: i64 = 65536 |
| 28 | const SI_MAGIC_65535: i64 = 65535 |
| 30 | const SI_MAXSRC: i64 = 4194304 |
| 40 | const SI_MIN_SCORE: i64 = 1 |
functions
| 53 | func w(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } |
| 54 | func wn(v: i64) -> i64 { let t: *u8=sys_mmap(28); var m: i64=v; var k: i64=0; if m==0{t[0]=48 as u8;k=1} while m>0{t[k]=(48+(m%10)) as u8;m=m/10;k=k+1} let b: *u8=sys_mmap(28); var i: i64=0; while i<k{b[i]=t[k-1-i];i=i+1} sys_write(1,b,k); return 0 } |
| 56 | func si_read(path: *u8, buf: *u8, cap: i64) -> i64 |
| 68 | func si_find(hay: *u8, hn: i64, ned: *u8, nl: i64) -> i64 |
| 80 | func si_cat(dst: *u8, off: i64, s: *u8) -> i64 { var o: i64=off; var i: i64=0; while s[i]!=(0 as u8){dst[o]=s[i];o=o+1;i=i+1} return o } called by 1: main |
| 83 | func si_target(elf: *u8, out: *u8) -> i64 called by 1: main |
| 106 | func si_symscore(gsrc: *u8, gn: i64, cb: *u8, cn: i64) -> i64 |
| 136 | func si_score(gsrc: *u8, gn: i64, cand: *u8) -> i64 |
| 178 | func main(argc: i64, argv: *i64) -> i64 |