Skip to content

ci(security): fail closed before package publication - #159

Merged
imran-siddique merged 3 commits into
mainfrom
agent/fail-closed-release-gates
Aug 11, 2026
Merged

imran-siddique merged 3 commits into
mainfrom
agent/fail-closed-release-gates

Conversation

@imran-siddique

Copy link
Copy Markdown
Member

Why

Two release gates could give false confidence: CodeQL analysis was explicitly allowed to fail, and the PyPI workflow published artifacts that had only been built—not installed or exercised. Source tests do not prove the wheel contains the expected schemas or that the sdist builds the same usable package.

What changed

  • remove continue-on-error from CodeQL analysis
  • add a fail-closed artifact verifier
  • install the exact wheel and sdist into separate clean virtual environments outside the checkout
  • compare package metadata and runtime version with the release tag
  • prove imports resolve to the installed artifact rather than checkout source
  • load the packaged schema, validate an example, perform a signing/verification round trip, and reject an unknown security field
  • include the verifier in CI lint scope

Verification

Local reproduction of the release path:

  • built agentrust_trace-0.9.0-py3-none-any.whl
  • installed and verified the wheel in a clean temporary venv
  • built/installed and verified agentrust_trace-0.9.0.tar.gz in a second clean venv
  • source suite: 323 passed, 1 skipped
  • ruff check src tests scripts
  • mypy src/agentrust_trace
  • git diff --check

The publish job still uses PyPI trusted publishing and now cannot reach it unless both artifact checks pass.

@imran-siddique
imran-siddique marked this pull request as ready for review August 11, 2026 15:37
@imran-siddique
imran-siddique merged commit dd1b6e6 into main Aug 11, 2026
5 checks passed
@imran-siddique
imran-siddique deleted the agent/fail-closed-release-gates branch August 11, 2026 15:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant