Skip to content

Commit d043fd2

Browse files
committed
Restore peer runtime canary validation
Keep legacy hierarchy checks scoped to retired Agent declarations. Bind migration and host onboarding checks to their fixture runtime routes. Signed-off-by: LoopX Agent <337587101+loopx-agent@users.noreply.github.com>
1 parent b927e20 commit d043fd2

3 files changed

Lines changed: 28 additions & 12 deletions

File tree

‎examples/control_plane/agent-onboard-host-loop-activation-smoke.py‎

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
import sys
1212
import tempfile
1313
from pathlib import Path
14+
from unittest.mock import patch
1415

1516
REPO_ROOT = Path(__file__).resolve().parents[2]
1617
if str(REPO_ROOT) not in sys.path:
@@ -292,6 +293,8 @@ def main() -> int:
292293
cli_bin="loopx",
293294
host_surface="codex-cli-tui",
294295
goal_text="build a deterministic onboarding path",
296+
resolve_linked_worktree_alias=False,
297+
runtime_root_arg=str(Path(tmp) / "runtime"),
295298
)
296299
assert payload["agent_type"] == "codex-cli", payload
297300
activation = payload["host_loop_activation"]
@@ -313,7 +316,16 @@ def main() -> int:
313316
assert "register-agent" in message, message
314317
assert "explicit takeover" in message, message
315318

316-
with tempfile.TemporaryDirectory(prefix="loopx-agent-onboard-identity-") as tmp:
319+
# Route the connected fixture's builders and CLI children through its legacy registry.
320+
with (
321+
tempfile.TemporaryDirectory(prefix="loopx-agent-onboard-identity-") as tmp,
322+
patch.dict(os.environ, {"LOOPX_RUNTIME_ROOT": str(Path(tmp) / "home" / ".codex" / "loopx")}),
323+
patch.multiple(
324+
"loopx.paths",
325+
DEFAULT_RUNTIME_ROOT=Path(tmp) / "home" / ".loopx",
326+
LEGACY_RUNTIME_ROOT=Path(tmp) / "home" / ".codex" / "loopx",
327+
),
328+
):
317329
root = Path(tmp)
318330
project = root / "project"
319331
home = root / "home"

‎examples/control_plane/peer-agent-hard-cut-boundary-smoke.py‎

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@
4040
r"\bprimary_agent\b|\bprimary_review\b|\bside_agent\b|\bhandoff_agent\b|"
4141
r"\bagent_profile_v0\b|\bprimary_checkout\b|"
4242
r"\bprimary agent\b|\bside agent\b|\bside-agent\b|\bmain controller\b|"
43-
r"controller/sub-agent|controller-subagent|controller owns|"
43+
r"controller/sub-agent|controller-subagent|"
4444
r'"role"\s*:\s*"(?:controller|subagent)"',
4545
re.IGNORECASE,
4646
)
@@ -52,14 +52,6 @@ def hierarchy_scan_line(path: Path, line: str) -> str:
5252
if (path == REPO_ROOT / "loopx/control_plane/todos/read_codec.ts"
5353
and line.strip() == '["removed_continuation_policy", ["primary_review", "review_handoff"]]] as const) {'):
5454
return line.replace('"primary_review"', '').replace('"review_handoff"', '')
55-
# This accepted RFC names native session roles, not Agent hierarchy.
56-
if (path == REPO_ROOT / "docs/architecture/rfcs/controller-executor-unified-contract-v0.md"
57-
and line.strip() == 'the current single Agent-scoped slot. One controller owns control dialogue;'):
58-
return line.replace("controller owns", "native session role owns")
59-
# Benchmark recovery assigns retries to the experiment provider or controller.
60-
if (path == REPO_ROOT / "loopx/capabilities/benchmark_toolkit/README.md"
61-
and line.strip() == "grading alive until it drains. The provider/controller owns bounded retry after"):
62-
return line.replace("provider/controller owns", "benchmark provider or controller handles")
6355
return line
6456

6557

@@ -83,10 +75,20 @@ def main() -> int:
8375
"handoff_agent",
8476
"agent_profile_v0",
8577
"primary_checkout",
86-
"controller owns",
78+
"main controller",
79+
"controller/sub-agent",
80+
"controller-subagent",
81+
'"role": "controller"',
82+
'"role": "subagent"',
8783
):
8884
assert LEGACY_PATTERN.search(token), token
89-
for domain_term in ("primary_reviewers", "primary_review_score"):
85+
# Owning a domain resource does not describe an Agent hierarchy.
86+
for domain_term in (
87+
"primary_reviewers",
88+
"primary_review_score",
89+
"The benchmark controller owns the worker lock.",
90+
"One controller owns control dialogue.",
91+
):
9092
assert not LEGACY_PATTERN.search(domain_term), domain_term
9193

9294
decoder = REPO_ROOT / "loopx/control_plane/todos/read_codec.ts"

‎examples/control_plane/peer-agent-migration-smoke.py‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,13 +312,15 @@ def main() -> int:
312312

313313
heartbeat = build_heartbeat_prompt(
314314
goal_id=GOAL_ID,
315+
registry_path=fresh_registry,
315316
thin=True,
316317
agent_id=AGENTS[0],
317318
agent_scopes=["peer task claims and leases"],
318319
registered_agents=AGENTS,
319320
)
320321
assert heartbeat["agent_model"] == "peer_v1", heartbeat
321322
assert heartbeat["agent_role"] == "peer-agent", heartbeat
323+
assert str(fresh_registry) in heartbeat["task_body"], heartbeat
322324
assert "primary_agent" not in heartbeat, heartbeat
323325
assert "side_agent_handoff_agent" not in heartbeat, heartbeat
324326
assert "single primary" not in heartbeat["task_body"].lower(), heartbeat

0 commit comments

Comments
 (0)