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

@@ -550,6 +550,18 @@ def apply_ai_loop_current_blocker_execution_queue(
state["ai_loop_current_blocker_control_path_blocker"] = external_blocker
state["ai_loop_current_blocker_runtime_write_gate"] = runtime_write_gate
state["ai_loop_current_blocker_learning_target_count"] = len(learning_targets)
state["ai_loop_current_blocker_local_console_phase_count"] = len(
local_console_plan
)
state["ai_loop_current_blocker_local_console_phase_ids"] = (
local_console_phase_ids
)
state["ai_loop_current_blocker_post_recovery_readback_command_count"] = len(
post_recovery_readback_commands
)
state["ai_loop_current_blocker_forbidden_runtime_action_count"] = len(
forbidden_runtime_actions
)
state["active_p0_live_active_blockers"] = _unique_strings(
_strings(state.get("active_p0_live_active_blockers"))
+ ["ai_loop_current_blocker_execution_queue"]
@@ -622,13 +634,12 @@ def apply_ai_loop_current_blocker_execution_queue(
)
professional_fix = _dict(workplan.setdefault("professional_fix", {}))
professional_fix["action"] = (
"Run the AI Loop current blocker package in order: verify 110 "
"control path, execute "
f"{controlled_recovery_package}, run {post_apply_verifier}, then "
"rerun Harbor queue / registry /v2/ / deploy-marker readbacks and "
"write metadata-only KM/RAG/MCP/PlayBook receipts. Do not restart "
"Docker daemon, reboot hosts, drain nodes, switch registry "
"provider, trigger workflows, or read runner tokens from this lane."
"Run the AI Loop current blocker package in order: "
f"{', '.join(local_console_phase_ids)}, then rerun "
"Harbor queue / registry /v2/ / deploy-marker readbacks and write "
"metadata-only KM/RAG/MCP/PlayBook receipts. Do not restart Docker "
"daemon, reboot hosts, drain nodes, switch registry provider, "
"trigger workflows, or read runner tokens from this lane."
)
professional_fix["owner"] = (
"AI Loop current blocker queue plus P0-006 Harbor/110 control path"
@@ -639,8 +650,8 @@ def apply_ai_loop_current_blocker_execution_queue(
(
"P0-006-AI-LOOP-CURRENT-BLOCKER-EXECUTION-QUEUE: execute the "
f"{blocker_id} queue item through 110 control-path readback, "
"ordered local-console phases, bounded recovery package check-mode, "
"post-apply verifier, and metadata-only KM/RAG/MCP/PlayBook writeback."
f"{len(local_console_plan)} ordered local-console phases, post-recovery "
"readback commands, and metadata-only KM/RAG/MCP/PlayBook writeback."
),
(
"P0-006-HARBOR-REGISTRY-CONTROLLED-RECOVERY-PREFLIGHT: after the "

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():