Isolate cross-database repair validation
Some checks failed
CI / test (push) Has been cancelled

This commit is contained in:
2026-08-28 13:26:43 +02:00
parent aa979f3ca9
commit 75894f8b52
4 changed files with 116 additions and 4 deletions

View File

@@ -5,6 +5,7 @@ from pathlib import Path, PurePosixPath
from .config import Settings
from .git import ChangeSummary
from .models import FailureReport
_ALWAYS_DENIED = (
".env",
@@ -66,3 +67,16 @@ def evaluate_changes(
errors.append(f"Direct-main denied path changed: {filename}")
return PolicyResult(not errors, tuple(errors))
def evaluate_report_scope(report: FailureReport, summary: ChangeSummary) -> PolicyResult:
expected = f"{report.user_feedback or ''}\n{report.expected_behavior or ''}".lower()
requires_cross_database_orchestration = "cockpit_config" in expected and "fk_" in expected
has_application_change = any(filename.startswith("app/") for filename in summary.files)
errors = []
if requires_cross_database_orchestration and not has_application_change:
errors.append(
"Cross-database report changed no application code; inspect routing and implement staged orchestration"
)
return PolicyResult(not errors, tuple(errors))