code wiki / _hdl_build / nx_doctor_import_gate.nx

nx_doctor_import_gate.nx

buildroot/runtime/_hdl_build/nx_doctor_import_gate.nx

4669 B103 linesdepth 3pulls 4 transitivereach 0 importersview sourcekind gate/prooftopic doctor
docsdependenciesstructsconstsfunctions

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

nx_doctor_import.nx nx_engineer_crash.nx nx_syscalls.nx nx_doctor_import_gate.nx

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

main sys_openat_wr sys_write di_len sys_close eng_compile_diag sys_mmap sys_fork sys_openat_wr ↻ sys_dup3 sys_close ↻ sys_execve sys_exit sys_wait4 sys_openat_rd sys_read sys_mmap ↻ di_undef_fn sys_mmap ↻ sys_read_file sys_openat_rd ↻ sys_lseek sys_mmap ↻ sys_read ↻ sys_close ↻ di_find di_len ↻ di_len ↻ dig_streq di_resolve di_heal sys_mmap ↻ sys_read_file ↻ di_len ↻ sys_openat_wr ↻ sys_write ↻ sys_close ↻ eng_compile sys_mmap ↻ sys_fork ↻

structs

none

consts

17const DIG_LOG: *u8 = "knowledge/status/doctor_import.log"
18const DIG_CC: *u8 = "/mnt/c/Users/elder/nishi-core/nxc2/_offc/nx_cc_sovereign.elf"
19const DIG_BAD: *u8 = "runtime/_ki_autofix_bad.nx"
20const DIG_HEAL:*u8 = "runtime/_ki_autofix_healed.nx"

functions

22func 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 }
called by 2: dig_rowmain calls 1: sys_write
23func dig_streq(a: *u8, b: *u8) -> i64
called by 1: main
32func dig_row(fd: i64, name: *u8, pass: i64) -> i64
called by 1: main calls 1: dig_w
38func main() -> i64