feat(confidence-engine): retain clarified questions

This commit is contained in:
2026-09-01 15:09:45 +01:00
parent 76c6096905
commit 9da0928453
+32 -6
View File
@@ -1187,8 +1187,10 @@ function OpenQuestionsPanel({
onUpdateFindingDisposition,
onUpdateFindingProposition,
}) {
const resolvedIds = new Set(graph?.resolvedNodeIds || []);
const openNodes = (graph?.nodes || []).filter(
(n) => n.kind === "unknown" && n.status !== "resolved" && !doneForNowIds.includes(n.id),
(n) => n.kind === "unknown" && !resolvedIds.has(n.id) && !doneForNowIds.includes(n.id),
);
if (openNodes.length <= 0) return null;
@@ -1817,12 +1819,14 @@ export default function ReasoningWorkspace({
{(() => {
const resolvedIds = new Set(graph?.resolvedNodeIds || []);
// Open Questions: unresolved unknown nodes only (investigable)
// Open Questions: unknown nodes NOT in resolvedNodeIds (canonically investigable)
const openUnknowns = (graph?.nodes || []).filter(
(n) =>
n.kind === "unknown" &&
n.status !== "resolved" &&
!resolvedIds.has(n.id),
(n) => n.kind === "unknown" && !resolvedIds.has(n.id),
);
// Clarified questions: unknown nodes that ARE in resolvedNodeIds (read-only historical)
const clarifiedQuestions = (graph?.nodes || []).filter(
(n) => n.kind === "unknown" && resolvedIds.has(n.id),
);
// Possible Interpretations: unresolved assumption nodes only (informational, not investigable)
@@ -1915,6 +1919,28 @@ export default function ReasoningWorkspace({
</div>
)}
{/* QUESTIONS WE HAVE CLARIFIED — resolved unknowns shown post-Done */}
{clarifiedQuestions.length > 0 && (
<div className="space-y-3">
<h2 className="text-[11px] font-semibold tracking-widest uppercase text-gray-500">
Questions we have clarified
</h2>
{clarifiedQuestions.map((node) => (
<div key={node.id} className="space-y-1">
<div
className="w-full text-left rounded-lg border border-green-200/60 bg-green-50/30 px-5 py-4"
>
<span className="block text-sm leading-relaxed text-gray-900">{node.label}</span>
{node.description && node.description !== node.label && (
<p className="mt-1.5 text-xs leading-snug text-gray-500">{node.description}</p>
)}
<span className="mt-2 block text-[10px] uppercase tracking-wider text-green-600">Clarified</span>
</div>
</div>
))}
</div>
)}
{/* POSSIBLE INTERPRETATIONS — assumption nodes (informational, not investigable) */}
{possibleInterpretations.length > 0 && (
<div className="space-y-3">