|
36 | 36 | | 8 | Synthesis Agent & Intelligence Layer | Cross-referencing, hypotheses, contradictions, gaps, timeline, case summary/verdict | REQ-AGENT-008, REQ-HYPO-*, REQ-WOW-*, REQ-VIS-004/005/006, REQ-TASK-001/002 | ✅ COMPLETE | |
37 | 37 | | 8.1 | Geospatial Agent & Map View | Location intelligence, geocoding, movement patterns, Earth Engine | REQ-GEO-* | ✅ COMPLETE | |
38 | 38 | | 9 | Chat Interface & Research | Multi-source tool-based Q&A, research/discovery, context caching | REQ-CHAT-*, REQ-RESEARCH-*, REQ-HYPO-007/008 | 🟡 FRONTEND_DONE | |
39 | | -| 10 | Source Panel & Agent Flow Polish | Source viewers, citation navigation, task panel, narrative generation | REQ-SOURCE-*, REQ-VIS-*, REQ-TASK-003-007 | 🟡 FRONTEND_DONE | |
| 39 | +| 10 | Source Panel & Entity Resolution | Citation-to-source wiring, entity name resolution across all views | REQ-SOURCE-* | ✅ COMPLETE | |
40 | 40 | | 11 | Corrections & Refinement | Error flagging, Verification, Regeneration | REQ-CORR-* | ⏳ NOT_STARTED | |
41 | 41 | | 12 | Demo Preparation | Demo case showcasing all integration features | Demo readiness, REQ-RESEARCH-004, REQ-AGENT-007i | ⏳ NOT_STARTED | |
42 | 42 |
|
43 | 43 | > **Status Legend:** ✅ COMPLETE | 🟡 FRONTEND_DONE (backend pending) | ⏳ NOT_STARTED | ⏳ PLANNED |
44 | | -> **Note:** Phase 6 complete (2026-02-06, 35 commits). Architecture redesigned 2026-02-07: Phases 7-9 restructured with KG-as-Memory pattern, hybrid storage (PG + Vector), programmatic KG Builder, Synthesis Agent, tool-based Chat Agent. Architecture revised 2026-02-08: Programmatic KG Builder replaced with LLM-based KG Builder Agent (Approach 4); D3.js retained and enhanced (Epstein-inspired); vis-network deferred to optional Phase 7.3. |
| 44 | +> **Note:** Phase 10 complete (2026-02-09). Citation-to-source navigation wired across all 4 views (KG, Geospatial, Verdict, Timeline) with shared hooks and entity resolution. Known issues: PDF viewer has rendering bugs, audio viewer untested. Architecture revised 2026-02-08: Programmatic KG Builder replaced with LLM-based KG Builder Agent (Approach 4); D3.js retained and enhanced (Epstein-inspired); vis-network deferred to optional Phase 7.3. |
45 | 45 |
|
46 | 46 | **Post-MVP:** |
47 | 47 | | Phase | Name | Focus | Requirements | |
@@ -1252,78 +1252,61 @@ Plans: |
1252 | 1252 |
|
1253 | 1253 | --- |
1254 | 1254 |
|
1255 | | -## Phase 10: Agent Flow & Source Panel |
| 1255 | +## Phase 10: Source Panel & Entity Resolution |
1256 | 1256 |
|
1257 | | -**Goal:** Full-featured source viewers, Agent Flow refinements, and task panel. |
| 1257 | +**Goal:** Wire citation-to-source navigation across all views and resolve all entity IDs to human-readable names with type badges. |
1258 | 1258 |
|
1259 | | -**Requirements:** REQ-SOURCE-001 (complete), REQ-SOURCE-002 (complete), REQ-SOURCE-003 (complete), REQ-SOURCE-004 (complete), REQ-VIS-001, REQ-VIS-001a, REQ-VIS-002, REQ-VIS-004, REQ-VIS-007, REQ-WOW-004, REQ-TASK-003, REQ-TASK-004, REQ-TASK-005, REQ-TASK-006, REQ-TASK-007 |
| 1259 | +**Requirements:** REQ-SOURCE-001 (complete), REQ-SOURCE-002 (complete), REQ-SOURCE-003 (complete), REQ-SOURCE-004 (complete) |
1260 | 1260 |
|
1261 | | -**Status:** 🟡 FRONTEND_DONE (Timeline) — Source viewers + Task Panel pending |
| 1261 | +**Status:** ✅ COMPLETE (2026-02-09) |
1262 | 1262 |
|
1263 | | -### Frontend Completed (Yatharth, 2026-02-02) |
1264 | | -- ✅ Timeline view with events (`Timeline/`) |
1265 | | - - Day/week/month/year zoom levels |
1266 | | - - Layer filtering (evidence/legal/strategy) |
1267 | | - - Event cards with click-to-detail |
1268 | | - - Search with debouncing |
1269 | | - - SSE hooks ready (`useTimelineSSE.ts`) |
1270 | | - - React Query with caching (`useTimelineData.ts`) |
1271 | | - - Skeleton loading states |
1272 | | - - Framer Motion animations |
1273 | | -- ✅ Evidence source panel exists (`evidence-source-panel.tsx`) |
1274 | | - |
1275 | | -### Backend Work Remaining |
1276 | | -- ⏳ Timeline API endpoints (CRUD + SSE stream) |
1277 | | -- ⏳ PDF viewer with excerpt highlighting |
1278 | | -- ⏳ Video player with timestamp markers |
1279 | | -- ⏳ Audio player with waveform and transcript sync |
1280 | | -- ⏳ Image viewer with bounding box annotations |
1281 | | -- ⏳ Citation navigation (click → exact location) |
1282 | | -- ⏳ Narrative generation (executive summary, detailed) |
1283 | | -- ⏳ Export as PDF/DOCX |
1284 | | -- ⏳ Agent Flow refinements (most items) |
1285 | | -- ⏳ Investigation Task Panel (all items) |
| 1263 | +**Plans:** 3 plans in 3 waves |
| 1264 | + |
| 1265 | +Plans: |
| 1266 | +- [x] 10-01-PLAN.md -- Shared utilities: citation-utils, useSourceNavigation hook, useEntityResolver hook, CitationLink + EntityBadge components |
| 1267 | +- [x] 10-02-PLAN.md -- Wire KG entity panel, EntityTimelineEntry, and Geospatial detail panel |
| 1268 | +- [x] 10-03-PLAN.md -- Wire Verdict detail panels (hypothesis, contradiction, gap) and Timeline event cards |
| 1269 | + |
| 1270 | +**Scope (narrowed from original Phase 10 via CONTEXT.md):** |
| 1271 | +- **Track 1 -- Source Viewer Wiring:** Connect citations across ALL views to open SourceViewerModal with real source files at exact page/timestamp locations. Components already built in Phase 7.2 (SourceViewerModal, PdfViewer, AudioViewer, VideoViewer, ImageViewer); only the data pipeline needs wiring. |
| 1272 | +- **Track 2 -- Entity Name Resolution:** Resolve ALL entity integer IDs and UUIDs to human-readable names + type badges across every view (KG, Geospatial, Verdict, Timeline). |
| 1273 | + |
| 1274 | +**Deferred (out of scope for this phase):** |
| 1275 | +- Agent Flow refinements (thinking overlay, task badges, time-scrubbing, playback, pause/resume, fullscreen) |
| 1276 | +- Investigation Task Panel |
| 1277 | +- Narrative generation (executive summary, reports) |
| 1278 | +- PDF/DOCX export |
| 1279 | +- Image bounding box annotations |
| 1280 | +- Audio transcript sync highlighting |
1286 | 1281 |
|
1287 | 1282 | **Deliverables:** |
1288 | | -- **KG Source Viewer wiring (deferred from Phase 7.2):** Wire `source_finding_ids` → `case_findings` → `agent_executions` → `case_files` → signed download URL chain so that clicking "View source" in KG EntityTimelineEntry opens the SourceViewerModal with the actual document/audio/video/image content. Components already built in Phase 7.2 (SourceViewerModal, PdfViewer, AudioViewer, VideoViewer, ImageViewer); only the data pipeline needs wiring. |
1289 | | -- PDF viewer with excerpt highlighting |
1290 | | -- Video player with timestamp markers |
1291 | | -- Audio player with waveform and transcript sync |
1292 | | -- Image viewer with bounding box annotations |
1293 | | -- Citation navigation (click → exact location) |
1294 | | -- ~~Timeline view with events~~ ✅ |
1295 | | -- Narrative generation (executive summary, detailed) |
1296 | | -- Export as PDF/DOCX |
1297 | | -- **Agent Flow refinements:** |
1298 | | - - ~~ReactFlow agent pipeline visualization~~ ✅ (@xyflow/react + dagre, done in Phase 4.1) |
1299 | | - - ~~Custom node components per agent type~~ ✅ (DecisionNode, FileGroupNode, Phase 4.1) |
1300 | | - - ~~Agent color coding~~ ✅ (muted palette, Phase 4.1) |
1301 | | - - **Task count badges on agent nodes** (pending) |
1302 | | - - Thinking overlay with streaming thoughts |
1303 | | - - Interactive time-scrubbing |
1304 | | - - Pause/resume workflow |
1305 | | - - Workflow playback with speed control |
1306 | | - - Frontend confirmation dialogs for sensitive operations |
1307 | | - - Fullscreen mode |
1308 | | -- **Investigation Task Panel:** (all pending) |
| 1283 | +- Shared useSourceNavigation hook: citation {file_id, locator, excerpt} -> SourceViewerContent with signed URL |
| 1284 | +- Shared useEntityResolver hook: entity UUID -> {name, entity_type, color} via cached graph data |
| 1285 | +- citation-utils.ts: locator parser (page:N, ts:HH:MM:SS, region:x,y,w,h), category-to-viewer mapper |
| 1286 | +- Reusable CitationLink and EntityBadge UI components |
| 1287 | +- KG entity panel: source finding IDs clickable -> opens SourceViewerModal |
| 1288 | +- EntityTimelineEntry: "View source evidence" replaces "Source not yet available" |
| 1289 | +- Geospatial detail panel: citations open SourceViewerModal, entity IDs show resolved names + type badges |
| 1290 | +- Verdict hypothesis evidence items clickable -> two-hop finding -> citation -> source navigation |
| 1291 | +- Verdict contradiction source excerpts clickable |
| 1292 | +- Verdict gap entity badges use consistent getEntityColor styling |
| 1293 | +- Timeline event card source count expandable with clickable source links |
1309 | 1294 |
|
1310 | 1295 | **Technical Notes:** |
1311 | | -- PDF: react-pdf or pdf.js |
1312 | | -- Audio: wavesurfer.js |
1313 | | -- Video: native HTML5 with custom controls |
1314 | | -- ~~Timeline: D3.js or vis-timeline~~ → Custom React implementation ✅ |
1315 | | -- Narrative: Gemini generates from Synthesis output |
1316 | | -- **Task count badges update in real-time via SSE** |
1317 | | -- **Frontend files:** `frontend/src/components/Timeline/`, `frontend/src/hooks/useTimelineData.ts`, `frontend/src/hooks/useTimelineFilters.ts`, `frontend/src/hooks/useTimelineSSE.ts` |
| 1296 | +- Frontend-only phase: no new backend endpoints needed (all data accessible via existing APIs) |
| 1297 | +- Two-hop resolution for findings: finding_id -> GET /findings/:id -> citations[] -> file_id -> signed URL |
| 1298 | +- Entity resolution via cached graph data: GET /graph returns all entities, cached per case session |
| 1299 | +- File metadata cached via React Query (staleTime: 5 min) |
| 1300 | +- Signed URLs cached via existing useFileUrlCache hook (1h cache, 24h expiry) |
| 1301 | +- Race condition prevention via request counter ref in useSourceNavigation |
| 1302 | +- PDF highlight: first 100 chars of excerpt for search match reliability |
1318 | 1303 |
|
1319 | 1304 | **Exit Criteria:** |
1320 | | -- All source types viewable with full features |
1321 | | -- Citations navigate to exact locations |
1322 | | -- ~~Timeline shows chronological events~~ ✅ |
1323 | | -- Narrative generation works with citations |
1324 | | -- **Task panel shows pending investigation tasks** |
1325 | | -- **Task count badges visible on agent nodes** |
1326 | | -- **Task completion workflow functional** |
| 1305 | +- Citations clickable from ALL views: KG entity panel, KG timeline entry, Verdict (hypothesis/contradiction), Geospatial detail, Timeline cards |
| 1306 | +- Clicking any citation opens SourceViewerModal at correct page/timestamp with excerpt highlighting |
| 1307 | +- Entity IDs resolved to human-readable names + type badges in Geospatial and across all views |
| 1308 | +- No "Source not yet available" placeholders remain in KG views |
| 1309 | +- All type checking and build pass |
1327 | 1310 |
|
1328 | 1311 | --- |
1329 | 1312 |
|
@@ -1552,3 +1535,4 @@ For 2 developers working simultaneously: |
1552 | 1535 | *Phase 7.3 (vis-network, optional) renumbered: 2026-02-08 |
1553 | 1536 | *Phase 7.2 (D3.js Enhancement) planned: 2026-02-08 (5 plans in 3 waves) |
1554 | 1537 | *Phase 7.2 (D3.js Enhancement) complete: 2026-02-08 (5 plans + 28 post-plan polish, 46 total commits; source viewer deferred to Phase 10) |
| 1538 | +*Phase 10 planned: 2026-02-09 (3 plans in 2 waves -- source viewer wiring + entity resolution) |
0 commit comments