Phase 3 KPI 상태값 명시

This commit is contained in:
Yun Chan 2026-06-28 23:53:17 +09:00
parent 1e9f293fda
commit f7aae885b2
4 changed files with 42 additions and 21 deletions

View file

@ -160,9 +160,14 @@ KPI_METRIC_REQUIRED_KEYS = {
"numerator",
"pass",
"source_files",
"status",
"threshold",
"value",
}
KPI_METRIC_STATUSES = {
"computed_prepost",
"design_pending",
}
MANIFEST_KEYS = {
"agreement",
@ -342,6 +347,13 @@ def validate_kpi_report(root: Path, report: Report) -> None:
report.error(f"{rel_path}: metric '{metric_name}' missing '{key}'")
if "source_files" in metric and not isinstance(metric["source_files"], list):
report.error(f"{rel_path}: metric '{metric_name}' source_files must be a list")
status = metric.get("status")
if status is not None and status not in KPI_METRIC_STATUSES:
expected = ", ".join(sorted(KPI_METRIC_STATUSES))
report.error(
f"{rel_path}: metric '{metric_name}' status '{status}' is invalid "
f"(expected one of: {expected})"
)
def sha256_file(path: Path) -> str: