# imran-delta/cafs architecture

> Architecture diagram of the GitHub repository imran-delta/cafs, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-25). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/imran-delta/cafs
- Repository: https://github.com/imran-delta/cafs

## Overview

CAFS is an alpha filesystem project whose only buildable runtime component is a Linux Rust I/O Engine PoC. Its principal workflow is formatting a device, mounting its anchor region, applying runtime mount options, checking or confirming it, and issuing generic block I/O. The README also identifies a shared SMART telemetry processor. The allocator, FUSE request layer, dedup table, WAL, and kernel driver are unbuilt or placeholders, so they are not represented as runtime components. Some engine internals are unsampled; links are limited to documented or excerpt-supported calls.

Main entry points: [`Src/FUSE/Linux/x86-64/I-O_Engine/src/lib.rs`](https://github.com/imran-delta/cafs/blob/main/Src/FUSE/Linux/x86-64/I-O_Engine/src/lib.rs) (Engine API), [`Src/FUSE/Linux/x86-64/I-O_Engine/src/mount.rs`](https://github.com/imran-delta/cafs/blob/main/Src/FUSE/Linux/x86-64/I-O_Engine/src/mount.rs) (Anchor Mount), [`Src/FUSE/Linux/x86-64/I-O_Engine/src/block_io.rs`](https://github.com/imran-delta/cafs/blob/main/Src/FUSE/Linux/x86-64/I-O_Engine/src/block_io.rs) (Block Read Write), [`Src/FUSE/Linux/x86-64/I-O_Engine/src/confirm.rs`](https://github.com/imran-delta/cafs/blob/main/Src/FUSE/Linux/x86-64/I-O_Engine/src/confirm.rs) (Mount Confirmation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_engine["I/O Engine"]
  node_engine_api["Engine API<br/>[lib.rs]"]
  node_mount["Anchor Mount<br/>[mount.rs]"]
  node_anchor["Pointer Verification<br/>[anchor.rs]"]
  node_remount["Runtime Options<br/>[remount.rs]"]
  node_check["Superblock Check<br/>[check.rs]"]
  node_confirm["Mount Confirmation<br/>[confirm.rs]"]
  node_block_io["Block Read Write<br/>[block_io.rs]"]
  node_checksum["Checksums<br/>[checksum.rs]"]
  node_layout["On-Disk Layout<br/>[layout.rs]"]
end

subgraph group_format["Formatting"]
  node_mkfs["Filesystem Formatter<br/>[mkfs_cafs.rs]"]
end

subgraph group_telemetry["SMART Telemetry"]
  node_smart["SMART Processor<br/>[smart_handler.py]"]
  node_json_io["JSON Input Output"]
end

node_operator(("Caller"))
node_device[("Device or Image")]

node_operator -->|"formats"| node_mkfs
node_mkfs -->|"writes anchor"| node_device
node_operator -->|"uses"| node_engine_api
node_engine_api -->|"mounts"| node_mount
node_mount -->|"reads anchor"| node_device
node_mount -->|"verifies pointers"| node_anchor
node_mount -->|"reads structures"| node_block_io
node_engine_api -->|"sets options"| node_remount
node_engine_api -->|"checks"| node_check
node_engine_api -->|"confirms mount"| node_confirm
node_engine_api -->|"reads or writes blocks"| node_block_io
node_confirm -->|"writes structures"| node_block_io
node_confirm -->|"hashes superblock"| node_checksum
node_block_io -->|"reads or writes"| node_device
node_operator -->|"submits telemetry"| node_smart
node_json_io -->|"provides JSON"| node_smart
node_smart -->|"returns analysis"| node_json_io

click node_engine_api "https://github.com/imran-delta/cafs/blob/main/Src/FUSE/Linux/x86-64/I-O_Engine/src/lib.rs"
click node_mount "https://github.com/imran-delta/cafs/blob/main/Src/FUSE/Linux/x86-64/I-O_Engine/src/mount.rs"
click node_anchor "https://github.com/imran-delta/cafs/blob/main/Src/FUSE/Linux/x86-64/I-O_Engine/src/anchor.rs"
click node_remount "https://github.com/imran-delta/cafs/blob/main/Src/FUSE/Linux/x86-64/I-O_Engine/src/remount.rs"
click node_check "https://github.com/imran-delta/cafs/blob/main/Src/FUSE/Linux/x86-64/I-O_Engine/src/check.rs"
click node_confirm "https://github.com/imran-delta/cafs/blob/main/Src/FUSE/Linux/x86-64/I-O_Engine/src/confirm.rs"
click node_block_io "https://github.com/imran-delta/cafs/blob/main/Src/FUSE/Linux/x86-64/I-O_Engine/src/block_io.rs"
click node_checksum "https://github.com/imran-delta/cafs/blob/main/Src/FUSE/Linux/x86-64/I-O_Engine/src/checksum.rs"
click node_layout "https://github.com/imran-delta/cafs/blob/main/Src/FUSE/Linux/x86-64/I-O_Engine/src/layout.rs"
click node_mkfs "https://github.com/imran-delta/cafs/blob/main/Src/FUSE/Linux/x86-64/I-O_Engine/src/bin/mkfs_cafs.rs"
click node_smart "https://github.com/imran-delta/cafs/blob/main/Src/smart_handler.py"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_engine_api,node_mount,node_anchor,node_remount,node_check,node_confirm,node_block_io,node_checksum,node_layout toneBlue
class node_mkfs,node_device toneAmber
class node_smart,node_json_io toneMint
class node_operator toneIndigo
```

## Components

### I/O Engine

- [Engine API](https://github.com/imran-delta/cafs/blob/main/Src/FUSE/Linux/x86-64/I-O_Engine/src/lib.rs): `Src/FUSE/Linux/x86-64/I-O_Engine/src/lib.rs`
- [Anchor Mount](https://github.com/imran-delta/cafs/blob/main/Src/FUSE/Linux/x86-64/I-O_Engine/src/mount.rs): `Src/FUSE/Linux/x86-64/I-O_Engine/src/mount.rs`
- [Pointer Verification](https://github.com/imran-delta/cafs/blob/main/Src/FUSE/Linux/x86-64/I-O_Engine/src/anchor.rs): `Src/FUSE/Linux/x86-64/I-O_Engine/src/anchor.rs`
- [Runtime Options](https://github.com/imran-delta/cafs/blob/main/Src/FUSE/Linux/x86-64/I-O_Engine/src/remount.rs): `Src/FUSE/Linux/x86-64/I-O_Engine/src/remount.rs`
- [Superblock Check](https://github.com/imran-delta/cafs/blob/main/Src/FUSE/Linux/x86-64/I-O_Engine/src/check.rs): `Src/FUSE/Linux/x86-64/I-O_Engine/src/check.rs`
- [Mount Confirmation](https://github.com/imran-delta/cafs/blob/main/Src/FUSE/Linux/x86-64/I-O_Engine/src/confirm.rs): `Src/FUSE/Linux/x86-64/I-O_Engine/src/confirm.rs`
- [Block Read Write](https://github.com/imran-delta/cafs/blob/main/Src/FUSE/Linux/x86-64/I-O_Engine/src/block_io.rs): `Src/FUSE/Linux/x86-64/I-O_Engine/src/block_io.rs`
- [Checksums](https://github.com/imran-delta/cafs/blob/main/Src/FUSE/Linux/x86-64/I-O_Engine/src/checksum.rs): `Src/FUSE/Linux/x86-64/I-O_Engine/src/checksum.rs`
- [On-Disk Layout](https://github.com/imran-delta/cafs/blob/main/Src/FUSE/Linux/x86-64/I-O_Engine/src/layout.rs): `Src/FUSE/Linux/x86-64/I-O_Engine/src/layout.rs`

### Formatting

- [Filesystem Formatter](https://github.com/imran-delta/cafs/blob/main/Src/FUSE/Linux/x86-64/I-O_Engine/src/bin/mkfs_cafs.rs): `Src/FUSE/Linux/x86-64/I-O_Engine/src/bin/mkfs_cafs.rs`

### SMART Telemetry

- [SMART Processor](https://github.com/imran-delta/cafs/blob/main/Src/smart_handler.py): `Src/smart_handler.py`
- **JSON Input Output**

### Other components

- **Caller**
- **Device or Image**

## Connections

- Caller → Filesystem Formatter: formats
- Filesystem Formatter → Device or Image: writes anchor
- Caller → Engine API: uses
- Engine API → Anchor Mount: mounts
- Anchor Mount → Device or Image: reads anchor
- Anchor Mount → Pointer Verification: verifies pointers
- Anchor Mount → Block Read Write: reads structures
- Engine API → Runtime Options: sets options
- Engine API → Superblock Check: checks
- Engine API → Mount Confirmation: confirms mount
- Engine API → Block Read Write: reads or writes blocks
- Mount Confirmation → Block Read Write: writes structures
- Mount Confirmation → Checksums: hashes superblock
- Block Read Write → Device or Image: reads or writes
- Caller → SMART Processor: submits telemetry
- JSON Input Output → SMART Processor: provides JSON
- SMART Processor → JSON Input Output: returns analysis
