|
| 1 | +```yaml |
| 2 | +name: Validate Examples |
| 3 | +
|
| 4 | +on: |
| 5 | + push: |
| 6 | + branches: [ main ] |
| 7 | + paths: |
| 8 | + - 'examples/**/*.md' |
| 9 | + pull_request: |
| 10 | + branches: [ main ] |
| 11 | + paths: |
| 12 | + - 'examples/**/*.md' |
| 13 | +
|
| 14 | +jobs: |
| 15 | + validate: |
| 16 | + runs-on: ubuntu-latest |
| 17 | + |
| 18 | + steps: |
| 19 | + - name: Checkout code |
| 20 | + uses: actions/checkout@v3 |
| 21 | + |
| 22 | + - name: Set up Python |
| 23 | + uses: actions/setup-python@v4 |
| 24 | + with: |
| 25 | + python-version: '3.9' |
| 26 | + |
| 27 | + - name: Install dependencies |
| 28 | + run: | |
| 29 | + python -m pip install --upgrade pip |
| 30 | + # Add any Python dependencies here if needed |
| 31 | + |
| 32 | + - name: Validate example files |
| 33 | + run: | |
| 34 | + echo "Validating Claude-TTD framework examples..." |
| 35 | + EXIT_CODE=0 |
| 36 | + |
| 37 | + for file in examples/**/*.md; do |
| 38 | + echo "" |
| 39 | + echo "Checking: $file" |
| 40 | + echo "----------------------------------------" |
| 41 | + |
| 42 | + if python scripts/validate-structure.py "$file"; then |
| 43 | + echo "✅ Valid: $file" |
| 44 | + else |
| 45 | + echo "❌ Invalid: $file" |
| 46 | + EXIT_CODE=1 |
| 47 | + fi |
| 48 | + done |
| 49 | + |
| 50 | + echo "" |
| 51 | + echo "========================================" |
| 52 | + if [ $EXIT_CODE -eq 0 ]; then |
| 53 | + echo "✅ All examples are valid" |
| 54 | + else |
| 55 | + echo "❌ Some examples failed validation" |
| 56 | + fi |
| 57 | + |
| 58 | + exit $EXIT_CODE |
| 59 | + |
| 60 | + - name: Check for required sections |
| 61 | + run: | |
| 62 | + echo "Checking for required framework sections..." |
| 63 | + |
| 64 | + REQUIRED_SECTIONS=( |
| 65 | + "EXECUTIVE SUMMARY" |
| 66 | + "CLAIM VALIDATION" |
| 67 | + "COMPONENT ANALYSIS" |
| 68 | + "INTEGRATION PATH" |
| 69 | + "ALIGNMENT CHECK" |
| 70 | + "DELIVERABLES" |
| 71 | + "VERIFICATION" |
| 72 | + ) |
| 73 | + |
| 74 | + EXIT_CODE=0 |
| 75 | + |
| 76 | + for file in examples/**/*.md; do |
| 77 | + echo "Checking sections in: $file" |
| 78 | + |
| 79 | + for section in "${REQUIRED_SECTIONS[@]}"; do |
| 80 | + if ! grep -q "$section" "$file"; then |
| 81 | + echo "❌ Missing section '$section' in $file" |
| 82 | + EXIT_CODE=1 |
| 83 | + fi |
| 84 | + done |
| 85 | + done |
| 86 | + |
| 87 | + exit $EXIT_CODE |
| 88 | + |
| 89 | + - name: Check for epistemic labels |
| 90 | + run: | |
| 91 | + echo "Checking for epistemic labels (FACT/HYPOTHESIS/ASSUMPTION)..." |
| 92 | + |
| 93 | + EXIT_CODE=0 |
| 94 | + |
| 95 | + for file in examples/**/*.md; do |
| 96 | + if ! grep -q "FACT:" "$file"; then |
| 97 | + echo "⚠️ Warning: No FACT labels in $file" |
| 98 | + fi |
| 99 | + |
| 100 | + if ! grep -q "HYPOTHESIS:" "$file"; then |
| 101 | + echo "⚠️ Warning: No HYPOTHESIS labels in $file" |
| 102 | + fi |
| 103 | + |
| 104 | + if ! grep -q "ASSUMPTION:" "$file"; then |
| 105 | + echo "⚠️ Warning: No ASSUMPTION labels in $file" |
| 106 | + fi |
| 107 | + done |
| 108 | + |
| 109 | + exit $EXIT_CODE |
| 110 | +``` |
0 commit comments