code wiki / _hdl_build / _offc_install_gate.nx
_offc_install_gate.nx
buildroot/runtime/_hdl_build/_offc_install_gate.nx
about
_offc_install_gate.nx -- LOCK for the LM-026 prevention (stale-_offc guardrail). NO mocks.
Proves the ENGINEER guardrail (nx_offc_install) detects + atomically fixes a stale _offc artifact,
AND that the DOCTOR's recall (ki_recall over the LIVE ki- catalogue) routes the STALE-OFFC-ARTIFACT
signature to the wired auto-remedy -- so the team prevents the landmine that cost a full session.
HERMETIC: operates on a clearly-test name (_oitest*), writing the /tmp "fresh build" and the _offc
"installed" artifact directly, so the file-copy logic is exercised end-to-end with NO real build.
T1 detect : _offc differs from /tmp -> oi_stale==1
T2 fix : oi_install copies + verifies -> _offc now byte-equals /tmp
T3 post-fresh : after install -> oi_stale==0
T4 neg-control : _offc already equals /tmp -> oi_stale==0 (no false-positive)
T5 recall : a real STALE-OFFC-ARTIFACT diag -> ki_recall HIT id=LM-026 rem=nx_offc_install:oi_install
T6 tamper : corrupt the signature -> ki_recall UNKNOWN (real substring, not constant)
T7 fresh-LM027 : oi_fresh removes a stale artifact -> artifact gone (external-oracle gate path that
oi_install cannot cover -- no /tmp twin: compile-then-run can never fork a stale binary)
GREEN only if T1..T7 hold. Evidence -> knowledge/status/offc_install.log. license_tier: ORIGINAL
dependencies 3 imports · 0 importers
imports: nx_offc_install.nxnx_known_issue_store.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
| 21 | const G_LOG: *u8 = "knowledge/status/offc_install.log" |
functions
| 23 | func g_len(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n } |
| 24 | func g_p(s: *u8) -> i64 { sys_write(1, s, g_len(s)); return 0 } |
| 25 | func g_fp(fd: i64, s: *u8) -> i64 { sys_write(fd, s, g_len(s)); return 0 } |
| 26 | func g_streq(a: *u8, b: *u8) -> i64 called by 1: main |
| 32 | func g_write(path: *u8, content: *u8) -> i64 |
| 39 | func g_file_eq(path: *u8, expected: *u8) -> i64 |
| 49 | func g_row(name: *u8, pass: i64) -> i64 { g_p(" " as *u8); g_p(name); if pass == 1 { g_p(" PASS\n" as *u8) } else { g_p(" FAIL\n" as *u8) } return 0 } |
| 51 | func main() -> i64 |