feat(forge): Enhanced agent orchestration validation system with /forge command#565
Open
feat(forge): Enhanced agent orchestration validation system with /forge command#565
Conversation
- Add ValidationAgent trait with async validate method - Add SecurityAgent for security-focused code analysis: - secrets_exposed: detect hardcoded secrets/API keys - dependencies_audit: check for vulnerable dependencies - unsafe_code: find undocumented unsafe blocks - input_validation: basic injection pattern detection - Add QualityAgent for code quality checks: - todo_comments: find TODO/FIXME/HACK comments - unimplemented_code: detect todo!() and unimplemented!() - error_handling: check for unwrap() without context - dead_code: find #[allow(dead_code)] markers - documentation: check missing public item docs - Add AggregatorAgent to combine results from all agents: - Determines overall status (Pass only if ALL agents passed) - Groups findings by severity - Produces ForgeResponse with recommendation (proceed/block) - Add comprehensive unit tests for all agents
- Fix GlobalConfig to use manual Default impl instead of derive - Ensures max_parallel defaults to 4, timeout_seconds to 600 - Add module exports for config, orchestrator, protocol in mod.rs - Add documentation for orchestration usage example
Implement the /forge command with subcommands: - /forge (or /forge run) - Run all validation agents - /forge status - Show current validation status - /forge config - Show configuration - /forge agents - List available agents - /forge check <agent> - Run specific agent only Includes alias 'validate', category 'Development', comprehensive help text, and 9 unit tests covering all subcommands.
012daaf to
7c1190d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR introduces the Forge Orchestration System, a comprehensive modular framework for code validation through specialized agents. Each agent validates specific aspects of the codebase and returns structured JSON responses indicating rule compliance.
Features
🔧 Core Orchestration System
max_parallelsetting🤖 Validation Agents
Three built-in agents with extensible architecture:
📋 Modular Configuration (TOML)
All agent behavior is controlled via modifiable TOML configuration files:
📊 JSON Protocol
Agents respond with structured JSON for machine-readable validation:
{ "status": "pass|warning|fail", "agent_id": "security", "rules_applied": [...], "findings": [{ "severity": "error|warning|info", "message": "Description", "location": { "file": "...", "line": 42 }, "suggestion": "How to fix" }] }🖥️ TUI Dashboard
Interactive dashboard via
/forgecommand showing:🔗 Slash Command Integration
New
/forgecommand for validation orchestrationFiles Changed
New Modules
src/cortex-agents/src/forge/- Core orchestrationprotocol.rs- Validation protocol (JSON serialization)orchestrator.rs- DAG-based execution engineconfig.rs- TOML configuration loaderagents/- Built-in validation agentssrc/cortex-engine/src/commands/forge.rs- Slash commandsrc/cortex-tui/src/views/forge.rs- Dashboard viewConfiguration Files
.cortex/forge/forge.toml- Global settings.cortex/forge/agents/*/rules.toml- Per-agent rulesTesting
cargo checkpassescargo fmtapplied