Repository navigation
fix(core): fix dependency pins blocking agent-governance-toolkit-core installs - #4017
Conversation
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
PR Review Summary
Verdict: AI review comments are untrusted advisory output. The summary reports workflow-generated completion status only, not model-authored pass/fail claims. |
agent-governance-toolkit-core's dependencies pin agt-policies>=5.1.0,<6.0,
which in turn pins agent-control-specification>=0.4.0b0,<0.5.0. Neither
version is published to PyPI (PyPI tops out at agt-policies 5.0.0 and
agent-control-specification 0.3.1b1), so a plain
'pip install agent-governance-toolkit-core' or '[full]' cannot resolve.
agt-policies backs only the v4-to-ACS manifest migration CLI ('agt
migrate'). Nothing in agentmesh.governance (govern(), GovernanceDenied,
policy.py/PolicyEngine) imports agt or agent_control_specification -
confirmed by grepping agent-mesh/src/agentmesh/ for both. The base
governance runtime does not need this dependency at all.
Moves it to a new 'migrate' extra instead, matching the existing
optional-dependencies pattern for other CLI/framework-specific pieces
(mcp, redis, django, etc.). Verified: a clean venv can now
'pip install agent-governance-toolkit-core[full]' and exercise
govern()'s contains/startswith/endswith operators (microsoft#3924) end-to-end
without agt-policies or agent-control-specification installed at all.
Signed-off-by: karimad <kmehaleb@gmail.com>
Signed-off-by: karimad <kmehaleb@gmail.com>
Review caught that agent_os (force-included into this same wheel) imports agent_control_specification directly in 4 places: providers.py, cmd_validate.py, _native_adapter_runtime.py, and openai_agents_sdk.py. That package previously arrived only transitively via agt-policies's own pin, which the prior commit removed from the base dependency set - trading the original unresolvable-install failure for a quieter ImportError at runtime the moment agent_os actually exercised one of those paths. Fix: declare agent-control-specification>=0.3.1b0,<0.4.0 directly in agent-governance-toolkit-core's own dependencies, matching the range agt-policies 5.0.0 already resolved to before microsoft#3939. Verified in a clean venv: all four previously-broken agent_os modules import cleanly, and cmd_validate.py's _validate_manifest() actually runs end-to-end (not just import-checked). govern()'s contains/startswith/endswith path (microsoft#3924) still passes both the deny and allow cases. One related, pre-existing gap surfaced during this verification and is NOT fixed here (out of scope for a packaging PR): _native_adapter_runtime .py's _session_for() imports HostSession from agent_control_specification, which genuinely does not exist in any published release yet (checked 0.3.1b1's exports directly). That call path was already broken before this PR - it depends on ACS 0.4.0b0's API regardless of how the agt-policies/agent-control-specification pins are arranged - so it's unaffected by this change either way. Also: moved the new 'migrate' extra out from under the '--- Bundles ---' header (it's a single-package extra like redis/django, not a bundle), and added a CHANGELOG.md [Unreleased]/Fixed entry. Signed-off-by: karimad <kmehaleb@gmail.com>
Signed-off-by: karimad <kmehaleb@gmail.com>
The migrate extra's agt-policies>=5.1.0,<6.0 pin predates this PR and is unchanged by it. It's still unresolvable on its own today (agt-policies 5.1.0 isn't published), and will conflict with this PR's new base ACS pin once it is (agt-policies would then require ACS>=0.4.0b0, base requires <0.4.0). Documented in the CHANGELOG and the extra itself, tracked in microsoft#4019 so it isn't rediscovered fresh. Signed-off-by: Karim Mehalebi <kmehalebi@egencia.com>
Signed-off-by: Karim Mehalebi <kmehalebi@egencia.com>
57f422d to
7211fb9
Compare
|
Azure Pipelines: There may be pipelines that require an authorized user to comment /azp run to run. |
…requires Reviewer found 0.3.1b1 lacks HostSession and rejects every in-repo manifest, breaking the adapter runtime and agent-os validate despite the install itself resolving. Update the base pin and changelog entry to match. Signed-off-by: Karim Mehalebi <kmehaleb@gmail.com>
34329fe to
d7419b7
Compare
39da963 to
bc1d80c
Compare
MohammadHaroonAbuomar
left a comment
There was a problem hiding this comment.
- Commit be9c593 has no
Signed-off-bytrailer, so the DCO check will fail once the gated runs execute. Pleasegit rebase --signoff origin/main(or amend that commit with--signoff) and force-push. Blocking; everything else is in place. - scripts/ci/check_native_policy_wheels.py:80 asserts
"Requires-Dist: agt-policies" in metadata; after this change only the; extra == 'migrate'line satisfies it, so the check no longer proves what it was written for. Assert the fullRequires-Dist: agt-policies<6.0,>=5.1.0; extra == 'migrate'line, or drop the assertion. Non-blocking.
bc1d80c to
2725cd6
Compare
all fixed thanks |
MohammadHaroonAbuomar
left a comment
There was a problem hiding this comment.
Verified at 3e22d99: every commit now carries a matching sign-off, the pyproject comment is updated, and the one-line test key change in tests/ci/test_release_tooling.py is the fix main's #3939 test needs (25 pass). The base pin matches agt-policies 5.1.0's range; install coherence passes. The check_native_policy_wheels.py assertion note stays open as a follow-up, not a blocker. The docker-compose-test failure was the known relay knock flake, green on rerun. Thanks.
26aaf36
into
microsoft:main
… installs (microsoft#4017) * fix(core): move agt-policies to an opt-in extra, not a base dependency agent-governance-toolkit-core's dependencies pin agt-policies>=5.1.0,<6.0, which in turn pins agent-control-specification>=0.4.0b0,<0.5.0. Neither version is published to PyPI (PyPI tops out at agt-policies 5.0.0 and agent-control-specification 0.3.1b1), so a plain 'pip install agent-governance-toolkit-core' or '[full]' cannot resolve. agt-policies backs only the v4-to-ACS manifest migration CLI ('agt migrate'). Nothing in agentmesh.governance (govern(), GovernanceDenied, policy.py/PolicyEngine) imports agt or agent_control_specification - confirmed by grepping agent-mesh/src/agentmesh/ for both. The base governance runtime does not need this dependency at all. Moves it to a new 'migrate' extra instead, matching the existing optional-dependencies pattern for other CLI/framework-specific pieces (mcp, redis, django, etc.). Verified: a clean venv can now 'pip install agent-governance-toolkit-core[full]' and exercise govern()'s contains/startswith/endswith operators (microsoft#3924) end-to-end without agt-policies or agent-control-specification installed at all. Signed-off-by: karimad <kmehaleb@gmail.com> * trim comment on the migrate extra Signed-off-by: karimad <kmehaleb@gmail.com> * fix(core): give agent-control-specification its own base dependency Review caught that agent_os (force-included into this same wheel) imports agent_control_specification directly in 4 places: providers.py, cmd_validate.py, _native_adapter_runtime.py, and openai_agents_sdk.py. That package previously arrived only transitively via agt-policies's own pin, which the prior commit removed from the base dependency set - trading the original unresolvable-install failure for a quieter ImportError at runtime the moment agent_os actually exercised one of those paths. Fix: declare agent-control-specification>=0.3.1b0,<0.4.0 directly in agent-governance-toolkit-core's own dependencies, matching the range agt-policies 5.0.0 already resolved to before microsoft#3939. Verified in a clean venv: all four previously-broken agent_os modules import cleanly, and cmd_validate.py's _validate_manifest() actually runs end-to-end (not just import-checked). govern()'s contains/startswith/endswith path (microsoft#3924) still passes both the deny and allow cases. One related, pre-existing gap surfaced during this verification and is NOT fixed here (out of scope for a packaging PR): _native_adapter_runtime .py's _session_for() imports HostSession from agent_control_specification, which genuinely does not exist in any published release yet (checked 0.3.1b1's exports directly). That call path was already broken before this PR - it depends on ACS 0.4.0b0's API regardless of how the agt-policies/agent-control-specification pins are arranged - so it's unaffected by this change either way. Also: moved the new 'migrate' extra out from under the '--- Bundles ---' header (it's a single-package extra like redis/django, not a bundle), and added a CHANGELOG.md [Unreleased]/Fixed entry. Signed-off-by: karimad <kmehaleb@gmail.com> * shorten comments Signed-off-by: karimad <kmehaleb@gmail.com> * docs: disclose still-unresolvable migrate-extra pin, file tracking issue The migrate extra's agt-policies>=5.1.0,<6.0 pin predates this PR and is unchanged by it. It's still unresolvable on its own today (agt-policies 5.1.0 isn't published), and will conflict with this PR's new base ACS pin once it is (agt-policies would then require ACS>=0.4.0b0, base requires <0.4.0). Documented in the CHANGELOG and the extra itself, tracked in microsoft#4019 so it isn't rediscovered fresh. Signed-off-by: Karim Mehalebi <kmehalebi@egencia.com> * docs: tell agt migrate users they now need the migrate extra Signed-off-by: Karim Mehalebi <kmehalebi@egencia.com> * fix(core): pin agent-control-specification to 0.4.0b0 range agent_os requires Reviewer found 0.3.1b1 lacks HostSession and rejects every in-repo manifest, breaking the adapter runtime and agent-os validate despite the install itself resolving. Update the base pin and changelog entry to match. Signed-off-by: Karim Mehalebi <kmehaleb@gmail.com> --------- Signed-off-by: karimad <kmehaleb@gmail.com> Signed-off-by: Karim Mehalebi <kmehalebi@egencia.com> Signed-off-by: Karim Mehalebi <kmehaleb@gmail.com> Co-authored-by: Karim Mehalebi <kmehalebi@egencia.com> Signed-off-by: yuvrajsingh2428 <offcyuvi2428@gmail.com>
Related Issue
None filed for the original problem yet — happy to file one if maintainers would rather track this separately before review. Filed #4019 for a follow-on gap this PR discloses but doesn't close (see "Known remaining gap" below).
Problem & Solution
Problem:
agent-governance-toolkit-core'sdependenciespinagt-policies>=5.1.0,<6.0(bumped in #3939).agt-policies's ownmainpinsagent-control-specification>=0.4.0b0,<0.5.0. Neither version is published to PyPI — PyPI tops out atagt-policies==5.0.0andagent-control-specification==0.3.1b1— so a plainpip install agent-governance-toolkit-core(or the[full]extra) cannot resolve today. This is the same recurring bug class as #3414 (closed) and #3733 (open), just a different pair of packages, and it isn't covered by either.I hit this trying to depend on the fix from #3924 (merged, adds
contains/startswith/endswithto the condition DSL) from an external project — there's currently no way topip install/uv syncto a commit containing that fix without a--no-depsgit overlay.Solution:
agt-policiesbacks only the v4-to-ACS manifest migration CLI (agt migrate). I greppedagent-mesh/src/agentmesh/(wheregovern(),GovernanceDenied, andpolicy.py/PolicyEngineactually live) for any import ofagtoragent_control_specification— there are none. The base governance runtime doesn't use this dependency at all; it was pulled into the required set as part of the "merged dependencies" consolidation, not because anything imports it. This PR movesagt-policiesout ofdependenciesand into a newmigrateoptional-dependency extra, matching the existing pattern already used for other CLI/framework-specific pieces (mcp,redis,django, etc.).agent_os(force-included into this same wheel), which directly importsagent_control_specificationinproviders.py,cli/cmd_validate.py,integrations/_native_adapter_runtime.py, andintegrations/openai_agents_sdk.py— it previously received that package only transitively viaagt-policies. Fixed by declaringagent-control-specification>=0.3.1b0,<0.4.0as its own direct base dependency, matching the currently-published range.fulldoes not pull inmigrate, sopip install agent-governance-toolkit-core[full]resolves cleanly against what's actually published today.Known remaining gap: the
migrateextra's ownagt-policies>=5.1.0,<6.0pin is untouched by this PR and is still unresolvable on its own (5.1.0 isn't published), and will conflict with this PR's new baseagent-control-specificationpin once it is (5.1.0 will require ACS>=0.4.0b0, base here requires<0.4.0). There's no ACS release yet that both sides could share, so this isn't fixable in this PR — documented in the CHANGELOG and next to the extra, tracked in #4019.Impact on Your Work
Blocked me from cleanly depending on the #3924 fix in a downstream project without a manual
--no-depsoverlay script. Filing this so the next person hitting the same resolver error doesn't have to reinvent that workaround.Timeline
None.
Alternatives Considered
Widening the base
agent-control-specificationpin to accept the unpublished0.4.0b0beta instead of pinning the currently-published0.3.1b1range — rejected because it would just reintroduce the same "depends on something PyPI doesn't have" problem this PR is fixing, one level down.Type of Change
Package(s) Affected
Testing
Unit Testing
No new tests added — packaging-only change. Ran the existing suite covering the condition DSL and
govern()(test_policy_rule_string_operators.py,test_govern.py, 51 passed) against a venv built from this branch to confirm nothing regressed.Manual Testing
In a clean venv, built from this branch's local source:
resolves and installs successfully (confirmed via
pip show:agent-control-specificationis present at0.3.1b1;agt-policiesis absent, as expected).Then verified the actual governance path still works end-to-end in that same venv:
Both the
containsdeny path (#3924) and the benign allow path passed.Also confirmed
agent_os's own use ofagent_control_specificationstill works (agent_os.cli.cmd_validate._validate_manifest()runs end-to-end), and thatagt-policiesis still installable and pinned correctly when explicitly requested via the new extra (agent-governance-toolkit-core[migrate]) — this PR only changes when it's pulled in, not the pin itself.Checklist
pyproject.toml/CHANGELOG.mdonlyAttribution & Prior Art
Prior art / related projects (if any):
None — this mirrors the repo's own existing extras pattern (
mcp,redis,django).AI Assistance
AI tools were used to draft the diagnosis, code changes, commit messages, and this description; I reviewed and verified every change myself (see Testing) before pushing.
IP, Patents, and Licensing