AFA Documentation
Autonomous Function Amplifier -- autonomous code evolution with quantitative rigor.
AFA -- Autonomous Function Amplifier
AFA is an autonomous code evolution engine. It analyzes every function in your codebase, generates improvement candidates using AI, validates each candidate through nine quantitative gates, and commits only when the math proves the change is worthwhile.
Why AFA
- Quantitative gate validation -- nine gates with formal thresholds, not heuristic scores. Every enhancement must pass all nine before it touches your code.
- Autonomous enhancement loop -- analyze, generate, validate, commit. No human in the loop for routine improvements.
- Model-agnostic -- works with Anthropic, OpenAI, or Google Gemini. Swap providers without changing anything else.
- Cryptographic audit trail -- SHA-256 hash chain per decision. Every gate evaluation is recorded and verifiable.
How it works
1. ANALYZE Parse functions via tree-sitter + LLM semantic analysis
2. GENERATE Create enhancement candidates via model-agnostic agents
3. VALIDATE Run every candidate through 9 quantitative gates
4. COMMIT Auto-commit if all gates pass and utility ratio > 1.0
5. LEARN Track acceptance/rejection to improve over timeAFA uses a tri-plane architecture: the control plane (governance) never generates code; the data plane (execution) never makes governance decisions; the auth plane (identity, billing, access control) resolves tier and enforces rate limits but never evaluates gates or generates code.
Four ways to use AFA
| Surface | Use case |
|---|---|
| CLI | Developer workflow: afa analyze ., afa enhance src/ |
| REST API | CI/CD integration, webhook-driven pipelines |
| GitHub App | Automated PR review with gate-check status |
| MCP Server | IDE agents (Claude Code, Cursor) invoke AFA as a tool |
Get started
Install AFA and run your first analysis in under three minutes.