From d431a026ce3a8499764daab00239c539e2b47b02 Mon Sep 17 00:00:00 2001 From: woogi Date: Mon, 10 Aug 2026 10:56:53 -0500 Subject: [PATCH] feat: treat disputed extracted values as unverified in constructability and critic prompts --- backend/agents/construct_agent.py | 1 + backend/pipeline/conflict_checker.py | 10 ++++++++++ backend/prompts.py | 12 +++++++++++- 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/backend/agents/construct_agent.py b/backend/agents/construct_agent.py index 5a935ec..2bd15cf 100644 --- a/backend/agents/construct_agent.py +++ b/backend/agents/construct_agent.py @@ -47,6 +47,7 @@ class ConstructabilityAgent: "assertions": dumps(cluster["assertions"]), "clusters": dumps(slim_clusters([cluster])), "conflicts": dumps(scope.payload.get("conflicts") or []), + "disputes": dumps(cluster.get("disputed_attributes") or []), } for key, value in substitutions.items(): instruction = instruction.replace("{" + key + "}", value) diff --git a/backend/pipeline/conflict_checker.py b/backend/pipeline/conflict_checker.py index fc0bdde..d461f31 100644 --- a/backend/pipeline/conflict_checker.py +++ b/backend/pipeline/conflict_checker.py @@ -32,6 +32,16 @@ def _evidence_block(cluster: Dict) -> str: f"{a.get('attribute','')} = {a.get('value','')} | " f"\"{a.get('source_text','')}\"" ) + disputes = cluster.get("disputed_attributes") or [] + if disputes: + lines.append("") + for d in disputes: + lines.append( + "DISPUTED VALUE (possible extraction misread): " + f"attribute={d.get('attribute','')} " + f"values={' | '.join(d.get('values') or [])} " + f"(assertions {', '.join(d.get('assertion_ids') or [])})" + ) return "\n".join(lines) diff --git a/backend/prompts.py b/backend/prompts.py index f4f5c5d..d640d53 100644 --- a/backend/prompts.py +++ b/backend/prompts.py @@ -410,6 +410,9 @@ What is NOT a conflict: - Anything not supported with drawing evidence. Be conservative: - Only flag genuine disagreements. +- When a value is marked DISPUTED (possible extraction misread), verify it against + the sheet images before relying on either reading; if the images do not resolve + it, do not assert a conflict from one reading alone. - A clean cluster with no contradiction must return an empty conflicts array. - missing_element requires evidence that another discipline would reasonably be expected to show the missing item. For each conflict: @@ -545,6 +548,12 @@ Flag: Rules: - Only flag issues supported by drawing evidence. - Be specific about the location and why it is a constructability risk. +- Assertions are machine-extracted from sheet images and may contain misread values, + especially quantities and member sizes (e.g. "(2) 2x6" vs "(5) 2x6"). +- When the cluster lists disputed_attributes, or two evidence items disagree on a + numeric value, do NOT assert a buildability conclusion from one reading. Report the + ambiguity itself (category "detail_gap", confidence "low") and state that the value + needs verification against the sheet. - Use plain ASCII only. Respond only with valid JSON.""" @@ -554,7 +563,8 @@ Respond ONLY with a valid JSON object - no markdown fences, no explanation: If no constructability issues are found, return: { "issues": [] } Extracted assertions: {assertions} Clusters: {clusters} -Cross-discipline conflicts already found: {conflicts}""" +Cross-discipline conflicts already found: {conflicts} +Disputed extracted values in this cluster (possible vision misreads - treat as unverified): {disputes}""" # ---------------------------------------------------------------------------