From 2c212f75f6f4b16d7cc2609f92709c05468184e7 Mon Sep 17 00:00:00 2001 From: Thorsten Sommer Date: Sun, 6 Sep 2026 14:20:53 +0200 Subject: [PATCH] Resolve the remaining unused-symbol warnings --- .../Tools/Services/DataSourceEmbeddingService.Files.cs | 2 +- .../Tools/Services/DataSourceLocalRetrievalService.cs | 8 ++++++++ .../Tools/Services/DataSourceService.cs | 7 +++++++ 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/app/MindWork AI Studio/Tools/Services/DataSourceEmbeddingService.Files.cs b/app/MindWork AI Studio/Tools/Services/DataSourceEmbeddingService.Files.cs index b472b14b..f92bd76f 100644 --- a/app/MindWork AI Studio/Tools/Services/DataSourceEmbeddingService.Files.cs +++ b/app/MindWork AI Studio/Tools/Services/DataSourceEmbeddingService.Files.cs @@ -679,7 +679,7 @@ public sealed partial class DataSourceEmbeddingService if (matches.Count == 0) return [text]; - return matches.Cast().Select(match => match.Value).ToList(); + return matches.Select(match => match.Value).ToList(); } private static List<(int Start, int End, string Text)> ReadLines(string text) diff --git a/app/MindWork AI Studio/Tools/Services/DataSourceLocalRetrievalService.cs b/app/MindWork AI Studio/Tools/Services/DataSourceLocalRetrievalService.cs index 643ec8af..aa1b8ca0 100644 --- a/app/MindWork AI Studio/Tools/Services/DataSourceLocalRetrievalService.cs +++ b/app/MindWork AI Studio/Tools/Services/DataSourceLocalRetrievalService.cs @@ -23,6 +23,13 @@ public sealed class DataSourceLocalRetrievalService( BM25, } + // + // A hit keeps the complete shape both retrieval channels deliver, even where nothing reads a + // value yet. Merging is deterministic on purpose for now, so Channel, Score and Rank have no + // consumer until reranking arrives. Naming them still beats handing an unlabelled tuple of + // strings and numbers through the service. + // + // ReSharper disable NotAccessedPositionalProperty.Local private sealed record LocalRetrievalHit( RetrievalChannel Channel, string ChunkId, @@ -41,6 +48,7 @@ public sealed class DataSourceLocalRetrievalService( int Rank, string ConfidenceLevel, int ConfidenceLevelRank); + // ReSharper restore NotAccessedPositionalProperty.Local public Task> RetrieveDataAsync(DataSourceLocalFile dataSource, IContent lastUserPrompt, ChatThread thread, CancellationToken token = default) => this.RetrieveDataAsync(dataSource, lastUserPrompt, token); diff --git a/app/MindWork AI Studio/Tools/Services/DataSourceService.cs b/app/MindWork AI Studio/Tools/Services/DataSourceService.cs index 22bb936d..38bdd98d 100644 --- a/app/MindWork AI Studio/Tools/Services/DataSourceService.cs +++ b/app/MindWork AI Studio/Tools/Services/DataSourceService.cs @@ -9,6 +9,13 @@ namespace AIStudio.Tools.Services; public sealed class DataSourceService { + // + // Trust is recorded for every participating provider, while only the chat provider's trust + // decides about external data sources below. The agent which validates retrieval contexts + // checks its own provider before it runs, so nothing slips through today. Keeping the value + // named here is what makes that asymmetry visible. + // + // ReSharper disable once NotAccessedPositionalProperty.Local private readonly record struct ParticipatingProvider(string Role, bool IsTrusted, ConfidenceLevel ConfidenceLevel); private readonly RustService rustService;