From 713e13e2e618724ab23bb916f2c26e7e262e31d4 Mon Sep 17 00:00:00 2001 From: LoopX Agent <337587101+loopx-agent@users.noreply.github.com> Date: Tue, 27 Oct 2026 18:19:25 +0800 Subject: [PATCH] refactor: keep read-only runtime routing independent of history writes Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com> --- loopx/control_plane/runtime/runtime_projection_route.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/loopx/control_plane/runtime/runtime_projection_route.py b/loopx/control_plane/runtime/runtime_projection_route.py index 801bc8cd6c..9bc7fd274b 100644 --- a/loopx/control_plane/runtime/runtime_projection_route.py +++ b/loopx/control_plane/runtime/runtime_projection_route.py @@ -13,7 +13,7 @@ goal_activation_state, normalize_goal_activation_state, ) -from ...history import load_index, load_registry +from ..projects.registry_codec import load_registry from ... import paths from ...paths import global_registry_path, resolve_runtime_root from ...registry import registry_goals @@ -451,6 +451,8 @@ def _latest_route_source_row( goal_id: str, route_id: str, ) -> dict[str, Any] | None: + from ...history import load_index + rows, _ = load_index(runtime_root / "goals" / goal_id / "runs" / "index.jsonl") for row in reversed(rows): marker = row.get("runtime_projection_route") @@ -471,6 +473,8 @@ def _route_projection_is_current( source_generated_at: Any, marker_field: str, ) -> bool: + from ...history import load_index + rows, _ = load_index( target_runtime_root / "goals" / goal_id / "runs" / "index.jsonl" )