fix(sre): fail closed DB verifier runtime drift

This commit is contained in:
Your Name
2026-07-19 00:18:06 +08:00
parent 373ad979f4
commit f1811bf8ab
2 changed files with 40 additions and 1 deletions

View File

@@ -335,6 +335,16 @@ def evaluate_catalog_snapshot(row: Mapping[str, Any]) -> dict[str, Any]:
drift = bool(
index_count > 1 or (index_exists and not index_definition_exact_except_validity)
)
verify_ready = bool(
row.get("table_exists") is True
and row.get("columns_complete") is True
and row.get("table_kind_supported") is True
and row.get("primary_database") is True
and row.get("schema_usage") is True
and row.get("table_select") is True
and index_shape_exact
and not drift
)
apply_ready = bool(
base_ready
and not drift
@@ -384,6 +394,7 @@ def evaluate_catalog_snapshot(row: Mapping[str, Any]) -> dict[str, Any]:
"reindex_ready": reindex_ready,
"catalog_drift": drift,
"apply_ready": apply_ready,
"verify_ready": verify_ready,
}
@@ -522,7 +533,7 @@ async def execute_bounded_db_command(
error_code=None if terminal == "check_ready" else "precheck_failed",
)
if mode == "verify":
verified = before["index_shape_exact"] and not before["catalog_drift"]
verified = before["verify_ready"]
return _receipt(
mode=mode,
trace_id=trace_id,