fix(agent): expose runtime receipt recovery action
All checks were successful
CD Pipeline / workflow-shape (push) Successful in 0s
CD Pipeline / cancel-stale-cd (push) Has been skipped
CD Pipeline / tests (push) Successful in 39s
CD Pipeline / build-and-deploy (push) Successful in 8m10s
CD Pipeline / post-deploy-checks (push) Successful in 1m39s
All checks were successful
CD Pipeline / workflow-shape (push) Successful in 0s
CD Pipeline / cancel-stale-cd (push) Has been skipped
CD Pipeline / tests (push) Successful in 39s
CD Pipeline / build-and-deploy (push) Successful in 8m10s
CD Pipeline / post-deploy-checks (push) Successful in 1m39s
This commit is contained in:
@@ -339,6 +339,17 @@ def test_ai_agent_autonomous_runtime_control_exposes_reports_and_executor_receip
|
||||
assert data["rollups"]["direct_bot_api_allowed_count"] == 0
|
||||
assert data["rollups"]["legacy_policy_overridden_count"] >= 4
|
||||
assert data["runtime_receipt_readback"]["db_read_status"] == "not_queried"
|
||||
recovery = data["runtime_receipt_readback"]["runtime_receipt_readback_recovery"]
|
||||
assert recovery["status"] == "blocked_runtime_receipt_db_readback_unavailable"
|
||||
assert recovery["safe_next_action_id"] == (
|
||||
"repair_runtime_receipt_db_readback_then_rerun_log_integration_taxonomy"
|
||||
)
|
||||
assert data["rollups"]["live_runtime_receipt_recovery_status"] == (
|
||||
"blocked_runtime_receipt_db_readback_unavailable"
|
||||
)
|
||||
assert data["rollups"]["live_runtime_receipt_safe_next_action_id"] == (
|
||||
"repair_runtime_receipt_db_readback_then_rerun_log_integration_taxonomy"
|
||||
)
|
||||
_assert_log_controlled_writeback_executor(
|
||||
data["runtime_receipt_readback"]["log_controlled_writeback_executor"]
|
||||
)
|
||||
@@ -380,6 +391,14 @@ def test_ai_agent_autonomous_runtime_control_exposes_reports_and_executor_receip
|
||||
]
|
||||
== 7
|
||||
)
|
||||
progress_items = {
|
||||
item["work_item_id"]: item
|
||||
for item in data["runtime_receipt_readback"]["work_item_progress"]["ordered_items"]
|
||||
}
|
||||
assert progress_items["P0-A-runtime-truth"]["status"] == "blocked"
|
||||
assert progress_items["P0-A-runtime-truth"]["blocker"] == (
|
||||
"runtime_receipt_db_readback_unavailable"
|
||||
)
|
||||
|
||||
|
||||
def test_ai_agent_autonomous_runtime_control_exposes_internal_control_loop():
|
||||
@@ -635,6 +654,11 @@ def test_runtime_receipt_readback_summarizes_live_executor_closure_rows():
|
||||
|
||||
assert readback["db_read_status"] == "ok"
|
||||
assert readback["writes_on_read"] is False
|
||||
recovery = readback["runtime_receipt_readback_recovery"]
|
||||
assert recovery["status"] == "completed_live_runtime_receipts_observed"
|
||||
assert recovery["classified_event_total"] > 0
|
||||
assert recovery["active_source_family_count"] == 10
|
||||
assert recovery["inactive_source_family_ids"] == []
|
||||
assert readback["ansible_apply_executed"]["total"] == 1
|
||||
assert (
|
||||
readback["ansible_operations"]["counts"]["log_controlled_writeback_dispatched"][
|
||||
@@ -903,6 +927,8 @@ def test_runtime_receipt_readback_summarizes_live_executor_closure_rows():
|
||||
"P2-B-multi-product-expansion",
|
||||
]
|
||||
assert progress["ordered_items"][4]["status"] == "completed"
|
||||
assert progress["ordered_items"][0]["status"] == "completed"
|
||||
assert progress["ordered_items"][0]["classified_event_total"] > 0
|
||||
assert progress["ordered_items"][5]["status"] == "completed"
|
||||
assert progress["ordered_items"][6]["status"] == "completed"
|
||||
assert progress["ordered_items"][7]["status"] == "completed"
|
||||
@@ -929,6 +955,32 @@ def test_runtime_receipt_readback_summarizes_live_executor_closure_rows():
|
||||
assert progress["rollups"]["pending_count"] == 0
|
||||
|
||||
|
||||
def test_runtime_receipt_recovery_flags_zero_live_log_events():
|
||||
readback = build_runtime_receipt_readback_from_rows(
|
||||
project_id="awoooi",
|
||||
db_read_status="ok",
|
||||
)
|
||||
|
||||
recovery = readback["runtime_receipt_readback_recovery"]
|
||||
assert recovery["status"] == "blocked_live_log_source_family_events_missing"
|
||||
assert recovery["safe_next_action_id"] == (
|
||||
"connect_service_tool_package_logs_to_trace_ledger_then_rerun_taxonomy"
|
||||
)
|
||||
assert recovery["active_source_family_count"] == 0
|
||||
assert len(recovery["inactive_source_family_ids"]) == 10
|
||||
|
||||
progress_items = {
|
||||
item["work_item_id"]: item
|
||||
for item in readback["work_item_progress"]["ordered_items"]
|
||||
}
|
||||
assert progress_items["P0-A-runtime-truth"]["status"] == "in_progress"
|
||||
assert progress_items["P0-A-runtime-truth"]["blocker"] == (
|
||||
"live_log_classified_event_total_zero"
|
||||
)
|
||||
assert progress_items["P1-A-ingestion-coverage"]["status"] == "in_progress"
|
||||
assert readback["work_item_progress"]["rollups"]["not_started_count"] == 10
|
||||
|
||||
|
||||
def test_runtime_receipt_work_items_use_learning_receipts_without_latest_telegram_gate():
|
||||
apply_op_id = "2f8ef5c8-fd4e-4950-99e9-dc9e61150cab"
|
||||
incident_id = "INC-20260629-LEARNING"
|
||||
|
||||
Reference in New Issue
Block a user