From f703fdc842e64ed6b7af5095af49fff9f2aaf49c Mon Sep 17 00:00:00 2001 From: robbond Date: Tue, 4 Aug 2026 18:09:45 +0100 Subject: [PATCH] fix: clarify terminal investigation states --- components/reasoning-workspace.jsx | 155 +++++++++++++++-------------- components/scenario-form.jsx | 10 -- 2 files changed, 82 insertions(+), 83 deletions(-) diff --git a/components/reasoning-workspace.jsx b/components/reasoning-workspace.jsx index 8c2fa9d..16eca54 100644 --- a/components/reasoning-workspace.jsx +++ b/components/reasoning-workspace.jsx @@ -25,11 +25,35 @@ function isTechnicalSummary(summary) { return false; } +// ── Current understanding card ──────────────────────────────── + +// Evidence-limit text that must not appear inside Current understanding +// when the terminal outcome already communicates that state. +const EVIDENCE_LIMIT_PHRASES = [ + "The available evidence has reached its current limit", + "evidence has reached its current limit", + "evidence limit reached", + "has reached its current limit", +]; + function resolveCurrentSummary(currentSummary) { - if (isTechnicalSummary(currentSummary)) { - return null; + if (!currentSummary || typeof currentSummary !== "string") return null; + const trimmed = currentSummary.trim(); + if (!trimmed) return null; + + // Filter out technical graph summaries + for (const p of TECHNICAL_PATTERNS) { + if (p.test(trimmed)) return null; } - return currentSummary || null; + + // Don't show evidence-limit text in Current understanding when + // the terminal outcome card already communicates that state. + const lower = trimmed.toLowerCase(); + for (const phrase of EVIDENCE_LIMIT_PHRASES) { + if (lower.includes(phrase)) return null; + } + + return trimmed; } // ── Status message pools for loading feedback ──────────────── @@ -139,24 +163,17 @@ function CompletionCard() { return (

Investigation complete

-

You have provided enough information. The situation has been fully investigated.

+

The current investigation has reached a justified conclusion.

); } -// ── Evidence exhaustion card (terminal state) ───────────────── -function EvidenceExhaustedCard({ noQuestionReason }) { - let message = "There is not yet enough evidence to guide the next step."; - if (noQuestionReason) { - const reason = String(noQuestionReason); - if (reason.toLowerCase().includes("insufficient")) { - message = reason; - } - } +// ── Evidence-limit card (terminal state: no next question) ─────── +function EvidenceLimitCard() { return (
-

Further investigation needed

-

{message}

+

Current evidence limit reached

+

Further progress requires additional evidence.

); } @@ -432,8 +449,6 @@ export default function ReasoningWorkspace({ const graph = result?.situationGraph ?? null; const diagnostics = result?.diagnostics ?? null; const newlySurfacedNodeIds = result?.newlySurfacedNodeIds || []; - const noQuestionReason = diagnostics?.noQuestionReason ?? null; - const genuineCompletion = hasGenuineCompletion(graph); return ( @@ -457,68 +472,66 @@ export default function ReasoningWorkspace({ {/* ── No graph produced after initial analysis ───────── */} {(status === "success" || status === "error") && !graph ? (
- {noQuestionReason + {diagnostics?.noQuestionReason ? "Validation failed — no structured graph output was produced." : "The analysis completed but did not produce a structured result."}
) : ( <> - {/* ── 1. Current investigation (or terminal state) ─ */} - {canAnswer && } + {/* ── 1. Terminal state: outcome card (no active question) ─ */} + {status === "success" && !canAnswer && graph && !isUpdating && genuineCompletion && } + {status === "success" && !canAnswer && graph && !isUpdating && !genuineCompletion && } - {/* Terminal states occupy the hero position when no question */} - {status === "success" && !canAnswer && graph && genuineCompletion && ( - - )} - {status === "success" && !canAnswer && graph && !genuineCompletion && updateStatus !== "success" && ( - - )} + {/* ── 2. Current understanding (when meaningful) ─ */} + {(graph?.currentSummary || (status === "success" && !canAnswer)) && } - {/* ── 2. Post-update acknowledgement ─────────────── */} - {updateStatus === "success" && canAnswer && } - - {/* ── 3. Response form ───────────────────────────── */} - {canAnswer && ( -
-
- -