ryo-storage 0.1.0

Persistent storage and transaction log for RYO
Documentation

ryo-storage

crates.io docs.rs License: MIT OR Apache-2.0

Status: stable. Part of the ryo workspace — AST-centric Rust programming for AI agents.

Persistent storage and transaction log. Three-layer design: a Mutation function layer, a serializable MutationRecord recording layer, and a content-addressed StateStore for file-state snapshots. Sessions are dumped under ~/.ryo/sessions/ as JSON TxLogs for replay / undo / inspection.

Install

cargo add ryo-storage

Quickstart

use ryo_storage::{RyoStorage, TxLog, TxLogger};

// Create storage at ~/.ryo
let mut storage = RyoStorage::global()?;
storage.ensure_init()?;

// Start logging
let logger = TxLogger::start(project_path, file_count);
logger.log_mutation("Rename", "foo -> bar", 3);
let log = logger.finish();

// Save session and load it back
let session_id = storage.dump(&log)?;
let loaded = storage.load(&session_id)?;

API Summary

Item Purpose
RyoStorage Session persistence over ~/.ryo
TxLog / TxLogger / TxAction Transaction log primitives
Format (JSON / JsonCompact) Session serialization format
SessionIndex / SessionMeta Session lookup / metadata
StateStore / StateRef / WorkspaceSnapshot Content-addressed state store
ProjectIndex / ProjectMeta Per-project metadata under ~/.ryo
FileUuidStorage UUID ↔ path indirection

Status

API surface considered stable for the v0.1.0 release. BincodeFormat was removed in the run-up to v0.1.0 (incompatible with serde_json::Value-carrying TxActions); JSON formats remain.

License

Licensed under either of Apache-2.0 or MIT at your option.