88
99from ..agent_registry import registered_agent_ids_for_goal
1010
11- # The projection builder is reached through this module by
12- # tests that seed and read the shadow through the command surface; keep them
13- # importable here even when the command does not call them directly.
14- from ..control_plane .coordination .runtime_shadow import ( # noqa: F401
15- bootstrap_coordination_runtime_shadow ,
16- build_runtime_shadow_source_snapshot ,
17- build_todo_runtime_shadow_projection ,
18- inspect_coordination_runtime_shadow ,
19- qualify_coordination_runtime_shadow ,
20- read_coordination_runtime_shadow_todo_candidate ,
21- review_local_coordination_authority_promotion ,
22- resolve_coordination_runtime_shadow_config ,
23- rollback_coordination_runtime_shadow ,
24- )
11+ from ..control_plane .coordination .authority_source_capture import build_runtime_shadow_source_snapshot
12+ from ..control_plane .coordination .configuration import resolve_coordination_runtime_shadow_config
2513from ..control_plane .coordination .promotion_review import execute_reviewed_coordination_promotion
2614from ..control_plane .coordination .shadow_goal_scope import shadow_goal_scope
2715from ..control_plane .projects .registry_codec import load_project_registry
@@ -356,6 +344,9 @@ def handle_coordination_shadow_command(
356344 }
357345 print_payload (payload , output_format (args ), _render )
358346 return 1
347+ # Only explicit, enabled legacy shadow actions load the producer.
348+ from ..control_plane .coordination import runtime_shadow as shadow
349+
359350 _ , _ , state_path = resolve_goal_state (registry = registry , goal_id = args .goal_id ,
360351 project_override = args .project , state_file_override = args .state_file )
361352 if args .coordination_shadow_command == "rollback" :
@@ -366,7 +357,7 @@ def handle_coordination_shadow_command(
366357 projection_version = _projection_version (projection )
367358 projected_todos = projection .get ("todos" )
368359 projected_leases = projection .get ("leases" )
369- inspection = {"status" : "not_evaluated" } if args .coordination_shadow_command == "rollback" else inspect_coordination_runtime_shadow (
360+ inspection = {"status" : "not_evaluated" } if args .coordination_shadow_command == "rollback" else shadow . inspect_coordination_runtime_shadow (
370361 goal = goal ,
371362 runtime_root = runtime_root ,
372363 goal_id = args .goal_id ,
@@ -408,7 +399,7 @@ def handle_coordination_shadow_command(
408399 operation_id = f"shadow-bootstrap:{ args .goal_id } :{ operation_digest } "
409400 with shadow_goal_scope (registry_path , goal_id = args .goal_id ) as scope :
410401 goal = scope .goal
411- bootstrap = bootstrap_coordination_runtime_shadow (
402+ bootstrap = shadow . bootstrap_coordination_runtime_shadow (
412403 goal = goal ,
413404 runtime_root = runtime_root ,
414405 goal_id = args .goal_id ,
@@ -421,7 +412,7 @@ def handle_coordination_shadow_command(
421412 payload ["executed" ] = True
422413 payload ["bootstrap" ] = bootstrap
423414 if bootstrap .get ("status" ) in {"applied" , "replayed" , "recovered" }:
424- payload ["inspection" ] = inspect_coordination_runtime_shadow (
415+ payload ["inspection" ] = shadow . inspect_coordination_runtime_shadow (
425416 goal = goal ,
426417 runtime_root = runtime_root ,
427418 goal_id = args .goal_id ,
@@ -435,7 +426,7 @@ def handle_coordination_shadow_command(
435426 and final_inspection .get ("status" ) == "matched"
436427 )
437428 if args .coordination_shadow_command == "qualify" :
438- qualification = qualify_coordination_runtime_shadow (
429+ qualification = shadow . qualify_coordination_runtime_shadow (
439430 goal = goal ,
440431 runtime_root = runtime_root ,
441432 goal_id = args .goal_id ,
@@ -447,7 +438,7 @@ def handle_coordination_shadow_command(
447438 payload ["qualification" ] = qualification
448439 payload ["ok" ] = qualification .get ("status" ) == "qualified"
449440 if args .coordination_shadow_command == "read-candidate" :
450- read_candidate = read_coordination_runtime_shadow_todo_candidate (
441+ read_candidate = shadow . read_coordination_runtime_shadow_todo_candidate (
451442 goal = goal ,
452443 runtime_root = runtime_root ,
453444 goal_id = args .goal_id ,
@@ -484,7 +475,7 @@ def handle_coordination_shadow_command(
484475 "registered_agents" : registered_agents ,
485476 }
486477 )
487- promotion = review_local_coordination_authority_promotion (
478+ promotion = shadow . review_local_coordination_authority_promotion (
488479 goal = goal ,
489480 runtime_root = runtime_root ,
490481 goal_id = args .goal_id ,
@@ -508,7 +499,7 @@ def handle_coordination_shadow_command(
508499 payload ["expected_provider_revision" ] = provider_revision
509500 payload ["expected_bootstrap_operation_id" ] = pending_bootstrap
510501 if args .execute :
511- rollback = rollback_coordination_runtime_shadow (
502+ rollback = shadow . rollback_coordination_runtime_shadow (
512503 goal = goal , runtime_root = runtime_root , goal_id = args .goal_id ,
513504 operation_id = f"shadow-rollback:{ args .goal_id } :{ provider_revision or pending_bootstrap } " ,
514505 expected_provider_revision = provider_revision ,
0 commit comments