Skip to content

Commit da282a9

Browse files
viswa-uipathclaude
andcommitted
refactor(core): drop AdapterRegistry + BaseAdapter; keep EvaluatorProtocol
The adapter-registry plugin-discovery system in uipath-core was a parallel keyed-by-agent-type dispatcher for a fact already known statically: the runtime-factory registry has picked the framework by the time anything needs an "adapter". The two registries existed only to support an open-PR pattern (#125/#126) where the runtime layer sniffed the framework off an opaque agent. With that approach abandoned in favor of framework plugins wiring governance at their native seam (callback handlers, hook lists), the registry, the BaseAdapter abstraction, and their per-package entry-point group are all dead weight. Deletions - src/uipath/core/adapters/base.py — BaseAdapter + GovernedAgentBase. No internal consumers; the only external one (uipath-langchain PR #899) is unmerged and is being reshaped to consume EvaluatorProtocol directly via its factory. - src/uipath/core/adapters/registry.py — AdapterRegistry, get_adapter_registry, reset_adapter_registry, the `uipath.governance.adapters` entry-point group, and the side-effect discovery on first call. - tests/adapters/test_base.py and tests/adapters/test_registry.py. Kept - src/uipath/core/adapters/evaluator.py — EvaluatorProtocol is the one contract framework plugins still consume. Plugin factories accept an evaluator at create_runtime() time and wire it into their own callback seam. - tests/adapters/test_evaluator.py — protocol-conformance unchanged. Net diff: ~960 LOC removed. uipath-core 0.5.22 → 0.5.23. uv.lock files regenerated in uipath-core, uipath-platform, and uipath (workspace editable-path deps, so they pick up 0.5.23 immediately). Verified: ruff clean, mypy clean (45 source files), 230 passed + 1 skipped in uipath-core's test suite. Monorepo grep for AdapterRegistry / BaseAdapter / GovernedAgentBase / get_adapter_registry / reset_adapter_registry returns zero hits outside the deleted files across .py/.toml/.md/.rst/.json. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent ab8b772 commit da282a9

9 files changed

Lines changed: 12 additions & 974 deletions

File tree

packages/uipath-core/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[project]
22
name = "uipath-core"
3-
version = "0.5.22"
3+
version = "0.5.23"
44
description = "UiPath Core abstractions"
55
readme = { file = "README.md", content-type = "text/markdown" }
66
requires-python = ">=3.11"

packages/uipath-core/src/uipath/core/adapters/__init__.py

Lines changed: 6 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,34 +2,19 @@
22
33
This package holds only the abstract contracts — concrete adapter
44
implementations live in framework-specific plugin packages (e.g.
5-
``uipath-langchain``, ``uipath-openai``) that target the framework they
6-
integrate with. Plugin packages register their concrete adapters with
7-
the global :class:`AdapterRegistry` via the
8-
``uipath.governance.adapters`` entry-point group.
5+
``uipath-langchain``, ``uipath-openai``). A framework plugin is the one
6+
that knows its own native wiring seam (callback handler list, hook
7+
registry, …) and installs governance there directly; uipath-core only
8+
defines the protocol an evaluator must satisfy.
99
1010
Public surface:
1111
12-
- :class:`BaseAdapter` – abstract base every adapter inherits from.
13-
- :class:`GovernedAgentBase` – proxy base for governed agent wrappers.
14-
- :class:`EvaluatorProtocol` – structural protocol the adapter expects
15-
from any policy evaluator.
16-
- :class:`AdapterRegistry` – ordered list of adapters that resolves
17-
the first match for a given agent.
12+
- :class:`EvaluatorProtocol` – structural protocol the framework
13+
plugin expects from any policy evaluator.
1814
"""
1915

20-
from .base import BaseAdapter, GovernedAgentBase
2116
from .evaluator import EvaluatorProtocol
22-
from .registry import (
23-
AdapterRegistry,
24-
get_adapter_registry,
25-
reset_adapter_registry,
26-
)
2717

2818
__all__ = [
29-
"BaseAdapter",
30-
"GovernedAgentBase",
3119
"EvaluatorProtocol",
32-
"AdapterRegistry",
33-
"get_adapter_registry",
34-
"reset_adapter_registry",
3520
]

packages/uipath-core/src/uipath/core/adapters/base.py

Lines changed: 0 additions & 116 deletions
This file was deleted.

packages/uipath-core/src/uipath/core/adapters/registry.py

Lines changed: 0 additions & 176 deletions
This file was deleted.

0 commit comments

Comments
 (0)