nx_organ_ship_loss_candidate_t370.nx
buildroot/runtime/nx_organ_ship_loss_candidate_t370.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 4 imports · 1 importers
imports: nx_syscalls.nxnx_tool_run.nxnx_organ_ship_loss_lib_candidate_t370.nxnx_build_firsttry_lib.nx
imported by: nx_organ_ship_loss_integration_gate_t370.nx
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| 81 | const OS_CAP: i64 = 262144 |
| 82 | const OS_TIMEOUT_MS: i64 = 900000 // a build under admit backoff can legitimately wait minutes |
| 85 | const OS_MGMT_CALL: *u8 = "./nx_mgmt_call.elf" |
| 86 | const OS_LINE_CAP: i64 = 2048 // one journal line: epoch+target+stage+verdict+detail(a sha or a path) |
| 87 | const OS_SMALL_CAP: i64 = 4096 // captured stdout of a one-line receipt fork (filehash/offc_install) |
| 94 | const OS_GATE_DIR_A: *u8 = "./" |
| 95 | const OS_GATE_SUF_A: *u8 = ".elf" |
| 96 | const OS_GATE_DIR_B: *u8 = "./buildroot/_build/" |
| 97 | const OS_GATE_SUF_B: *u8 = ".sov.elf" |
| 100 | const OS_EXIT_NO_GATE_NAMED: i64 = 22 |
| 106 | const OS_PROVCHECK: *u8 = "./nx_provcheck.elf" |
| 111 | const OS_PROV_INNER_TMO_MS: i64 = 90000 |
| 207 | const OS_JRNL: *u8 = "knowledge/status/organ_ship.jrnl" |
| 208 | const OS_MODE_JRNL: i64 = 420 |
| 214 | const OS_REFUSAL_HEAD: i64 = 160 |
| 215 | const OS_CTRL_MAX: i64 = 31 |
| 216 | const OS_SPACE: i64 = 32 |
| 357 | const OS_DOCSTAGE_ELF: *u8 = "./nx_docstage.elf" |
| 358 | const OS_DOC_RC_DOC: i64 = 0 |
| 359 | const OS_DOC_RC_UNDOC: i64 = 1 |
functions
| 114 | func os_prov_timeout_ms() -> i64 { return OS_PROV_INNER_TMO_MS + OS_PROV_INNER_TMO_MS / 3 } called by 1: os_gate_freshen |
| 116 | func os_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n } |
| 117 | func os_puts(s: *u8) -> i64 { sys_write(1, s, os_slen(s)); return 0 } called by 7: os_doc_stageos_gate_freshenos_loss_refusedos_loss_exact_innermaintest+1 calls 2: sys_writeos_slen |
| 118 | func os_pn(v: i64) -> i64 |
| 130 | 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 } |
| 132 | func os_catn(d: *u8, o: i64, v: i64) -> i64 |
| 144 | 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 } |
| 145 | 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: main |
| 146 | func os_exists(path: *u8) -> i64 { let fd: i64 = sys_openat_rd(path); if fd < 0 { return 0 } sys_close(fd); return 1 } |
| 155 | func os_prov(gate: *u8, target: *u8) -> *u8 |
| 167 | func os_find(hay: *u8, hlen: i64, needle: *u8) -> i64 called by 6: os_json_stros_int_afteros_build_refusal_classos_jrnl_lossesos_gate_freshenmain calls 1: os_slen |
| 174 | func os_json_str(hay: *u8, hlen: i64, key: *u8, dst: *u8, dcap: i64) -> i64 |
| 186 | func os_int_after(hay: *u8, hlen: i64, needle: *u8) -> i64 |
| 195 | func os_tail(buf: *u8, n: i64, lines: i64) -> i64 |
| 217 | 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 } |
| 218 | func os_build_refusal_class(body: *u8, n: i64) -> *u8 |
| 227 | func os_refusal_head(body: *u8, n: i64, out: *u8) -> i64 called by 1: main |
| 236 | func ce_build_firsttry(argc: i64, argv: *i64) -> i64 |
| 244 | func os_jrnl(target: *u8, stage: *u8, verdict: *u8, detail: *u8) -> i64 |
| 268 | func os_ncat(d: *u8, o: i64, v: i64) -> i64 |
| 285 | func os_jrnl_losses(target: *u8, buf: *u8, n: i64) -> i64 |
| 316 | func os_mgmt(method: *u8, path: *u8, body: *u8, out: *u8, olen: *i64) -> i64 |
| 326 | func os_sha_of(path: *u8, dst: *u8) -> i64 called by 4: os_gate_freshenos_loss_exact_innermainmain calls 3: sys_mmaptr_run_capture_toos_json_str |
| 360 | func os_doc_stage(target: *u8) -> i64 |
| 386 | func os_src_names(hay: *u8, hlen: i64, name: *u8) -> i64 |
| 418 | func os_gate_freshen(gname: *u8, target: *u8, gpath: *u8) -> i64 |
| 559 | 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: main |
| 563 | 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} |
| 564 | 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 |
| 601 | func os_loss_exact(target:*u8,live:*u8,stage_sha:*u8,approval:*u8)->i64 called by 2: mainmain calls 5: os_slenos_loss_refusedsys_mmap_tryos_loss_exact_innersys_munmap_direct |
| 610 | func os_loss_journal(target:*u8,detail:*u8)->i64 |
| 624 | func main(argc: i64, argv: *i64) -> i64 |