code wiki / _hdl_build / nx_dep_retire.nx

nx_dep_retire.nx source

↩ module page · 29 lines · 1585 B

1// nx_dep_retire.nx -- track the RETIREMENT of 3rd-party dependencies (operator: "get rid of the 2// remaining dependencies... build the nishi team to retire those, only as benchmarking tools"). Each 3// tool: has the team built a SOVEREIGN NishiLang replacement? -> RETIRED (the tool is now kept ONLY as a 4// benchmark/reference, not a dependency); else REMAINING (owed a replacement); the OS kernel is SUBSTRATE 5// (the floor, not retirable). As replacements land, the Auditor reclassifies the tool from DEPENDENCY to 6// demarcated COMPETITOR. license_tier: ORIGINAL Pairs with nx_auditor. 7 8import "nx_syscalls.nx" 9 10const DR_RETIRED: i64 = 1 // sovereign replacement exists -> the tool is now BENCHMARK-ONLY 11const DR_REMAINING: i64 = 2 // still a real dependency -> owed a sovereign replacement 12const DR_SUBSTRATE: i64 = 3 // OS kernel / hardware -- the floor, not retirable 13 14func dr_status(has_replacement: i64, is_substrate: i64) -> i64 { 15 if is_substrate == 1 { return DR_SUBSTRATE } 16 if has_replacement == 1 { return DR_RETIRED } 17 return DR_REMAINING 18} 19 20// a RETIRED tool is kept ONLY as a benchmark competitor (not relied upon). 21func dr_benchmark_only(status: i64) -> i64 { if status == DR_RETIRED { return 1 } return 0 } 22 23func dr_count(statuses: *i64, n: i64, kind: i64) -> i64 { 24 var c: i64 = 0; var i: i64 = 0 25 while i < n { if statuses[i] == kind { c = c + 1 } i = i + 1 } 26 return c 27} 28// the real dependency count remaining (the sovereignty debt). 29func dr_remaining_deps(statuses: *i64, n: i64) -> i64 { return dr_count(statuses, n, DR_REMAINING) }