Skip to content

test: add protocol conformance pins for runtime implementations#987

Merged
vldcmp-uipath merged 1 commit into
mainfrom
test/runtime-protocol-conformance
Jul 14, 2026
Merged

test: add protocol conformance pins for runtime implementations#987
vldcmp-uipath merged 1 commit into
mainfrom
test/runtime-protocol-conformance

Conversation

@vldcmp-uipath

Copy link
Copy Markdown
Contributor

Summary

Static conformance pins for this repo's uipath-runtime protocol implementations: UiPathLangGraphRuntime, UiPathLangGraphRuntimeFactory, and SqliteResumableStorage, plus the platform's UiPathResumeTriggerHandler as wired here.

Each protocol-annotated assignment is a typed boundary: mypy verifies the implementation against the protocol surface of the installed uipath-runtime version. When a future runtime bump adds or changes protocol members (the uipath-runtime#138 / uipath-python#1764 scenario — the missing create_triggers crash originated in this repo's factory wiring), the ordinary mypy job fails on these pre-existing lines, naming the exact class and missing member — no one needs to know about the protocol change in advance.

The test mirrors UiPathLangGraphRuntimeFactory._create_runtime_instance with real objects (compiled StateGraph, in-memory AsyncSqliteSaver, real trigger handler) flowing into UiPathResumableRuntime — the exact production composition that broke in the incident, expressed entirely as typed boundaries. Construction-only: no runtime behavior is exercised.

Verification

Simulated a protocol change by installing a locally modified uipath-runtime (new create_triggers_v2 member on UiPathResumeTriggerCreatorProtocol): mypy failed on the trigger_manager pin naming create_triggers_v2. Restored to the lockfile: green. Tests pass, mypy and ruff clean.

🤖 Generated with Claude Code

Typed assignments that make mypy verify each implementation against the
protocol surface of the installed uipath-runtime version. A dependency
bump that adds or changes protocol members fails typecheck on these
lines until the implementations catch up, without this file changing.

Covers UiPathLangGraphRuntime, UiPathLangGraphRuntimeFactory and
SqliteResumableStorage, wired through UiPathResumableRuntime exactly as
in UiPathLangGraphRuntimeFactory._create_runtime_instance.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Copilot AI review requested due to automatic review settings July 14, 2026 07:22

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Adds a new test module that “pins” protocol conformance for this repo’s uipath-runtime integrations by creating protocol-typed assignment boundaries that mypy can validate against the installed uipath-runtime protocol surfaces.

Changes:

  • Introduces protocol-annotated assignments for UiPathLangGraphRuntime, UiPathLangGraphRuntimeFactory, SqliteResumableStorage, and UiPathResumeTriggerHandler wiring.
  • Builds a minimal compiled StateGraph + in-memory AsyncSqliteSaver composition to reflect the production runtime factory wiring (construction-only).

value: str


async def test_langgraph_wiring_satisfies_runtime_protocols() -> None:
construction-only: no runtime behavior is exercised here.
"""

from typing import TypedDict
Comment on lines +45 to +51
delegate: UiPathRuntimeProtocol = UiPathLangGraphRuntime(
graph=compiled_graph,
runtime_id="protocol-conformance-test",
entrypoint="test",
)
storage: UiPathResumableStorageProtocol = SqliteResumableStorage(memory)
trigger_manager: UiPathResumeTriggerProtocol = UiPathResumeTriggerHandler()
@sonarqubecloud

Copy link
Copy Markdown

@vldcmp-uipath vldcmp-uipath merged commit 3338b18 into main Jul 14, 2026
72 of 73 checks passed
@vldcmp-uipath vldcmp-uipath deleted the test/runtime-protocol-conformance branch July 14, 2026 09:54
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.

3 participants