Show Action on finding cards and inject PCB geometry into AI context.

Layout and AI findings always get action (fallback recommendation). The card
renders that sentence in the body. PCB review context now includes vias under
the footprint, copper thickness, nearby widths, courtyard, and keepout polygons.
This commit is contained in:
2026-09-20 09:13:51 +02:00
parent f63c1c3411
commit facbaa2305
12 changed files with 359 additions and 28 deletions
+9 -2
View File
@@ -6,6 +6,7 @@ import logging
from pathlib import Path
from backend.periscopex.cad_bridge import annotate_findings_cad, cad_index_from_graph
from backend.periscopex.finding_engine import complete_findings
from backend.periscopex.functional_groups import FunctionalGroupsReport
from backend.periscopex.models import ComponentType, DesignGraph, Finding, LayoutGraph
from backend.periscopex.pcb_inventory import PcbInventoryReport
@@ -27,8 +28,14 @@ def _ensure_recs(findings: list[Finding]) -> None:
for f in findings:
if f.source in (None, "review"):
f.source = "pcb_review"
if not (f.recommendation or "").strip():
f.recommendation = _FIX
rec = (f.recommendation or "").strip()
act = (f.action or "").strip()
if not rec:
rec = act or _FIX
f.recommendation = rec
if not act:
f.action = rec
complete_findings(findings)
def _has_library_extraction(cons) -> bool: