CF-5 OrcChat Library experience - #14
Conversation
Adds source-bound chat: a library drawer for adding/indexing corpora, Quick/Study query routing through FabricAskService, cited-and-verified answer bubbles with a source-preview rail, and web-find import. Wires FabricAskService/FabricIndexingOrchestrator/LibraryViewModel into ChatPanel and MainWindow behind the existing experimental native-runtime opt-in, with a new FabricNativeReaderService.ReadSegmentsAsync scoped re-read for indexing retries that doesn't wipe other segments' claims. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- ChatPanel: fall through to plain chat instead of silently dropping pending attachments when a corpus is attached. - FabricEvidenceGraphImporter/DocumentGraphRepository: add a segment-scoped claim replace (ReplaceSegmentEvidenceCard / ReplaceClaimsForSegment) so a retry that returns fewer claims than before no longer leaves the dropped ones orphaned in the graph. - LibraryDrawerControl: guard BeginIndexing against re-entrant calls for the same document (double-click / overlapping imports were racing two concurrent IndexDocumentAsync runs against the same SQLite rows); fix the active-progress lookup to reuse its own filter instead of falling back to whichever entry was inserted first; wrap the async-void Click handlers in try/catch with an inline error banner instead of letting network/import failures become unhandled UI-thread exceptions; wire FabricIndexingOrchestrator.RetryFailedAsync to a new "Repair" button (it previously had unit tests but no UI call site). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Framework/integration exit passed in focused headless/scripted-runtime tests (351 unit + 73 headless, all green); the real native-model end-to-end exit gate (index the real Darwin PDF, ask a cited cross-chapter question) has not yet been run. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (37)
📝 WalkthroughWalkthroughImplements the CF-5 OrcChat Library experience end-to-end: new backend services ( ChangesCF-5 OrcChat Library Feature
Sequence Diagram(s)sequenceDiagram
participant User
participant ChatPanel
participant FabricAskService
participant IRoleRuntime
participant FabricCitationVerifier
participant SourcePreviewPanel
participant ConversationNotebookStore
User->>ChatPanel: SendAsync(question)
ChatPanel->>ChatPanel: corpus attached → SendFabricAsync
ChatPanel->>FabricAskService: AskAsync(question, corpusId, mode)
FabricAskService->>IRoleRuntime: StreamRoleCompletionAsync(evidence prompt)
IRoleRuntime-->>FabricAskService: streamed JSON tokens
FabricAskService->>FabricCitationVerifier: VerifyClaim(claim, allowRepair=true)
FabricCitationVerifier-->>FabricAskService: verification items
FabricAskService-->>ChatPanel: FabricAskResult
ChatPanel->>ChatPanel: BuildCitedAnswerView(result) → cited bubble + footnotes
User->>ChatPanel: click citation footnote
ChatPanel->>SourcePreviewPanel: LoadCitation(citationVm, libraryVm)
User->>ChatPanel: Save to Notebook
ChatPanel->>ConversationNotebookStore: Append(path, entry)
Estimated code review effort🎯 5 (Critical) | ⏱️ ~120 minutes Possibly related PRs
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
Summary
docs/The Orc Context Fabric.md: source-bound chat via a new library drawer (add/index/search corpora, web-find import), Quick/Study query routing throughFabricAskService, cited-and-verified answer bubbles, a source-preview rail, and a per-conversation cited-conclusion notebook.FabricAskService/FabricIndexingOrchestrator/LibraryViewModelintoChatPanelandMainWindow, gated behind the existingExperimentalNativeMainChatEnabledopt-in (off by default).FabricNativeReaderService.ReadSegmentsAsync,FabricEvidenceGraphImporter.ReplaceSegmentEvidenceCard,DocumentGraphRepository.ReplaceClaimsForSegment) so indexing retries don't wipe other segments' claims or leave stale ones behind.RetryFailedAsyncto a "Repair" button.Status
Framework/integration exit passed in focused tests (351 unit + 73 headless, all green; full solution builds clean). The literal CF-5 exit gate — index the real Darwin PDF with a loaded native model and get a cited cross-chapter answer — has not been run yet; that's the remaining acceptance step before this phase is done (see roadmap docs).
Test plan
dotnet test OrchestratorIDE.UnitTests— 351 passeddotnet test OrchestratorIDE.Avalonia.HeadlessTests— 73 passeddotnet buildon every project in the repo (no regressions)🤖 Generated with Claude Code
Summary by CodeRabbit