code wiki / _hdl_build / nx_doctor_import.nx
nx_doctor_import.nx
buildroot/runtime/_hdl_build/nx_doctor_import.nx
about
nx_doctor_import.nx -- DOCTOR sub-organ (the IMPORT-FIXER role; sibling of nx_doctor_fix). Turns the
CC-UNDEFFN known-issue ("call to undefined function: X") from recall-and-REPORT into a real AUTO-FIX
for the resolvable case: most such failures are a MISSING IMPORT, and every sys_* primitive lives in
nx_syscalls.nx (verified sys_write @ nx_syscalls.nx:79). So: extract the named function from the
Engineer's diagnostic, resolve it to the organ that defines it, and write a healed candidate with the
import prepended (ADDITIVE -- new file, the protected source is never clobbered).
RACI: the Doctor produces a CANDIDATE only; it does NOT verify (the Engineer re-compiles) and does
NOT admit (Warden/Council). di_resolve returns 0 for names it cannot resolve -> the caller falls back
to recall-and-report (NO false fix -- honest). v1 rule = sys_*->nx_syscalls.nx (deterministic); a
general symbol-index over the corpus is the next extension. license_tier: ORIGINAL
dependencies 1 imports · 1 importers
imports: nx_syscalls.nx
imported by: nx_doctor_import_gate.nx
structs
| none |
consts
| none |
functions
| 14 | func di_len(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n } |
| 18 | func di_unlink(path: *u8) -> i64 { __syscall(263, AT_FDCWD, path, 0, 0, 0, 0) return 0 } called by 1: main |
| 21 | func di_find(hay: *u8, hlen: i64, needle: *u8) -> i64 |
| 36 | func di_undef_fn(diag_path: *u8, out: *u8) -> i64 |
| 63 | func di_resolve(name: *u8, out_import: *u8) -> i64 called by 1: main |
| 83 | func di_heal(src_path: *u8, out_path: *u8, imp: *u8) -> i64 |