fix(agent): surface work order recovery readbacks
Some checks failed
CD Pipeline / workflow-shape (push) Successful in 0s
CD Pipeline / cancel-stale-cd (push) Has been skipped
CD Pipeline / tests (push) Successful in 37s
CD Pipeline / build-and-deploy (push) Failing after 2m31s
CD Pipeline / post-deploy-checks (push) Has been skipped

This commit is contained in:
Your Name
2026-06-30 23:01:05 +08:00
parent 780ad71ed1
commit 0708602c00
2 changed files with 79 additions and 10 deletions

View File

@@ -127,6 +127,55 @@ def test_awoooi_priority_work_order_readback_endpoint_returns_snapshot(
assert "reboot SLO scorecard is blocked" in data["next_execution_order"][0]
def test_awoooi_priority_work_order_readback_endpoint_redacts_ai_loop_queue(
monkeypatch: pytest.MonkeyPatch,
tmp_path: Path,
):
monkeypatch.setattr(
agents,
"load_latest_stockplatform_public_api_runtime_readback",
_stockplatform_runtime_ready,
)
def _harbor_registry_upstream_502() -> dict:
return load_latest_harbor_registry_controlled_recovery_preflight(
route_source_path=_harbor_route_source(tmp_path),
watchdog_source_path=_harbor_watchdog_source(tmp_path),
probe=_harbor_upstream_502_probe,
)
monkeypatch.setattr(
agents,
"load_latest_harbor_registry_controlled_recovery_preflight",
_harbor_registry_upstream_502,
)
app = FastAPI()
app.include_router(router, prefix="/api/v1")
client = TestClient(app)
response = client.get("/api/v1/agents/awoooi-priority-work-order-readback")
assert response.status_code == 200
assert "192.168.0.110" not in response.text
data = response.json()
in_progress = data["in_progress_or_blocked_in_priority_order"][0]
evidence = in_progress["evidence"]
assert data["status"] == (
"p0_006_blocked_ai_loop_current_blocker_execution_queue"
)
assert evidence["ai_loop_current_blocker_post_recovery_readback_commands"] == [
"read-public-gitea-actions-queue.py --json",
"curl -k https://registry.wooo.work/v2/",
"curl host:public-gateway/registry/v2/",
]
assert len(
evidence["ai_loop_current_blocker_local_console_execution_plan"]
) == 5
assert "read_runner_registration_token_or_runner_file" in evidence[
"ai_loop_current_blocker_forbidden_runtime_actions"
]
def test_awoooi_priority_work_order_readback_overlays_harbor_deploy_blocker(
tmp_path: Path,
):
@@ -264,6 +313,14 @@ def test_awoooi_priority_work_order_readback_overlays_ai_loop_current_blocker_qu
assert evidence["ai_loop_current_blocker_metadata_only_writeback_ready"] is True
assert evidence["ai_loop_current_blocker_runtime_dispatch_performed"] is False
assert evidence["ai_loop_current_blocker_raw_payload_required"] is False
assert evidence["ai_loop_current_blocker_post_recovery_readback_commands"] == [
"read-public-gitea-actions-queue.py --json",
"curl -k https://registry.wooo.work/v2/",
"curl http://192.168.0.110:5000/v2/",
]
assert "workflow_dispatch_from_this_endpoint" in evidence[
"ai_loop_current_blocker_forbidden_runtime_actions"
]
assert "not generic manual triage" in in_progress["reason"]
assert "Do not restart Docker daemon" in in_progress["professional_fix"]["action"]
assert payload["summary"]["ai_loop_current_blocker_execution_queue_count"] == 1
@@ -276,10 +333,11 @@ def test_awoooi_priority_work_order_readback_overlays_ai_loop_current_blocker_qu
] == 3
assert payload["summary"][
"ai_loop_current_blocker_forbidden_runtime_action_count"
] >= 5
] == 6
assert payload["next_execution_order"][0].startswith(
"P0-006-AI-LOOP-CURRENT-BLOCKER-EXECUTION-QUEUE"
)
assert "5 ordered local-console phases" in payload["next_execution_order"][0]
def test_awoooi_priority_work_order_readback_overlays_live_stockplatform_drift():