# Rivox Architecture Specification
Rivox V1 is structured as a modular Rust workspace in `c:\Users\Aaryan Rawat\Documents\Rivox`.
```
+-------------------------------------------------------------------------------+
| │ Adapter │ │ Adapter │ │ Adapter │ │ Unified Graph │ |
| │ (uv) │ │ (cargo) │ │ (pnpm) │ │ Builder │ |
| └──────┬──────┘ └──────┬──────┘ └──────┬──────┘ └─────────┬─────────┘ |
| └─────────────────┴─────────────────┴───────────────────┘ |
| │ |
| ┌────────┴────────┐ |
| │ Sandbox Engine │ |
| └────────┬────────┘ |
| │ |
| ┌────────┴────────┐ |
| │ Provenance │ |
| └────────┬────────┘ |
+----------------─────────────────────┼────────────────────────────────---------+
│ REAPI (gRPC) / Local CAS
┌─────────┴──────────┐
│ Content Addressed │
│ Storage (CAS) │
└────────────────────┘
```
## Module Breakdown
1. **Ingestion Adapters (`src/adapters/`)**: Wraps `uv`, `cargo`, and `pnpm`. Resolves dependencies via native tools and parses lockfiles into `GraphNode` records.
2. **Unified Graph Builder (`src/graph/`)**: Merges ecosystem subgraphs with `rivox.toml` cross-refs into a `petgraph::DiGraph`.
3. **Content-Addressed Cache (`src/cache/`)**: Computes Merkle subtree cache keys (`sha256(...)`) and stores file blobs and directory manifest trees in `~/.rivox/cache/cas`.
4. **Sandbox Execution Engine (`src/sandbox/`)**: Isolates compilation steps using Linux unprivileged namespaces and macOS Seatbelt sandbox profiles.
5. **Provenance Emitter (`src/provenance/`)**: Formats in-toto, SLSA Level 2, SPDX 2.3 JSON SBOMs, and performs Sigstore Rekor registration.
6. **Conformance Suite (`src/conformance/`)**: Verifies 100% equivalence between Rivox graph representation and native tool resolution outputs.