Interface IBowireDiscoveryDiagnostics
- Namespace
- Kuestenlogik.Bowire
- Assembly
- Kuestenlogik.Bowire.dll
Optional capability surface for protocol plugins whose probe can half-succeed (#544): "here are the services I found, AND here is what broke while I found them".
DiscoverAsync(string, bool, CancellationToken) has no channel for that — a plugin either returns a list or throws, so a partially-faulted probe had to hide either the fault or the results. The MCP plugin is the canonical case: an MCP server with a single malformed tool used to suppress its perfectly good resources and prompts as well, because the throw was the only way to make the fault visible.
Discovered exactly the way IInlineHttpInvoker is — core
does protocol is IBowireDiscoveryDiagnostics on the instance it
was going to call anyway. A plugin that does not implement this behaves
exactly as before, and third-party plugins keep compiling: nothing on
IBowireProtocol changed.
public interface IBowireDiscoveryDiagnostics
Remarks
Build the diagnostic from locals of the call that produced
it. The channel is a return value on purpose: it is bound to
its invocation by the call stack, so two concurrent probes of two URLs
through the same plugin instance cannot read each other's diagnosis.
A plugin that instead stashes the diagnostic in an instance field, a
static ring buffer or an AsyncLocal and lets core come back for
it re-creates precisely the cross-call bleed this seam exists to remove.
BowireDiscoveryProbe owns the outcome vocabulary. The
plugin states a BowireDiscoverySeverity; the probe pairs
it with the number of services that came back and picks
ok / empty / partial / error from that.
Throwing still works and is still the stronger signal: an exception is
classified as error (or timeout) with its own message,
which is strictly more than a diagnostic reported just before it would
have been. A diagnostic is for the case where there is something to
return.
Methods
DiscoverWithDiagnosticsAsync(string, bool, CancellationToken)
Same probe as DiscoverAsync(string, bool, CancellationToken), but able to report a fault without swallowing the services it did find.
Task<BowireDiscoveryReport> DiscoverWithDiagnosticsAsync(string serverUrl, bool showInternalServices, CancellationToken ct = default)
Parameters
serverUrlstringThe bare target URL, as DiscoverAsync gets it.
showInternalServicesboolForwarded verbatim from the probe.
ctCancellationTokenCaller cancellation, linked into the probe ceiling.