feat(core): add EnforcementMode enum to governance contracts#1727
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds a shared EnforcementMode enum to uipath-core’s governance contracts so downstream governance consumers can reference a single, common type without depending on uipath-runtime.
Changes:
- Introduces
EnforcementModeas an exported governance contract inuipath.core.governance.models. - Updates the governance config module docstring to clarify where the enum lives vs where runtime state lives.
- Bumps
uipath-coreversion to0.5.19to support consumers pinning a minimum version.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| packages/uipath-core/src/uipath/core/governance/models.py | Adds the EnforcementMode enum alongside other shared governance contracts. |
| packages/uipath-core/src/uipath/core/governance/config.py | Updates module docstring to reflect the enum’s new location and runtime ownership. |
| packages/uipath-core/src/uipath/core/governance/init.py | Re-exports EnforcementMode as part of the public governance surface. |
| packages/uipath-core/pyproject.toml | Bumps package version to 0.5.19. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
radu-mocanu
approved these changes
Jun 17, 2026
8c7ac91 to
a95b480
Compare
Move the EnforcementMode value type into uipath.core.governance so any governance consumer can reference it without depending on uipath-runtime. Runtime state (cached mode, env-var override, get/set/reset helpers) stays in uipath-runtime alongside the policy loader that drives it. The governance models module docstring is broadened to describe the two contract groups now hosted here (output types + config value types), keeping the policy-input separation point intact. The cross-reference in governance/config.py uses the fully-qualified public path so the Sphinx link resolves to the canonical re-export. Bump uipath-core to 0.5.19 and refresh all three package lockfiles so uv sync --locked accepts the new pin; uipath-runtime can pin a floor when it switches to importing the enum from here. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
a95b480 to
a93802c
Compare
|
🚨 Heads up:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
EnforcementModevalue type fromuipath-runtime-pythonintouipath.core.governanceso any governance consumer (adapters, customer code, other packages) can reference it without taking a dependency onuipath-runtime._enforcement_modecache,get_enforcement_mode/set_enforcement_mode/reset_enforcement_mode,UIPATH_GOVERNANCE_MODEenv-var resolution) stays inuipath-runtimealongside the policy loader that drives it — only the enum itself is shared.uipath.core.governance.configthat previously said enforcement mode lived in the runtime package.uipath-coreto0.5.19souipath-runtimecan pin a version floor when it switches to importing the enum from here.Follow-up
A separate PR in
uipath-runtime-pythonwill updatesrc/uipath/runtime/governance/config.pyto re-exportEnforcementModefromuipath.core.governanceinstead of redefining it, preventing drift between the two repos.Test plan
uv run ruff check,uv run ruff format --check,uv run mypyfrompackages/uipath-core/— all passuv run pytest tests/governance/— 18/18 pass,models.pyat 100% coverage🤖 Generated with Claude Code