1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
//! Virtual Filesystem (VFS) for kaish.
//!
//! The VFS provides a unified interface over multiple filesystem backends:
//!
//! - **MemoryFs**: In-memory ephemeral storage (for `/v`, tests)
//! - **LocalFs**: Real filesystem access (for mounted worktrees)
//! - **VfsRouter**: Routes paths to mounted backends
//!
//! # Design
//!
//! Kaish kernels own `/` in their VFS. Backends are mounted at paths:
//!
//! ```text
//! / # kernel root
//! ├── /v/ # MemoryFs (blobs, jobs)
//! ├── /mnt/project/ # LocalFs (worktree, rw)
//! └── /mnt/reference/ # LocalFs (repo, ro)
//! ```
//!
//! The router finds the longest matching mount point and delegates operations.
pub use BuiltinFs;
// GitVfs + git types live in the kaish-tools-git crate (keeps libgit2 out
// of the kernel). Re-exported so `crate::vfs::GitVfs` paths keep working.
pub use ;
pub use JobFs;
pub use MemoryFs;
pub use ;
// The `Filesystem` trait + `LocalFs` moved to the leaf `kaish-vfs` crate so
// out-of-tree backends (notably `GitVfs`, which wraps a `LocalFs` worktree)
// can implement the trait without depending on the kernel. Re-exported here so
// existing `crate::vfs::{Filesystem, DirEntry, LocalFs}` paths keep working.
pub use ;
pub use LocalFs;