From d35e8311d6ebf2cebd5488dcf8a8da09371d841a Mon Sep 17 00:00:00 2001 From: kjh2064 Date: Sun, 14 Jun 2026 10:39:37 +0900 Subject: [PATCH] =?UTF-8?q?fix:=20validate=5Fgas=5Fthin=5Fadapter=5Fv1.py?= =?UTF-8?q?=20=E2=80=94=20audit=20JSON=20=ED=95=84=EB=93=9C=EB=AA=85=20?= =?UTF-8?q?=EB=A7=A4=ED=95=91=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit audit_gas_thin_adapter_v1.py(Phase-1) 출력 형식(summary.forbidden_count, summary.total_functions)을 올바르게 읽도록 elif audit 브랜치 수정. 수정 전: forbidden=0, coverage=0.0 → gate=FAIL 수정 후: forbidden=23, coverage=100.0, migration_plan=true → gate=PASS Co-Authored-By: Claude Sonnet 4.6 --- tools/validate_gas_thin_adapter_v1.py | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/tools/validate_gas_thin_adapter_v1.py b/tools/validate_gas_thin_adapter_v1.py index 1ea7067..5b7b32a 100644 --- a/tools/validate_gas_thin_adapter_v1.py +++ b/tools/validate_gas_thin_adapter_v1.py @@ -116,9 +116,23 @@ def main() -> int: function_inventory_coverage_pct = 100.0 if rows else 0.0 sample_findings = rows[:200] elif audit: - forbidden_function_count = int(audit.get("forbidden_function_count") or 0) - function_inventory_coverage_pct = float(audit.get("function_inventory_coverage_pct") or 0.0) - sample_findings = audit.get("rows")[:200] if isinstance(audit.get("rows"), list) else [] + # audit_gas_thin_adapter_v1.py (v2) 출력 형식 지원: + # summary.forbidden_count, summary.compliance_pct, migration_candidates + summary = audit.get("summary", {}) + if summary: + forbidden_function_count = int(summary.get("forbidden_count") or 0) + total_functions = int(summary.get("total_functions") or 0) + function_inventory_coverage_pct = 100.0 if total_functions > 0 else 0.0 + candidates = audit.get("migration_candidates", []) + sample_findings = [ + {"file": c.get("file",""), "name": c.get("name",""), + "responsibility": c.get("responsibility",[])} + for c in candidates[:200] + ] + else: + forbidden_function_count = int(audit.get("forbidden_function_count") or 0) + function_inventory_coverage_pct = float(audit.get("function_inventory_coverage_pct") or 0.0) + sample_findings = audit.get("rows")[:200] if isinstance(audit.get("rows"), list) else [] else: classified_allowlist = _load_classified_allowlist() findings: list[dict[str, str]] = []