Skip to content

Conversation

Copy link

Copilot AI commented Feb 7, 2026

In-memory virtual file system enabling isolated, parallel session file operations without disk interaction. Uses SHA-256 content addressing for automatic deduplication across sessions.

Architecture

VirtualFileSystem
├── ObjectStore (shared, lock-free reads via DashMap)
│   └── DashMap<ObjectId, Bytes>
└── sessions: DashMap<SessionId, Mutex<SessionFS>>
    └── SessionFS
        ├── files: HashMap<PathBuf, ObjectId>
        ├── snapshots: HashMap<PathBuf, Vec<ObjectId>>
        └── deleted: HashSet<PathBuf>

New types in paws_domain::virtual_fs

  • ObjectId — SHA-256 content hash, analogous to git blob IDs
  • ObjectStore — Thread-safe deduplicated blob store (DashMap<ObjectId, Bytes>)
  • SessionFS — Per-session overlay mapping paths → ObjectId, with snapshot stack for undo
  • VirtualFileSystem — Multi-session orchestrator; DashMap for cross-session concurrency, tokio::sync::Mutex per session
  • SessionId — UUID-based session identifier

Usage

let vfs = Arc::new(VirtualFileSystem::new());
let sid = vfs.create_session();

vfs.with_session(&sid, |fs| {
    fs.write_utf8(Path::new("/src/main.rs"), "fn main() {}");
    fs.snapshot(Path::new("/src/main.rs"))?;
    fs.write_utf8(Path::new("/src/main.rs"), "fn main() { todo!() }");
    Ok(())
}).await?;

// Undo restores previous version
vfs.with_session(&sid, |fs| fs.undo(Path::new("/src/main.rs"))).await?;

Sessions are fully isolated — writes in one session are invisible to others. Identical content across sessions is stored once via content addressing.

Dependencies added to paws_domain

  • sha2 (workspace), dashmap (workspace), bytes (workspace)
Original prompt

understand the current snapshot system and design a virtual IO layer which will allow each task to work on their own version of file in memory without having to interact with disk state of the file leveraging design like object addressing files and stuff create a clean and performant system which will allow multiple sessions to run in parallel


💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.

…essions

Co-authored-by: manthanabc <48511543+manthanabc@users.noreply.github.com>
Copilot AI changed the title [WIP] Design virtual IO layer for parallel task sessions Add virtual IO layer with content-addressed storage for parallel sessions Feb 7, 2026
Copilot AI requested a review from manthanabc February 7, 2026 14:45
@manthanabc
Copy link
Owner

The VFS seems cool at the first glance, will need to do some testing, can you map out where and how it would be integrated with the read / write /execute tool calls in paws

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.

2 participants