code wiki / _hdl_build / nx_deploy_manifest.nx
nx_deploy_manifest.nx source
↩ module page · 27 lines · 1342 B
1// nx_deploy_manifest.nx -- LIB: the ordered, prereq-gated DEPLOY MANIFEST for the NAS remote-access stack, so it goes
2// live in ONE coordinated push. Steps (each requires the prior): cert -> relay -> gateway -> OPAQUE-login -> WAF ->
3// audit -> mTLS. Picks the next deployable step (prereq satisfied), reports readiness, and verifies all components
4// healthy before declaring the API live. Composes the proven deploy-safety pattern. never-brick #26: pure logic,
5// nothing is "live" until its health check passes. license_tier: ORIGINAL
6import "nx_syscalls.nx"
7
8// the next step to deploy = the first not-done step whose prereq is done; -1 if all done or blocked.
9func mf_next(done: *i64, prereq: *i64, n: i64) -> i64 {
10 var i: i64 = 0
11 while i < n {
12 if done[i] == 0 {
13 let p: i64 = prereq[i]
14 if p < 0 { return i }
15 if done[p] == 1 { return i }
16 return 0 - 1
17 }
18 i = i + 1
19 }
20 return 0 - 1
21}
22
23// ready iff every step is done.
24func mf_ready(done: *i64, n: i64) -> i64 { var i: i64=0; while i<n { if done[i]==0 { return 0 } i=i+1 } return 1 }
25
26// healthy iff every deployed component passes its health check (the API is only "live" when this is 1).
27func mf_health(up: *i64, n: i64) -> i64 { var i: i64=0; while i<n { if up[i]==0 { return 0 } i=i+1 } return 1 }