Skip to content

Commit adec3d8

Browse files
fix(ci/parity-guards): unblock registry-drift + soften citation-audit
Self-review of 200c9e6 surfaced three concrete defects: 1. ``registry-drift`` installed ``pip install -e .`` (no ``[dev]``) but then invoked ``pytest``. Two failures stacked: pyproject's pytest ``addopts`` injects ``--cov`` unconditionally (needs ``pytest-cov``), and ``pytest`` itself is only in ``[dev]``. Switched to ``pip install -e ".[dev]"``. 2. ``citation-audit`` ran with ``--strict``, which exits non-zero on unresolved citations as well as mismatches. ``--strict`` conflates "fabricated citation" (§10 red line, *should* fail) with "network glitch on a cold arxiv / crossref endpoint" (transient, *should not* fail). Drop ``--strict`` so only mismatches block. Recent commits (476d6f9, 8faacd7) had already paid for this distinction. 3. None of the three jobs had ``timeout-minutes``, so a hung pip install or hung arxiv request could burn the GitHub Actions default 6-hour ceiling per shard. Added 10 / 15 / 30 min bounds. Plus a noise reduction: ``citation-audit`` now runs only when files that can carry citations actually change (``src/``, ``docs/``, ``paper.md`` / ``paper.bib``, top-level README / CHANGELOG / MIGRATION, or the auditor itself). Rust / benchmarks / .gitignore commits no longer trigger 167+ outbound API calls. The audit report is uploaded as an artifact whether the job passes or fails so a reviewer can read unresolved entries without re-running. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 200c9e6 commit adec3d8

1 file changed

Lines changed: 43 additions & 4 deletions

File tree

.github/workflows/parity-guards.yml

Lines changed: 43 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ jobs:
2525
reference-parity:
2626
name: Numerical reference parity
2727
runs-on: ubuntu-latest
28+
timeout-minutes: 30
2829
steps:
2930
- uses: actions/checkout@v4
3031
- name: Set up Python
@@ -49,16 +50,19 @@ jobs:
4950
registry-drift:
5051
name: Registry / API surface drift
5152
runs-on: ubuntu-latest
53+
timeout-minutes: 10
5254
steps:
5355
- uses: actions/checkout@v4
5456
- name: Set up Python
5557
uses: actions/setup-python@v5
5658
with:
5759
python-version: "3.10"
58-
- name: Install (minimal — registry boot only)
60+
# ``[dev]`` is required: pyproject ``tool.pytest.ini_options.addopts``
61+
# injects ``--cov`` unconditionally, which needs ``pytest-cov``.
62+
- name: Install
5963
run: |
6064
python -m pip install --upgrade pip
61-
pip install -e .
65+
pip install -e ".[dev]"
6266
- name: registry_stats --check
6367
run: |
6468
python scripts/registry_stats.py --check
@@ -68,17 +72,52 @@ jobs:
6872
6973
citation-audit:
7074
name: Citation audit (§10 zero-hallucination)
75+
# ``--strict`` would conflate "fabricated citation" (mismatch — the real
76+
# §10 red line) with "network glitch" (unresolved). Run in the default
77+
# mismatch-only mode so transient arxiv / crossref / NBER outages don't
78+
# paint the gate red. Unresolved entries are still surfaced in the
79+
# audit_report.md artifact for human follow-up.
7180
runs-on: ubuntu-latest
81+
timeout-minutes: 15
82+
# Per-step ``paths-filter`` skips the network-heavy verification when no
83+
# citation-bearing file changed (e.g. rust/, benchmarks/, .gitignore).
84+
# This bounds outbound API load and reduces transient arxiv / crossref
85+
# outage flake on unrelated commits.
7286
steps:
7387
- uses: actions/checkout@v4
88+
- name: Detect citation-bearing changes
89+
id: changes
90+
uses: dorny/paths-filter@v3
91+
with:
92+
filters: |
93+
cite:
94+
- 'src/**'
95+
- 'docs/**'
96+
- 'paper.md'
97+
- 'paper.bib'
98+
- 'README.md'
99+
- 'README_CN.md'
100+
- 'CHANGELOG.md'
101+
- 'MIGRATION.md'
102+
- 'tools/audit_citations.py'
74103
- name: Set up Python
104+
if: steps.changes.outputs.cite == 'true'
75105
uses: actions/setup-python@v5
76106
with:
77107
python-version: "3.10"
78108
- name: Install
109+
if: steps.changes.outputs.cite == 'true'
79110
run: |
80111
python -m pip install --upgrade pip
81112
pip install -e ".[dev]"
82-
- name: tools/audit_citations.py --strict
113+
- name: tools/audit_citations.py (mismatch-only)
114+
if: steps.changes.outputs.cite == 'true'
83115
run: |
84-
python tools/audit_citations.py --strict
116+
python tools/audit_citations.py
117+
- name: Upload audit report
118+
if: steps.changes.outputs.cite == 'true' && (success() || failure())
119+
uses: actions/upload-artifact@v4
120+
with:
121+
name: citation-audit-report
122+
path: audit_report.md
123+
if-no-files-found: ignore

0 commit comments

Comments
 (0)