Skip to main content

kaish_kernel/vfs/
mod.rs

1//! Virtual Filesystem (VFS) for kaish.
2//!
3//! The VFS provides a unified interface over multiple filesystem backends:
4//!
5//! - **MemoryFs**: In-memory ephemeral storage (for `/v`, tests)
6//! - **LocalFs**: Real filesystem access (for mounted worktrees)
7//! - **VfsRouter**: Routes paths to mounted backends
8//!
9//! # Design
10//!
11//! Kaish kernels own `/` in their VFS. Backends are mounted at paths:
12//!
13//! ```text
14//! /                      # kernel root
15//! ├── /v/                # MemoryFs (blobs, jobs)
16//! ├── /mnt/project/      # LocalFs (worktree, rw)
17//! └── /mnt/reference/    # LocalFs (repo, ro)
18//! ```
19//!
20//! The router finds the longest matching mount point and delegates operations.
21
22mod builtin_fs;
23mod git;
24mod jobfs;
25mod local;
26mod memory;
27mod router;
28mod traits;
29
30pub use builtin_fs::BuiltinFs;
31pub use git::{FileStatus, GitVfs, LogEntry, StatusSummary, WorktreeInfo};
32pub use jobfs::JobFs;
33pub use local::LocalFs;
34pub use memory::MemoryFs;
35pub use router::{MountInfo, VfsRouter};
36pub use traits::{DirEntry, EntryType, Filesystem, Metadata};