forked from oliver-kriska/claude-elixir-phoenix
-
Notifications
You must be signed in to change notification settings - Fork 0
165 lines (131 loc) · 4.18 KB
/
Copy pathlint.yml
File metadata and controls
165 lines (131 loc) · 4.18 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
name: Quality Gate
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
lint:
name: Markdown + YAML + JSON
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: "20"
- name: Install dependencies
run: npm ci
- name: Lint Markdown
run: npm run lint
- name: Lint YAML
uses: ibiqlik/action-yamllint@v3
with:
file_or_dir: .
config_file: .yamllint.yml
strict: false
- name: Validate JSON
run: |
for file in $(find . -name "*.json" -not -path "./node_modules/*" -not -path "./.claude/*"); do
echo "Validating $file"
python3 -m json.tool "$file" > /dev/null
done
python:
name: Python Lint + Security
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup Python
uses: actions/setup-python@v6
with:
python-version: "3.12"
- name: Install dependencies
run: pip install pyyaml ruff pip-audit
- name: Ruff lint (Python)
run: ruff check lab/ --select E,F,W --ignore E501,E402
- name: Ruff format check
run: ruff format --check lab/ || true
- name: Pip audit (security)
run: pip-audit -r requirements.txt || true
shell:
name: Shell Lint
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
- name: ShellCheck
run: |
sudo apt-get install -y shellcheck
find plugins/elixir-phoenix/hooks/scripts -name "*.sh" -exec shellcheck {} + || true
find lab/autoresearch/scripts -name "*.sh" -exec shellcheck {} + || true
shellcheck lab/eval/run_eval.sh || true
security:
name: Dependency Audit
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup Node.js
uses: actions/setup-node@v6
with:
node-version: "20"
- name: Install dependencies
run: npm ci
- name: npm audit
run: npm audit --omit=dev || true
test:
name: Python Tests
runs-on: ubuntu-latest
needs: python
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup Python
uses: actions/setup-python@v6
with:
python-version: "3.12"
- name: Install dependencies
run: pip install -r requirements.txt
- name: Run pytest
run: python3 -m pytest lab/eval/tests/ -v --tb=short
eval:
name: Skill & Agent Eval
runs-on: ubuntu-latest
needs: [lint, python, test]
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup Python
uses: actions/setup-python@v6
with:
python-version: "3.12"
- name: Install PyYAML
run: pip install pyyaml
- name: Score all skills (8 dimensions)
run: |
python3 -m lab.eval.scorer --all 2>/dev/null | python3 -c "
import json, sys
d = json.load(sys.stdin)
perfect = sum(1 for v in d.values() if v['composite'] >= 0.999)
avg = sum(v['composite'] for v in d.values()) / len(d)
fixable_failures = {}
for name, data in d.items():
if data['composite'] < 0.95:
all_behavioral = all(
dim == 'behavioral'
for dim, dd in data['dimensions'].items()
for a in dd['assertions'] if not a['passed']
)
if not all_behavioral:
fixable_failures[name] = round(data['composite'], 3)
print(f'{len(d)} skills | {perfect} perfect | avg {avg:.3f}')
if fixable_failures:
print(f'FIXABLE FAILURES: {fixable_failures}')
sys.exit(1)
print('All skills pass (behavioral edge cases expected)')
"
- name: Score all agents (5 dimensions)
run: |
python3 -m lab.eval.agent_scorer --all 2>&1 | tee /dev/stderr | tail -1 | grep -q "perfect"