Active case context
{activeCase?.problem_statement}
{activeCase?.constraints && activeCase.constraints.length > 0 && (
Scope:
{activeCase.constraints.map((c, i) => (
{c}
))}
)}
{activeCase?.status}
ID: {activeCase?.case_id.substring(0, 8)}...
{/* Status Visual Pipeline */}
{[
{
name: "Case Manager Agent",
desc: "Hypothesis generation",
active: activeCase?.status === "investigating" && activeCase?.hypotheses.length === 0,
done: activeCase?.hypotheses.length > 0,
},
{
name: "Research Agent",
desc: "Web queries & verification",
active: activeCase?.status === "investigating" && activeCase?.hypotheses.length > 0 && activeCase?.hypotheses.some(h => h.status === "investigating"),
done: activeCase?.status === "completed" || (activeCase?.hypotheses.length > 0 && activeCase?.hypotheses.every(h => h.status !== "pending" && h.status !== "investigating")),
},
{
name: "Synthesis Specialist",
desc: "Final verdicts & sorting",
active: activeCase?.status === "investigating" && activeCase?.hypotheses.length > 0 && activeCase?.hypotheses.every(h => h.status !== "pending" && h.status !== "investigating"),
done: activeCase?.status === "completed",
},
].map((step, idx) => (
{step.name}
{step.active ? (
) : step.done ? (
✓
) : (
○
)}
{step.desc}
))}
{/* Accordion List of Hypotheses with Nested Evidence */}
Generated Hypotheses & Live Evidence
{activeCase?.hypotheses && activeCase.hypotheses.length > 0 ? (
{activeCase.hypotheses.map((h, i) => {
const isExpanded = expandedHypothesisId === h.id;
// Filter evidence belonging to this hypothesis
const relatedEvidence = activeCase.evidence ? activeCase.evidence.filter(ev => ev.hypothesis_id === h.id) : [];
return (
{/* Accordion Trigger Header */}
setExpandedHypothesisId(isExpanded ? null : h.id)}
className="w-full text-left p-5 flex items-start justify-between gap-4 cursor-pointer"
>
HYPOTHESIS {i + 1}
{h.assigned_investigator && (
🕵️ {h.assigned_investigator}
)}
{h.statement}
{h.status}
{isExpanded ? "▲" : "▼"}
{/* Accordion Body Content */}
{isExpanded && (
{/* Evidence items */}
Collected Evidence & Web Snippets
{relatedEvidence.length > 0 ? (
{relatedEvidence.map((ev, evIdx) => {
const isContrary = ev.content.startsWith("[CONTRARY]");
const cleanContent = isContrary ? ev.content.replace("[CONTRARY] ", "") : ev.content;
return (
Source: {ev.source}
Confidence: {(ev.confidence * 100).toFixed(0)}%
{cleanContent}
);
})}
) : h.status === "investigating" ? (
Crawling DuckDuckGo search queries for evidence...
) : (
No direct evidence recorded for this hypothesis.
)}
)}
);
})}
) : (
Case Manager decomposing case objective...
)}
{/* ── Conclusion Section ── */}
{activeCase?.status === "completed" && activeCase?.facts && activeCase.facts.length > 0 && (