nx_mod_manifest_gate.nx
buildroot/runtime/nx_mod_manifest_gate.nx
about
nx_mod_manifest_gate.nx -- THE MOD PACKAGE MANIFEST GATE (/compare/modding MD18, 2026-09-06). A three-member package (an OBJ, a
PNG under a subdirectory, a VMD) is written under /tmp/nx_mod_manifest_gate/pkg/ at runtime; one member carries a provenance
row on a SCRATCH journal (cc0-1.0, the MD9 composition), the others have none. The manifest must emit deterministically
(two emits byte-identical), parse back to the same fields, verify ACCEPT, and then every tamper the rung names must be
REFUSED BY NAME: a member's bytes changed (TAMPERED, the head of the files moves while the declared chain still verifies),
a member removed (MISSING), the audit head forged (HEAD), a content row forged (the chain no longer matches). A licence the
rights table lacks refuses at emit; a non-redistributable licence still emits with redist=0 because private use is allowed
and the publish door is MD23's refusal; unsafe member paths refuse. The command is the second witness through the ladder.
usage: nx_mod_manifest_gate (no args)
license_tier: ORIGINAL No hw writes (Rule 26). expect_exit: 0
dependencies 4 imports · 0 importers
imports: nx_syscalls.nxnx_gate_verdict.nxnx_gatekit_lib.nxnx_mod_manifest_lib.nx
imported by: nobody (leaf or entry point)
structs
| none |
consts
| 16 | const MG_DIR: *u8 = "/tmp/nx_mod_manifest_gate" |
| 17 | const MG_PKG: *u8 = "/tmp/nx_mod_manifest_gate/pkg" |
| 18 | const MG_TEX: *u8 = "/tmp/nx_mod_manifest_gate/pkg/textures" |
| 19 | const MG_A_REL: *u8 = "a.obj" |
| 20 | const MG_B_REL: *u8 = "textures/b.png" |
| 21 | const MG_C_REL: *u8 = "c.vmd" |
| 22 | const MG_A: *u8 = "/tmp/nx_mod_manifest_gate/pkg/a.obj" |
| 23 | const MG_B: *u8 = "/tmp/nx_mod_manifest_gate/pkg/textures/b.png" |
| 24 | const MG_C: *u8 = "/tmp/nx_mod_manifest_gate/pkg/c.vmd" |
| 25 | const MG_JRNL: *u8 = "/tmp/nx_mod_manifest_gate/assets.jrnl" |
| 26 | const MG_OUT1: *u8 = "/tmp/nx_mod_manifest_gate/one.nxmod" |
| 27 | const MG_OUT2: *u8 = "/tmp/nx_mod_manifest_gate/two.nxmod" |
| 28 | const MG_OUT3: *u8 = "/tmp/nx_mod_manifest_gate/three.nxmod" |
| 29 | const MG_OUT4: *u8 = "/tmp/nx_mod_manifest_gate/forgedhead.nxmod" |
| 30 | const MG_OUT5: *u8 = "/tmp/nx_mod_manifest_gate/forgedrow.nxmod" |
| 31 | const MG_OUT6: *u8 = "/tmp/nx_mod_manifest_gate/nc.nxmod" |
| 32 | const MG_ELF_LIVE: *u8 = "./nx_mod_manifest.elf" |
| 33 | const MG_ELF_STAGE: *u8 = "./nx_mod_manifest.sov.elf.new" |
| 34 | const MG_ELF_BUILD: *u8 = "buildroot/_build/nx_mod_manifest.sov.elf" |
| 35 | const MG_DIR_MODE: i64 = 493 |
| 36 | const MG_FILE_MODE: i64 = 420 |
| 37 | const MG_CAP: i64 = 65536 |
| 38 | const MG_A_LEN: i64 = 40 |
| 39 | const MG_B_LEN: i64 = 40 |
| 40 | const MG_C_LEN: i64 = 30 |
| 41 | const MG_VMD_MAGIC_LEN: i64 = 25 |
| 42 | const MG_NAME: *u8 = "house-cape" |
| 43 | const MG_VER: *u8 = "1.2.0" |
| 44 | const MG_VER2: *u8 = "1.2.1" |
| 45 | const MG_GAMES: *u8 = "skyrimse,palworld" |
| 46 | const MG_DEPS: *u8 = "nx_base@1.0" |
| 47 | const MG_LIC: *u8 = "cc0-1.0" |
| 48 | const MG_LIC_NC: *u8 = "cc-by-nc-4.0" |
| 49 | const MG_LIC_NONE: *u8 = "no-such-licence-9f" |
| 50 | const MG_SRC_URL: *u8 = "https://example.invalid/house-cape" |
| 51 | const MG_EPOCH: i64 = 1788710000 |
functions
| 53 | func mg_exists(path: *u8) -> i64 { let fd: i64 = sys_openat_rd(path); if fd < 0 { return 0 } sys_close(fd); return 1 } |
| 54 | func mg_write_file(path: *u8, b: *u8, n: i64) -> i64 |
| 62 | func mg_same_file(a: *u8, b: *u8) -> i64 |
| 74 | func mg_is_hex64(s: *u8) -> i64 |
| 88 | func mg_write_a() -> i64 { return mg_write_file(MG_A, "v 0 0 0\nv 1 0 0\nv 0 1 0\nf 1 2 3\n# cape\n" as *u8, MG_A_LEN) } |
| 89 | func mg_write_b(flip: i64) -> i64 |
| 97 | func mg_write_c() -> i64 |
| 105 | func mg_emit(out: *u8, version: *u8, lic: *u8, head65: *u8, info: *i64) -> i64 |
| 110 | func mg_parse_file(path: *u8, m: *i64) -> i64 |
| 116 | func mg_verify_file(path: *u8, r: *i64, m: *i64) -> i64 |
| 122 | func main(argc: i64, argv: *i64) -> i64 |