Phase 1: UI Restructuring + Batch Ontology Review - #107
Merged
Conversation
- Add pending_ontology to AgentState for deferred merge flow - Modify ontology subgraph to save as pending instead of merging to Neo4j - Add API endpoints: GET/POST pending-ontology, approve, reject, build - Add documents listing endpoint for Sources tab - Restructure UI into three-tab layout (User, Sources, Ontology) - Add pipeline status bar showing session/sources/ontology status - Add pending review panel with approve/reject functionality - Wire up pending_ontology_updated SSE event to frontend
- Fix pending ontology bug: filter out already-committed entities/links by comparing against Neo4j ontology before adding to pending - Sources tab now shows intelligence log with chat replies + tool results from each query (expandable entries with response snippets and tool badges) - Add collapsible reasoning trail below chat area in User tab (auto-expands on query, shows step count badge) - Add service links grid to Sources tab (Terminal, Dozzle, Grafana, MongoDB, Neo4j, LangSmith) - Improve pending review UI: - Color-coded entity type badges (Person, Location, Organization, etc.) - Select-all checkboxes per section - Source text snippets for each pending entity - Loading spinners on approve/reject buttons - Success/error status messages after actions - Empty state when no pending changes - Disabled selected buttons when nothing is selected
- main-tabs.js: filter out tools without .name before toLowerCase(),
preventing TypeError on undefined entries in sourceLog
- pending-ontology.js: after approve, fetch full ontology from
GET /api/ontology/{threadId} and call updateOntology() instead of
nonexistent loadOntology()
- Wire Sources tab refresh button to call _renderSources()
- ontology_extractor.py: Replace fragile markdown fence stripping with robust _extract_json_from_response() that handles prose before JSON, code fences anywhere in the response, and brace extraction fallback - streaming.py: Include pending_ontology in auto-save to MongoDB so it survives page refresh/restart (was only saving messages before) - sessions.py: Accept pending_ontology in SessionSave model, persist it on both insert and update operations - graph.py: Fix link filter to keep links between pending and committed entities (was dropping any link whose endpoint wasn't also pending) - graph.py: Add update_graph_pending_ontology() to sync LangGraph checkpointer state after approve/reject (prevents stale pending data) - sessions.py: Call update_graph_pending_ontology after approve and reject to keep graph state and MongoDB consistent
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements Phase 1 of the Intelligence Pipeline restructuring (#102, #103).
Backend Changes
Frontend Changes
Backward Compatibility
Implementation Tasks
Related