v2/docs/development/training-pipeline-real-only.md
The Claude Flow Training Pipeline now exclusively uses real code execution. There is no simulation mode - all training runs actual npm tests on real code files to provide genuine learning and improvement.
Math.random() to simulate test resultsnpm install and npm test commandsThe pipeline creates real code files in .claude-flow/training/real-tasks/:
// Example: Email validation function
function validateEmail(email) {
const regex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
return regex.test(email);
}
Three strategies modify the code differently:
Each strategy variant is tested using:
npm install # Install Jest and dependencies
npm test # Run actual tests
npm run lint # Check code quality
The system learns from actual test results:
# Always runs with real code - no simulation option
./claude-flow train-pipeline run
# Options
./claude-flow train-pipeline run --complexity hard --iterations 5
./claude-flow train-pipeline status
# Output shows real metrics:
š Training Pipeline Status
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
š¤ Strategy Profiles:
conservative:
Success Rate: 40.9% # Real test pass rate
Average Score: 40.25 # Based on actual results
Execution Time: 1633ms # Real npm test time
Real Executions: 4 # Number of real runs
./claude-flow train-pipeline validate
# Shows current real performance:
š Current Performance:
Success Rate: 43.1% # Actual success rate
Avg Execution Time: 1567ms # Real execution time
Average Score: 41.05 # Based on real tests
From actual training runs:
š Learning Results:
conservative: Score 12.64, Success 0.0%, Time 1839ms
balanced: Score 12.98, Success 0.0%, Time 1756ms
aggressive: Score 13.24, Success 0.0%, Time 1691ms
š Learning Results:
conservative: Score 42.56, Success 50.0%, Time 1860ms
balanced: Score 42.57, Success 50.0%, Time 1858ms
aggressive: Score 43.33, Success 50.0%, Time 1667ms
š Improvements:
Success Rate: +14.3%
Execution Time: -10.8%
Score: +3.0%
The training pipeline creates real project structures:
.claude-flow/training/real-tasks/
āāā task-[timestamp]/
āāā [taskName]/
āāā index.js # Real implementation
āāā index.test.js # Real Jest tests
āāā package.json # Real dependencies
// Learning rate: 0.4 for real execution (higher than simulation)
newReliability = oldReliability * 0.6 + newScore * 0.4
If you have existing profiles from the simulation mode:
npm ls jest--complexity easy for quicker iterationsThe Training Pipeline now provides real machine learning based on actual code execution. No more simulations - every score, every metric, and every improvement is based on real npm test results. This ensures that agent improvements translate directly to better real-world performance.