code wiki / _hdl_build / nx_auto_builder_s20.nx

nx_auto_builder_s20.nx

buildroot/runtime/_hdl_build/nx_auto_builder_s20.nx

17615 B419 linesdepth 4pulls 12 transitivereach 0 importersview sourcekind tooltopic auto
docsdependenciesstructsconstsfunctions

about

nx_auto_builder.nx -- the BUILDER's SELF-BUILD organ (the S-class-exceed rung of build-code synthesis): a NEW CAPABILITY IS A SPEC FILE. Reads a build-spec grammar, routes the shape via the CLASSIFIER (no human/Claude shape decision), dispatches the right pattern emitter, then builds AND RUNS the authored KAT sovereignly -- spec in, gated capability out, hands-off. name <module> the authored module name (paths derived) feature <fname> classifier feature vector rows (in_table, in_state, ...) param <ints...> shape-specific parameter vector, meaning per routed shape: shape 12 WIRE_TLV: type_w len_w type_first len_le pad2 trail_w (pe7 v3) shape 13 STRUCT_WALK: nfields k0 w0 k1 w1 ... (pe8 v2) shape 18 STATE_MACHINE nstates nevents s0 t[0] t[1] ... (pe13) VERDICTS (honest, exit-coded): GREEN(0) authored + KAT green; RED(1) KAT failed; REFUSED(2) malformed spec or emitter rail refused; NEEDS-TUTOR(3) classifier routed a shape this organ has no dispatch row for (NOVEL stays measured, never silently absorbed). Durable: AUTOBUILD rows w/ measured ms -> knowledge/status/auto_builder.log. EXCEEDS manual authoring: zero marginal Claude lines per capability, ms-scale latency, byte-REPRODUCIBLE output (same spec -> identical module), classifier-routed dispatch. Usage: nx_auto_builder <specpath> LAWS: struct-free, integer-only, flat ifs (per-row parse helpers), no &&/||, <=6 args. license_tier: ORIGINAL

dependencies 9 imports · 0 importers

nx_pattern_classify.nx nx_pattern_emit7.nx nx_pattern_emit8.nx nx_pattern_emit10.nx nx_pattern_emit13.nx nx_pattern_emit14.nx nx_pattern_emit6.nx nx_pattern_emit6_erf.nx nx_syscalls.nx nx_auto_builder_s20.nx

imports: nx_pattern_classify.nxnx_pattern_emit7.nxnx_pattern_emit8.nxnx_pattern_emit10.nxnx_pattern_emit13.nxnx_pattern_emit14.nxnx_pattern_emit6.nxnx_pattern_emit6_erf.nxnx_syscalls.nx

imported by: nobody (leaf or entry point)

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

main ab_w sys_write sys_exit ab_ms sys_mmap sys_clock_gettime_mono sys_mmap ↻ sys_read_file sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_close ab_log sys_openat_append ab_w ↻ ab_wn sys_mmap ↻ sys_write ↻ sys_close ↻ plc_new_features sys_mmap ↻ ab_parse_line sys_mmap ↻ ab_tok ab_teq ab_tcopy ab_feat_idx ab_teq ↻ ab_tint plc_match_spec plc_classify plc_table sys_mmap ↻ plc_table_rows pl_covered ab_wn ↻ ab_cat ab_author_11

structs

none

consts

29const K_MAGIC_1000000: i64 = 1000000
30const K_MAGIC_2048: i64 = 2048

functions

32func ab_w(fd: i64, s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(fd, s, n); return 0 }
called by 2: ab_logmain calls 1: sys_write
33func ab_wn(fd: i64, v: i64) -> i64 { let bb: *u8=sys_mmap(28); var m: i64=v; if m<0{m=0-m; sys_write(fd,"-" as *u8,1)}; let t: *u8=sys_mmap(28); var k: i64=0; if m==0{t[0]=48;k=1}; while m>0{t[k]=(48+(m%10)) as u8;m=m/10;k=k+1}; var i: i64=0; while i<k{bb[i]=t[k-1-i];i=i+1}; sys_write(fd,bb,k); return 0 }
called by 2: ab_logmain calls 2: sys_mmapsys_write
35func ab_ms() -> i64
called by 1: main calls 2: sys_mmapsys_clock_gettime_mono
41func ab_cat(dst: *u8, o: i64, s: *u8) -> i64
called by 2: ab_author_11main
49func ab_tok(buf: *u8, ls: i64, le: i64, idx: i64, se: *i64) -> i64
called by 1: ab_parse_line
77func ab_teq(buf: *u8, s: i64, e: i64, lit: *u8) -> i64
90func ab_tint(buf: *u8, s: i64, e: i64) -> i64
called by 1: ab_parse_line
104func ab_tcopy(buf: *u8, s: i64, e: i64, pool: *u8, pp: *i64) -> i64
called by 1: ab_parse_line
114func ab_feat_idx(buf: *u8, s: i64, e: i64) -> i64
called by 1: ab_parse_line calls 1: ab_teq
134func ab_parse_line(spec: *u8, ls: i64, le: i64, st: *i64) -> i64
180func ab_author_12(name: *u8, mp: *u8, tp: *u8, p: *i64, np: i64) -> i64
called by 1: main calls 1: pe7_author_wire_tlv3
184func ab_author_13(name: *u8, mp: *u8, tp: *u8, p: *i64, np: i64) -> i64
194func ab_author_18(name: *u8, mp: *u8, tp: *u8, p: *i64, np: i64) -> i64
called by 1: main calls 1: pe13_author_state_machine
203func ab_author_4(name: *u8, mp: *u8, tp: *u8, p: *i64, np: i64) -> i64
called by 1: main calls 1: pe14_author_permil_verdict
214func ab_author_15(name: *u8, mp: *u8, tp: *u8, p: *i64, np: i64) -> i64
230func ab_load_spec(path: *u8, c: *i64) -> i64
called by 1: ab_author_11 calls 2: sys_mmapsys_read_file
277func ab_author_11(name: *u8, mp: *u8, tp: *u8, p: *i64, np: i64, sf: *u8) -> i64
298func ab_kat(testname: *u8) -> i64
317func ab_log(name: *u8, shape: i64, ms: i64, verdict: *u8) -> i64
328func main(argc: i64, argv: *i64) -> i64