rivox 1.0.0

Universal polyglot build coordination layer for Python, Rust, and Node monorepos
Documentation
# Rivox System Architecture Specification

**Version**: 1.0.0 (2026)  
**Core Motto**: *Coordinate. Never Replace.*

---

## High-Level Architectural Flow

```
+-------------------------------------------------------------------------------+
|                            User Manifest: rivox.toml                          |
+-------------------------------------------------------------------------------+
+-------------------------------------------------------------------------------+
|                             Rivox CLI Entry Point                             |
+-------------------------------------------------------------------------------+
+-------------------------------------------------------------------------------+
|                         Ecosystem Ingestion Adapters                          |
|         ┌───────────────────┬───────────────────┬───────────────────┐         |
|         │  Python Adapter   │   Rust Adapter    │   Node Adapter    │         |
|         │     (uv lock)     │ (cargo metadata)  │ (pnpm-lock.yaml)  │         |
|         └─────────┬─────────┴─────────┬─────────┴─────────┬─────────┘         |
+----------------───┼───────────────────┼───────────────────┼-------------------+
                    │                   │                   │
                    └───────────────────┼───────────────────┘
+-------------------------------------------------------------------------------+
|                             Unified Graph Builder                             |
+-------------------------------------------------------------------------------+
+-------------------------------------------------------------------------------+
|                           Topological Task Scheduler                          |
+-------------------------------------------------------------------------------+
                    ┌───────────────────┴───────────────────┐
                    ▼                                       ▼
         [ Subtree Cache Hit ]                   [ Subtree Cache Miss ]
                    │                                       │
                    ▼                                       ▼
       Local CAS / REAPI Hard-link              OS Sandbox Process Execution
                    │                                       │
                    └───────────────────┬───────────────────┘
+-------------------------------------------------------------------------------+
|                            Local CAS Artifact Store                           |
+-------------------------------------------------------------------------------+
+-------------------------------------------------------------------------------+
|                        Signed Provenance Emitter                              |
+-------------------------------------------------------------------------------+
+-------------------------------------------------------------------------------+
|                          Deterministic rivox.lock                             |
+-------------------------------------------------------------------------------+
```

## Subsystem Responsibilities

1. **Ingestion Layer (`src/adapters/`)**: Wraps `uv`, `cargo`, and `pnpm`. Executes resolution commands in offline/frozen modes and extracts package nodes while preserving target markers and workspace feature unification.
2. **Unified Graph Builder (`src/graph/`)**: Merges subgraphs into a unified DAG (`petgraph::DiGraph`) and binds user-declared `cross_refs`.
3. **Content-Addressed Storage (`src/cache/`)**: Computes Merkle subtree cache keys (`sha256(ecosystem:package:version:merkle_deps:arch)`) and stores file blobs and directory manifest trees (`TreeManifest`).
4. **OS Sandboxing Engine (`src/sandbox/`)**: Isolates build commands using Linux unprivileged user/mount namespaces and macOS Seatbelt (`sandbox-exec`) sandbox profiles.
5. **Provenance Emitter (`src/provenance/`)**: Generates in-toto statements, SLSA Build Level 2 attestations, SPDX 2.3 JSON SBOMs, and Sigstore/Rekor registration.
6. **Equivalence Conformance Suite (`src/conformance/`)**: Automated testing harness checking 100% resolution equivalence against raw native tools.

See also: [design.md](design.md), [cas.md](cas.md), [security.md](security.md).