# Silk Code Architecture

Silk Code separates the developer-owned coding environment from replaceable cloud or local AI models.

## Major layers

1. **Interfaces** — terminal REPL, one-shot CLI, and local multi-session web GUI.
2. **Agent harness** — repository context, tools, permissions, checkpoints, compaction, and verification.
3. **Provider layer** — cloud APIs, OpenAI-compatible endpoints, Ollama, and local-model discovery.
4. **Tools** — filesystem editing, tests, git, GitHub, MCP, sandboxes, and benchmarks.
5. **Persistence** — resumable sessions, project memory, rules, and provenance metadata.

## Design principles

- The coding environment belongs to the developer.
- The AI model is replaceable.
- Tool actions remain permission-gated and auditable.
- Verification is part of the agent loop.

Authoritative specification: https://github.com/RupertCloud/SilkCode/blob/main/SRS.md
