nx_content_get_gate.nx
buildroot/runtime/nx_content_get_gate.nx
about
nx_content_get_gate.nx -- THE GATE FOR THE NAS->LAPTOP DOOR, 2026-09-03.
SUBJECT: the BUILT nx_content_get elf, forked end-to-end. Its verbs are the whole contract, so an
in-process gate could not test the thing that matters (argv parsing, exit codes, the wire receipt).
argv[1] overrides the subject path so nx_gate_bite can hand it a mutant.
THE TEETH THAT CARRY THE CLAIM ARE T4/T5 AND T10, and each is a law this estate has been bitten by:
T4 IS A FIXTURE ASSERTION, NOT AN OUTCOME. It proves the big fixture actually forced nchunks>1
BEFORE T5 judges reassembly. Without it, a subject that fits in one chunk would let T5 pass
while the multi-chunk path -- the only path that can corrupt -- was never executed. The
single-chunk case looks identical to a working transfer from the outside.
T10 IS THE POSITIVE CONTROL FOR THE REFUSALS. T7/T8/T9 all assert a REFUSAL, and a guard that
refuses EVERYTHING passes every one of them. T10 demands a legitimate path be ACCEPTED, so
the deny-tests can only pass on a guard that actually discriminates.
T3 uses the gate's OWN one-shot sha256_digest against the tool's STREAMING sha256_update path --
genuinely different code, so it is a cross-check rather than the subject grading itself.
T2 re-reads chunk_raw FROM THE PROBE rather than re-deriving it here: re-deriving would install a
second ruler that drifts the moment the reserve changes.
Teeth, in order:
T1 the probe partition RECONCILES: skel+pathcap+digits+shahex == reserve.
T2 chunk_raw is positive and an exact multiple of 3 (so base64 emits no interior padding).
T3 begin's whole-file digest equals an INDEPENDENTLY computed digest of the same bytes.
T4 FIXTURE ASSERTION: the large fixture forces nchunks > 1.
T5 multi-chunk reassembly is byte-identical to the original.
T6 the partition SUMS: the per-chunk raw sizes total exactly total_bytes.
T7 NEG-CONTROL: a path-traversal source is REFUSED (exit 4).
T8 NEG-CONTROL: a source outside the allowlist is REFUSED (exit 4).
T9 NEG-CONTROL: credential material is REFUSED (exit 4).
T10 POSITIVE CONTROL: an allowlisted source is ACCEPTED -- without this T7/T9 pass on a guard
that refuses everything.
T11 an index past end of file is a RANGE refusal (exit 5), distinct from a source refusal.
MEASURED 11/11 GREEN 2026-09-03 on the laptop, bite-proven killed=1 with the source and the
deployed subject both restored byte-identical (12665 / 40212 bytes).
license_tier: ORIGINAL No hw writes (Rule 26). expect_exit: 0
dependencies 5 imports · 0 importers
imports: nx_syscalls.nxnx_gate_verdict.nxnx_tool_run.nxnx_base64.nxnx_sha256.nx
imported by: nobody (leaf or entry point)
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| 49 | const CGG_SUBJECT: *u8 = "buildroot/_build/nx_content_get.sov.elf" as *u8 |
| 50 | const CGG_SUBJ_B: *u8 = "_build/nx_content_get.sov.elf" as *u8 |
| 51 | const CGG_SUBJ_C: *u8 = "_offc/nx_content_get.elf" as *u8 |
| 52 | const CGG_SUBJ_D: *u8 = "nx_content_get.elf" as *u8 |
| 53 | const CGG_DIR: *u8 = "/tmp/cgget" as *u8 |
| 54 | const CGG_SMALL: *u8 = "/tmp/cgget/small.bin" as *u8 |
| 55 | const CGG_BIG: *u8 = "/tmp/cgget/big.bin" as *u8 |
| 56 | const CGG_CAP: i64 = 220000 |
| 57 | const CGG_DIGEST: i64 = 32 |
| 58 | const CGG_SHAHEX: i64 = 64 |
| 59 | const CGG_SMALL_N: i64 = 4096 |
| 60 | const CGG_BIG_EXTRA: i64 = 3000 |
| 61 | const CGG_MODE: i64 = 420 |
functions
| 63 | func cgg_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n } called by 1: cgg_find |
| 67 | func cgg_find(buf: *u8, n: i64, needle: *u8) -> i64 |
| 83 | func cgg_int_after(buf: *u8, n: i64, key: *u8) -> i64 |
| 101 | func cgg_hex_into(d: *u8, out: *u8) -> i64 called by 1: main |
| 115 | func cgg_hex_eq(buf: *u8, n: i64, pos: i64, hex: *u8) -> i64 called by 1: main |
| 126 | func cgg_write_file(path: *u8, buf: *u8, n: i64) -> i64 |
| 141 | func cgg_exists(path: *u8) -> i64 |
| 147 | func cgg_resolve() -> *u8 |
| 155 | func cgg_run(subj: *u8, a1: *u8, a2: *u8, a3: *u8, out: *u8, ol: *i64) -> i64 |
| 166 | func main(argc: i64, argv: *i64) -> i64 |