nx_adoptgate_review_candidate_t371.nx
buildroot/runtime/nx_adoptgate_review_candidate_t371.nx
about
nx_adoptgate.nx -- THE ENFORCED GATE BETWEEN /api/build AND /api/promote (2026-08-07).
WHY: the 4-step adoption recipe exists and is correct, and I ran it BY HAND and therefore ran it
INCONSISTENTLY -- 35 organs promoted on step 2 alone because step 3 was something I had to remember.
*A LAW I HAVE TO REMEMBER IS A LAW I WILL SKIP; PUT IT IN THE PATH.*
This collapses steps 2 and 3 into ONE call that emits ONE machine-checkable token, so a promote can be
gated on `APPROVED` instead of on my good intentions.
IT DOES NOT BUILD AND IT DOES NOT PROMOTE, and that is deliberate:
- build must go through /api/build because only that stages the artifact where /api/promote LOOKS
(a direct nx_sov_build_run drops it in /tmp or _build -- provably the wrong place, and exactly the
artifacts-never-placed-where-consumers-look defect this whole campaign is about).
- promotion stays an explicit operator act. A gate that also performs the action it authorises cannot
be re-run to audit its own decision.
COMPOSES THE INCUMBENTS, never reimplements them (one duplicate ruler was already built and retracted
this session): nx_contentdiff = NECESSARY half, nx_behaveprobe = SUFFICIENCY half.
nx_adoptgate <target> [workload-args...]
-> ADOPT-GATE <target> verdict=APPROVED|REFUSED reason=... content=... behave=... evidence=...
exit 0 APPROVED | 1 REFUSED | 2 missing artifact | 3 usage
license_tier: ORIGINAL No hw writes (Rule 26). expect_exit: 0
dependencies 2 imports · 1 importers
imports: nx_behaveprobe_review_candidate_t371.nxnx_contentdiff.nx
imported by: nx_organ_ship_review_candidate_t371.nx
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| 159 | struct NxAdoptObservation { state:i64,content_rc:i64,behavior_rc:i64,behavior_ran:i64,requires_review:i64 } |
consts
| 26 | const AG_HOST: *u8 = "/volume1/homes/elderwesto/nishihost" |
| 27 | const AG_CDIFF: *u8 = "/volume1/homes/elderwesto/nishihost/nx_contentdiff.elf" |
| 28 | const AG_BPROBE: *u8 = "/volume1/homes/elderwesto/nishihost/nx_behaveprobe.elf" |
| 29 | const AG_CAP: i64 = 262144 |
| 30 | const AG_TMO: i64 = 180000 |
functions
| 32 | func agp(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } |
| 33 | func age(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(2,s,n); return 0 } called by 1: main |
| 34 | func agcat(d: *u8, o: i64, s: *u8) -> i64 { var x: i64=o; var i: i64=0; while s[i]!=(0 as u8){d[x]=s[i];x=x+1;i=i+1} return x } called by 1: main |
| 35 | func agexists(p: *u8) -> i64 { let fd: i64 = sys_openat_rd(p); if fd < 0 { return 0 } sys_close(fd); return 1 } called by 1: main |
| 40 | func agfind(buf: *u8, n: i64, ndl: *u8) -> i64 called by 1: main |
| 66 | func agpos(buf: *u8, n: i64, ndl: *u8, from: i64) -> i64 |
| 81 | func agnum(v: i64) -> i64 |
| 94 | func agint_after(buf: *u8, n: i64, ndl: *u8) -> i64 calls 1: agpos |
| 115 | func ag_echo_lines(buf: *u8, n: i64, ndl: *u8) -> i64 |
| 139 | func ag_content_paths(live:*u8,staged:*u8,target:*u8)->i64 |
| 160 | func ag_observe_owned_result(q:*NxBehaviorRequest,c:*NxCdResult,b:*NxBehaviorResult,r:*NxAdoptObservation,liveOutput:*NxBufOwned,otherOutput:*NxBufOwned)->i64 |
| 173 | func ag_observe_result(q:*NxBehaviorRequest,c:*NxCdResult,b:*NxBehaviorResult,r:*NxAdoptObservation)->i64 calls 1: ag_observe_owned_result |
| 181 | func main(argc: i64, argv: *i64) -> i64 |