| 1 | # Golden fixtures — provenance (IMMUTABLE) |
| 2 | |
| 3 | Captured from the **real** upstream tooling. DO NOT edit or regenerate from |
| 4 | rustyriver. A mismatch means rustyriver is wrong (AGENTS.md rule 3 / PLAN.md §6.2). |
| 5 | |
| 6 | | Source tool | Version | Provenance | |
| 7 | |-------------|---------|-----------| |
| 8 | | `litestream` | built from tag **v0.5.11** (commit `016c3687…`) | `reference/litestream-go` | |
| 9 | | `sqlite3` | 3.51.0 | system | |
| 10 | |
| 11 | ## Files |
| 12 | |
| 13 | - **`replica/`** — a full file-replica tree produced by `litestream replicate -once` |
| 14 | (deterministic, no background timing). Layout: `ltx/<level>/<minTXID>-<maxTXID>.ltx`. |
| 15 | Contents are **L0-only** (level `0`): a snapshot at TXID 1 plus 5 single-txn L0 |
| 16 | files (TXIDs 2–6). The real binary restores this tree and the result equals the |
| 17 | source under Oracle A — see the U-2 resolution in `OPEN_QUESTIONS.md`. |
| 18 | - SQL sequence: `PRAGMA journal_mode=WAL`; `CREATE TABLE kv(k TEXT PRIMARY KEY, |
| 19 | v TEXT NOT NULL)`; seed `('a','1'),('b','2'),('c','3')`; then 5 iterations each |
| 20 | `INSERT ('k$i','v$i')` + `UPDATE kv SET v='upd$i' WHERE k='a'`, each flushed |
| 21 | with `replicate -once`. |
| 22 | |
| 23 | - **`sample.wal`** — a raw **SQLite** WAL file (16,512 bytes) for the `wal.rs` |
| 24 | parser (T1). Produced by sqlite3 3.51.0 in WAL mode with `wal_autocheckpoint=0`, |
| 25 | 20 inserts + an update across 2 commits, copied while a second connection held a |
| 26 | read transaction (so the close-time checkpoint could not truncate it). Header |
| 27 | magic `0x377f0682` (big-endian salt variant), page size 4096. |
| 28 | |
| 29 | ## How rustyriver uses these |
| 30 | Reader tests **decode** these bytes and assert structural fields (TXIDs, page |
| 31 | numbers, checksums, frame counts). Writer byte-fidelity is **not** asserted by |
| 32 | comparison against these files (LTX headers embed timestamps and are not |
| 33 | bit-reproducible) — it is proven by differential test D1 against the real binary |
| 34 | (PLAN.md §6.3). |
| 35 | |
| 36 | ## Reproduce |
| 37 | `scripts/capture-golden.sh` regenerates an equivalent tree from a `litestream` |
| 38 | binary built at tag v0.5.11. The bytes are not identical run-to-run (timestamps), |
| 39 | but the structure and the round-trip property are. |