- Eliminate N+1 lazy queries in activity, documents, and workflows endpoints using joinedload/selectinload
- Aggregate dashboard KPI counts into a single SQL query to reduce remote DB roundtrips
- Increase DB pool size to 10 with max_overflow of 20 to prevent connection starvation
- Add in-flight GET request deduplication in frontend API client
- Remove blocking /auth/me call on login to enable instant navigation
- Cache workspace data in localStorage to eliminate sequential loading waterfalls
- Implement session caching and skeleton shimmer states in Dashboard UI
perf: knowledge page loads 2x faster, filters are instantβ
- Fetch listKnowledge + listDocuments in parallel (Promise.all)
instead of two serial requests β halves initial load time
- All three filters (document, type, status) now client-side β
changing a dropdown is instant, no network round-trip
- Background poll uses silent refresh (no spinner flash every 3s)
- Removed stale typeFilter/statusFilter deps from load callback
- Replace avatar badge in topbar with sun/moon theme toggle button
- Light mode: same blue-dark family shifted lighter (#1e2535 bg),
not a jarring white theme
- Sharper text: primary #f5f6f7, secondary #b0b8c4, muted #727d8a
- font-weight: 420 on body for better stroke thickness on dark bg
- Toggle animates with subtle rotate+scale on hover
fix: activity filter shows all event types per doc; knowledge filter persists on backβ
backend/app/api/activity.py:
- proposal_created/approved/rejected/archived events now include filename
by walking proposal -> knowledge_item -> document_version relationship
- commit_created events now include filename by walking
commit -> proposal -> knowledge_item -> document_version
- Selecting a document in the activity dropdown now shows ALL events
for that document (workflow, upload, proposals, commits) not just
workflow/upload events
frontend/src/pages/Knowledge.jsx:
- docFilter persisted to sessionStorage so navigating to a knowledge
item detail page and pressing Back restores the selected document
instead of resetting to All documents
Durable restart (requirement #2):
- On startup, queries all RUNNING workflows from DB
- For each, creates WorkflowExecutor and calls resume()
- LangGraph loads checkpoint from PostgreSQL, continues from last node
- If resume fails, marks workflow as FAILED
- Waits 5s after startup for DB pool initialization
Auto-detect stuck workflows:
- Any workflow RUNNING for >5 min with no progress checkpoint
auto-marks as FAILED when polled by frontend
Cancel button:
- POST /workflows/{id}/cancel endpoint marks as FAILED
- Red Cancel button on WorkflowDetail for RUNNING/PENDING workflows
- Immediate escape hatch without waiting for timeout
Fix workspace delete:
- Navigate first, refresh after (prevents double-click issue)
Token capture logging:
- Added explicit INFO/WARNING logs to diagnose token tracking
feat: topic_relevance validation rule using hybrid retrievalβ
- New WorkflowDetail page with pipeline, timeline, proposals, metrics
- Workflows list now navigates to /workflows/{id} (own page)
- Document Workspace remains at /documents/{docId}/{wfId} (doc-focused)
- Back button links to /workflows
- Both pages share same components (Pipeline, Timeline, ProposalReviewList)
- Separate concerns: Documents page = doc management, Workflows page = processing
fix: search page input layout, topbar search button, back button on doc workspaceβ
- Search page: input + button wrapped in max-width container, no weird float
- Topbar: replaced dead βK badge with clickable β arrow button that triggers search
- Document Workspace: added 'β Documents' back button at top to navigate back
feat: redesign Settings into governance configuration centerβ
- Section navigation (Governance / Validation Rules / Danger Zone)
- Governance Summary cards using real dashboard stats API:
Human Review status, Min Confidence threshold, Active Rules count,
Pending Review count, Running Workflows count
- Rule cards with proper layout: name, description, operator details,
enabled badge, edit/disable/delete actions
- Operator-specific form fields with validation and error feedback
- Human-readable proposal type labels in allowed_proposal_types
- Description field for rules (optional)
- Danger Zone separated at bottom with clear destructive warning
- Responsive grid (stacks on mobile)
- Empty states for no rules / no pending reviews
- Real-time refresh after any rule change
- Collapsible glossary preserved
- All existing functionality preserved (CRUD, enable/disable, delete workspace)
No backend changes - reuses existing APIs:
- GET /rules
- POST /rules
- PATCH /rules/{id}
- POST /rules/{id}/enable
- POST /rules/{id}/disable
- DELETE /rules/{id}β¦
Backend:
- Token tracking wired into knowledge extraction node
(reads langchain response_metadata for prompt/completion tokens)
- Stage timing added to extract, chunk, embed, reconcile nodes
- Each stage start/end recorded via RunTracker
Frontend:
- New api/metrics.js module
- Document Workspace shows 'Run cost and timing' card after workflow
completes or pauses for review
- Summary row: total time, tokens used, LLM calls
- Per-stage breakdown with proportional bar chart + time + token count
- Stages shown: extraction, chunking, embedding, knowledge_extraction,
reconciliation
The reviewer can now see exactly where time was spent and how many
tokens each run consumed β stage by stage.
feat: human-readable proposal labels + glossary on every pageβ
Login:
- Email format validation (real-time feedback)
- Minimum 8 character password check
- Show/hide password toggle
- Remember me checkbox
- Error messages in styled alert box
Signup:
- Email validation
- Password strength meter (Weak/Medium/Strong with colored bar)
- Show/hide password toggle (applies to both fields)
- Confirm password with mismatch detection
- 2-step flow: form β OTP verification
- OTP sent to email (demo mode shows code in UI)
- Resend code button
- Back to form navigation
Backend:
- POST /auth/send-otp β generates 6-digit OTP, validates email not taken
- POST /auth/verify-otp β verifies code, creates user on success
- 10 minute OTP expiry
- Demo mode returns OTP in response (production would use SMTP)
Each knowledge item now displays its source evidence:
- The exact quote extracted from the document
- Page number and section where it was found
- Styled as an indented blockquote with accent border
Backend: /knowledge endpoint now includes evidence array with
quote, page_number, section, confidence, source_type per item.
Mirrors TracePilot's chunk display β every claim traces to its
exact source passage.
feat: auto-approve on CONTINUE path + improved knowledge cardsβ
1. Auto-commit when no review needed:
- When decision is CONTINUE (all rules pass), the complete node
auto-approves all PENDING proposals for that document version
- Creates commit records (audit trail preserved)
- Promotes knowledge items from PENDING β ACTIVE
- Items only stay PENDING if human review is required
2. Knowledge page visual overhaul:
- Title is now small/muted (context label)
- Value is the hero (larger, bold, primary color)
- Confidence shown as a colored bar (green/yellow/red)
- Source and date pushed to subtle footer line
- Type and status badges stay compact in header
fix: proposal card layout - separate labels from valuesβ
Fields like Type, Title, Value, Confidence were rendering mashed
together (TypeDATE, TitleInterview Date). Added proper CSS:
- Detail rows with label/value columns
- Labels are uppercase, muted, fixed width
- Values are primary color, flexible
- Subtle row separators
- Background panel for the details section
- Styled the raw JSON fallback and toggle button
fix: notification badge persists read state across pollsβ
Badge count was resetting because the 15s poll recalculated unread
based on a rolling 5-minute window. Now uses localStorage to persist
the timestamp of when the user last opened the bell. Only events
newer than that timestamp count as unread. Survives page refresh.
feat: wire notification bell with real activity feedβ