KnowledgeProvider protocol with a deterministic TF-IDF-weighted extractive demo provider (never generative, always cites real excerpts) and a RAGcore HTTP adapter that degrades cleanly to unavailable. Knowledge nav + chat-style Q&A UI with source cards and honest grounded/insufficient/unavailable states. 57 backend tests passing, ruff clean. Fixed a real relevance bug (generic terms like "vehicle" crowding out distinctive matches) via IDF weighting, found by testing the actual S6 scenario. Verified end-to-end in the browser: grounded damage question cites both expected procedures; unrelated question honestly returns insufficient evidence with no fabrication.
46 lines
1.9 KiB
TypeScript
46 lines
1.9 KiB
TypeScript
import { Navigate, Route, Routes } from "react-router-dom";
|
|
import { AuthProvider } from "./context/AuthContext";
|
|
import { Layout } from "./components/Layout";
|
|
import { RequireAuth } from "./components/RequireAuth";
|
|
import { Login } from "./pages/Login";
|
|
import { Dashboard } from "./pages/Dashboard";
|
|
import { Vehicles } from "./pages/Vehicles";
|
|
import { VehicleDetail } from "./pages/VehicleDetail";
|
|
import { Bookings } from "./pages/Bookings";
|
|
import { BookingDetail } from "./pages/BookingDetail";
|
|
import { DataQuality } from "./pages/DataQuality";
|
|
import { DataQualityIssueDetail } from "./pages/DataQualityIssueDetail";
|
|
import { Automation } from "./pages/Automation";
|
|
import { Knowledge } from "./pages/Knowledge";
|
|
import { Audit } from "./pages/Audit";
|
|
|
|
export function App() {
|
|
return (
|
|
<AuthProvider>
|
|
<Routes>
|
|
<Route path="/login" element={<Login />} />
|
|
<Route
|
|
element={
|
|
<RequireAuth>
|
|
<Layout />
|
|
</RequireAuth>
|
|
}
|
|
>
|
|
<Route path="/dashboard" element={<Dashboard />} />
|
|
<Route path="/vehicles" element={<Vehicles />} />
|
|
<Route path="/vehicles/:publicRef" element={<VehicleDetail />} />
|
|
<Route path="/bookings" element={<Bookings />} />
|
|
<Route path="/bookings/:publicRef" element={<BookingDetail />} />
|
|
<Route path="/data-quality" element={<DataQuality />} />
|
|
<Route path="/data-quality/:publicRef" element={<DataQualityIssueDetail />} />
|
|
<Route path="/automation" element={<Automation />} />
|
|
<Route path="/knowledge" element={<Knowledge />} />
|
|
<Route path="/audit" element={<Audit />} />
|
|
</Route>
|
|
<Route path="/" element={<Navigate to="/dashboard" replace />} />
|
|
<Route path="*" element={<Navigate to="/dashboard" replace />} />
|
|
</Routes>
|
|
</AuthProvider>
|
|
);
|
|
}
|