code wiki / _hdl_build / nx_doctor_fix.nx

nx_doctor_fix.nx

buildroot/runtime/_hdl_build/nx_doctor_fix.nx

4977 B118 linesdepth 2pulls 2 transitivereach 6 importersview sourcekind librarytopic doctor
docsdependenciesstructsconstsfunctions

about

nx_doctor_fix.nx -- the DOCTOR organ (the FIXER role; runtime/source hygiene). Its ONE responsibility: produce a candidate fix. A reserved-keyword-as-identifier failure (e.g. `var match`) is mechanically fixable -- rename the offending word to a non-reserved one. doc_heal reads a failing source, renames reserved words used as identifiers (word-boundary aware, so `matched`/`index` are untouched), and writes a healed candidate. RACI: the Doctor is RESPONSIBLE for the fix ONLY -- it does NOT verify and does NOT admit its own work. The ENGINEER re-verifies (separate organ) and the WARDEN/COUNCIL govern admission. The fixer never blesses its own fix. Depends only on syscalls -- decoupled from the Engineer, so the roles stay clean.

dependencies 1 imports · 3 importers

nx_syscalls.nx nx_doctor_fix.nx nx_doctor_datadriven_test.nx nx_doctor_fix_test.nx nx_self_heal_conductor.nx

imports: nx_syscalls.nx

imported by: nx_doctor_datadriven_test.nxnx_doctor_fix_test.nxnx_self_heal_conductor.nx

structs

none

consts

none

functions

13func doc_is_ic(c: i64) -> i64
called by 1: doc_rename
20func doc_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
called by 2: doc_renamedoc_find
23func doc_rename(src: *u8, slen: i64, kw: *u8, out: *u8) -> i64
53func doc_write_file(path: *u8, buf: *u8, len: i64) -> i64
62func doc_find(hay: *u8, hlen: i64, needle: *u8) -> i64
called by 1: doc_offending_kw calls 1: doc_slen
81func doc_offending_kw(diag_path: *u8, out: *u8) -> i64
96func doc_heal_token(src_path: *u8, out_path: *u8, kw: *u8) -> i64
108func doc_heal(src_path: *u8, out_path: *u8) -> i64