Apply the finding engine to schematic and PCB reviews.

FACT, REQUIREMENT, and INFERENCE are separate fields; datasheet provenance
lives in the rule DB so Recommended cannot stay ERROR; LLM output is REVIEW.
Designer decisions persist across rescans. Schematic and PCB share one library
and the same finding object in the report UI.
This commit is contained in:
2026-09-20 08:38:59 +02:00
parent 8f4ebc645c
commit dc65e96a22
16 changed files with 797 additions and 211 deletions
+7
View File
@@ -21,6 +21,7 @@ from typing import Awaitable, Callable
log = logging.getLogger(__name__)
from backend.periscopex.finding_engine import apply_decisions
from backend.periscopex.models import (
ComponentConstraints,
ComponentType,
@@ -789,6 +790,12 @@ async def validate_design_async(
def _write_report(paused: bool = False) -> ValidationReport:
annotate_findings_cad(all_findings, graph.cad_index)
assign_finding_ids(all_findings)
dec_path = existing_path.with_name("decisions.json")
if dec_path.is_file():
try:
apply_decisions(all_findings, json.loads(dec_path.read_text()))
except Exception:
log.exception("decisions.json apply failed")
summary = {"total": len(all_findings), "ERROR": 0, "WARNING": 0, "INFO": 0}
for f in all_findings:
summary[f.status] = summary.get(f.status, 0) + 1