Skip to content

Codex Retain 0.1.5

Choose a tag to compare

@github-actions github-actions released this 27 Nov 00:19
· 4 commits to main since this release

Codex Retain 0.1.5

Major peak-memory and CPU optimization release across archive scanning,
rollout-lineage discovery, report serialization, and batched deletion, while
preserving all existing CLI, JSON, policy, capture, recovery-journal, and
safety contracts.

What changed

  • Compact report storage and streaming JSON: Replaces per-entry heap
    materialization with 28-byte CompactEntry records, chunked byte arenas,
    interned diagnostics, and direct 64 KiB buffered JSON output (itoa) across
    enable, preview, run, and run --scheduled. Text and scheduled runs
    materialize only the 30 display entries and up to 10 diagnostic skips needed
    for last-run.json.
  • SQLite scan and statement reuse: Decouples large archive reads into
    sequential scans (visit_archived_compact), adds due-count pre-sizing for
    summary/text paths, compiles per-batch SQL statements once per run, and
    bounds SQLite page caches (cache_size = -256 RO / -512 RW) with
    PRAGMA shrink_memory before inventory peaks.
  • Direct descriptor traversal and compact inventory: Replaces walkdir
    with rustix::fs::Dir and directory-relative syscalls (openat, statat,
    fstat, unlinkat, renameat_with), packs standard rollout filenames
    inline into HeaderCache (48-byte slabs) and OwnedRollout, reuses zstd
    decoders across files, and switches internal hot maps/sets to a per-process
    seeded wymix hasher.
  • Targeted narrow hot-path crates: Uses memchr for SIMD newline/NUL
    scans, simdutf8 for SIMD UTF-8 validation paired with serde_json
    from_str (with cold from_slice fallback for exact error diagnostics on
    invalid UTF-8), itoa for integer formatting, and smallvec for small
    per-batch scratch buffers.
  • Smaller release binary: Removes walkdir (and its transitive
    dependencies) and enables full symbol stripping (strip = true), reducing
    the ARM64 macOS release binary from 4.43 MiB to 3.54 MiB (−20.1%).
  • Dependency security updates and attributions: Updated rusqlite to
    0.41.1 (libsqlite3-sys 0.39.1 / SQLite 3.54.1), rustix to 1.1.6,
    and zstd to 0.14.3 (zstd-safe 8.2.0, zstd-sys 2.1.2+zstd.1.5.7) to
    address RUSTSEC-2026-0391, RUSTSEC-2026-0398, RUSTSEC-2026-0403,
    RUSTSEC-2026-0410, RUSTSEC-2026-0459, and RUSTSEC-2026-0486, and
    regenerated THIRD_PARTY_NOTICES.md and
    docs/evidence/dependency-licenses.json for the updated Cargo.lock.

Measured impact (local ARM64 macOS, synthetic profiles)

Paired /usr/bin/time -l measurements comparing local Rust 1.98.1 release
builds of 0.1.4 and 0.1.5 on identical synthetic profiles:

Synthetic workload 0.1.4 footprint 0.1.5 footprint 0.1.4 user CPU 0.1.5 user CPU
enable --json (100k archives) 111.05 MiB 9.30 MiB (−91.6%) 0.28 s 0.17 s
preview --json (100k archives) 26.48 MiB 7.00 MiB (−73.6%) 0.16 s 0.07 s
preview text (100k archives) 26.45 MiB 2.16 MiB (−91.8%) 0.14 s < 0.01 s
run --scheduled (100k, none due) 4.42 MiB 2.41 MiB (−45.5%) 0.14 s < 0.01 s
run --json (delete 10k archives) 29.00 MiB 7.94 MiB (−72.6%) 1.22 s 0.32 s
run --scheduled (delete 10k) 27.50 MiB 7.80 MiB (−71.6%) 0.86 s 0.34 s
preview --json (99k active + 1k arch) 11.11 MiB 3.83 MiB (−65.5%) 1.27 s 0.41 s
run --json (99k active + 1k arch, 1 due) 50.25 MiB 8.05 MiB (−84.0%) 0.77 s 0.23 s

These local measurements use synthetic profiles on ARM64 macOS and do not
establish cold-cache I/O latency, Intel macOS timings, or live-writer latency.

Update

brew update
brew upgrade dankosik/codex-retain/codex-retain
codex-retain --version
codex-retain status

Installer users can rerun the installer at the same installation directory.
Installation does not enable retention. Existing policies, exclusions,
captured archive periods, and journal schemas remain unchanged.

Compatibility remains the reviewed Codex 0.153.4 storage protocol, with macOS
15+ packages for Apple Silicon and Intel. All validation uses synthetic
profiles.