Skip to content

release: v0.1.1 — Phase 3: NDJSON WAL + PyO3 bindings#15

Merged
tbitcs merged 3 commits into
mainfrom
develop
May 19, 2026
Merged

release: v0.1.1 — Phase 3: NDJSON WAL + PyO3 bindings#15
tbitcs merged 3 commits into
mainfrom
develop

Conversation

@tbitcs
Copy link
Copy Markdown
Contributor

@tbitcs tbitcs commented May 19, 2026

Syncs develop into main with Phase 3 changes (PRs #12, #13 resolved):

  • WAL format unified: Rust crate now uses NDJSON with SHA-256 hash chain matching Python exactly. bincode removed. Cross-compatible WAL format between Rust and Python implementations.
  • PyO3 bindings: crates/chronomemory-py/ provides RustChronoStore and RustRecord. chronomemory auto-detects and loads Rust backend when maturin-compiled; falls back silently to pure Python.
  • 20/20 Rust tests pass (0 ignored, replay test re-enabled).
  • 192/192 Python tests pass.
  • 0 open issues. All CI green.

Co-Authored-By: Oz oz-agent@warp.dev

tbitcs and others added 2 commits May 18, 2026 21:45
Issue #12 - Rust WAL NDJSON migration:
  crates/chronomemory/src/wal.rs: remove binary magic header + bincode.
  Each WAL entry is now one NDJSON line. Hash = SHA256 of sorted-key JSON
  matching Python: {seq,ts,op,record_id,record,prev_hash,recursion_depth}.
  WalEntry.record field (was payload) aligns with Python WalEvent.record.
  crates/chronomemory/src/replay.rs: bincode::deserialize -> serde_json.
  crates/chronomemory/src/lib.rs: bincode::serialize -> serde_json::to_value.
  Cargo.toml: remove bincode, add hex.
  TEST-ESDB-002 (replay test) now enabled - was previously #[ignore].
  Result: 20/20 Rust tests pass, 0 ignored.

Issue #13 - PyO3 Python bindings:
  crates/chronomemory-py/: new cdylib crate _chronomemory_rust.
  Cargo.toml (workspace): add chronomemory-py member.
  Exposes RustRecord and RustChronoStore wrapping the Rust Esdb engine.
  __init__.py: try-import _chronomemory_rust, fall back silently to Python.
  RUST_BACKEND bool exported to let callers detect which backend is active.
  pyproject.toml: [rust] optional extras, [tool.maturin] config.
  Build: maturin develop --manifest-path crates/chronomemory-py/Cargo.toml

All checks:
  Python: 192/192 tests, ruff clean, mypy clean.
  Rust: 20/20 tests (0 ignored), PyO3 crate builds clean.

Co-Authored-By: Oz <oz-agent@warp.dev>
feat(phase3): NDJSON WAL migration + PyO3 Python bindings
RustChronoStore = _rust.RustChronoStore
RustRecord = _rust.RustRecord
RUST_BACKEND = True
except ImportError:
… fmt

- pyo3 0.22.6 had buffer overflow risk in PyString::from_object
  (RUSTSEC-2025-0020). Upgraded to 0.24.2 which patches this.
- cargo fmt --all applied to wal.rs and chronomemory-py/src/lib.rs
  to pass CI rust lint (fmt) check.
- cargo audit: 0 vulnerabilities.

Co-Authored-By: Oz <oz-agent@warp.dev>
@tbitcs tbitcs merged commit a6b40ad into main May 19, 2026
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant