Commit graph

8 commits

Author SHA1 Message Date
b65103c9f7
refactor: decompose archive read/write into composable building blocks
Delete archive_context.rs and archive_ops.rs (1200+ lines of duplicated
logic). Replace with four focused modules:

1. open_archive() - opens a file, detects compression, returns raw bytes
2. read_archive() - parses bytes into validated observations
3. CompressionWriter - writes bytes with any compression format
4. WriteStrategy - given a list of files, determines input archive,
 output archive, output format, and which of four write modes to use:
  - Create: new archive, no input
  - Append: uncompressed input, seek to end
  - AtomicSwap: compressed input, rewrite via temp file
  - CopyOnWrite: different input/output paths, transcode between formats

Previously you could not specify output format. Appending always
preserved the input format, creating compressed archives didn't work.
Now all four cases work with any supported compression format.

Atomic swap now writes to temp file, then renames. Crash-safe.

Trade-off: This approach prioritizes code clarity over syscall efficiency.
  The archive file may be opened and read multiple times during a single
  operation (once for format detection, once for reading state, once for
  copying content). A more optimized implementation could reuse file
  handles, but the current approach makes each step's purpose obvious.
2025-12-01 21:01:27 -08:00
a760114ffe
chore: update Cargo metadata for publishing 2025-11-30 17:34:48 -08:00
44d15e29b7
refactor: reorder readme sections 2025-11-30 17:23:19 -08:00
2ab1c31993
feat: transparently append to compressed archives
When appending to a compressed archive (gzip, brotli, zstd), the tool
now handles compression automatically. Since some compression formats don't
support appending to compressed files in place, we write a new
compressed file with all the data and atomically rename it to replace
the original (assuming there is enough space on that filesystem).

This means you can work with compressed archives the same way as
uncompressed ones. Point the tool at your .json.gz file and append
values. No manual decompression/recompression needed.
2025-11-30 17:09:49 -08:00
da0fed29de
fix: use ArchiveReader parsing for state subcommand 2025-09-30 11:25:59 -07:00
1f0f41a96c
feat: add reading compressed archive files 2025-09-30 11:19:13 -07:00
07e604ac25
refactor: increase parse error diagnostic converage
Replace several of the generic serde_json parse error messages with
detailed descriptions of what went wrong.
2025-09-30 09:14:56 -07:00
b370f462f2
feat: open source vibecoding example project 2025-09-28 11:20:25 -07:00