code wiki / _hdl_build / nx_subject_infer.nx

nx_subject_infer.nx

buildroot/runtime/_hdl_build/nx_subject_infer.nx

18933 B342 linesdepth 3pulls 3 transitivereach 0 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

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

nx_syscalls.nx nx_artifact_root.nx nx_subject_infer.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 w sys_write sys_exit sys_mmap si_cat si_read sys_openat_rd sys_read sys_close si_target ar_resolve ar_resolve_with ar_exists sys_openat_rd ↻ sys_close ↻ sys_mmap ↻ ar_read sys_openat_rd ↻ sys_read ↻ sys_close ↻ si_score si_find sys_mmap ↻ ar_resolve ↻ si_read ↻ si_symscore sys_mmap ↻ si_find ↻ wn sys_mmap ↻ sys_write ↻

structs

none

consts

25const SI_MAGIC_4096: i64 = 4096
26const SI_MAGIC_4000: i64 = 4000
27const SI_MAGIC_65536: i64 = 65536
28const SI_MAGIC_65535: i64 = 65535
30const SI_MAXSRC: i64 = 4194304
40const SI_MIN_SCORE: i64 = 1

functions

53func w(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
54func 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 }
called by 1: main calls 2: sys_mmapsys_write
56func si_read(path: *u8, buf: *u8, cap: i64) -> i64
68func si_find(hay: *u8, hn: i64, ned: *u8, nl: i64) -> i64
called by 2: si_symscoresi_score
80func 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
83func si_target(elf: *u8, out: *u8) -> i64
called by 1: main
106func si_symscore(gsrc: *u8, gn: i64, cb: *u8, cn: i64) -> i64
called by 1: si_score calls 2: sys_mmapsi_find
136func si_score(gsrc: *u8, gn: i64, cand: *u8) -> i64
178func main(argc: i64, argv: *i64) -> i64