|
| 1 | +name: gitagent-validate |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + branches: [main] |
| 6 | + pull_request: |
| 7 | + branches: [main] |
| 8 | + |
| 9 | +jobs: |
| 10 | + validate: |
| 11 | + name: Validate Bloop Agent |
| 12 | + runs-on: ubuntu-latest |
| 13 | + |
| 14 | + steps: |
| 15 | + - name: Checkout |
| 16 | + uses: actions/checkout@v4 |
| 17 | + |
| 18 | + - name: Setup Node.js |
| 19 | + uses: actions/setup-node@v4 |
| 20 | + with: |
| 21 | + node-version: "20" |
| 22 | + cache: "npm" |
| 23 | + |
| 24 | + - name: Install dependencies |
| 25 | + run: npm install |
| 26 | + |
| 27 | + - name: Check required agent files exist |
| 28 | + run: | |
| 29 | + echo "Checking agent structure..." |
| 30 | + test -f agent.yaml && echo "✓ agent.yaml" || (echo "✗ agent.yaml MISSING" && exit 1) |
| 31 | + test -f SOUL.md && echo "✓ SOUL.md" || (echo "✗ SOUL.md MISSING" && exit 1) |
| 32 | + test -f RULES.md && echo "✓ RULES.md" || (echo "✗ RULES.md MISSING" && exit 1) |
| 33 | + test -f DUTIES.md && echo "✓ DUTIES.md" || (echo "✗ DUTIES.md MISSING" && exit 1) |
| 34 | + test -f workflows/audit-pipeline.yaml && echo "✓ workflows/audit-pipeline.yaml" || (echo "✗ workflow MISSING" && exit 1) |
| 35 | + test -f hooks/bootstrap.md && echo "✓ hooks/bootstrap.md" || (echo "✗ bootstrap hook MISSING" && exit 1) |
| 36 | + test -f hooks/teardown.md && echo "✓ hooks/teardown.md" || (echo "✗ teardown hook MISSING" && exit 1) |
| 37 | + test -f knowledge/ml-failure-taxonomy.md && echo "✓ knowledge/ml-failure-taxonomy.md" || (echo "✗ taxonomy MISSING" && exit 1) |
| 38 | + test -f skills/segment-analysis/SKILL.md && echo "✓ skills/segment-analysis" || (echo "✗ segment-analysis skill MISSING" && exit 1) |
| 39 | + test -f skills/root-cause/SKILL.md && echo "✓ skills/root-cause" || (echo "✗ root-cause skill MISSING" && exit 1) |
| 40 | + test -f skills/fix-generator/SKILL.md && echo "✓ skills/fix-generator" || (echo "✗ fix-generator skill MISSING" && exit 1) |
| 41 | + test -f examples/diabetic-retinopathy.csv && echo "✓ examples/diabetic-retinopathy.csv" || (echo "✗ example dataset MISSING" && exit 1) |
| 42 | + echo "All required files present." |
| 43 | +
|
| 44 | + - name: Validate agent.yaml structure |
| 45 | + run: | |
| 46 | + node -e " |
| 47 | + import('fs').then(fs => { |
| 48 | + const yaml = fs.readFileSync('agent.yaml', 'utf8'); |
| 49 | + if (!yaml.includes('spec_version')) { console.error('Missing spec_version'); process.exit(1); } |
| 50 | + if (!yaml.includes('name: bloop')) { console.error('Missing agent name'); process.exit(1); } |
| 51 | + if (!yaml.includes('skills:')) { console.error('Missing skills list'); process.exit(1); } |
| 52 | + console.log('✓ agent.yaml is valid'); |
| 53 | + }); |
| 54 | + " |
| 55 | +
|
| 56 | + - name: Validate workflow pipeline structure |
| 57 | + run: | |
| 58 | + node -e " |
| 59 | + import('fs').then(fs => { |
| 60 | + const workflow = fs.readFileSync('workflows/audit-pipeline.yaml', 'utf8'); |
| 61 | + if (!workflow.includes('segment-analysis')) { console.error('Missing segment-analysis step'); process.exit(1); } |
| 62 | + if (!workflow.includes('root-cause')) { console.error('Missing root-cause step'); process.exit(1); } |
| 63 | + if (!workflow.includes('fix-generator')) { console.error('Missing fix-generator step'); process.exit(1); } |
| 64 | + if (!workflow.includes('depends_on')) { console.error('No depends_on found — pipeline is not chained'); process.exit(1); } |
| 65 | + console.log('✓ audit-pipeline.yaml has 3 chained steps'); |
| 66 | + }); |
| 67 | + " |
| 68 | +
|
| 69 | + - name: Validate skill frontmatter |
| 70 | + run: | |
| 71 | + node -e " |
| 72 | + import('fs').then(fs => { |
| 73 | + const skills = ['skills/segment-analysis/SKILL.md', 'skills/root-cause/SKILL.md', 'skills/fix-generator/SKILL.md']; |
| 74 | + for (const s of skills) { |
| 75 | + const content = fs.readFileSync(s, 'utf8'); |
| 76 | + if (!content.startsWith('---')) { console.error('Missing YAML frontmatter in ' + s); process.exit(1); } |
| 77 | + if (!content.includes('outputs:')) { console.error('Missing outputs: in ' + s); process.exit(1); } |
| 78 | + if (!content.includes('role:')) { console.error('Missing role: in ' + s); process.exit(1); } |
| 79 | + console.log('✓ ' + s); |
| 80 | + } |
| 81 | + }); |
| 82 | + " |
| 83 | +
|
| 84 | + - name: Validate memory structure |
| 85 | + run: | |
| 86 | + test -f memory/runtime/dailylog.md && echo "✓ memory/runtime/dailylog.md" || (echo "✗ dailylog MISSING" && exit 1) |
| 87 | + test -f memory/runtime/patterns.md && echo "✓ memory/runtime/patterns.md" || (echo "✗ patterns MISSING" && exit 1) |
| 88 | + test -f memory/runtime/context.md && echo "✓ memory/runtime/context.md" || (echo "✗ context MISSING" && exit 1) |
| 89 | +
|
| 90 | + - name: All checks passed |
| 91 | + run: echo "✓ Bloop agent structure validated successfully." |
0 commit comments