f6_gate.nx
buildroot/runtime/f6_gate.nx
about
f6_gate.nx -- sovereign replacement for bench/f6_gate.sh.
Reads the committed golden manifest, invokes nxc2 on each
target, SHA-256 hashes the output, compares against the
manifest hash. Any mismatch signals one of:
(a) intentional change -- rerun with --update
(b) non-determinism regression -- fix before shipping
(c) toolchain compromise -- Thompson / Vault-7 attack signal
Removes the last non-NishiLang language (bash) from the
nishi-core build chain. The gate's logic is identical to the
bash script's; only the driver changes.
Usage:
f6_gate -- check against committed manifest
f6_gate --update -- overwrite the manifest
Environment assumptions (same as f6_gate.sh):
- nxc2 executable at ./../nxc2.exe relative to pwd
- Manifest at ./f6_manifest.txt
- Targets listed in manifest paths (relative to nxc2 dir)
Invariants:
FG1 Each target compiled under `--target asm --opt` with
stdout captured via pipe+dup3. Same invocation as bash
gate. Mismatch in options == mismatch against manifest
expected.
FG2 SHA-256 computed over captured bytes exactly; no trailing
whitespace stripped, no normalization. Byte-identical
semantics.
FG3 Non-zero exit codes from nxc2 (compile errors) cause
the target to be skipped (marked "# skip" in manifest)
per the bash gate's behaviour.
FG4 Output buffer caps: 16 MiB per target's asm. Larger is
a configuration issue; we fail loudly rather than truncate.
dependencies 3 imports · 0 importers
imports: syscalls.nxsha256.nxhex.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
| 46 | const CAPTURE_CAP: i64 = 16777216 // 16 MiB per compilation |
functions
| 48 | func nxc2_path() -> *u8 { return "../nxc2.exe" } |
| 49 | func manifest_path() -> *u8 { return "f6_manifest.txt" }
called by 1: main |
| 57 | func build_argv(argv_slots: *i64, path: *u8) -> i64 { |
| 77 | func capture_compile(path: *u8, out_buf: *u8, out_cap: i64) -> i64 { |
| 146 | func parse_manifest_line(buf: *u8, buf_len: i64, pos: i64,
called by 1: main |
| 192 | func main() -> i64 { |