Repository navigation
ELCODE Forge v0.4.0 — AI Engine, Grounded Code Review & Local Intelligence
ELCODE Forge (eforge) v0.4.0
Know your code. Ship with confidence.
"Deterministic before generative." — "Precision over decoration."
We are thrilled to release ELCODE Forge v0.4.0, marking the complete delivery of Phase 4 (AI Engine & Codebase Intelligence).
In v0.4.0, eforge bridges deterministic static analysis, import graphs, and blast-radius git impact with an explainable, grounded generative AI layer. Generative AI is positioned strictly as an advisory layer, never an unconstrained authoritative judge: deterministic health scores, security findings, and CI policy exit codes can never be altered or dismissed by AI models.
Highlights in v0.4.0 (Phase 4 Completed)
1. AI Foundation & Multi-Provider Abstraction (Epic #82)
crates/forge-ai: Added to workspace DAG, adhering strictly to zero-panic policies and clean trait separation (AiProvider).- Local & Offline Inference First: Full support for
openai-compatibleendpoints, enabling zero-data-exfiltration execution using local models with Ollama (http://localhost:11434/v1) or LM Studio (http://localhost:1234/v1). - Cloud Provider Support: Modular adapters for OpenAI (
gpt-4o,gpt-4o-mini), Anthropic (claude-3-5-sonnet), and Google Gemini (gemini-1.5-pro,gemini-1.5-flash). - Untrusted Data Envelopes: All repository code, commit logs, and AST chunks are wrapped inside
<untrusted_repository_data>envelopes with automated detection of prompt-injection signals (role_hijack_attempt,override_previous_instructions, etc.). - MockProvider: Offline provider with scripted responses and token usage recording for fast, deterministic unit and CI test execution.
2. Deterministic Context Retrieval & Cost Controls (Epic #83)
- Token-Budgeted Context Assembler (
build_context): Selects, ranks, and fits repository architecture, high/critical security findings, dependencies, and safe source snippets within strict token boundaries. - In-Flight Secret Redaction (
redact_secrets): Integrated withforge-securityto redact high-entropy API tokens, credentials, and PEM private keys ([REDACTED_SECRET]) before prompt generation. - Strict Sensitive File Exclusion: Automatically excludes
.env*,credentials*,id_rsa*,*.pem, and internal directories (.git/,.eforge/). - Multi-Tier Cost Governance:
--dry-run: Previews exact context packs and token estimates with zero network calls and zero cost.budget_daily_usd: Enforces daily USD expenditure caps against an append-only ledger (.eforge/ai-usage.jsonl), failing fast to prevent rogue CI loops.- Response Cache (
.eforge/ai-cache/): SHA-256 prompt hashing for zero-latency, zero-cost deterministic replay.
3. Grounded AI CLI Commands & Deterministic Guard (Epic #84)
eforge explain [target] --ai: Explains structural roles, imports, and findings with grounded citations ([verified]vs[unverified]).eforge ai-review: Grounded PR diff review combining blast-radius change risk with structured review insights classified asConfirmed,Probable, orSuggestion.apply_deterministic_guard: Guarantees thatConfirmeditems require 1:1 backing by deterministic findings, hallucinated file references are discarded, and CI exit codes (--fail-on) are evaluated strictly from deterministic findings.eforge ai status&eforge ai usage: Operational commands for checking AI configuration, testing endpoint latency (--ping), and tracking token spend against daily budgets.
4. Quality Benchmark Suite & Privacy Documentation
- Golden Benchmark Dataset (
fixtures/ai-eval/questions.json): Deterministic evaluation assertions for retrieval recall and anti-hallucination acrossnext-appandvulnerable-ts-app. - Comprehensive Quality Test Suite (
crates/forge-cli/tests/ai_eval.rs): Automated validation of context recall, secret redaction, and grounding invariants. - GitHub Action Update (
elcode-id/forge-action): Added opt-inai-review: 'false'input (defaulting strictly tofalsefor privacy). - Privacy Architecture Guide (
docs/AI_AND_PRIVACY.md): Complete documentation on local AI setup, security envelopes, secret masking, and cost controls.
Verification & Self-Dogfooding
- Test Suite: 105 automated unit and integration tests passing cleanly across the workspace.
- Zero Linter Warnings:
cargo fmt --all -- --checkandcargo clippy --workspace --all-targets -- -D warningsexit code0. - Self-Dogfooding Health Score:
eforge doctorexecutes in 61ms with 0 warnings, andeforge scanreports 99/100 Health Score on theelcode-forgerepository itself.