code wiki / _hdl_build / nx_engineer_wire.nx
nx_engineer_wire.nx
buildroot/runtime/_hdl_build/nx_engineer_wire.nx
about
nx_engineer_wire.nx -- the ENGINEER's WIRING capability (operator: "if we need wiring we need the
engineer to have a wiring capability"). Wiring = swap component X for component Y at a call site, then
CERTIFY the wired system before accepting it. A swap is admissible only if it is NON-REGRESSING (every
case the old component handled, the new one still handles -- rule 19 contract stability) and ideally
IMPROVING (fixes at least one case the old got wrong). A swap that breaks anything is REJECTED, never
wired. The Engineer runs both components over a labelled case set and returns the verdict; the Council
only admits a safe wiring. RACI: Engineer certifies, Council admits, Builder/Researcher supplied the
new component. license_tier: ORIGINAL
dependencies 1 imports · 2 importers
imports: nx_syscalls.nx
imported by: nx_engineer_wire_sclass.nxnx_engineer_wire_test.nx
structs
| none |
consts
| 12 | const EW_REGRESS: i64 = 0 // the new component broke a case the old one handled -> REJECT |
| 13 | const EW_NEUTRAL: i64 = 1 // non-regressing but no improvement -> optional |
| 14 | const EW_OK: i64 = 2 // non-regressing AND fixes >=1 case -> WIRE IT |
functions
| 17 | func ew_coverage_ok(old_served: i64, new_served: i64) -> i64 { if new_served >= old_served { return 1 } return 0 } |
| 20 | func ew_regressions(n: i64, old_correct: *i64, new_correct: *i64) -> i64 |
| 27 | func ew_improvements(n: i64, old_correct: *i64, new_correct: *i64) -> i64 |
| 34 | func ew_verdict(regressions: i64, improvements: i64) -> i64 called by 1: main |
| 41 | func ew_safe_to_wire(verdict: i64) -> i64 { if verdict == EW_REGRESS { return 0 } return 1 } called by 1: main |