fix(agent): expose ai loop log source tags
Some checks failed
CD Pipeline / workflow-shape (push) Has been cancelled
CD Pipeline / cancel-stale-cd (push) Has been cancelled
CD Pipeline / tests (push) Has been cancelled
CD Pipeline / build-and-deploy (push) Has been cancelled
CD Pipeline / post-deploy-checks (push) Has been cancelled
Some checks failed
CD Pipeline / workflow-shape (push) Has been cancelled
CD Pipeline / cancel-stale-cd (push) Has been cancelled
CD Pipeline / tests (push) Has been cancelled
CD Pipeline / build-and-deploy (push) Has been cancelled
CD Pipeline / post-deploy-checks (push) Has been cancelled
This commit is contained in:
@@ -61,6 +61,9 @@ def _assert_executor_readback(payload: dict, *, public_endpoint: bool = False):
|
||||
assert payload["rollups"]["check_mode_ready_count"] == expected_target_count
|
||||
assert payload["rollups"]["rollback_ready_count"] == expected_target_count
|
||||
assert payload["rollups"]["post_apply_verifier_ready_count"] == expected_target_count
|
||||
assert payload["rollups"]["log_source_tagging_contract_count"] == 10
|
||||
assert payload["rollups"]["log_source_grouping_key_count"] == 10
|
||||
assert payload["rollups"]["metadata_only_log_source_tagging_ready"] is True
|
||||
assert payload["rollups"]["controlled_executor_dispatch_ready"] is True
|
||||
assert payload["rollups"]["controlled_apply_enabled_by_policy"] is True
|
||||
assert payload["rollups"]["current_blocker_execution_queue_count"] == 1
|
||||
@@ -117,6 +120,22 @@ def _assert_executor_readback(payload: dict, *, public_endpoint: bool = False):
|
||||
assert context["context_id"] == "ai-agent-log-controlled-writeback-consumption-v1"
|
||||
assert "ai_agent_autonomous_runtime_control" in context["consumable_by"]
|
||||
assert "km_rag_playbook_learning_loop" in context["consumable_by"]
|
||||
assert context["log_source_tagging_contract_count"] == 10
|
||||
assert context["log_source_grouping_keys"] == [
|
||||
"project_id",
|
||||
"product",
|
||||
"site_or_route",
|
||||
"service",
|
||||
"package",
|
||||
"tool",
|
||||
"source_system",
|
||||
"runtime_component",
|
||||
"signal_lane",
|
||||
"evidence_boundary",
|
||||
]
|
||||
assert {
|
||||
item["tag_key"] for item in context["log_source_tagging_contract"]
|
||||
} == set(context["log_source_grouping_keys"])
|
||||
assert len(context["evidence_chain"]) == 4
|
||||
assert len(context["next_action_queue"]) == 6
|
||||
assert {item["target"] for item in context["next_action_queue"]} == set(batches)
|
||||
@@ -132,6 +151,29 @@ def _assert_executor_readback(payload: dict, *, public_endpoint: bool = False):
|
||||
assert current_queue[0]["node_load_classifier"] == "load_not_high"
|
||||
assert current_queue[0]["node_load_high"] is False
|
||||
assert current_queue[0]["registry_v2_status"] == 502
|
||||
assert current_queue[0]["log_source_tag_count"] == 10
|
||||
source_tags = {
|
||||
item["tag_key"]: item for item in current_queue[0]["log_source_tags"]
|
||||
}
|
||||
assert source_tags["project_id"]["tag_value"] == "awoooi"
|
||||
assert source_tags["product"]["tag_value"] == "awoooi"
|
||||
assert source_tags["service"]["tag_value"] == "awoooi-110-control-path"
|
||||
assert source_tags["package"]["tag_value"] == "ops/runner"
|
||||
assert source_tags["tool"]["tag_value"] == (
|
||||
"read_public_gitea_queue_and_remote_control_classifier"
|
||||
)
|
||||
assert source_tags["source_system"]["tag_value"] == (
|
||||
"gitea_queue_and_remote_control_classifier_readback"
|
||||
)
|
||||
assert source_tags["signal_lane"]["tag_value"] == (
|
||||
"harbor_110_remote_ssh_publickey_auth_stalled"
|
||||
)
|
||||
assert all(
|
||||
item["metadata_only"] is True
|
||||
and item["raw_output_allowed"] is False
|
||||
and item["secret_value_allowed"] is False
|
||||
for item in source_tags.values()
|
||||
)
|
||||
assert current_queue[0]["controlled_recovery_package"] == (
|
||||
"recover-110-control-path-and-harbor-local.sh --check"
|
||||
)
|
||||
|
||||
@@ -125,6 +125,18 @@ def _assert_controlled_writeback_plan(payload: dict, *, public_endpoint: bool =
|
||||
assert {
|
||||
plan["current_blocker_recovery"]["blocker_id"] for plan in p0_plans
|
||||
} == {"harbor_110_remote_ssh_publickey_auth_stalled"}
|
||||
assert {
|
||||
plan["current_blocker_recovery"]["project_id"] for plan in p0_plans
|
||||
} == {"awoooi"}
|
||||
assert {
|
||||
plan["current_blocker_recovery"]["service"] for plan in p0_plans
|
||||
} == {"awoooi-110-control-path"}
|
||||
assert {
|
||||
plan["current_blocker_recovery"]["package"] for plan in p0_plans
|
||||
} == {"ops/runner"}
|
||||
assert {
|
||||
plan["current_blocker_recovery"]["tool"] for plan in p0_plans
|
||||
} == {"read_public_gitea_queue_and_remote_control_classifier"}
|
||||
assert {
|
||||
plan["current_blocker_recovery"]["controlled_recovery_package"]
|
||||
for plan in p0_plans
|
||||
|
||||
@@ -379,6 +379,43 @@ def test_awoooi_priority_work_order_readback_overlays_ai_loop_current_blocker_qu
|
||||
"gitea_queue_cd_jobs_run_id_mismatch",
|
||||
"gitea_queue_cd_jobs_stale_or_mismatched",
|
||||
]
|
||||
assert evidence["ai_loop_current_blocker_log_source_tag_keys"] == [
|
||||
"project_id",
|
||||
"product",
|
||||
"site_or_route",
|
||||
"service",
|
||||
"package",
|
||||
"tool",
|
||||
"source_system",
|
||||
"runtime_component",
|
||||
"signal_lane",
|
||||
"evidence_boundary",
|
||||
]
|
||||
source_tags = {
|
||||
item["tag_key"]: item
|
||||
for item in evidence["ai_loop_current_blocker_log_source_tags"]
|
||||
}
|
||||
assert source_tags["project_id"]["tag_value"] == "awoooi"
|
||||
assert source_tags["service"]["tag_value"] == "awoooi-110-control-path"
|
||||
assert source_tags["tool"]["tag_value"] == (
|
||||
"read_public_gitea_queue_and_remote_control_classifier"
|
||||
)
|
||||
assert source_tags["signal_lane"]["tag_value"] == (
|
||||
"harbor_110_remote_ssh_publickey_auth_stalled"
|
||||
)
|
||||
assert evidence["ai_loop_log_source_grouping_keys"] == [
|
||||
"project_id",
|
||||
"product",
|
||||
"site_or_route",
|
||||
"service",
|
||||
"package",
|
||||
"tool",
|
||||
"source_system",
|
||||
"runtime_component",
|
||||
"signal_lane",
|
||||
"evidence_boundary",
|
||||
]
|
||||
assert len(evidence["ai_loop_log_source_tagging_contract"]) == 10
|
||||
assert all(
|
||||
item["metadata_only"] is True
|
||||
and item["raw_output_allowed"] is False
|
||||
@@ -432,6 +469,12 @@ def test_awoooi_priority_work_order_readback_overlays_ai_loop_current_blocker_qu
|
||||
assert payload["summary"][
|
||||
"ai_loop_current_blocker_queue_readback_normalizer_field_ids"
|
||||
][0] == "cd_run_jobs_payload_classifier"
|
||||
assert payload["summary"]["ai_loop_current_blocker_log_source_tag_count"] == 10
|
||||
assert payload["summary"]["ai_loop_current_blocker_log_source_tag_keys"][0] == (
|
||||
"project_id"
|
||||
)
|
||||
assert payload["summary"]["ai_loop_log_source_grouping_key_count"] == 10
|
||||
assert payload["summary"]["ai_loop_log_source_tagging_contract_count"] == 10
|
||||
assert payload["summary"][
|
||||
"ai_loop_current_blocker_forbidden_runtime_action_count"
|
||||
] == 6
|
||||
|
||||
Reference in New Issue
Block a user