Skip to content

chore(loop): note npm packages are live (#11) #35

chore(loop): note npm packages are live (#11)

chore(loop): note npm packages are live (#11) #35

name: Validate Patterns & Registry
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
validate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
node-version: '22'
- name: Check registry covers all pattern files
run: |
set -e
echo "Patterns declared in registry:"
grep '^\s*-\s*id:' patterns/registry.yaml | sed 's/.*id: //' | sort > /tmp/registry.txt
echo "Pattern markdown files:"
ls patterns/*.md | xargs -n1 basename | sed 's/.md$//' | grep -v README | sort > /tmp/files.txt
echo "=== Registry ==="; cat /tmp/registry.txt
echo "=== Files ==="; cat /tmp/files.txt
comm -23 /tmp/files.txt /tmp/registry.txt | grep . && (echo "ERROR: pattern md file(s) missing from registry.yaml"; exit 1) || echo "All pattern files registered ✓"
comm -23 /tmp/registry.txt /tmp/files.txt | grep . && (echo "ERROR: registry entry without matching .md"; exit 1) || echo "No orphan registry entries ✓"
- name: Verify CONTRIBUTING + template compliance (basic)
run: |
set -e
echo "Checking that key sections exist in patterns (lightweight)"
for f in patterns/*.md; do
if [[ "$f" == *"README.md" ]]; then continue; fi
grep -q "^## Scheduling" "$f" || { echo "Missing Scheduling in $f"; exit 1; }
grep -q "^## Required Skills" "$f" || { echo "Missing Required Skills in $f"; exit 1; }
grep -Eq "maker.*checker|verifier|Maker / Checker|Verification Strategy|reviewer sub-agent" "$f" || { echo "Missing verifier strategy (maker/checker) mention in $f"; exit 1; }
done
echo "Basic pattern structure checks passed ✓"
- name: Ensure templates exist
run: |
test -f templates/pattern-template.md || (echo "Missing pattern-template.md"; exit 1)
test -f templates/STATE.md.template || (echo "Missing STATE template"; exit 1)
test -f templates/loop-run-log.md.template || (echo "Missing loop-run-log template"; exit 1)
test -f templates/loop-budget.md.template || (echo "Missing loop-budget template"; exit 1)
echo "Templates present ✓"
- name: Validate registry.yaml schema and starter paths
run: |
npm install --no-save yaml@2 ajv@8
node scripts/validate-registry.mjs
- name: Verify loop-init pattern sync
run: node scripts/check-loop-init-sync.mjs
- name: Smoke test loop-init package layout
run: |
cd tools/loop-init
npm ci
npm test