feat(plugin): add tagged health results and scoped cached execution - #38
Merged
Merged
Conversation
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
Extends the structured plugin health contract with tagged results and safe host side execution: plugin health checks run inside dedicated scoped
IServiceProvider, latency is measured by the host and kept out of pluginData, and completed executions are cached with a configurable TTL, single-flight de-duplication, and correct cancellation behavior (D7–D8).Tagged Health Results (D5–D6)
Tagscollection toPluginHealthResult, kept distinct from plugin owned diagnosticDataDevTokensandDevToolsemit tags alongside their structured resultsScoped Health Execution (D7)
PluginHealthExecutorruns each plugin health check inside dedicated async scope, resolves scoped dependencies from that scope, and disposes it on success, failure, or cancellationStopwatchand wrapped host side inPluginHealthExecutionResult(Results, Duration)it is never written into pluginDataHealthyresultHealth Result Caching (D8)
CachedPluginHealthExecution(Results, Duration, ExpiresAt)keyed per plugin, so one plugin's result is never returned for anotherHealth:CacheTtl, default 30s) a zero TTL explicitly disables cachingValidation
dotnet buildcompletes with zero errors across the solution (only pre-existing warnings remain: CS8602, NU1510/NU1608, xUnit1031)git diff --checkpassesPluginContractValidatorpasses;DevTokensandDevToolskeep compiling and loading with no contract changesResult
Plugins report tagged health results while the host executes them safely in scoped isolation, measures latency without polluting plugin data, and serves cached executions within a configurable TTL with correct single flight, expiry, disabled cache, and cancellation semantics that never corrupt the cache.
Closes #16
Closes #17
Closes #18