Skip to content

feat(core): add EnforcementMode enum to governance contracts#1727

Merged
viswa-uipath merged 1 commit into
mainfrom
feat/core-enforcement-mode-enum
Jun 17, 2026
Merged

feat(core): add EnforcementMode enum to governance contracts#1727
viswa-uipath merged 1 commit into
mainfrom
feat/core-enforcement-mode-enum

Conversation

@viswa-uipath

Copy link
Copy Markdown
Contributor

Summary

  • Moves the EnforcementMode value type from uipath-runtime-python into uipath.core.governance so any governance consumer (adapters, customer code, other packages) can reference it without taking a dependency on uipath-runtime.
  • Runtime state (_enforcement_mode cache, get_enforcement_mode / set_enforcement_mode / reset_enforcement_mode, UIPATH_GOVERNANCE_MODE env-var resolution) stays in uipath-runtime alongside the policy loader that drives it — only the enum itself is shared.
  • Updates the misleading module docstring in uipath.core.governance.config that previously said enforcement mode lived in the runtime package.
  • Bumps uipath-core to 0.5.19 so uipath-runtime can pin a version floor when it switches to importing the enum from here.

Follow-up

A separate PR in uipath-runtime-python will update src/uipath/runtime/governance/config.py to re-export EnforcementMode from uipath.core.governance instead of redefining it, preventing drift between the two repos.

Test plan

  • uv run ruff check, uv run ruff format --check, uv run mypy from packages/uipath-core/ — all pass
  • uv run pytest tests/governance/ — 18/18 pass, models.py at 100% coverage
  • CI green

🤖 Generated with Claude Code

Copilot AI review requested due to automatic review settings June 17, 2026 07:34
@github-actions github-actions Bot added test:uipath-langchain Triggers tests in the uipath-langchain-python repository test:uipath-runtime test:uipath-integrations labels Jun 17, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 EnforcementMode as an exported governance contract in uipath.core.governance.models.
  • Updates the governance config module docstring to clarify where the enum lives vs where runtime state lives.
  • Bumps uipath-core version to 0.5.19 to 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.

Comment thread packages/uipath-core/src/uipath/core/governance/config.py Outdated
Comment thread packages/uipath-core/src/uipath/core/governance/models.py
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>
@viswa-uipath viswa-uipath force-pushed the feat/core-enforcement-mode-enum branch from a95b480 to a93802c Compare June 17, 2026 08:06
@sonarqubecloud

Copy link
Copy Markdown

@github-actions

Copy link
Copy Markdown

🚨 Heads up: uipath-langchain cross-tests are FAILING 🚨

Your changes may break the uipath-langchain-python integration.

⚠️ These checks are NOT enforced by branch protection rules. Please review the failures before merging.

🔍 Inspect the failed run →

@viswa-uipath viswa-uipath merged commit 1e40891 into main Jun 17, 2026
154 of 169 checks passed
@viswa-uipath viswa-uipath deleted the feat/core-enforcement-mode-enum branch June 17, 2026 08:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test:uipath-integrations test:uipath-langchain Triggers tests in the uipath-langchain-python repository test:uipath-runtime

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants