feat: validate real-bench seat orchestration and self-repair

This commit is contained in:
vee
2026-08-09 19:00:16 +08:00
parent 3bceb0d5a1
commit 3701192a11
41 changed files with 10403 additions and 3392 deletions
+23
View File
@@ -1,5 +1,7 @@
from __future__ import annotations
import json
import time
from pathlib import Path
from cognitive_agent.application.self_repair.healing_model import (
@@ -81,3 +83,24 @@ def test_bridge_manager_does_not_arm_visible_tooling_by_default(tmp_path: Path)
assert snapshot["state"] == "IDLE"
assert snapshot["retry_armed"] is False
assert snapshot["attempts"] == 0
def test_bridge_manager_does_not_restart_a_live_busy_request(tmp_path: Path) -> None:
status_path = tmp_path / "bridge.json"
status_path.write_text(
json.dumps({
"heartbeat_epoch": time.time() - 5.0,
"bridge_state": "RUNNING",
"current_request_id": "SELF_HEAL_BENCH_1",
}),
encoding="utf-8",
)
manager = ZcanBridgeManager(
status_path,
tmp_path / "bridge.py",
heartbeat_stale_s=3.0,
busy_heartbeat_grace_s=45.0,
)
assert manager._heartbeat_online() is False
assert manager._bridge_busy_within_grace() is True