ci: add dependency audit workflow
Part of splitting #2442 into smaller, dedicated PRs. This is the original #2438 ask — the dependency-audit workflow — re-derived against current main.
What
- New
.github/workflows/security.ymlwith dependency-audit coverage split by trigger:- push / PR / manual: one deterministic
dependency-auditjob audits the committed.github/security-audit-requirements.txtsnapshot withpip-audit --require-hashes. - weekly schedule:
dependency-audit-scheduledcompiles the runtime +testdependency set live per(os, python)matrix entry (ubuntu/windows× 3.11/3.12/3.13) and audits that, to catch newly published advisories the committed snapshot wouldn't.
- push / PR / manual: one deterministic
.github/scripts/check_security_requirements.py: a sync gate that fails a PR which changedpyproject.toml(or the snapshot) without regenerating the committed requirements..github/security-audit-requirements.txt: the committed--universal --generate-hashessnapshot (generated against currentmain).tests/test_security_workflow.py: static guards for the jobs, matrix, pins, hashed snapshot, and the sync script. Triggers are asserted by inclusion so the follow-up baseline-gate PR can addlabeled/unlabeledwithout rewriting the test.CONTRIBUTING.md: a "Security checks" subsection documenting the local commands.
Why
Gives CI a deterministic dependency-advisory signal on every PR plus a live scheduled sweep, without a lockfile or redundant PR matrix runs.
Validation
tests/test_security_workflow.py— 12 passed.uvx ruff check .github/scripts/check_security_requirements.py tests/test_security_workflow.pyis clean.pip-audit --require-hashesagainst the committed snapshot reports no known vulnerabilities.- A fresh
uv pip compile ... --no-headeris byte-identical to the committed snapshot (sync gate passes). - Actions pinned to commit SHAs (
actions/checkoutaligned to the repo-standard9c091bb... # v7.0.0).
Bandit + secret-scan gates are deliberately not here — they come in a follow-up PR so each gate reviews on its own. Independent of the other split PRs.
Disclosure: Updated on behalf of @PascalThuet by Codex (model: GPT-5, autonomous).
Please address Copilot feedback
Security audit review summary
Audit feedback addressed
- Full checkout history keeps dependency diff bases available.
- Missing
GENERATED_REQUIREMENTSconfiguration now fails with an actionable message. setup-pythonandsetup-uvuse the repository-standard pinned SHAs.- The scheduled audit matrix now covers Python 3.11, 3.12, 3.13, and 3.14 on Ubuntu and Windows.
Failed check resolution
The previous Dependency audit failure was caused by a genuinely stale committed requirements snapshot. It has been regenerated from current main, and the sync gate now accepts it.
Validation
- Security/static workflow tests: 17 passed
- Full suite: 4,446 passed, 112 skipped
- Ruff: passed
- Snapshot sync gate: passed
pip-audit: no known vulnerabilities foundgit diff --check: passed
Head commit: 6c6ab783c49faf330d5262f007057626ed11631b
Posted on behalf of @PascalThuet by Codex (model: GPT-5, autonomous).
@mnriem
One maintenance-policy question surfaced while rebasing this PR: pyproject.toml still declares Python >=3.11, while the functional CI matrix currently tests only Python 3.13 and 3.14. The scheduled security audit covers 3.11 through 3.14.
Could you confirm whether Python 3.11 and 3.12 remain officially supported, or are merely installable without CI guarantees?
Depending on the intended policy, we could either retain 3.11–3.14 in the scheduled audit or align it with the functional CI matrix.
Separately, the rebase exposed version drift for pinned actions between workflows (setup-uv v8.2.0 versus the repository-standard v8.3.2). This PR now aligns them, but a shared consistency check or documented convention could prevent future drift
Addressed the latest Copilot review round.
The contributor guidance now explicitly describes the pip-audit command as auditing the committed snapshot and requires dependency changes to refresh and commit that snapshot before auditing. I also regenerated the snapshot to incorporate platformdirs 4.11.0, which fixes the current dependency-audit sync failure.
Validation: 17 security/workflow tests passed; the snapshot sync gate passed; pip-audit reported no known vulnerabilities; git diff --check passed. Markdownlint still reports two pre-existing fence-style findings at CONTRIBUTING.md:180 and CONTRIBUTING.md:194, outside this change.
Commit: 7032366caaf5e1c492d6777999882124f9e2a37f
Posted on behalf of @PascalThuet by Codex (model: GPT-5, autonomous).
@mnriem
One maintenance-policy question surfaced while rebasing this PR: pyproject.toml still declares Python >=3.11, while the functional CI matrix currently tests only Python 3.13 and 3.14. The scheduled security audit covers 3.11 through 3.14.
Could you confirm whether Python 3.11 and 3.12 remain officially supported, or are merely installable without CI guarantees?
They are supported indeed without direct CI guarantee. If a bug shows up, we will fix it. As those 2 versions are already security fixes only from Python perspective, we do not anticipate that to occur regularly.
Depending on the intended policy, we could either retain 3.11–3.14 in the scheduled audit or align it with the functional CI matrix.
If it does not cause extra churn include 3.11 and 3.12
Separately, the rebase exposed version drift for pinned actions between workflows (setup-uv v8.2.0 versus the repository-standard v8.3.2). This PR now aligns them, but a shared consistency check or documented convention could prevent future drift
The alignment will be forced by updates needed for the GitHub agentic workflows on the one hand and the Dependabot fixes on the other hand
Thank you!