fix(semantic-scene): move describe_screen_semantic out of the tools/ layer

tools/ is a Hexagonal inner layer that must never depend on LLM
concerns (ADR 0002), but describe_screen_semantic.py imported
semantic.enricher, which pulls in the Anthropic client by default.
Relocated the wrapper to runtime/, which is where LLM-dependent code
is allowed to live; updated the tool registry and all test imports
accordingly. No behavior change.

openspec: semantic-scene capability, archived change semantic-scene-runtime
This commit is contained in:
2026-07-07 08:30:49 +08:00
parent 1bdc3784dc
commit 49ad589c2d
4 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -109,8 +109,8 @@ def default_tool_registry(
*, *,
manager: DeviceManager | None = None, manager: DeviceManager | None = None,
) -> dict[str, ToolCallable]: ) -> dict[str, ToolCallable]:
from runtime.describe_screen_semantic import describe_screen_semantic
from tools.describe_screen import describe_screen from tools.describe_screen import describe_screen
from tools.describe_screen_semantic import describe_screen_semantic
from tools.find_icon import find_icon, find_icon_on_screen from tools.find_icon import find_icon, find_icon_on_screen
from tools.find_text import find_text, find_text_on_screen from tools.find_text import find_text, find_text_on_screen
from tools.input_text import input_text from tools.input_text import input_text
+1 -1
View File
@@ -6,8 +6,8 @@ from core.models import Bounds, Scene, SceneElement
from device.manager import DeviceManager from device.manager import DeviceManager
from semantic.config import SemanticConfig from semantic.config import SemanticConfig
from semantic.llm_client import EnrichmentUnavailable from semantic.llm_client import EnrichmentUnavailable
from runtime.describe_screen_semantic import describe_screen_semantic
from tools.describe_screen import describe_screen from tools.describe_screen import describe_screen
from tools.describe_screen_semantic import describe_screen_semantic
from tests.fakes import FakeDriver from tests.fakes import FakeDriver
+1 -1
View File
@@ -6,12 +6,12 @@ import pytest
from core.models import Bounds, Scene, SceneElement, Task from core.models import Bounds, Scene, SceneElement, Task
from device.manager import DeviceManager from device.manager import DeviceManager
from runtime.describe_screen_semantic import describe_screen_semantic
from runtime.executor import Executor, ExecutorConfig from runtime.executor import Executor, ExecutorConfig
from runtime.planner import PlannedStep, Planner from runtime.planner import PlannedStep, Planner
from runtime.task import TaskRunner, TaskRunnerConfig from runtime.task import TaskRunner, TaskRunnerConfig
from semantic.config import SemanticConfig from semantic.config import SemanticConfig
from semantic.llm_client import EnrichmentUnavailable from semantic.llm_client import EnrichmentUnavailable
from tools.describe_screen_semantic import describe_screen_semantic
from tests.fakes import FakeDriver, PNG_10X20 from tests.fakes import FakeDriver, PNG_10X20