Skip to main content
Glama
README.md
# Devrith — Architectural Control Plane for AI-Written Code

> **`arch-sidecar`** is the open-source engine powering Devrith. Free forever for individual developers.

[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
[![Python 3.9+](https://img.shields.io/badge/python-3.9+-brightgreen.svg)](https://www.python.org/)
[![Model Context Protocol](https://img.shields.io/badge/MCP-Compatible-purple.svg)](https://modelcontextprotocol.io)
[![Glama MCP Server](https://glama.ai/mcp/servers/Hackedghost64/arch-sidecar/badge)](https://glama.ai/mcp/servers/Hackedghost64/arch-sidecar)
[![Tests Passing](https://img.shields.io/badge/tests-119%20passed-success.svg)](tests/)
[![Empirical Case Study](https://img.shields.io/badge/Case%20Study-Documented-orange.svg)](CASE_STUDY.md)

<p align="center">
  <img src="assets/demo.gif" alt="Devrith arch-sidecar in action — digest, preflight check, feature planning" width="100%" />
</p>

---

> **70% fewer agent tool calls · 40% faster completions · <15ms static preflight · Zero exploratory file reads**
>
> Compatible with **Claude Code**, **Cursor**, **Windsurf**, **Gemini CLI**, and **Antigravity**.  
> Empirical benchmarks across 37,005 LOC (pre-registered). [Read the full data →](CASE_STUDY.md)

---

## What is Devrith?

AI coding agents are fast — but architecturally blind. They read whole files to find one function, make changes that break imports three layers up, and spin in loops catching errors they caused themselves.

**Devrith is the architectural control plane that sits between your AI agent and your codebase.** It gives agents surgical context (not whole files), catches compiler-grade hazards before code touches disk, and enforces architecture contracts across your entire repo — in milliseconds, with zero external dependencies.

```
Agent → arch-sidecar → Surgical context (500 tokens, not 50k)
                      → Pre-flight hazard check (<15ms)
                      → Feature plan with 1-indexed source + test paths
```

---

## 🆓 Free for Individual Developers (This Repo)

The `arch-sidecar` CLI and MCP server are **free, open-source (MIT), and always will be** for individual developers.

### ⚡ One-Liner Install (Linux / macOS / WSL)

```bash
curl -fsSL https://raw.githubusercontent.com/Hackedghost64/arch-sidecar/main/install.sh | bash
```

### Via `uv`, `pipx`, or `pip`

```bash
uv tool install git+https://github.com/Hackedghost64/arch-sidecar.git@v0.4.0
# or
pipx install git+https://github.com/Hackedghost64/arch-sidecar.git@v0.4.0
# or
pip install --upgrade git+https://github.com/Hackedghost64/arch-sidecar.git@v0.4.0
```

> [!TIP]
> Both `arch-sidecar` and `devrith` are installed as identical entry points. Use whichever you prefer.

### Install as an Antigravity / AGY Skill (Free)

Install the bundled Devrith skill directly into your AI coding environment via [Agensi](https://www.agensi.io) — free, one-click, no setup:

```
agy skill install devrith
```

Or find it at: **[agensi.io → Devrith](https://www.agensi.io)**

### 🛡️ Drop-in GitHub Action (CI PR Guard)

Add Devrith to any repository's CI in seconds. It runs in under 15 seconds, predicts PR blast radius against `main`, and catches breaking AST hazards before merging:

```yaml
# .github/workflows/devrith.yml
name: Devrith Architectural Guard
on: [pull_request, push]

jobs:
  guard:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
        with:
          fetch-depth: 0
      - uses: Hackedghost64/arch-sidecar@main
```

---

## 🏢 Devrith Team — Coming Soon

The free CLI gets you surgical context and preflight for your own repos. **Devrith Team** extends this into an organization-wide architectural control plane:

| Feature | Individual (Free) | Team (Paid) |
|---|---|---|
| Architectural Digest (`digest`) | ✅ | ✅ |
| Surgical Feature Context (`feature`) | ✅ | ✅ |
| Pre-flight Hazard Check (`check`) | ✅ | ✅ |
| Architecture Contract (`.devrith.yml`) | ✅ auto-generated | ✅ enforced org-wide |
| **GitHub App Merge Gate** | ❌ | ✅ Blocks PRs that violate contracts |
| **Multi-Repo Dependency Graph** | ❌ | ✅ Cross-service boundary enforcement |
| **Team Policy Dashboard** | ❌ | ✅ |
| **Org-Wide Architecture Audit** | ❌ | ✅ |

> **Interested in early access or a pilot?** → [Open an issue](https://github.com/Hackedghost64/arch-sidecar/issues) or email `devrith@pm.me`

---

## 🚀 What's in v0.4.0

**6-language polyglot architectural co-processor** — Python, TypeScript/JS, Go, Rust, Dart/Flutter, Kotlin/Java. Zero external binaries, zero background daemons.

### Core Commands

```bash
# 1. Architectural Digest — instant codebase skeleton (<100ms)
arch-sidecar digest ./my-repo

# 2. Feature Planning — surgical context for a task (~274ms)
arch-sidecar feature "add OAuth login" ./my-repo

# 3. Pre-flight Check — compiler-grade hazard detection (<15ms)
arch-sidecar check ./my-repo

# 4. Audit — full architectural health report
arch-sidecar audit ./my-repo

# 5. Deterministic AST Refactoring
arch-sidecar decouple "MyClass" ./my-repo

# 6. Verification after edits
arch-sidecar feature "add OAuth login" ./my-repo --verify
```

### As an MCP Server (Claude, Cursor, Windsurf, AGY)

```json
{
  "mcpServers": {
    "devrith": {
      "command": "arch-sidecar",
      "args": ["serve"]
    }
  }
}
```

---

## 📊 Empirical Benchmarks

> [!IMPORTANT]
> **Pre-registered benchmarks across 37,005 LOC (`anime-cli` + `movie-app`):**
>
> | Metric | With Devrith | Without |
> |---|---|---|
> | Agent tool calls | **18** | 60 (70% reduction) |
> | Wall-clock time | **6m 19s** | 10m 32s (40% faster) |
> | Exploratory `read_file` calls | **0** | 28 |
> | Net token savings | **21–27%** | — |
>
> **Hazard Recall (`pallets/werkzeug`, N=73):** Caught **82.9% of breaking structural hazards** before code touches disk (95% CI: 67.3%–91.9%).
>
> Full data: [CASE_STUDY.md](CASE_STUDY.md) · [BENCHMARK_REPORT](benchmark/FINDINGS.md)

---

## 🥊 Capability Matrix

| Capability | Aider | Codemap | CALM | **Devrith** |
| :--- | :---: | :---: | :---: | :---: |
| Architectural Digest | ✅ | ✅ | ✅ | **✅ (<100ms)** |
| Surgical Symbol Context | Partial | ✅ | ✅ | **✅ (~500 tokens)** |
| Feature Workflow Planning | ❌ | ❌ | ❌ | **✅** |
| Deterministic AST Extraction | ❌ | ❌ | ❌ | **✅ (1.8–16ms)** |
| Circular Import Defense | ❌ | ❌ | ⚠️ | **✅ Pre-flight** |
| Scope Shadowing Analysis | ❌ | ❌ | ❌ | **✅ Compiler-grade** |
| Multi-language support | ✅ | Partial | Partial | **✅ 6 languages** |
| Team Merge Gate | ❌ | ❌ | ❌ | **🔜 Devrith Team** |

---

## 🏗️ How the Open-Core Flywheel Works

```
1. Developer installs free arch-sidecar CLI
         ↓
2. First run auto-generates .devrith.yml (Architecture Contract) in repo
         ↓
3. Contract defines module boundaries, allowed dependency edges, language scope
         ↓
4. Developer commits .devrith.yml — repo now has an architecture contract
         ↓
5. Team sees the contract → installs Devrith Team GitHub App
         ↓
6. GitHub App enforces contract as a merge gate on every PR
         ↓
7. Org-wide architectural drift becomes impossible
```

The free tool creates the artifact (`.devrith.yml`) that makes the paid team layer valuable.

---

## 📖 Documentation

- **[QUICKSTART.md](QUICKSTART.md)** — 5-minute onboarding & MCP setup
- **[CASE_STUDY.md](CASE_STUDY.md)** — Full empirical benchmarks (wins, losses, boundaries)
- **[CASE_STUDY_FLASH.md](CASE_STUDY_FLASH.md)** — Flash-model benchmarks
- **[benchmark/FINDINGS.md](benchmark/FINDINGS.md)** — Raw benchmark data

---

## 🔬 Technical Details

**6-Language Polyglot Engine:** Python, TypeScript/JS (`.ts`, `.tsx`, `.js`, `.jsx`), Go, Rust, Dart/Flutter, Kotlin/Java. Operates via lightweight in-process AST parsers with **zero external binaries or background daemon processes**.

**Rare-Term IDF Scoring:** Down-weights generic CRUD verbs (`get`, `set`, `handle`, `process`) and boosts domain-specific identifiers by up to `+45`, preventing search dilution.

**Cross-Boundary Route & Environment Linking:** Automatically bridges backend endpoints and frontend/mobile client files sharing HTTP routes or environment variables for cross-layer consistency.

**Atomic Multi-Symbol Decoupling:** Extract multiple symbols atomically across supported languages with automatic import migration, re-export shims, and transactional rollback if tests fail.

**Known Boundaries:** Static AST analysis cannot resolve runtime reflection (`getattr`, `eval`, `exec`), runtime monkeypatching (`unittest.mock.patch`), or dynamic mock patterns. Dynamic unit tests remain required for behavioral validation.

---

## License

`arch-sidecar` (the CLI and MCP engine in this repo) is licensed under the **MIT License**. See [LICENSE](LICENSE).

Devrith Team features (GitHub App, merge gate, org dashboard) are proprietary. © 2026 Devrith.

---

<sub>Built by <a href="https://github.com/Hackedghost64">Divyam Gupta</a> · <a href="https://www.agensi.io">Get the free Agensi skill</a></sub>