mirror of
https://github.com/ruvnet/ruflo.git
synced 2026-11-24 06:06:02 +09:00
- Reorganize v3/ into implementation/ subfolders: - planning/, architecture/, migration/, integration/ - security/, adrs/, research/, swarm-plans/ - Add 15-agent concurrent swarm implementation plans: - SWARM-OVERVIEW.md: Hierarchical mesh topology, 4 phases - AGENT-SPECIFICATIONS.md: 15 agent configs with capabilities - TDD-LONDON-SCHOOL-PLAN.md: Mock-first TDD methodology - BENCHMARK-OPTIMIZATION.md: Performance targets (2.49x-7.47x) - DEPLOYMENT-PLAN.md: Release strategy, CI/CD, rollback - GITHUB-ISSUE-TRACKING.md: Issue workflow with agent replies - Update .claude/settings.json with proper hooks format - Add bash aliases for claude --dangerously-skip-permissions 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
5.0 KiB
5.0 KiB
Verification System Integration Guide
Overview
The verification system provides real-time validation of agent work and task execution. It integrates with swarm commands, non-interactive mode, and the training system.
How It Actually Works
1. Pre-Task Verification
Before any task executes, the system checks:
- Git repository state (clean/dirty)
- Dependencies installed
- Environment ready
2. Post-Task Verification
After task completion, it verifies:
- Code compiles (TypeScript/JavaScript)
- Tests pass
- Linting succeeds
- Documentation exists (for architect agents)
3. Automatic Rollback
If verification fails and rollback is enabled:
- Resets to last git commit
- Preserves verification history
- Feeds failure data to training system
Integration with Commands
Swarm Command with Verification
# Enable verification for swarm execution
export VERIFICATION_MODE=strict
export VERIFICATION_ROLLBACK=true
# Run swarm with verification hooks
claude-flow swarm "Build REST API" --verify
# The swarm will:
# 1. Run pre-task verification
# 2. Execute the objective
# 3. Run post-task verification
# 4. Rollback if verification fails
Non-Interactive Mode with Verification
# Non-interactive with verification
claude-flow swarm "Build feature" \
-p \
--output-format stream-json \
--verify \
--threshold 0.95
# Verification results appear in JSON output
Manual Verification
# Pre-task check
node src/cli/simple-commands/verification-hooks.js pre task-123 coder
# Post-task check
node src/cli/simple-commands/verification-hooks.js post task-123 coder
# Feed to training
node src/cli/simple-commands/verification-hooks.js train task-123 coder
# Check status
node src/cli/simple-commands/verification-hooks.js status
Integration with Training System
Verification results automatically feed into the training system:
# View training data
cat .claude-flow/training/verification-data.jsonl
# Sample output:
{"taskId":"task-123","agentType":"coder","preScore":1,"postScore":0.75,"success":false,"timestamp":"2025-01-12T15:00:00Z"}
Verification Scores
| Agent Type | Checks Performed | Threshold |
|---|---|---|
| coder | typecheck, tests, lint | 0.85 |
| researcher | output completeness | 0.85 |
| tester | coverage threshold | 0.85 |
| architect | documentation exists | 0.85 |
Environment Variables
# Set verification mode (strict/moderate/development)
export VERIFICATION_MODE=strict
# Enable automatic rollback on failure
export VERIFICATION_ROLLBACK=true
# Custom threshold (0.0-1.0)
export VERIFICATION_THRESHOLD=0.95
Real Example: Verifying a Coder Agent
# 1. Initialize verification
./claude-flow verify init strict
# 2. Run a coder task with verification
./claude-flow swarm "Implement user authentication" --verify
# Output:
🔍 Pre-task verification: swarm-123 (coder)
✅ git-status: 1.00
✅ npm-deps: 1.00
✅ Pre-task verification passed (1.00)
[... task execution ...]
🔍 Post-task verification: swarm-123 (coder)
✅ typecheck: 1.00
❌ tests: 0.40
✅ lint: 0.80
❌ Post-task verification failed (0.73 < 0.95)
🔄 Attempting rollback...
✅ Rollback completed
Verification Memory
Verification results are stored in .swarm/verification-memory.json:
{
"history": [
{
"taskId": "swarm-123",
"phase": "post",
"passed": false,
"score": 0.73,
"checks": [
{"name": "typecheck", "passed": true, "score": 1.0},
{"name": "tests", "passed": false, "score": 0.4},
{"name": "lint", "passed": true, "score": 0.8}
],
"agentType": "coder",
"timestamp": "2025-01-12T15:30:00Z"
}
],
"tasks": {
"swarm-123": {
"pre": {"passed": true, "score": 1.0},
"post": {"passed": false, "score": 0.73}
}
}
}
Current Limitations
- Not Yet Fully Integrated: The verification hooks exist but aren't automatically called by all commands yet
- Basic Checks: Currently runs simple npm scripts, not deep code analysis
- Manual Setup: Requires environment variables to be set manually
- Limited Agent Types: Only 4 agent types have specific verification logic
Future Improvements
- Deep Integration: Automatic verification for all agent operations
- Smart Rollback: Selective rollback of only failed changes
- Learning System: Use verification history to improve agent selection
- Custom Checks: Allow project-specific verification rules
- Real-time Monitoring: Dashboard showing verification metrics
Using Verification Today
While not fully integrated, you can use verification today by:
- Running verification hooks manually before/after tasks
- Setting environment variables for automatic checks
- Using the
--verifyflag with swarm commands (when implemented) - Checking verification history with
truthcommand
The verification system provides the foundation for ensuring quality in AI-generated code, even if it's not yet fully automated.