hutch

Crates.iohutch
lib.rshutch
version0.1.0
created_at2025-12-14 20:27:15.43213+00
updated_at2025-12-14 20:27:15.43213+00
descriptionCheckpoint and undo system for AI agent sessions - safe burrow to return to
homepage
repositoryhttps://github.com/moltenlabs/molten
max_upload_size
id1985053
size82,572
Chris Mathew (chriscmathew-dorsia)

documentation

README

🏠 Hutch

Checkpoint and undo system for AI agent sessions - safe burrow to return to.

Crates.io Documentation License

Overview

Hutch provides checkpoint and undo functionality for AI agent sessions, allowing you to save state and rollback changes.

Features

  • 💾 Automatic checkpoints at turn boundaries
  • 📝 Named manual checkpoints
  • â†Šī¸ Undo to previous states
  • 📁 File change tracking
  • đŸ’ŋ Persistent storage backend

Installation

[dependencies]
hutch = "0.1"

Usage

use hutch::{CheckpointManager, CheckpointConfig};

#[tokio::main]
async fn main() -> Result<(), hutch::CheckpointError> {
    let config = CheckpointConfig::default();
    let manager = CheckpointManager::new(config);

    // Save a named checkpoint
    let checkpoint_id = manager.save(Some("before refactor".into())).await?;
    println!("Saved checkpoint: {}", checkpoint_id);

    // Do some work...

    // Undo to the last checkpoint
    manager.undo().await?;

    // Or restore a specific checkpoint
    manager.restore(checkpoint_id).await?;

    // List all checkpoints
    for meta in manager.list() {
        println!("{}: {} ({})", meta.id, meta.summary, meta.timestamp);
    }

    Ok(())
}

Auto-checkpointing

use hutch::{CheckpointManager, CheckpointConfig};
use warhorn::TaskId;

// Enable auto-checkpointing at turn boundaries
let config = CheckpointConfig {
    auto_checkpoint: true,
    max_checkpoints: 50,
    ..Default::default()
};

let manager = CheckpointManager::new(config);

// Checkpoint automatically saved at each turn
let task_id = TaskId::new();
manager.checkpoint_turn(task_id, 1).await?;
manager.checkpoint_turn(task_id, 2).await?;

File Tracking

use std::path::PathBuf;

// Track file changes for checkpoint restore
manager.record_file_change(
    PathBuf::from("src/main.rs"),
    Some("old content".into()),
    "new content".into(),
);

Part of the Goblin Family

License

MIT OR Apache-2.0

Commit count: 0

cargo fmt