code wiki / _hdl_build / nx_doctor_fix.nx
nx_doctor_fix.nx
buildroot/runtime/_hdl_build/nx_doctor_fix.nx
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
imports: nx_syscalls.nx
imported by: nx_doctor_datadriven_test.nxnx_doctor_fix_test.nxnx_self_heal_conductor.nx
structs
| none |
consts
| none |
functions
| 13 | func doc_is_ic(c: i64) -> i64 called by 1: doc_rename |
| 20 | func doc_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n } |
| 23 | func doc_rename(src: *u8, slen: i64, kw: *u8, out: *u8) -> i64 |
| 53 | func doc_write_file(path: *u8, buf: *u8, len: i64) -> i64 |
| 62 | func doc_find(hay: *u8, hlen: i64, needle: *u8) -> i64 |
| 81 | func doc_offending_kw(diag_path: *u8, out: *u8) -> i64 |
| 96 | func doc_heal_token(src_path: *u8, out_path: *u8, kw: *u8) -> i64 |
| 108 | func doc_heal(src_path: *u8, out_path: *u8) -> i64 |