5.6 KiB
5.6 KiB
🔍 NexusReader Code Review Backlog
🔴 CRITICAL — Fix Before Next Release
- Status: ✅ Resolved (2026-05-03)
- Implementation: Removed
AddMediatRfromAddApplication()andAddInfrastructure(). Unified registration in Host (Program.cs,MauiProgram.cs). AddedIInfrastructureMarkerand a startup validation check inWeb.Newthat throwsInvalidOperationExceptionifAddInfrastructureis missing. - DoD: Application fails fast with a clear error if
AddInfrastructure()is omitted.
- Status: ✅ Resolved (2026-05-03)
- Implementation: Added
VerifyGroundednessAsynctoIKnowledgeServiceand implemented it inKnowledgeService(Infrastructure). UpdatedVerifyGroundednessCommandHandlerin Application to injectIKnowledgeServiceinstead ofIChatClient. - DoD: No
IChatClientorIEmbeddingGeneratorreferences remain inNexusReader.Application.
- Status: ✅ Resolved (2026-05-03)
- Implementation: Threaded
tenantIdthrough allIKnowledgeServicemethods andProcessKnowledgeUnitsAsync. ScopedSemanticKnowledgeCacheandKnowledgeUnitlookups/writes to the providedtenantId. Updated API endpoints inProgram.csandWasmKnowledgeServiceto pass the authenticated user'sTenantId. - DoD: No hardcoded
"global"TenantId in write paths. Extracted units are always scoped to the caller's tenant.
- Status: ✅ Resolved (2026-05-03)
- Implementation: Changed
NexusUser.TenantIdfromGuidtostring. All entities now usestringforTenantId, allowing the use of"global"as a sentinel value. - DoD: All entities use the same
TenantIdtype. All query filters are consistent.
🟠 MAJOR — High Priority Fixes
- Status: ✅ Resolved (2026-05-03)
- Implementation: Added
File.Existscheck and granulartry-catcharoundEpubReader.ReadBookAsyncto prevent unhandled exceptions and provide descriptive error messages. - DoD: Corrupted or missing files return
Result.Failinstead of crashing.
- Status: ✅ Resolved (2026-05-03)
- Implementation: Verified
IDbContextFactory<AppDbContext>is correctly registered viaAddDbContextFactoryinInfrastructure/DependencyInjection.cs. - DoD: Webhook and profile endpoints successfully resolve the factory.
- Status: ✅ Resolved (2026-05-03)
- Implementation: Implemented
Coordinator.Clear()(which callsKnowledgeGraphService.Clear()) inReaderCanvas.razor'sOnInitialized. - DoD: Stale graph data is cleared upon component initialization.
- Status: ✅ Resolved (2026-05-03)
- Implementation: Created
UserProfileDtoto exclude sensitive internal IDs likeTenantIdand DB GUIDs. Updated/identity/profileendpoint to project into this DTO using.Select(). - DoD: Internal IDs are no longer exposed in the profile API.
- Status: ✅ Resolved (2026-05-03)
- Implementation: Added
HasIndex(x => x.TenantId)toNexusUser,Ebook, andQuizResultinAppDbContext.KnowledgeUnitandSemanticKnowledgeCachealready had them. - DoD: Tenant-scoped queries are optimized via DB indexes.
- Status: ✅ Resolved (2026-05-03)
- Implementation: Refactored
KnowledgeService.ProcessKnowledgeUnitsAsyncto pre-fetch all existing unit IDs in a single batch query, eliminating the N+1FindAsyncandAnyAsynccalls. - DoD: Batch processing performance is significantly improved.
- Status: ✅ Resolved (2026-05-03)
- Implementation: Added
TenantIdproperty toEbookentity with mandatory validation and index. UpdatedAppDbContextconfiguration. - DoD: Ebooks are now isolated at the database level.
- Status: ✅ Resolved (2026-05-03)
- Implementation: Added
TenantIdproperty toQuizResultentity with mandatory validation and index. - DoD: Quiz results are now isolated at the database level.
🟡 MINOR — Technical Debt & UX
[MN-01] Missing Logging in KnowledgeCoordinator
- Action: Add
ILogger<KnowledgeCoordinator>and log successful/failed extraction steps.
[MN-02] Hardcoded "Gemini-1.5-Flash" in Domain
- File:
Domain/Entities/SemanticKnowledgeCache.cs:20 - Action: Move the default model ID to a constant in
AiSettings.
[MN-03] UI: Shimmer Effect Lack Animation
- File:
UI.Shared/Components/Molecules/GroundednessBadge.razor - Action: Add
@keyframesfor the shimmer effect in CSS.
[MN-04] Identity: Google Callback Lack Error Handling
- File:
Web.New/Program.cs:340 - Action: Better UI feedback when
ExternalLoginInfois null.
[MN-05] Tokenizer Initialization is Expensive
- File:
Infrastructure/Services/KnowledgeService.cs:43 - Action: Make
_tokenizerstatic or Singleton to avoid recreating it per request.
[MN-06] Mapster: Global Configuration Check
- Action: Ensure
TypeAdapterConfig.GlobalSettings.Scan(...)is only called once.
[MN-07] SignalR: Missing Reconnection Logic
- Action: Implement
hubConnection.OnReconnectedinSyncService.cs.
[MN-10] Performance: Large EPUB Parsing
- Action: Implement streaming extraction for EPUBs over 10MB.
🧪 TESTING — Coverage Gaps
[TEST-01] Integration Tests for KM-RAG Retrieval
- Action: Create
tests/NexusReader.IntegrationTests. - Scenario: Ingest a document, then verify that
GetRelevantContextreturns the correct snippets with tenant isolation active.
📊 Summary Table
| Severity | Count | Status |
|---|---|---|
| 🔴 Critical | 4 | 4 resolved |
| 🟠 Major | 8 | 8 resolved |
| 🟡 Minor | 8 | Unresolved |
| 🧪 Tests | 1 | Unresolved |
| Total | 21 | 12 resolved |