Two critical fixes for successful pipeline execution: 1. GitLab CI YAML Syntax Fix (.gitlab-ci.yml:84-86) - Wrapped echo commands containing colons in single quotes - Root cause: YAML parser interprets `"text: value"` as key-value pairs - Solution: Single quotes force literal string interpretation - Impact: Enables Docker build pipeline execution 2. Trading Service Compilation Fix (trading_service/src/services/enhanced_ml.rs:1328-1348) - Added missing early stopping fields to PPOConfig initialization - Fields: early_stopping_enabled, early_stopping_patience, early_stopping_min_delta, early_stopping_min_epochs - Values: Disabled by default for paper trading (early_stopping_enabled: false) - Impact: Resolves pre-push hook compilation error Technical Details: - YAML Issue: Colons followed by spaces trigger mapping syntax parsing - Single quotes preserve shell variable expansion while forcing literal YAML strings - Early stopping config matches PPOConfig struct updates from Wave D - Default values: patience=5, min_delta=0.001, min_epochs=10 Validated: - ✅ YAML syntax validated with PyYAML - ✅ trading_service compilation successful (cargo check) - ✅ Ready for GitLab CI/CD pipeline execution 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
101 lines
3.0 KiB
Bash
Executable File
101 lines
3.0 KiB
Bash
Executable File
#!/bin/bash
|
|
# PPO Adapter Validation Script
|
|
# Date: 2025-10-30
|
|
# Purpose: Verify PPO adapter meets production requirements
|
|
|
|
set -e
|
|
|
|
echo "========================================"
|
|
echo "PPO ADAPTER VALIDATION SCRIPT"
|
|
echo "========================================"
|
|
echo ""
|
|
|
|
PASS=0
|
|
FAIL=0
|
|
|
|
# Test 1: Check for synthetic data generation
|
|
echo "Test 1: Checking for synthetic data generation..."
|
|
if grep -q "generate_synthetic_trajectories" /home/jgrusewski/Work/foxhunt/ml/src/hyperopt/adapters/ppo.rs; then
|
|
echo "❌ FAIL: generate_synthetic_trajectories() found in ppo.rs"
|
|
FAIL=$((FAIL + 1))
|
|
else
|
|
echo "✅ PASS: No synthetic data generation found"
|
|
PASS=$((PASS + 1))
|
|
fi
|
|
echo ""
|
|
|
|
# Test 2: Check for data loading field
|
|
echo "Test 2: Checking for dbn_data_dir field..."
|
|
if grep -q "dbn_data_dir" /home/jgrusewski/Work/foxhunt/ml/src/hyperopt/adapters/ppo.rs; then
|
|
echo "✅ PASS: dbn_data_dir field found"
|
|
PASS=$((PASS + 1))
|
|
else
|
|
echo "❌ FAIL: dbn_data_dir field NOT found"
|
|
FAIL=$((FAIL + 1))
|
|
fi
|
|
echo ""
|
|
|
|
# Test 3: Check for early stopping config in PPOConfig
|
|
echo "Test 3: Checking for early stopping config..."
|
|
if grep -q "early_stopping_enabled" /home/jgrusewski/Work/foxhunt/ml/src/ppo/ppo.rs; then
|
|
echo "✅ PASS: early_stopping_enabled found in PPOConfig"
|
|
PASS=$((PASS + 1))
|
|
else
|
|
echo "❌ FAIL: early_stopping_enabled NOT found in PPOConfig"
|
|
FAIL=$((FAIL + 1))
|
|
fi
|
|
echo ""
|
|
|
|
# Test 4: Run unit tests
|
|
echo "Test 4: Running unit tests..."
|
|
if cargo test -p ml --lib hyperopt::adapters::ppo 2>&1 | grep -q "test result: ok"; then
|
|
echo "✅ PASS: Unit tests passed"
|
|
PASS=$((PASS + 1))
|
|
else
|
|
echo "❌ FAIL: Unit tests failed"
|
|
FAIL=$((FAIL + 1))
|
|
fi
|
|
echo ""
|
|
|
|
# Test 5: Check if integration tests compile
|
|
echo "Test 5: Checking integration test compilation..."
|
|
if cargo test -p ml --test hyperopt_ppo_real_data_test --no-run 2>&1 | grep -q "Finished"; then
|
|
echo "✅ PASS: Integration tests compile"
|
|
PASS=$((PASS + 1))
|
|
else
|
|
echo "❌ FAIL: Integration tests don't compile"
|
|
FAIL=$((FAIL + 1))
|
|
fi
|
|
echo ""
|
|
|
|
# Test 6: Check for EarlyStoppingObserver usage
|
|
echo "Test 6: Checking for EarlyStoppingObserver integration..."
|
|
if grep -q "EarlyStoppingObserver" /home/jgrusewski/Work/foxhunt/ml/src/hyperopt/adapters/ppo.rs; then
|
|
echo "✅ PASS: EarlyStoppingObserver used in adapter"
|
|
PASS=$((PASS + 1))
|
|
else
|
|
echo "❌ FAIL: EarlyStoppingObserver NOT used in adapter"
|
|
FAIL=$((FAIL + 1))
|
|
fi
|
|
echo ""
|
|
|
|
# Summary
|
|
echo "========================================"
|
|
echo "VALIDATION SUMMARY"
|
|
echo "========================================"
|
|
echo "Tests Passed: $PASS/6"
|
|
echo "Tests Failed: $FAIL/6"
|
|
echo ""
|
|
|
|
if [ $FAIL -eq 0 ]; then
|
|
echo "✅ ALL TESTS PASSED - PPO ADAPTER READY FOR DEPLOYMENT"
|
|
exit 0
|
|
else
|
|
echo "❌ VALIDATION FAILED - DO NOT DEPLOY PPO ADAPTER"
|
|
echo ""
|
|
echo "See reports for detailed fix instructions:"
|
|
echo " - PPO_ADAPTER_VALIDATION_REPORT.md"
|
|
echo " - PPO_ADAPTER_VALIDATION_SUMMARY.md"
|
|
exit 1
|
|
fi
|