ryo-storage 0.1.0

Persistent storage and transaction log for RYO
Documentation
# ryo-storage

[![crates.io](https://img.shields.io/crates/v/ryo-storage.svg)](https://crates.io/crates/ryo-storage)
[![docs.rs](https://docs.rs/ryo-storage/badge.svg)](https://docs.rs/ryo-storage)
[![License: MIT OR Apache-2.0](https://img.shields.io/badge/license-MIT%20OR%20Apache--2.0-blue.svg)](#license)

> **Status:** stable. Part of the [ryo]https://github.com/ynishi/ryo-rs 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 `TxLog`s for replay / undo / inspection.

## Install

```sh
cargo add ryo-storage
```

## Quickstart

```rust,ignore
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](https://github.com/ynishi/ryo-rs/blob/main/LICENSE-APACHE)
or [MIT](https://github.com/ynishi/ryo-rs/blob/main/LICENSE-MIT) at your option.