nx_journal_log_test.nx
buildroot/runtime/nx_journal_log_test.nx
about
nx_journal_log_test.nx -- smoke for nx_journal_log ST-3 MVP.
Exercises:
1. Allocation + canary + initial state
2. Append + read roundtrip on 3 distinct payloads
3. Count increments correctly
4. read returns correct schema_id per entry
5. read with oversized buffer; read out-of-range seq_no -> -1
6. Empty log -> verify_chain returns -1 (trivially intact);
latest_hash returns NX_JOURNAL_NOT_FOUND
7. Filled log -> verify_chain returns -1 (chain intact)
8. latest_hash deterministic across two journals with same
payload sequence (cross-journal hash determinism)
9. TAMPER detection: stomp entry K's blob_w0 directly ->
verify_chain returns K+1 (next entry's prev_hash no longer
matches the recomputed hash of the tampered entry)
10. Canary tamper on log struct -> all ops refuse
11. Bad-input gates (null log / null payload / negative len /
out-of-range seq_no)
dependencies 3 imports · 0 importers
imports: nx_syscalls.nxnx_blob_store.nxnx_journal_log.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
| none |
functions
| 25 | func _fill_pattern(buf: *u8, len: i64, seed: i64) -> i64 called by 1: main |
| 34 | func main() -> i64 |