code wiki / (root) / nx_gcode_manifest_test.nx

nx_gcode_manifest_test.nx

buildroot/runtime/nx_gcode_manifest_test.nx

4864 B124 linesdepth 3pulls 4 transitivereach 0 importersview sourcekind gate/prooftopic gcode
docsdependenciesstructsconstsfunctions

about

nx_gcode_manifest_test.nx -- exercise manifest emit + finalize + determinism on synthetic blobs. Closed-form invariants: (a) Fresh manifest contains the magic line. (b) After add_blob x 4, the buffer grew + non-empty. (c) Finalize sets finalized=1 and appends the self-hash line. (d) Post-finalize, add_blob returns -2 (refused). (e) Two manifests built with the same inputs produce byte-identical buffers (determinism for reproducible builds). (f) Tampering with the buffer breaks the self-attestation: recomputing blake2b over the pre-final bytes no longer matches the embedded final hash. expect_exit: 0 license_tier: ORIGINAL

dependencies 3 imports · 0 importers

nx_syscalls.nx nx_blake2b.nx nx_gcode_manifest.nx nx_gcode_manifest_test.nx

imports: nx_syscalls.nxnx_blake2b.nxnx_gcode_manifest.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main sys_mmap nx_gmanifest_new sys_mmap ↻ nx_gmanifest_add_blob sys_mmap ↻ gmanifest_blake2b_oneshot sys_mmap ↻ nx_blake2b_hash nx_blake2b_init _b2b_iv nx_blake2b_update _b2b_compress _b2b_load_u64_le _b2b_iv ↻ _b2b_mix _b2b_sigma nx_blake2b_final _b2b_compress ↻ _b2b_store_u64_le _b2b_shr64 _b2b_shr64 ↻ nx_gmanifest_add nx_gmanifest_append_cstr nx_gmanifest_append_hex nx_gmanifest_nibble_hex nx_gmanifest_append_byte nx_gmanifest_finalize gmanifest_blake2b_oneshot ↻ nx_gmanifest_append_cstr ↻ nx_gmanifest_append_hex ↻ nx_gmanifest_append_byte ↻ build_manifest nx_gmanifest_new ↻ nx_gmanifest_add_blob ↻ gmanifest_blake2b_oneshot ↻

structs

none

consts

none

functions

23func build_manifest(b1: *u8, l1: i64, b2: *u8, l2: i64,
33func main() -> i64