code wiki / _hdl_build / nx_mirror_orchestrator.nx
nx_mirror_orchestrator.nx
buildroot/runtime/_hdl_build/nx_mirror_orchestrator.nx
about
nx_mirror_orchestrator.nx -- LIB: the UNIFYING "mirror a published open artifact (e.g. Apertus) onto the NAS"
flow (the #1 GAP nx_mirror_census surfaced). It COMPOSES shipped sovereign primitives -- it does NOT re-implement
them: sha256_digest (nx_sha256, byte-exact integrity), nx_https_fetch_follow (own-TLS HTTP), the BitTorrent+DHT
swarm (nx_torrent_get/nx_dht_get_peers/nx_peer_download), nx_aw_send (NAS transport), rcpt_emit (nx_pub_receipt,
Ed25519-signed provenance). This file is the pure, deterministic, NEVER-BRICK ORCHESTRATION LOGIC: parse a
data-driven manifest row -> resolve the fetch method by scheme (fail-closed on unknown) -> VERIFY the artifact's
SHA-256 against the manifest's expected digest (fail-closed = never store a corrupt artifact) -> derive the
idempotent content-address key (re-mirror = no-op) -> assemble the provenance-receipt binding in the exact
nx_pub_receipt shape. The LIVE dispatch (fetch + NAS push + SIGNED rcpt_emit) is rung-2, gated behind operator
confirm (heavy/outward). Additive-only + idempotent by construction (Cardinal 10/13). No main -> built via its
_gate. license_tier: ORIGINAL
dependencies 2 imports · 1 importers
imports: nx_sha256.nxnx_syscalls.nx
imported by: nx_mirror_orchestrator_gate.nx
structs
| none |
consts
| 16 | const MO_HTTP: i64 = 1 |
| 17 | const MO_TORRENT: i64 = 2 |
| 18 | const MO_REJECT: i64 = 0 |
functions
| 20 | func mo_slen(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} return n } |
| 21 | func mo_streq(a: *u8, b: *u8) -> i64 { var i: i64=0; while 1==1 { let ca: i64=a[i] as i64; let cb: i64=b[i] as i64; if ca!=cb {return 0} if ca==0 {return 1} i=i+1 } return 1 } |
| 22 | func mo_cat(dst: *u8, off: i64, s: *u8) -> i64 { var o: i64=off; var i: i64=0; while s[i]!=(0 as u8){dst[o]=s[i]; o=o+1; i=i+1} return o } |
| 25 | func mo_hexenc(inp: *u8, n: i64, out: *u8) -> i64 called by 1: mo_sha_hex |
| 34 | func mo_scheme_code(scheme: *u8) -> i64 |
| 43 | func mo_sha_hex(bytes: *u8, n: i64, out_hex: *u8) -> i64 |
| 51 | func mo_verify(bytes: *u8, n: i64, expect_hex: *u8) -> i64 |
| 59 | func mo_cas_key(sha_hex: *u8, dest: *u8, out: *u8) -> i64 |
| 66 | func mo_receipt_bind(buf: *u8, status: *u8, sha_hex: *u8, dest: *u8, verify: *u8, tsstr: *u8) -> i64 |
| 77 | func mo_parse_field(line: *u8, idx: i64, out: *u8) -> i64 |