forked from cobusgreyling/loop-engineering
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathci-validate-gates.sh
More file actions
executable file
·52 lines (43 loc) · 2.08 KB
/
Copy pathci-validate-gates.sh
File metadata and controls
executable file
·52 lines (43 loc) · 2.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/usr/bin/env bash
# Pattern/registry validation gates — shared by validate-patterns.yml and daily-triage.yml
set -euo pipefail
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 ✓"
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 ✓"
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 ✓"
npm install --no-save yaml@2 ajv@8
node scripts/validate-registry.mjs
node scripts/check-loop-init-sync.mjs
cd tools/loop-init
npm ci
npm test
echo "Building and testing loop-sync…"
cd ../loop-sync
npm ci
npm test
echo "Building and testing loop-context…"
cd ../loop-context
npm ci
npm test
echo "Building and testing mcp-server…"
cd ../mcp-server
npm ci
npm test
echo "validate gates passed ✓"