code wiki / _hdl_build / nx_deploy_ready.nx
nx_deploy_ready.nx
buildroot/runtime/_hdl_build/nx_deploy_ready.nx
about
nx_deploy_ready.nx -- PRE-DEPLOY SAFETY GATE (operator: "prevent things like this... deploy... managed").
The capstone of the deploy-reliability trilogy: an agent/session calls this BEFORE deploying an organ to
learn if it is SAFE. Aggregates the supervised signals into ONE actionable verdict instead of 3 separate
checks -- proactive prevention (won't deploy into a drifted buildroot or after a contract regression).
Data-driven (rule 11): knowledge/registry/deploy_checks.tsv rows = name<TAB>file<TAB>marker<TAB>severity<TAB>remediation.
A check PASSES if <file> contains <marker>. severity BLOCK -> a fail makes deploy UNSAFE; WARN -> advisory.
nx_deploy_ready check [manifest] [target] (JSON: deploy_safe + per-check pass/severity + blockers + remediations)
LOOSE COUPLING (operator 2026-09-02: "a supervisor deploy has no business being blocked by a search domain's
RED ... estate wide loose coupling small sharp intelligent pieces"). The evidence-honesty row used to be a
GLOBAL conjunction: any RED compare domain blocked EVERY deploy, so two content domains blocked a fleet-
supervisor memory-leak fix and the gate got overridden -- a gate that blocks too broadly is disabled in
practice and protects nothing. Now, when the caller names the deploy TARGET (a deploy_targets.conf row
name), that ONE row is SCOPED to the target's blast radius: it blocks iff the target's OWN domain, or a
SHARED-FATE domain (the deploy machinery itself), is named on the RED_DOMAINS= line nx_sota_status emits.
Every other row is unchanged. With no target, or an unmapped target, or an evidence log that carries no
RED_DOMAINS= line (an older producer), the row keeps its GLOBAL marker check -- the fallback fails in the
direction of REFUSING, never of acquitting, and the JSON names which scope applied so the audit is visible.
Data-driven (rule 11): knowledge/registry/deploy_domain.conf rows = <target> <domain>;
knowledge/registry/deploy_sharedfate.conf rows = one shared-fate domain per line.
license_tier: ORIGINAL No hw writes (Rule 26). expect_exit: 0
dependencies 1 imports · 0 importers
imports: nx_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
| 24 | const DR_CAP: i64 = 262144 |
| 25 | const DR_TAB: i64 = 9 |
| 26 | const DR_NL: i64 = 10 |
| 27 | const DR_HASH: i64 = 35 |
| 28 | const DR_SPACE: i64 = 32 |
| 29 | const DR_STDERR: i64 = 2 |
| 30 | const DR_SPAN: i64 = 16 |
| 31 | const DR_EXIT_USAGE: i64 = 2 |
| 32 | const DR_NAMECAP: i64 = 256 |
| 33 | const DR_DOMAIN_CONF: *u8 = "knowledge/registry/deploy_domain.conf" |
| 34 | const DR_SHAREDFATE_CONF: *u8 = "knowledge/registry/deploy_sharedfate.conf" |
| 35 | const DR_RED_KEY: *u8 = "RED_DOMAINS=" |
| 36 | const DR_SCOPED_ROW: *u8 = "evidence-honesty" |
functions
| 38 | func dr_werr(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(DR_STDERR, s, n); return 0 } |
| 39 | func dr_vlen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n } called by 1: main |
| 40 | func dr_cat(d: *u8, o: i64, s: *u8) -> i64 { var i: i64 = 0; while s[i] != (0 as u8) { d[o] = s[i]; o = o + 1; i = i + 1 } return o } called by 1: main |
| 41 | func dr_catn(d: *u8, o: i64, v: i64) -> i64 { let t: *u8 = sys_mmap(28); var m: i64 = v; if m < 0 { d[o] = 45 as u8; o = o + 1; m = 0 - m } var k: i64 = 0; if m == 0 { t[0] = 48 as u8; k = 1 } while m > 0 { t[k] = (48 + (m % 10)) as u8; m = m / 10; k = k + 1 } var i: i64 = 0; while i < k { d[o] = t[k-1-i]; o = o + 1; i = i + 1 } return o } |
| 42 | func dr_cat_esc(d: *u8, o: i64, q: *u8, s: i64, e: i64) -> i64 { var i: i64 = s; while i < e { var c: i64 = q[i] as i64; if c == 34 { c = 39 } if c == 92 { c = 47 } if c < 32 { c = 32 } d[o] = c as u8; o = o + 1; i = i + 1 } return o } called by 1: main |
| 43 | func dr_read(path: *u8, buf: *u8, cap: i64) -> i64 |
| 52 | func dr_contains(buf: *u8, n: i64, lit: *u8) -> i64 |
| 66 | func dr_le(q: *u8, i: i64, n: i64) -> i64 { var e: i64 = i; var s: i64 = 1; while s == 1 { if e >= n { s = 0 } else { if q[e] == (DR_NL as u8) { s = 0 } else { e = e + 1 } } } return e } |
| 67 | func dr_col(q: *u8, ls: i64, le: i64, c: i64, out: *i64) -> i64 called by 1: main |
| 83 | func dr_cstr(q: *u8, s: i64, e: i64, dst: *u8) -> i64 { var i: i64 = 0; while s + i < e { dst[i] = q[s+i]; i = i + 1 } dst[i] = 0 as u8; return i } called by 1: main |
| 84 | func dr_span_is(q: *u8, s: i64, e: i64, lit: *u8) -> i64 { var i: i64 = 0; while s + i < e { if lit[i] == (0 as u8) { return 0 } if q[s+i] != lit[i] { return 0 } i = i + 1 } if lit[i] != (0 as u8) { return 0 } return 1 } called by 1: main |
| 91 | func dr_red_names(buf: *u8, n: i64, domain: *u8, out: *i64) -> i64 |
| 106 | func dr_lookup_domain(conf: *u8, n: i64, target: *u8, dst: *u8) -> i64 |
| 132 | func dr_sharedfate_red(sf: *u8, sfn: i64, ev: *u8, evn: i64) -> i64 |
| 150 | func main(argc: i64, argv: *i64) -> i64 |