-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpyqual.yaml
More file actions
154 lines (136 loc) · 4.65 KB
/
pyqual.yaml
File metadata and controls
154 lines (136 loc) · 4.65 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
pipeline:
name: quality-loop-with-llx
# Quality gates — pipeline iterates until ALL pass
metrics:
cc_max: 15 # cyclomatic complexity per function
vallm_pass_min: 85 # vallm validation pass rate (%) — realistic for current codebase
coverage_min: 55 # test coverage (%) — realistic for current codebase
completion_rate_min: 75 # percentage of passed gates required for closure — realistic threshold
# Security gates (uncomment to enable):
# vuln_high_max: 0 # pip-audit high severity CVEs
# bandit_high_max: 0 # bandit high severity issues
# secrets_found_max: 0 # trufflehog/gitleaks secrets
# Pipeline stages — use 'tool:' for built-in presets or 'run:' for custom
stages:
# Verify/install all tool dependencies before pipeline starts
- name: setup
run: |
set -e
echo "=== pyqual dependency check ==="
# Python tools (pip)
for pkg in code2llm vallm prefact llx pytest-cov goal; do
if python -m pip show "$pkg" >/dev/null 2>&1; then
echo " ✓ $pkg"
else
echo " ✗ $pkg — installing…"
pip install -q "$pkg" || echo " ⚠ $pkg install failed (optional)"
fi
done
# Node tools (claude)
if command -v claude >/dev/null 2>&1; then
echo " ✓ claude $(claude --version 2>/dev/null)"
else
echo " ✗ claude — installing…"
npm install -g --prefix="$HOME/.local" @anthropic-ai/claude-code 2>/dev/null \
&& echo " ✓ claude installed" \
|| echo " ⚠ claude install failed (fix stage will use llx fallback)"
fi
# Claude Code auth can be either:
# - local OAuth session via `claude auth login`
# - ANTHROPIC_API_KEY in CI/GitHub Actions
# We only verify the CLI is available here.
echo "=== setup done ==="
when: first_iteration
timeout: 300
- name: setup_tasks
run: |
planfile sync github
planfile sync markdown
when: first_iteration
optional: true
# - name: analyze
# tool: code2llm
# when: first_iteration
# - name: validate
# run: vallm batch pyqual tests --recursive --format toon --output ./project
# when: always
# Security scans (uncomment to enable):
# - name: audit
# tool: pip-audit
# optional: true
# - name: bandit
# tool: bandit
# optional: true
- name: test
tool: pytest
optional: true
- name: prefact
tool: prefact
optional: true
when: metrics_fail
timeout: 900
# Custom fix - uses explicit LLM_MODEL (openrouter/openai/gpt-5-mini)
- name: fix
run: |
export PATH="$HOME/.local/bin:$PATH"
echo "Using model: ${LLM_MODEL:-openrouter/openai/gpt-5-mini}"
python3 pyqual/custom_fix.py 2>&1 | tee .pyqual/fix_output.log
when: metrics_fail
timeout: 1800
- name: verify
run: vallm batch pyqual tests --recursive --format toon --output ./project
optional: true
when: after_fix
timeout: 300
# Generate metrics report (YAML) and update README.md badges
- name: report
tool: report
when: always
optional: true
# Continuous improvement: process TODO.md items when all gates pass
# Uses parallel execution with multiple tools (Claude Code + llx)
- name: todo_fix
run: python3 -m pyqual.run_parallel_fix
when: metrics_pass
optional: true
timeout: 1800
# Simple git push (goal push had "Argument list too long" issue with many files)
- name: push
run: |
if [ -n "$(git status --porcelain)" ]; then
git add -A
git commit -m "chore: pyqual auto-commit [skip ci]" 2>/dev/null || true
git push origin HEAD
else
echo "No changes to push"
fi
when: after_fix
optional: true
timeout: 120
- name: publish
run: make publish
when: after_fix
optional: true
timeout: 300
- name: close_tasks
run: |
export PYTHONPATH=$PYTHONPATH:.
python3 pyqual/auto_closer.py
planfile sync all
when: after_fix
optional: true
# Generate comprehensive markdown report with Mermaid diagram and ASCII flow
- name: markdown_report
run: python3 -m pyqual.report_generator
when: always
optional: true
timeout: 30
# Loop behavior
loop:
max_iterations: 3
on_fail: report # report | create_ticket | block
# Environment (optional)
env:
LLM_MODEL: openrouter/openai/gpt-5-mini
LLX_DEFAULT_TIER: balanced
LLX_VERBOSE: true