feat: treat disputed extracted values as unverified in constructability and critic prompts

This commit is contained in:
2026-08-10 10:56:53 -05:00
parent 8631a26006
commit d431a026ce
3 changed files with 22 additions and 1 deletions
+1
View File
@@ -47,6 +47,7 @@ class ConstructabilityAgent:
"assertions": dumps(cluster["assertions"]), "assertions": dumps(cluster["assertions"]),
"clusters": dumps(slim_clusters([cluster])), "clusters": dumps(slim_clusters([cluster])),
"conflicts": dumps(scope.payload.get("conflicts") or []), "conflicts": dumps(scope.payload.get("conflicts") or []),
"disputes": dumps(cluster.get("disputed_attributes") or []),
} }
for key, value in substitutions.items(): for key, value in substitutions.items():
instruction = instruction.replace("{" + key + "}", value) instruction = instruction.replace("{" + key + "}", value)
+10
View File
@@ -32,6 +32,16 @@ def _evidence_block(cluster: Dict) -> str:
f"{a.get('attribute','')} = {a.get('value','')} | " f"{a.get('attribute','')} = {a.get('value','')} | "
f"\"{a.get('source_text','')}\"" 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) return "\n".join(lines)
+11 -1
View File
@@ -410,6 +410,9 @@ What is NOT a conflict:
- Anything not supported with drawing evidence. - Anything not supported with drawing evidence.
Be conservative: Be conservative:
- Only flag genuine disagreements. - 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. - 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. - missing_element requires evidence that another discipline would reasonably be expected to show the missing item.
For each conflict: For each conflict:
@@ -545,6 +548,12 @@ Flag:
Rules: Rules:
- Only flag issues supported by drawing evidence. - Only flag issues supported by drawing evidence.
- Be specific about the location and why it is a constructability risk. - 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. - Use plain ASCII only.
Respond only with valid JSON.""" 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": [] } If no constructability issues are found, return: { "issues": [] }
Extracted assertions: {assertions} Extracted assertions: {assertions}
Clusters: {clusters} 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}"""
# --------------------------------------------------------------------------- # ---------------------------------------------------------------------------