From 2427a61049350e94910f305be23e5b8fab2dfcae Mon Sep 17 00:00:00 2001 From: huangruiteng Date: Sat, 3 Oct 2026 18:17:40 +0800 Subject: [PATCH] test(release): align public smokes with current capability and replan contracts Signed-off-by: huangruiteng --- ...peer-agent-directory-and-observation-v0.md | 10 +++++++-- .../capability-extension-registry-smoke.py | 1 + .../todo-first-open-summary-smoke.py | 22 ++++++++++++++++--- ....py => peer-handoff-live-qualification.py} | 8 +++++-- examples/project/configure-goal-smoke.py | 6 +++++ 5 files changed, 40 insertions(+), 7 deletions(-) rename examples/{peer-handoff-live-smoke.py => peer-handoff-live-qualification.py} (98%) diff --git a/docs/reference/protocols/peer-agent-directory-and-observation-v0.md b/docs/reference/protocols/peer-agent-directory-and-observation-v0.md index 0474f315d5..4b14bdd2b6 100644 --- a/docs/reference/protocols/peer-agent-directory-and-observation-v0.md +++ b/docs/reference/protocols/peer-agent-directory-and-observation-v0.md @@ -254,7 +254,7 @@ from host submission and from each other. ### Real-host qualification -`examples/peer-handoff-live-smoke.py` is an explicit opt-in qualification of the +`examples/peer-handoff-live-qualification.py` is an explicit opt-in qualification of the existing Codex app-server adapter and the same request/return CLI. It creates two synthetic host threads in the selected authenticated home, a disposable Goal/registry/runtime, and a bounded artifact pinned to the checkout head and @@ -263,9 +263,15 @@ SHA-256. It does not resume a user thread or create replacement child workers. From the source checkout: ```bash -uv run --extra test python examples/peer-handoff-live-smoke.py --execute-real-host +uv run --extra test python examples/peer-handoff-live-qualification.py --execute-real-host ``` +The qualification filename keeps this paid host run outside the automatically +discovered `*-smoke.py` fleet. Ordinary offline coverage remains in +`tests/test_peer_collaboration.py` and `tests/control_plane/test_peer_host_route.py`; +neither default CI nor the public smoke fleet +authorizes model calls or host thread creation. + On Windows select `--codex-bin codex.cmd` if the installed launcher needs it. The command consumes model quota and leaves the host's own test-thread records in that home; no authentication or session records are copied between homes. diff --git a/examples/capability-extension-registry-smoke.py b/examples/capability-extension-registry-smoke.py index aac1469d24..e176471f0e 100644 --- a/examples/capability-extension-registry-smoke.py +++ b/examples/capability-extension-registry-smoke.py @@ -83,6 +83,7 @@ def run_cli(runtime_root: Path, *args: str) -> dict[str, object]: "performance-diagnosis", "reliability-diagnostics", "progress-review-sentinel", + "goal-capability-organization", ] assert all(item["provider_id"] == "loopx-core" for item in builtin_capabilities) value_summary = next( diff --git a/examples/control_plane/todo-first-open-summary-smoke.py b/examples/control_plane/todo-first-open-summary-smoke.py index a6d355fdf3..b64a8fa067 100644 --- a/examples/control_plane/todo-first-open-summary-smoke.py +++ b/examples/control_plane/todo-first-open-summary-smoke.py @@ -12,6 +12,9 @@ sys.path.insert(0, str(REPO_ROOT)) from loopx.quota import build_quota_should_run, render_quota_should_run_markdown # noqa: E402 +from loopx.control_plane.scheduler.execution_context import ( # noqa: E402 + GENERIC_CLI_OUTER_CONTROLLER_SCHEDULER_CONTEXT, +) from loopx.control_plane.todos.active_state_todo_parser import ( # noqa: E402 parse_active_state_todos as parse_active_state_todos_read_model, ) @@ -230,6 +233,7 @@ def assert_blocked_priority_fallback_notice_visible() -> None: build_blocked_priority_fallback_status_payload(), goal_id=GOAL_ID, agent_id="codex-main-control", + scheduler_execution_context=GENERIC_CLI_OUTER_CONTROLLER_SCHEDULER_CONTEXT, ) assert decision["should_run"] is True, decision fallback = decision["blocked_priority_fallback"] @@ -359,7 +363,10 @@ def assert_claimed_frontstage_lanes_visible() -> None: ] }, } - decision = build_quota_should_run(status_payload, goal_id=GOAL_ID, agent_id="codex-side-bypass") + decision = build_quota_should_run( + status_payload, goal_id=GOAL_ID, agent_id="codex-side-bypass", + scheduler_execution_context=GENERIC_CLI_OUTER_CONTROLLER_SCHEDULER_CONTEXT, + ) summary = decision["agent_todo_summary"] assert [item["index"] for item in summary["unclaimed_priority_open_items"]] == [1, 2], summary assert summary["payload_compaction"]["compacted_lanes"]["unclaimed_priority_open_items"] == { @@ -527,6 +534,7 @@ def assert_claimed_markdown_todos_survive_visibility_lanes() -> None: status_payload, goal_id=GOAL_ID, agent_id="codex-side-bypass", + scheduler_execution_context=GENERIC_CLI_OUTER_CONTROLLER_SCHEDULER_CONTEXT, ) summary = decision["agent_todo_summary"] assert [item["todo_id"] for item in summary["current_agent_claimed_open_items"]] == [ @@ -636,19 +644,24 @@ def assert_claimed_advancement_lanes_preserve_claimants() -> None: status_payload, goal_id=GOAL_ID, agent_id="codex-main-control", + scheduler_execution_context=GENERIC_CLI_OUTER_CONTROLLER_SCHEDULER_CONTEXT, ) primary_summary = primary_decision["agent_todo_summary"] assert primary_summary["first_executable_items"][0]["todo_id"] == "todo_primary_1", primary_summary assert primary_summary["claim_scope"]["agent_model"] == "peer_v1", primary_summary assert "agent_role" not in primary_summary["claim_scope"], primary_summary assert primary_summary["claim_scope"]["other_agent_claimed_items"][0]["todo_id"] == "todo_side_tui", primary_summary - assert "Primary claimed advancement item 1" in primary_decision["recommended_action"], primary_decision + # Twenty claimed primary tasks require the shipped long-chain replan before + # ordinary delivery. The quota read model must still preserve their owners. + assert primary_decision["decision"] == "autonomous_replan_required", primary_decision + assert primary_decision["normal_delivery_allowed"] is False, primary_decision assert "state_action_projection_warning" not in primary_decision, primary_decision decision = build_quota_should_run( status_payload, goal_id=GOAL_ID, agent_id="codex-side-bypass", + scheduler_execution_context=GENERIC_CLI_OUTER_CONTROLLER_SCHEDULER_CONTEXT, ) summary = decision["agent_todo_summary"] current_agent_advancement_ids = [ @@ -768,7 +781,10 @@ def main() -> int: ] }, } - decision = build_quota_should_run(status_payload, goal_id=GOAL_ID) + decision = build_quota_should_run( + status_payload, goal_id=GOAL_ID, + scheduler_execution_context=GENERIC_CLI_OUTER_CONTROLLER_SCHEDULER_CONTEXT, + ) assert decision["should_run"] is True, decision agent_summary = decision["agent_todo_summary"] assert agent_summary["open_count"] == 4, decision diff --git a/examples/peer-handoff-live-smoke.py b/examples/peer-handoff-live-qualification.py similarity index 98% rename from examples/peer-handoff-live-smoke.py rename to examples/peer-handoff-live-qualification.py index 31c4d4a19e..0448887235 100644 --- a/examples/peer-handoff-live-smoke.py +++ b/examples/peer-handoff-live-qualification.py @@ -16,8 +16,12 @@ import tempfile from pathlib import Path -from loopx.chat_agent import CodexChatAgentSession -from loopx.control_plane.effect_runtime import restart_effect_runtime +REPO_ROOT = Path(__file__).resolve().parents[1] +if str(REPO_ROOT) not in sys.path: + sys.path.insert(0, str(REPO_ROOT)) + +from loopx.chat_agent import CodexChatAgentSession # noqa: E402 +from loopx.control_plane.effect_runtime import restart_effect_runtime # noqa: E402 def tool(name, description, properties=None): diff --git a/examples/project/configure-goal-smoke.py b/examples/project/configure-goal-smoke.py index b255bc880d..376eaf7027 100644 --- a/examples/project/configure-goal-smoke.py +++ b/examples/project/configure-goal-smoke.py @@ -288,6 +288,7 @@ def main() -> int: assert catalog["disclosure_policy"]["first_run_configuration_required"] is False features = {item["feature_id"]: item for item in catalog["features"]} assert set(features) == { + "goal_capability_organization", "todo_replan_cadence", "local_authority_shadow", "coordination_runtime_shadow", @@ -303,6 +304,11 @@ def main() -> int: "pull_request_review", "periodic_report", } + improvement = features["goal_capability_organization"] + assert improvement["default"] == { + "mode": "off", "discovery_budget_minutes": 5, "max_trials": 1, + }, improvement + assert "current" not in improvement, improvement assert features["pull_request_review"]["availability"] == "supported" assert features["progress_review"]["availability"] == "supported_opt_in" assert features["progress_review"]["default"]["mode"] == "off"