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;
23#[cfg(feature = "native")]
24mod git;
25mod jobfs;
26#[cfg(feature = "native")]
27mod local;
28mod memory;
29mod router;
30mod traits;
31
32pub use builtin_fs::BuiltinFs;
33#[cfg(feature = "native")]
34pub use git::{FileStatus, GitVfs, LogEntry, StatusSummary, WorktreeInfo};
35pub use jobfs::JobFs;
36#[cfg(feature = "native")]
37pub use local::LocalFs;
38pub use memory::MemoryFs;
39pub use router::{MountInfo, VfsRouter};
40pub use traits::{DirEntry, DirEntryKind, Filesystem};