"use client"; import React from "react"; import { loadInvestigation } from "@/lib/storage/investigation-storage"; import ScenarioForm from "@/components/scenario-form"; import Link from "next/link"; import { useParams, useRouter } from "next/navigation"; import { useEffect, useState } from "react"; export default function InvestigationPage({ params }) { const router = useRouter(); const routeId = typeof params?.id === "string" ? params.id : ""; const [existing, setExisting] = useState(null); const [hydrated, setHydrated] = useState(false); useEffect(() => { let active = true; setHydrated(false); if (!routeId) { setHydrated(true); return; } (async () => { try { const snapshot = await loadInvestigation(routeId); if (active) setExisting(snapshot); } finally { if (active) setHydrated(true); } })(); return () => { active = false; }; }, [routeId]); return (
{/* Page-level navigation — owned by route, not ReasoningWorkspace */}

Confidence Engine

Experimental prototype: enter a scenario and send it to a local LLM for evidence-based structured reconstruction. This is a technical vertical slice — not a production system.

{!hydrated ? (

Loading investigation…

) : existing ? ( router.push(`/investigations/${routeId}/report`)} /> ) : ( router.push(`/investigations/${routeId}/report`)} /> )}
); }