From 3bc45aa5ebc58bb51298e96e0c55f392580097c5 Mon Sep 17 00:00:00 2001 From: "duanjialing.777" Date: Sat, 26 Sep 2026 21:07:29 +0800 Subject: [PATCH 1/2] test(control-plane): accept authority timeout kwargs Signed-off-by: duanjialing.777 --- tests/control_plane/checkpoint_process.py | 4 ++-- tests/control_plane/test_archive_retry_delivery.py | 4 ++-- tests/control_plane/test_canonical_handoff_mode.py | 2 +- .../control_plane/test_canonical_lease_inspection.py | 8 ++++---- .../control_plane/test_checkpoint_provider_fence.py | 8 ++++---- .../control_plane/test_validated_create_recovery.py | 12 ++++++------ 6 files changed, 19 insertions(+), 19 deletions(-) diff --git a/tests/control_plane/checkpoint_process.py b/tests/control_plane/checkpoint_process.py index 9e208c2b64..f1001c8dcd 100644 --- a/tests/control_plane/checkpoint_process.py +++ b/tests/control_plane/checkpoint_process.py @@ -72,10 +72,10 @@ def main(request): adapter = provider_update if mode == "writer" else checkpoint_context_io original = adapter.effect_runtime_result - def native(method, params): + def native(method, params, **kwargs): target = "coordination.local_authority.todo_update" if mode == "writer" else "goal.checkpoint_read_context.commit" if method != target: - return original(method, params) + return original(method, params, **kwargs) envelope = {"mode": "writer" if mode == "writer" else "checkpoint", "barrier": str(barrier), "provider": request["provider"], "method": method, "params": params, "provider_direct": request.get("provider_direct", False)} diff --git a/tests/control_plane/test_archive_retry_delivery.py b/tests/control_plane/test_archive_retry_delivery.py index 163d589f38..40241aedc6 100644 --- a/tests/control_plane/test_archive_retry_delivery.py +++ b/tests/control_plane/test_archive_retry_delivery.py @@ -301,10 +301,10 @@ def test_archive_ack_transport_failure_preserves_committed_result( registry, runtime, _ = _fixture(tmp_path) execute = provider_terminal_lifecycle.effect_runtime_result - def unavailable_ack(method, params): + def unavailable_ack(method, params, **kwargs): if method == "coordination.local_authority.todo_archive_ack": raise OSError("injected acknowledgement transport failure") - return execute(method, params) + return execute(method, params, **kwargs) with monkeypatch.context() as patch: patch.setattr( diff --git a/tests/control_plane/test_canonical_handoff_mode.py b/tests/control_plane/test_canonical_handoff_mode.py index 7a69397027..b9eecff9da 100644 --- a/tests/control_plane/test_canonical_handoff_mode.py +++ b/tests/control_plane/test_canonical_handoff_mode.py @@ -89,7 +89,7 @@ def test_provider_failure_is_not_a_legacy_fallback(canonical_mode, monkeypatch): state, runtime, _ = canonical_mode from loopx.control_plane.todos import provider_handoff_mode from loopx.control_plane.coordination.local_authority import LocalCoordinationAuthorityUnavailable - monkeypatch.setattr(provider_handoff_mode, "effect_runtime_result", lambda *_args: { + monkeypatch.setattr(provider_handoff_mode, "effect_runtime_result", lambda *_args, **_kwargs: { "status": "unavailable", "reason_code": "synthetic_provider_down", "reason": "Unavailable"}) before = state.read_bytes() with pytest.raises(LocalCoordinationAuthorityUnavailable, match="Unavailable"): diff --git a/tests/control_plane/test_canonical_lease_inspection.py b/tests/control_plane/test_canonical_lease_inspection.py index 255665b552..5b603b60b8 100644 --- a/tests/control_plane/test_canonical_lease_inspection.py +++ b/tests/control_plane/test_canonical_lease_inspection.py @@ -131,14 +131,14 @@ def test_registration_change_retries_and_uses_new_eligibility(tmp_path, monkeypa original = effect_runtime.effect_runtime_result calls = [] - def change_registration(method, payload): + def change_registration(method, payload, **kwargs): if method == "task_lease.inspect.native": calls.append(method) if len(calls) == 1: updated = json.loads(registry.read_text()) updated["goals"][0]["coordination"]["registered_agents"] = ["agent-b"] registry.write_text(json.dumps(updated)) - return original(method, payload) + return original(method, payload, **kwargs) monkeypatch.setattr(effect_runtime, "effect_runtime_result", change_registration) result = _inspect(registry, runtime) @@ -155,11 +155,11 @@ def test_continuous_source_churn_exhausts_bounded_retry_without_success(tmp_path original = effect_runtime.effect_runtime_result calls = [] - def change_source(method, payload): + def change_source(method, payload, **kwargs): if method == "task_lease.inspect.native": calls.append(method) registry.write_text(registry.read_text() + "\n") - return original(method, payload) + return original(method, payload, **kwargs) monkeypatch.setattr(effect_runtime, "effect_runtime_result", change_source) with pytest.raises(LocalCoordinationAuthorityUnavailable) as error: diff --git a/tests/control_plane/test_checkpoint_provider_fence.py b/tests/control_plane/test_checkpoint_provider_fence.py index 16cf52632c..b82efa20b2 100644 --- a/tests/control_plane/test_checkpoint_provider_fence.py +++ b/tests/control_plane/test_checkpoint_provider_fence.py @@ -115,9 +115,9 @@ def test_provider_transaction_cannot_commit_between_final_head_and_checkpoint(tm original = context_io.effect_runtime_result observed = [] - def native(method, params): + def native(method, params, **kwargs): if method != "goal.checkpoint_read_context.commit": - return original(method, params) + return original(method, params, **kwargs) checkpoint = start_probe({"mode": "checkpoint", "provider": provider, "barrier": str(barrier), "params": params, "repeat": True}) writer = None @@ -206,9 +206,9 @@ def test_failed_save_releases_provider_and_requires_fresh_comparison(tmp_path, m barrier.mkdir() original = context_io.effect_runtime_result - def native(method, params): + def native(method, params, **kwargs): if method != "goal.checkpoint_read_context.commit": - return original(method, params) + return original(method, params, **kwargs) child = start_probe({"mode": "checkpoint", "provider": provider, "barrier": str(barrier), "params": params, "fault": fault}) try: diff --git a/tests/control_plane/test_validated_create_recovery.py b/tests/control_plane/test_validated_create_recovery.py index 84b12dfd26..02b7afc927 100644 --- a/tests/control_plane/test_validated_create_recovery.py +++ b/tests/control_plane/test_validated_create_recovery.py @@ -52,8 +52,8 @@ def project(registry, runtime): def test_lost_response_replays_exact_create_after_another_edit(promoted, monkeypatch): registry, runtime, state = promoted real = provider_create.effect_runtime_result - def lose_response(method, request): - real(method, request) + def lose_response(method, request, **kwargs): + real(method, request, **kwargs) raise EffectRuntimeResponseAmbiguous(method, timeout=1) monkeypatch.setattr(provider_create, "effect_runtime_result", lose_response) with pytest.raises(LocalCoordinationAuthorityUnavailable) as error: @@ -108,8 +108,8 @@ def test_revision_lost_response_still_projects_exact_new_declaration(promoted, m registry, runtime, _ = promoted created = add_goal_todo(**intent(registry)) real = provider_update.effect_runtime_result - def lose_response(method, request): - real(method, request) + def lose_response(method, request, **kwargs): + real(method, request, **kwargs) raise EffectRuntimeResponseAmbiguous(method, timeout=1) monkeypatch.setattr(provider_update, "effect_runtime_result", lose_response) with pytest.raises(EffectRuntimeResponseAmbiguous): @@ -174,8 +174,8 @@ def test_process_exit_after_commit_recovers_through_public_cli(promoted): from loopx.control_plane.todos import provider_create from loopx.todos import add_goal_todo real = provider_create.effect_runtime_result -def exit_after_commit(method, request): - real(method, request) +def exit_after_commit(method, request, **kwargs): + real(method, request, **kwargs) os._exit(77) provider_create.effect_runtime_result = exit_after_commit add_goal_todo(registry_path=Path(sys.argv[1]), goal_id="goal-a", role="agent", From 147dc992794c1290d720458969d07022bfe4aee4 Mon Sep 17 00:00:00 2001 From: huangruiteng <14976749+huangruiteng@users.noreply.github.com> Date: Sun, 27 Sep 2026 00:20:32 +0800 Subject: [PATCH 2/2] chore(semantics): regenerate the project registry I/O manifest The checked-in manifest lagged main: `thread_agent_binding.py` gained the shared binding-route resolver, which moved five classified sites, and `cli_commands/capability.py` gained a second `load_registry` site. Running the generator reports the drift, so the manifest check is red on main today. Regenerated content only: 243 sites, 0 unclassified direct sites, no hand-edited rows. Nothing but line/column metadata and the one added site changes. Signed-off-by: huangruiteng <14976749+huangruiteng@users.noreply.github.com> --- .../project_registry_io_manifest_v1.json | 20 +++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/loopx/semantics/project_registry_io_manifest_v1.json b/loopx/semantics/project_registry_io_manifest_v1.json index 45357716b3..99b16fb2c1 100644 --- a/loopx/semantics/project_registry_io_manifest_v1.json +++ b/loopx/semantics/project_registry_io_manifest_v1.json @@ -495,7 +495,15 @@ }, { "site": "loopx/cli_commands/capability.py::.handle_capability_command::codec_read:load_registry#1", - "line": 212, + "line": 233, + "column": 21, + "kind": "codec_read", + "api": "load_registry", + "classification": "codec_api" + }, + { + "site": "loopx/cli_commands/capability.py::.handle_capability_command::codec_read:load_registry#2", + "line": 245, "column": 21, "kind": "codec_read", "api": "load_registry", @@ -1895,7 +1903,7 @@ }, { "site": "loopx/thread_agent_binding.py::.bind_thread_agent_in_registry::codec_write:mutate_project_registry#1", - "line": 566, + "line": 649, "column": 16, "kind": "codec_write", "api": "mutate_project_registry", @@ -1903,7 +1911,7 @@ }, { "site": "loopx/thread_agent_binding.py::.bind_thread_agent_in_registry::codec_read:load_registry#1", - "line": 573, + "line": 656, "column": 15, "kind": "codec_read", "api": "load_registry", @@ -1911,7 +1919,7 @@ }, { "site": "loopx/thread_agent_binding.py::.resolve_registry_thread_agent_binding::codec_read:load_registry#1", - "line": 329, + "line": 412, "column": 15, "kind": "codec_read", "api": "load_registry", @@ -1919,7 +1927,7 @@ }, { "site": "loopx/thread_agent_binding.py::.unbind_thread_agent_in_registry::codec_write:mutate_project_registry#1", - "line": 625, + "line": 708, "column": 16, "kind": "codec_write", "api": "mutate_project_registry", @@ -1927,7 +1935,7 @@ }, { "site": "loopx/thread_agent_binding.py::.unbind_thread_agent_in_registry::codec_read:load_registry#1", - "line": 632, + "line": 715, "column": 15, "kind": "codec_read", "api": "load_registry",