code wiki / (root) / nx_mod_manifest_gate.nx

nx_mod_manifest_gate.nx

buildroot/runtime/nx_mod_manifest_gate.nx

17176 B260 linesdepth 8pulls 18 transitivereach 0 importersview sourcekind gate/prooftopic mod
docsdependenciesstructsconstsfunctions

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

nx_syscalls.nx nx_gate_verdict.nx nx_gatekit_lib.nx nx_mod_manifest_lib.nx nx_mod_manifest_gate.nx

imports: nx_syscalls.nxnx_gate_verdict.nxnx_gatekit_lib.nxnx_mod_manifest_lib.nx

imported by: nobody (leaf or entry point)

structs

none

consts

16const MG_DIR: *u8 = "/tmp/nx_mod_manifest_gate"
17const MG_PKG: *u8 = "/tmp/nx_mod_manifest_gate/pkg"
18const MG_TEX: *u8 = "/tmp/nx_mod_manifest_gate/pkg/textures"
19const MG_A_REL: *u8 = "a.obj"
20const MG_B_REL: *u8 = "textures/b.png"
21const MG_C_REL: *u8 = "c.vmd"
22const MG_A: *u8 = "/tmp/nx_mod_manifest_gate/pkg/a.obj"
23const MG_B: *u8 = "/tmp/nx_mod_manifest_gate/pkg/textures/b.png"
24const MG_C: *u8 = "/tmp/nx_mod_manifest_gate/pkg/c.vmd"
25const MG_JRNL: *u8 = "/tmp/nx_mod_manifest_gate/assets.jrnl"
26const MG_OUT1: *u8 = "/tmp/nx_mod_manifest_gate/one.nxmod"
27const MG_OUT2: *u8 = "/tmp/nx_mod_manifest_gate/two.nxmod"
28const MG_OUT3: *u8 = "/tmp/nx_mod_manifest_gate/three.nxmod"
29const MG_OUT4: *u8 = "/tmp/nx_mod_manifest_gate/forgedhead.nxmod"
30const MG_OUT5: *u8 = "/tmp/nx_mod_manifest_gate/forgedrow.nxmod"
31const MG_OUT6: *u8 = "/tmp/nx_mod_manifest_gate/nc.nxmod"
32const MG_ELF_LIVE: *u8 = "./nx_mod_manifest.elf"
33const MG_ELF_STAGE: *u8 = "./nx_mod_manifest.sov.elf.new"
34const MG_ELF_BUILD: *u8 = "buildroot/_build/nx_mod_manifest.sov.elf"
35const MG_DIR_MODE: i64 = 493
36const MG_FILE_MODE: i64 = 420
37const MG_CAP: i64 = 65536
38const MG_A_LEN: i64 = 40
39const MG_B_LEN: i64 = 40
40const MG_C_LEN: i64 = 30
41const MG_VMD_MAGIC_LEN: i64 = 25
42const MG_NAME: *u8 = "house-cape"
43const MG_VER: *u8 = "1.2.0"
44const MG_VER2: *u8 = "1.2.1"
45const MG_GAMES: *u8 = "skyrimse,palworld"
46const MG_DEPS: *u8 = "nx_base@1.0"
47const MG_LIC: *u8 = "cc0-1.0"
48const MG_LIC_NC: *u8 = "cc-by-nc-4.0"
49const MG_LIC_NONE: *u8 = "no-such-licence-9f"
50const MG_SRC_URL: *u8 = "https://example.invalid/house-cape"
51const MG_EPOCH: i64 = 1788710000

functions

53func mg_exists(path: *u8) -> i64 { let fd: i64 = sys_openat_rd(path); if fd < 0 { return 0 } sys_close(fd); return 1 }
54func mg_write_file(path: *u8, b: *u8, n: i64) -> i64
62func mg_same_file(a: *u8, b: *u8) -> i64
74func mg_is_hex64(s: *u8) -> i64
88func 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) }
89func mg_write_b(flip: i64) -> i64
97func mg_write_c() -> i64
105func mg_emit(out: *u8, version: *u8, lic: *u8, head65: *u8, info: *i64) -> i64
110func mg_parse_file(path: *u8, m: *i64) -> i64
116func mg_verify_file(path: *u8, r: *i64, m: *i64) -> i64
122func main(argc: i64, argv: *i64) -> i64