Skip to content

ci: install CI dependencies from hash-pinned locks - #156

Merged
imran-siddique merged 3 commits into
mainfrom
ci/hash-pinned-pip
Sep 7, 2026
Merged

ci: install CI dependencies from hash-pinned locks#156
imran-siddique merged 3 commits into
mainfrom
ci/hash-pinned-pip

Conversation

@imran-siddique

Copy link
Copy Markdown
Member

Same pattern as agentrust-io/trace-registry#67, trace-tests#101, trace-spec#302, agentrust-telemetry#50 and cmcp#620 — all merged and green.

Five locks under requirements/, all installed with --require-hashes, which is all-or-nothing: pip refuses if any requirement, transitive included, lacks a hash.

The AGT venv needs two locks, and that is the interesting part

AGT 4.1 declares cryptography>=46.0.7,<49.0. This runtime requires >=50.0. They cannot be resolved together at all — uv says so outright:

because agent-governance-toolkit[full]>=4.1.0 depends on cryptography>=46.0.7,<49.0
and you require cryptography>=50.0, we can conclude that your requirements are unsatisfiable

That is precisely why the scanner already lived in its own venv behind an unpinned --upgrade --no-deps "cryptography>=50.0". The structure was right; only the pinning was missing.

  • agt.txt — AGT's own resolution, landing on cryptography 48.0.1
  • agt-override.txt — lifts it to 50.0.1 inside that venv with --no-deps

Verified end to end: after agt.txt the venv reports 48.0.1, after the override 50.0.1. Same isolation as before, both halves now pinned.

A test had to move with it

test_governance_tooling_cannot_downgrade_runtime_dependencies asserted on the literal install lines, so it failed on the new shape while the invariant it guards was completely intact.

Rewritten to assert the invariant rather than the text: AGT appears only via its lock, never in the environment holding the package under test. A companion test checks the override lock really carries a cryptography at or above 50.0, so the two halves cannot silently drift apart.

Also

setuptools is pinned rather than left to the runner. Dropping the --upgrade pip setuptools prefix would otherwise freeze the image's copy, and pip-audit flags 79.0.1 for PYSEC-2026-3447 — which is exactly what caught me on cmcp#620.

dist/*.whl and dist/*.tar.gz installs are left alone; they install what the job just built.

Verification

Clean venvs: 564 passed, 2 skipped, and the AGT two-step reproduces 48.0.1 then 50.0.1. actionlint clean.

🤖 Generated with Claude Code

https://claude.ai/code/session_01XbDBXDWWvMFa7c2jGgyq9t

Same pattern as trace-registry, trace-tests, trace-spec,
agentrust-telemetry and cmcp.

Five locks under requirements/, all installed with --require-hashes,
which is all-or-nothing: pip refuses if any requirement, transitive
included, lacks a hash.

The AGT venv needs two of them, and that is the part worth reading. AGT
4.1 declares cryptography>=46.0.7,<49.0 while this runtime requires
>=50.0, so the two cannot be resolved together at all; uv refuses. That
is exactly why the scanner already lived in its own venv with an unpinned
--upgrade --no-deps override. agt.txt is AGT's own resolution, which
lands on cryptography 48.0.1, and agt-override.txt lifts it to 50.0.1
inside that venv with --no-deps. Same isolation as before, both halves
now pinned.

test_governance_tooling_cannot_downgrade_runtime_dependencies asserted on
the literal install lines, so it failed on the new shape while the
invariant it guards was intact. It now asserts the isolation itself: AGT
appears only via its lock, never in the environment holding the package,
and a companion test checks the override lock really carries a
cryptography at or above 50.0.

setuptools is pinned rather than left to the runner, since dropping the
--upgrade prefix would otherwise freeze the image's copy and pip-audit
flags 79.0.1 for PYSEC-2026-3447.

The two installs of dist/*.whl and dist/*.tar.gz are left alone: they
install what the job just built.

Verified in clean venvs: 564 passed, 2 skipped, and the AGT two-step
reproduces 48.0.1 then 50.0.1.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XbDBXDWWvMFa7c2jGgyq9t
@imran-siddique
imran-siddique requested a review from a team as a code owner September 7, 2026 02:22
imran-siddique and others added 2 commits September 6, 2026 21:00
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XbDBXDWWvMFa7c2jGgyq9t
The file has mixed line endings in its blob. Rewriting it through a
normalizing write turned a 24-line change into a 242-line one, which
buries the actual edit. Reapplied byte-precisely against the committed
bytes, preserving each line ending as it was.

No behaviour change from the previous commit on this branch; only the
diff shrinks to what actually changed.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XbDBXDWWvMFa7c2jGgyq9t
@imran-siddique
imran-siddique merged commit a2042d1 into main Sep 7, 2026
12 checks passed
@imran-siddique
imran-siddique deleted the ci/hash-pinned-pip branch September 7, 2026 04:07
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