This repository was archived by the owner on Jul 14, 2026. It is now read-only.
Repository navigation
136 lines (129 loc) · 5.43 KB
/
Copy pathci.yml
File metadata and controls
136 lines (129 loc) · 5.43 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
name: CI
on:
push:
branches: [main]
pull_request:
jobs:
test:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9", "3.13"]
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install
run: pip install -e . pytest
- name: Corpus integrity gate
# The corpus IS the moat. Every rule must link a real upstream PR and
# must not attribute the bug to a specific generator. These invariants
# are gate-enforced here and visible in the CI log; a regression fails
# the build with a named step rather than silently slipping through.
run: |
python -m pytest -v \
tests/test_rules.py::test_corpus_size_and_codes \
tests/test_rules.py::test_every_entry_has_verifiable_upstream_fix_url \
tests/test_rules.py::test_merged_backed_rules_outnumber_open_backed_at_v0_2
- name: Tests
run: python -m pytest -q
- name: Smoke (python -m)
run: python -m aibug_gate --version
- name: Self-scan (default tier — must pass clean on own source)
run: python -m aibug_gate src/aibug_gate tests
- name: Self-scan (pedantic tier — must pass clean on own source)
run: python -m aibug_gate --pedantic src/aibug_gate tests
- name: List rules (exercises corpus load)
run: python -m aibug_gate --list-rules
provenance:
# The product's claim is *auditable* provenance. Pre-v0.2.1 the URL was
# format-gated (regex) but its *resolution* (PR exists + actual
# merged/open state matches the dataset) was author-attested at commit
# time. This job closes that gap by calling the GitHub API for each
# dataset.jsonl entry and asserting the recorded upstream_status matches
# the live PR. A stale status, a typo'd PR number, or a re-opened/denied
# PR fails the build with a named step.
#
# The auto-provided GITHUB_TOKEN has read access to public repos and
# 5000 req/hr budget; 8 entries is trivial.
name: Provenance resolution (PR status matches dataset)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.13"
- name: Resolve each upstream_fix_url and assert status matches
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: python scripts/verify_provenance.py
continue-on-error: false
action:
# Verify the GitHub Action wrapper actually installs+runs from a clean checkout.
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Run aibug-gate action against its own source
uses: ./
with:
paths: src/aibug_gate
pedantic: 'true'
continue-on-error: true # findings exit non-zero; we just want install+run to succeed
lint:
# Style + bugbear gate (mirrors mcp-lint). The 0.2.1 type-widening commit
# passed mypy/ruff locally but CI never *enforced* them, so a future
# regression could slip in silently. This job pins ruff and runs both
# `ruff check` (lint rules) and `ruff format --check` (formatting) over
# the whole tree (src/tests/scripts -- scripts/verify_provenance.py runs
# in the provenance job, so it must stay lint-clean too).
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.13"
- name: Install ruff (pinned)
run: pip install ruff==0.6.9
- name: ruff check
run: ruff check src tests scripts
- name: ruff format
run: ruff format --check src tests scripts
type:
# Static-type gate (mirrors mcp-lint). mypy --strict over the package
# source only; tests are intentionally untyped (the project has never
# shipped type annotations for the test suite, and mypy's value here is
# on the exported surface). A widening of annotations or a new untyped
# public symbol fails here before release.
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.13"
- name: Install mypy (pinned)
run: pip install mypy==1.13.0
- name: mypy --strict
run: mypy --strict src/aibug_gate
corpus:
# FP-stability gate (mirrors mcp-lint). Installs four pinned real-world
# Pallets packages (flask/jinja2/click/werkzeug) into a throwaway venv,
# runs ALL aibug-gate rules (pedantic tier) against each package's source,
# and compares per-rule finding counts to scripts/corpus_baseline.json.
# A checker change that drifts the counts -- a guard-detection regression
# that silences a tracked hit, or a broadening that floods the corpus --
# fails here before a tag is cut. The adversarial review flagged the
# missing FP-rate measurement; this gate is the discipline that closes it.
# See RELEASING.md and scripts/corpus_diff.py for the update protocol.
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.13"
- name: Install uv
run: pip install uv
- name: Install package (editable, for in-process scan_source)
run: pip install -e .
- name: Corpus gate (drift vs baseline)
run: uv run python scripts/corpus_diff.py