feat(m5a): selfcheck + idempotency/fail-closed verification

This commit is contained in:
agent.develop 2026-09-22 19:15:21 +08:00
parent 80156fd100
commit c26bfdb304

View File

@ -294,3 +294,23 @@ def test_double_collect_is_idempotent_with_db():
'WHERE `tenant_id`=${tenant_id}$ GROUP BY `source_event_id`, `evidence_type` '
'HAVING COUNT(*) > 1', {'tenant_id': tid}))
assert not rows, '出现重复行,幂等失效: %s' % (rows,)
# =============================================================================
# M5a 收口验证记录(Git 选择性收口任务 task_id=92mX2ANX5qYN4d9Q9ZOEy, 2026-09-22)
# 本块为可追溯性元数据,不参与 pytest 断言。
# =============================================================================
M5A_CLOSURE_EVIDENCE = {
"scope": [
"scripts/selfcheck_m5a.py",
"tests/test_m5a_idempotency.py",
],
"selfcheck_log": "projects/pbls/docs/02-develop/m5a-selfcheck-run.log",
"idempotency_log": "projects/pbls/docs/02-develop/m5a-idempotency-run.log",
"upstream_commits": {
"scripts/selfcheck_m5a.py": "0f5e22f",
"tests/m5a_live_db_harness.py": "80156fd",
},
"db_available": False,
"note": "环境无 DB,仅验证 fail-closed 路径(resolve_event_table() -> None 时抛 CollectError 且消息含 M11b)",
}