nx_organ_ship_review_candidate_t371.nx
buildroot/runtime/nx_organ_ship_review_candidate_t371.nx
about
nx_organ_ship.nx -- THE SHIP LOOP AS ONE ORGAN (operator 2026-08-18: "i want all of our workflows mined
and built and developed and tested and deployed etc i dont want all this grep and shell and ps1 and
other bullshit you have been doing except as fallbacks"). This session hand-pecked the ws-cycle phases
WORK->PROVE->EXPOSE->PUBLISH->VERIFY-LIVE ~40 times: build, run gate, contentdiff, behaveprobe,
promote with expect_sha256, read the artifact back, register, verify. Every step exists as an organ;
nothing ran them as ONE loop with the refusals in the right order. This does, in the nx_dr_chain shape:
one call, whole loop, every stage's evidence printed, REFUSE at the first RED with the unblock named.
STAGES (each composes the incumbent, never re-implements; each announces its evidence line):
1 BUILD /api/build target=X via nx_mgmt_call (the never-brick lane; the response's src_path MUST
name X -- the banked wrong-target compile is caught here -- and its sha256 is captured).
REFUSE if src_path is not X (exit 11) or the API refused (exit 12; the API's own reason is
printed: magic-ratchet, admit-gate, etc).
2 PROVE RESOLVE the gate that proves X (nx_organ_ship_lib), then RUN it; its EXIT CODE is the
verdict (gv_verdict law). Resolution order: gate=<name> the caller declared -> a row in
knowledge/organ_gate.conf -> the <X>_gate convention -> X ITSELF when X ends in _gate ->
X minus its last underscore segment plus _gate. Each candidate is probed at the serving
root (<n>.elf) and at buildroot/_build/ (<n>.sov.elf), and EVERY path probed is printed.
FRESHNESS (2026-08-25): for the ONE candidate that is the target this run just built,
buildroot/_build/ is probed FIRST -- it holds code from THIS build while the serving
root holds the PREVIOUS promote, and an in-process gate compiles its subject IN, so
promoted-first reported a tooth count from code the loop did not build. Measured in
this loop's own journal: ONE build sha 2d9c5011..., PROVE RED from
./nx_uvunwrap_gate.elf and PROVE GREEN from the artifact just built, consecutive rows.
It fails in the FLATTERING direction too -- nx_editstack_gate and nx_domain_map_gate
each went GREEN against the promoted copy moments after a build. Every PROVE line, its
journal row and the last line now carry artifact=<which one produced this verdict>.
REFUSE on a nonzero gate exit (21) with the gate's tail. REFUSE (22) when the caller
DECLARED a gate that does not exist -- a caller error, never the ordinary no-gate case.
Nothing resolved is announced NO-GATE-FOUND with its full search transcript, journalled,
and carried into the final line as prove=NO-GATE-FOUND UNPROVEN: a NAMED loud absence.
(Before 2026-08-20 this searched ONE name and silently continued on a miss, so shipping
nx_gate_roster_run -- gate nx_gate_roster_gate -- proved nothing and still said SHIPPED.)
EVERY DECLARED ROW RUNS (2026-08-23): when organ_gate.conf carries several rows for X
(the compiler: one gate per language rung) each further row is resolved at the same two
roots and RUN after the first; a declared row with no artifact REFUSES (22) and a RED
refuses (21). The last line prints gates_proven=N of_declared=M so a partial proof can
never read as a whole one. (Until today only the first row ran and the conf delegated
the rest to "the lane's checklist" -- a law that has to be remembered gets skipped.)
2a VINTAGE WHOSE TREE DID THAT VERDICT DESCRIBE? (2026-08-25, part 2). The freshness swap above fixed
dependencies 5 imports · 2 importers
imports: nx_syscalls.nxnx_tool_run.nxnx_organ_ship_review_lib_candidate_t371.nxnx_adoptgate_review_candidate_t371.nxnx_build_firsttry_lib.nx
imported by: nx_ship_behavior_authority_gate_t371.nxnx_ship_behavior_body_gate_t371.nx
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| 82 | const OS_CAP: i64 = 262144 |
| 83 | const OS_TIMEOUT_MS: i64 = 900000 // a build under admit backoff can legitimately wait minutes |
| 86 | const OS_MGMT_CALL: *u8 = "./nx_mgmt_call.elf" |
| 87 | const OS_LINE_CAP: i64 = 2048 // one journal line: epoch+target+stage+verdict+detail(a sha or a path) |
| 88 | const OS_SMALL_CAP: i64 = 4096 // captured stdout of a one-line receipt fork (filehash/offc_install) |
| 95 | const OS_GATE_DIR_A: *u8 = "./" |
| 96 | const OS_GATE_SUF_A: *u8 = ".elf" |
| 97 | const OS_GATE_DIR_B: *u8 = "./buildroot/_build/" |
| 98 | const OS_GATE_SUF_B: *u8 = ".sov.elf" |
| 101 | const OS_EXIT_NO_GATE_NAMED: i64 = 22 |
| 107 | const OS_PROVCHECK: *u8 = "./nx_provcheck.elf" |
| 112 | const OS_PROV_INNER_TMO_MS: i64 = 90000 |
| 208 | const OS_JRNL: *u8 = "knowledge/status/organ_ship.jrnl" |
| 209 | const OS_MODE_JRNL: i64 = 420 |
| 215 | const OS_REFUSAL_HEAD: i64 = 160 |
| 216 | const OS_CTRL_MAX: i64 = 31 |
| 217 | const OS_SPACE: i64 = 32 |
| 358 | const OS_DOCSTAGE_ELF: *u8 = "./nx_docstage.elf" |
| 359 | const OS_DOC_RC_DOC: i64 = 0 |
| 360 | const OS_DOC_RC_UNDOC: i64 = 1 |
functions
| 115 | func os_prov_timeout_ms() -> i64 { return OS_PROV_INNER_TMO_MS + OS_PROV_INNER_TMO_MS / 3 } called by 1: os_gate_freshen |
| 117 | func os_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n } |
| 118 | func os_puts(s: *u8) -> i64 { sys_write(1, s, os_slen(s)); return 0 } |
| 119 | func os_pn(v: i64) -> i64 called by 5: os_gate_freshenos_loss_exact_inneros_behavior_recordos_ship_mainmain calls 2: sys_mmapsys_write |
| 131 | func os_cat(d: *u8, o: i64, s: *u8) -> i64 { var i: i64 = 0; var oo: i64 = o; while s[i] != (0 as u8) { d[oo] = s[i]; oo = oo + 1; i = i + 1 } d[oo] = 0 as u8; return oo } |
| 133 | func os_catn(d: *u8, o: i64, v: i64) -> i64 |
| 145 | func os_streq(a: *u8, b: *u8) -> i64 { var i: i64 = 0; while a[i] == b[i] { if a[i] == (0 as u8) { return 1 } i = i + 1 } return 0 } |
| 146 | func os_starts(s: *u8, p: *u8) -> i64 { var i: i64 = 0; while p[i] != (0 as u8) { if s[i] != p[i] { return 0 } i = i + 1 } return 1 } called by 1: os_ship_main |
| 147 | func os_exists(path: *u8) -> i64 { let fd: i64 = sys_openat_rd(path); if fd < 0 { return 0 } sys_close(fd); return 1 } |
| 156 | func os_prov(gate: *u8, target: *u8) -> *u8 |
| 168 | func os_find(hay: *u8, hlen: i64, needle: *u8) -> i64 |
| 175 | func os_json_str(hay: *u8, hlen: i64, key: *u8, dst: *u8, dcap: i64) -> i64 |
| 187 | func os_int_after(hay: *u8, hlen: i64, needle: *u8) -> i64 |
| 196 | func os_tail(buf: *u8, n: i64, lines: i64) -> i64 |
| 218 | func os_bytes_of(path: *u8) -> i64 { let fd: i64 = sys_openat_rd(path); if fd < 0 { return 0 - 1 } let s: i64 = sys_lseek(fd, 0, 2); sys_close(fd); return s } |
| 219 | func os_build_refusal_class(body: *u8, n: i64) -> *u8 |
| 228 | func os_refusal_head(body: *u8, n: i64, out: *u8) -> i64 called by 1: os_ship_main |
| 237 | func ce_build_firsttry(argc: i64, argv: *i64) -> i64 |
| 245 | func os_jrnl(target: *u8, stage: *u8, verdict: *u8, detail: *u8) -> i64 |
| 269 | func os_ncat(d: *u8, o: i64, v: i64) -> i64 |
| 286 | func os_jrnl_losses(target: *u8, buf: *u8, n: i64) -> i64 |
| 317 | func os_mgmt(method: *u8, path: *u8, body: *u8, out: *u8, olen: *i64) -> i64 |
| 327 | func os_sha_of(path: *u8, dst: *u8) -> i64 |
| 361 | func os_doc_stage(target: *u8) -> i64 |
| 387 | func os_src_names(hay: *u8, hlen: i64, name: *u8) -> i64 |
| 419 | func os_gate_freshen(gname: *u8, target: *u8, gpath: *u8) -> i64 called by 1: os_ship_main calls 19: os_streqos_putssys_mmapos_pntr_run_capture_toos_prov_timeout_ms+13 |
| 560 | func os_harness_manifest(outpath: *u8, src_sha: *u8, gatepath: *u8, timeout_ms: i64, allow_loss: i64, extra: *u8, tok: *u8) -> i64 { return osl_harness_manifest(outpath, src_sha, gatepath, timeout_ms, allow_loss, extra, tok) } called by 1: os_ship_main |
| 564 | func os_loss_refused(reason:*u8)->i64{os_puts("{\"schema\":\"nishi-ship-loss-approval/1\",\"state\":\"needs-intervention\",\"reason\":\"");os_puts(reason);os_puts("\"}\n");return 31} |
| 565 | func os_loss_exact_inner(target:*u8,live:*u8,stage_sha:*u8,approval:*u8,scratch:*u8)->i64 called by 1: os_loss_exact calls 10: os_catos_slenos_sha_ofos_loss_refusedos_streqtr_run_capture_owned_result+4 |
| 602 | func os_loss_exact(target:*u8,live:*u8,stage_sha:*u8,approval:*u8)->i64 called by 1: os_adoption_review calls 5: os_slenos_loss_refusedsys_mmap_tryos_loss_exact_innersys_munmap_direct |
| 611 | func os_evidence_journal(target:*u8,kind:*u8,detail:*u8)->i64 |
| 625 | func os_loss_journal(target:*u8,detail:*u8)->i64{return os_evidence_journal(target,"ADOPT-LOSS-SET",detail)} |
| 627 | func os_behavior_refused(reason:*u8)->i64 called by 5: os_behavior_acceptos_behavior_recordos_adoption_reviewos_ship_mainmain calls 1: os_puts |
| 630 | func os_behavior_path(digest:*u8,path:*NxBufOwned)->i64 |
| 634 | func os_behavior_accept(target:*u8,context:*NxBufOwned,approval:*u8)->i64 called by 1: os_adoption_review calls 4: os_behavior_pathos_evidence_journalos_putsos_behavior_refused |
| 644 | func os_behavior_record(target:*u8,context:*NxBufOwned,r:*NxBehaviorResult,a:*NxBufOwned,b:*NxBufOwned)->i64 called by 1: os_adoption_review calls 8: sys_mmap_tryos_behavior_refusedos_behavior_pathsys_mkdiros_evidence_journalos_puts+2 |
| 662 | func os_adoption_review(target:*u8,live:*u8,staged:*u8,stageSha:*u8,args:*i64,count:i64,lossApproval:*u8,behaviorApproval:*u8,liveSha:*u8,exactLossApproved:*i64)->i64 called by 3: os_ship_mainmainmain calls 11: os_sha_ofsys_mmap_tryos_behavior_refusedos_streqsys_munmap_directag_content_paths+5 |
| 692 | func os_ship_main(argc:i64,argv:*i64,storage:*u8)->i64 |
| 1002 | func main(argc:i64,argv:*i64)->i64 |
| 1017 | func os_promote_loss_clause(body:*u8,off:i64,exactLossApproved:i64)->i64{if exactLossApproved==1{return os_cat(body,off,"&allow_capability_loss=yes")};return off} |