code wiki / _hdl_build / nx_doctor_import_gate.nx
nx_doctor_import_gate.nx
buildroot/runtime/_hdl_build/nx_doctor_import_gate.nx
about
nx_doctor_import_gate.nx -- THE LOCK for the import AUTO-FIX (CC-UNDEFFN OPEN->AUTO). REAL end-to-end
(rule 7, no mocks): writes a BAD source that calls a sys_* primitive with NO import, drives the
Engineer's REAL compile (capturing the diagnostic), then proves the Doctor's import-fix makes the
previously-failing source COMPILE. Self-cleaning (di_unlink) so it leaves no scratch in runtime/.
G1 bad-fails : the un-imported source genuinely fails to compile (rc<0)
G2 extract : di_undef_fn pulls "sys_close" out of the captured "call to undefined function:" diag
G3 resolve : di_resolve("sys_close") -> "nx_syscalls.nx"
G4 heal-compiles: the healed candidate (import prepended) COMPILES exit-0 -- the auto-fix is REAL
G5 neg-control : di_resolve("frobnicate_made_up") -> 0 (no false fix for the unresolvable case)
GREEN only if G1..G5. Sources live in runtime/ (the import root, required for resolution); the .s/.err
go to WSL /tmp (organ-side). Evidence -> knowledge/status/doctor_import.log. license_tier: ORIGINAL
dependencies 3 imports · 0 importers
imports: nx_doctor_import.nxnx_engineer_crash.nxnx_syscalls.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
| 17 | const DIG_LOG: *u8 = "knowledge/status/doctor_import.log" |
| 18 | const DIG_CC: *u8 = "/mnt/c/Users/elder/nishi-core/nxc2/_offc/nx_cc_sovereign.elf" |
| 19 | const DIG_BAD: *u8 = "runtime/_ki_autofix_bad.nx" |
| 20 | const DIG_HEAL:*u8 = "runtime/_ki_autofix_healed.nx" |
functions
| 22 | func dig_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 } |
| 23 | func dig_streq(a: *u8, b: *u8) -> i64 called by 1: main |
| 32 | func dig_row(fd: i64, name: *u8, pass: i64) -> i64 |
| 38 | func main() -> i64 |