fix(agents): accept monitoring coverage source fallback
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 1m12s
CD Pipeline / build-and-deploy (push) Successful in 4m53s
CD Pipeline / post-deploy-checks (push) Successful in 1m49s

This commit is contained in:
Your Name
2026-07-03 09:39:38 +08:00
parent 7093dae3b8
commit 80dae85eb2
3 changed files with 53 additions and 4 deletions

View File

@@ -1082,15 +1082,23 @@ def _inspect_source_contract(repo_root: Path) -> dict[str, bool]:
"apps/api/src/services/telegram_alert_learning_context_post_apply_verifier.py",
"telegram_alert_learning_context_post_apply_verifier_v1",
),
"awooop_coverage_surface_present": (
"apps/web/src/components/awooop/autonomous-runtime-receipt-panel.tsx",
"telegram-alert-monitoring-coverage-readback",
),
}
result: dict[str, bool] = {}
for key, (relative_path, marker) in checks.items():
text_value = _read_source_contract_text(repo_root, relative_path)
result[key] = marker in text_value
web_surface_text = _read_source_contract_text(
repo_root,
"apps/web/src/components/awooop/autonomous-runtime-receipt-panel.tsx",
)
api_endpoint_text = _read_source_contract_text(
repo_root,
"apps/api/src/api/v1/agents.py",
)
result["awooop_coverage_surface_present"] = (
"telegram-alert-monitoring-coverage-readback" in web_surface_text
or "/telegram-alert-monitoring-coverage-readback" in api_endpoint_text
)
return result

View File

@@ -323,3 +323,42 @@ def test_telegram_alert_monitoring_coverage_source_contract(tmp_path):
proof = _inspect_source_contract(tmp_path)
assert proof == _source_contract()
def test_telegram_alert_monitoring_coverage_source_contract_accepts_api_container_layout(
tmp_path,
):
(tmp_path / "apps/api/src/api/v1").mkdir(parents=True)
(tmp_path / "apps/api/src/repositories").mkdir(parents=True)
(tmp_path / "apps/api/src/services").mkdir(parents=True)
(tmp_path / "apps/api/src/api/v1/webhooks.py").write_text(
"get_alert_operation_log_repository\n"
'"TELEGRAM_SENT"\n',
encoding="utf-8",
)
(tmp_path / "apps/api/src/repositories/alert_operation_log_repository.py").write_text(
"ALERT_EVENT_TYPES\n",
encoding="utf-8",
)
(tmp_path / "apps/api/src/services/telegram_gateway.py").write_text(
"_mirror_outbound_message\n"
"record_outbound_message\n",
encoding="utf-8",
)
(tmp_path / "apps/api/src/services/platform_operator_service.py").write_text(
"list_ai_alert_card_delivery_readback\n"
"ai_alert_card_learning_writeback_refs_v1\n",
encoding="utf-8",
)
(tmp_path / "apps/api/src/services/telegram_alert_learning_context_post_apply_verifier.py").write_text(
"telegram_alert_learning_context_post_apply_verifier_v1\n",
encoding="utf-8",
)
(tmp_path / "apps/api/src/api/v1/agents.py").write_text(
'"/telegram-alert-monitoring-coverage-readback"\n',
encoding="utf-8",
)
proof = _inspect_source_contract(tmp_path)
assert proof == _source_contract()