code wiki / _hdl_build / nx_auto_builder_register.nx

nx_auto_builder_register.nx source

↩ module page · 39 lines · 3328 B

1// nx_auto_builder_register.nx -- records the SELF-BUILD organ. Engineer gate = the 2// auto-builder gate itself (6 rows incl. honest paths). Librarian alloc + dual-write. 3// license_tier: ORIGINAL 4import "nx_cap_register.nx" 5import "nx_capreg_librarian.nx" 6import "nx_syscalls.nx" 7 8func abr_run(path: *u8) -> i64 { 9 let pid: i64 = sys_fork() 10 if pid == 0 { 11 let dn: i64 = sys_openat_wr("/dev/null" as *u8, 0x1a4) 12 if dn >= 0 { sys_dup3(dn, 1, 0); sys_dup3(dn, 2, 0) } 13 let argv: *i64 = sys_mmap(32) as *i64; argv[0] = path as i64; argv[1] = 0 14 let envp: *i64 = sys_mmap(16) as *i64; envp[0] = 0 15 sys_execve(path, argv, envp); sys_exit(127) 16 } 17 let st: *i64 = sys_mmap(16) as *i64 18 sys_wait4(pid, st, 0) 19 return st[0] 20} 21 22func main() -> i64 { 23 var allok: i64 = 1 24 if abr_run("/tmp/nx_auto_builder_gate.sov.elf" as *u8) != 0 { allok = 0 } 25 cr_w(1, "ENGINEER: auto-builder gate pass=" as *u8); cr_wn(1, allok); cr_w(1, "\n" as *u8) 26 let eng: i64 = ig_engineer(1, 1, 1, allok) 27 let dec: i64 = ig_decision(eng, ig_council(eng, 1, 1, 2), 1) 28 if dec != IG_INGEST { cr_w(1, "HELD\n" as *u8); sys_exit(1) } 29 if cr_can_register(5, 2, 6, dec) != 1 { cr_w(1, "REFUSED\n" as *u8); sys_exit(1) } 30 let lp: *u8 = "/tmp/nishi_cap_registry.log" as *u8 31 let jp: *u8 = "knowledge/status/cap_registry_durable.log" as *u8 32 let idx: i64 = cl_next_idx(lp, jp) 33 let ok: i64 = cl_register_dual(lp, jp, idx, 5, 34 2, "SELF AUTO-BUILDER -- the Builder's SELF-BUILD organ: A NEW CAPABILITY IS A SPEC FILE (build-code synthesis at the S-class-exceed bar, operator directive 2026-06-10). nx_auto_builder reads a build-spec grammar (name + classifier feature rows + shape-specific param vector), the CLASSIFIER routes the shape (no human/Claude shape decision -- plc_match_spec is the front door it was built to be), dispatches the emitter author (rows: 12 WIRE_TLV v3 / 13 STRUCT_WALK v2 / 18 STATE_MACHINE; adding emitter support = adding a row), then builds AND RUNS the authored KAT through nx_sov_build_run -- spec in, GATED capability out. GATE 6/6 GREEN (nx_auto_builder_gate, log auto_builder_gate.log): three shapes synthesized HANDS-OFF (_pe_httpsm HTTP request lifecycle SM, _pe_tlv2b 2/2 TLV, _pe_chwalk2 CH-layout locator -- all KATs green inside the organ run), BYTE-REPRODUCIBLE (same spec -> identical module hash across runs), malformed spec REFUSED exit-2, uncovered shape (PREDICTOR_CODER 16) answers NEEDS-TUTOR exit-3 = novelty stays measured never absorbed. MEASURED EXCEED vs manual authoring: 58-84ms spec-to-gated-capability latency, ZERO marginal Claude lines per capability, deterministic output, honest refusal paths -- capabilities the manual lane lacks by construction. Closes the author-module Claude touch for covered shapes; remaining touch = the spec file itself + new-shape emitters. Composes CAPREG379 (shape 18) + the classifier (plc) + sov_build_run. NEXT: dispatch rows for shapes 16/17, batch mode (a spec DIRECTORY -> capability set), gap-to-spec organ (race FAIL rows -> draft build spec)" as *u8) 35 if ok != 1 { cr_w(1, "DUAL-WRITE FAILED\n" as *u8); sys_exit(1) } 36 cr_w(1, "CAPREG idx=" as *u8); cr_wn(1, idx); cr_w(1, " REGISTERED -- auto-builder: spec in, gated capability out\n" as *u8) 37 sys_exit(0) 38 return 0 39}