Skip to content

Add the stdio MCP server (Briosa.Cli mcp) for SA 2026.1.0529.7 - #469

Merged
davidalucas merged 28 commits into
mainfrom
445-cli-mcp
Nov 28, 2026
Merged

davidalucas merged 28 commits into
mainfrom
445-cli-mcp

Conversation

@davidalucas

@davidalucas davidalucas commented Nov 28, 2026 •

Copy link
Copy Markdown
Contributor

Slice B of four for #445 (Epic #440). It adds Briosa.Cli.exe mcp: a local stdio Model Context Protocol server over the engine that slice A (#465) added, for SpatialAnalyzer 2026.1.0529.7 only. Desktop and IDE AI hosts can then inspect a live SpatialAnalyzer session through a local Briosa server, read-only and attach-only.

Not in this slice: packaging, signing, license notices, CI workflow changes and conformance against the packaged ZIP (slice C); anything against a licensed SpatialAnalyzer (slice D); mutating execution, long-running handles and the replay interlock (#446); the 2024 target. The new dependency must not ship before slice C adds its reviewed license evidence.

The documentation is the new page targets/2026.1.0529.7/docs/operations/briosa-mcp.md, linked from briosa-cli.md. Everything below describes the behaviour at the head of this pull request; sections about earlier review rounds say what changed then, and are marked where a later round changed it again.

What it adds

  • Briosa.Cli.exe mcp [--endpoint URL] [--max-inline-bytes N]. Standard output carries JSON-RPC only from the first byte; a command line it cannot use is reported on standard error only (exit 2, or 3 for a non-loopback endpoint), and stdout stays empty. It ends with exit 0 when stdin closes.

  • Exactly five tools, all readOnlyHint: true, destructiveHint: false, openWorldHint: false; the descriptions of briosa_query and briosa_status state their one local effect each:

    Tool Engine command Arguments idempotentHint
    briosa_status status reattach_attachment_id (optional) true
    briosa_list_categories ops categories none true
    briosa_search_operations ops search the ops search filters; limit default 10, at most 25 true
    briosa_describe_operation ops describe operation_id true
    briosa_query call operation_id, request (object), keep_result_local (optional) false

    Each tool calls the same engine function as the CLI command, so verification, strict input, the briosa-caller-restriction: profile=read-only; deny=interactive_ui header, the refusal for revisions 0 and 1 and the wrong target, single submission and outcome classification are the CLI's own code, not a copy.

  • Results: structuredContent is the CLI envelope without exit_code, plus one member mcp (tool, is_error, do_not_retry, notice, argument_error, session); content is the fixed notice and the same JSON as text.

Design choices

Annotations. None of the five changes SpatialAnalyzer, the job or the server, and each talks only to one loopback server, so all are read-only, not destructive and closed-world; the read-only hint describes the effect on SpatialAnalyzer. Two have one local effect, stated in their descriptions: briosa_query can write one new private result file, kept until someone deletes it (expiry is planned with #446), and briosa_status with reattach_attachment_id can replace the session's connection with a newly verified one. The spec defines idempotentHint as "no additional effect on its environment", so the four discovery tools are idempotent even though live state can change their answers; briosa_query is not, because repeating it runs the MP again and can write another spill file.

isError. Hosts and models retry tool calls that report errors, so isError: true exactly when Briosa established that nothing ran (rejected_locally, usage_error, server_unreachable, server_incompatible, not_started, invalid_request, internal_error). Every outcome after which the operation may have run or did run is isError: false. For the six after which it may have run without a plain success, partial_success, outputs_incomplete, mp_failed, output_write_failed, started_outcome_unknown and completion_evidence_unavailable, the notice starts with DO NOT RETRY. and mcp.do_not_retry is true; succeeded has isError: false, do_not_retry: false, and no such sentence. For tools/call, the protocol errors are only an unknown tool and a malformed envelope (no string name, arguments that is not an object, or a string that is not valid Unicode): JSON-RPC -32602 with fixed messages. No protocol error message ever repeats caller text: the output guard rebuilds every error object, and replaces any message that is not one of the server's own fixed messages, the SDK's included, by a fixed text for its code. Before the handshake, a request other than initialize and ping is refused with -32600 when its per-request protocol version is missing, null, not a string, or one of the four revisions with a handshake; 2026-07-28 is served, and any other string (2026-07-27 and 2099-01-01 included) the SDK itself answers with -32022 before this server's checks run. Anything about the Briosa call is a tool result, including arguments that break the tool's input schema (see below) and a request that breaks the strict input rules.

Arguments that break a tool's schema. As MCP 2025-11-25 asks for input validation errors (tools specification, "Error Handling"; changelog entry SEP-1303), a known tool whose arguments object breaks its input schema gets a tool result with isError: true, so the host shows it to the model: outcome usage_error (the MCP form of the CLI's usage error; invalid_request would claim the server validated the request), failure.diagnostic_code tool-arguments-invalid, execution.request_sent: false for briosa_query, mcp.do_not_retry: false, a fixed notice, and mcp.argument_error with argument (one of the schema's own argument names, or null) and rule (duplicate_argument, unknown_argument, required, type, enum, pattern, length, range, unique_items). It never repeats a value, and never an unknown argument's name. Only the first violation is reported, in this order: a repeated argument; an argument the schema does not define; a missing required argument, in schema order; then each argument present, in schema order, type first; then a string's length (in code points) and its enum or pattern, an integer's range (an integer is a value: 10, 10.0, 1e1), and for risk_flags every element's type, then every name, then distinct items. Such a call sends nothing and never reaches the session.

Attachment. Lazy: nothing is sent until the first tool call, because hosts start MCP servers when they start, usually before the Briosa server runs. That call opens one connection. The session is attached only when the server was verified on it in full (identity, target, compatibility, and the capability listing) and the connection is still open. When no server was verified in full, the session stays unattached, the connection is closed, and the next call tries again. Once one was, no later failure leaves the session unattached: if the connection then ends (also cleanly, after the last response was read in full), a request on it is abandoned, the command fails inside Briosa, or the session's bookkeeping fails, the first attachment is committed as invalid under the ID prepared for it, with that reason. After that the session uses its one connection and never opens another (the connection's existing connect-once guard), so a server that replaces the verified one on the same port receives nothing. An invalid session refuses every tool call with session-invalid until an explicit reattachment.

Keeping the one connection open. A throwaway experiment against Kestrel (keep-alive timeout set to 3 s) showed that an idle HTTP/2 connection is closed by the server (two TCP connections were needed after a 7 s pause) unless the client sends HTTP/2 PINGs (one connection). Kestrel's default keep-alive timeout is 130 s, so without PINGs every pause of a few minutes would invalidate the session. An attachment's connection therefore disables the client's idle timeout and sends a PING after 30 s without traffic, with a 20 s answer timeout. PINGs are not RPCs: no service, log or admission sees them. CLI commands keep the HTTP client's defaults, so CLI behaviour is unchanged.

Reattachment. briosa_status with reattach_attachment_id set to the invalid attachment's ID (16 lowercase hex characters, random, shown in mcp.session and in the refusal's notice). An ordinary status read never reattaches, and requiring the ID means a model can only reattach by naming the attachment it was told is invalid, not by habit. A wrong ID or a reattach while attached or unattached is refused without sending anything. A reattachment verifies the new server in full before it replaces the old connection and takes the new ID (prepared before anything is sent); one that is not verified in full, or whose new connection is not usable afterwards, closes the new connection and keeps the session invalid with the same ID, and no ordinary call attaches in the meantime.

Cancellation. A host's notifications/cancelled stops waiting, as the CLI's first Ctrl+C does, and as MCP asks no response is sent (the SDK suppresses it). A call still waiting its turn is dropped without anything sent, and the session is unchanged. A request that Briosa has begun sending, whose response has not been read in full, has its gRPC call cancelled and is never resent: for the MP request of a briosa_query the outcome is completion_evidence_unavailable (client-cancelled), recorded on stderr; for a discovery request no operation was submitted. A cancellation that arrives after a response was read in full finds nothing to abandon: the call keeps that response's own outcome, which is completion_evidence_unavailable when the response carried no trustworthy completion evidence, and the session stays attached on the same connection (tested for a success). An abandoned request makes a session whose server was verified in full invalid until it is reattached; before that, a first attachment stays unattached. MP calls have no time limit; the discovery requests have 15-second deadlines. Letting a cancelled call finish and discarding the result would avoid the unknown outcome for a read but hold the session, and every call behind it, for as long as the read takes; every tool here only reads, so the unknown outcome cannot leave the job changed. Closing stdin cancels a call in flight the same way.

Concurrency. The SDK runs tool calls concurrently; the session runs them one at a time, without promising which waiting call goes next. The single-submission guard counts streams per connection, so two requests in flight could let one request's resend use the other's permit; one at a time keeps each request to exactly one stream and keeps spill writes and session changes single-threaded. The server serializes MP work anyway.

Cap. 16 KiB of result JSON by default, a quarter of the CLI's 64 KiB, because many hosts pass both the structured and text copies to the model; --max-inline-bytes changes it for the server (0 to 4 MiB), and keep_result_local spills any one result. Larger results use the engine's existing delivery unchanged. The cap bounds the formatted result JSON only; the line that carries the tool result also holds the envelope, the notice and the text copy, which escapes the result again: a 15,583-byte result made a 38,188-byte line (about 2.45 times; measured by the first independent review at 88b2b634), more for results heavy in escaped characters. Discovery sizes, measured by me at e4cba6d5 over all 1,018 operations: describe 3.7 to 13.6 KB (median 5.4 KB); status 2.7 KB; categories 5.1 KB; a search page of 10 is 8 KB. A 50-row page with denied operations was 34 KB, so pages are capped at 25 (about 17 KB).

Notices say only what the call's own evidence shows. Each notice is chosen from that call's outcome, from what the connection recorded for the call (how many requests it wrote, and which request, if any, was abandoned), from what its result returns, and from whether this call itself made the session invalid; never from the session's transition alone. Nothing was sent appears only when the call wrote no request at all. A rejected_locally, server_unreachable or server_incompatible call that wrote only discovery requests, each of them answered, says No operation was submitted, and only discovery requests were sent; a successful discovery tool, which also sends only those, says Succeeded. A request counts from the moment its opening frame is let through to the transport, before its bytes are known to have gone out, so delivery is claimed only for a request that was answered: an abandoned request is reported as begun, and one that may or may not have reached the server, on every path. The full table, with a case for each text and a neighbouring case where each factual clause would be false, is under the third review.

Untrusted content and egress. The instructions and every tool description say in fixed text that result content is data, not instructions, and that results leave the workstation with a cloud-hosted model. Notices, descriptions, instructions, error messages, stderr and file names never contain result, server or request text. The only variable parts of a notice are the session's own attachment ID, the name of a discovery RPC from the fixed pair GetServerInfo and ListCapabilities (taken from the client's own method name), and, for arguments that break a tool's schema, that schema's own argument names, choices and bounds. With keep_result_local, the result carries server or SpatialAnalyzer text only where the CLI can verify it against the operation's own schema or what the session sent.

Standard output. Every outgoing line passes through a guard that writes only whole JSON-RPC 2.0 messages (valid UTF-8; request, notification, result or error members only, no member twice; every error object rebuilt from its checked parts) and drops (and reports on stderr) anything else, including part of a message that never finished. Once shutdown begins (input ends, the process is told to stop, or the server ends otherwise), a write the host has not finished reading one second later is abandoned. Console.Out is redirected to nothing in mcp mode.

Engine changes (CLI behaviour unchanged)

  • BriosaConnection: an options record (Command = today's settings; Attachment = PINGs and no idle close), a ConnectionLost signal from the connection stream, Unusable, and BeginCommand() to reset the receive-limit evidence between commands on a shared connection.
  • BridgeEngine: an optional attachment connection; without one each command opens and closes its own, as before. BridgeEnvelope.Serialize, used by ToUtf8 and the MCP results.
  • CommandParser gains the mcp grammar, CliHost an OpenStandardInput used only by mcp, and the usage text two lines (the pinned help count goes from 13 to 15). CliApplication.TryReadInteger became internal. Comment-only: ResultDelivery now says "before any result bytes are written".
  • Review round 3: SubmissionHandler retires unused permits; CallRequest gains a Sending signal and KeepServerTextLocal (MCP only); the engine catches every failure after a send (MpOutcome.FaultAfterSend); BridgeEnvelope gains three unwritten flags; ServerText withholds server text; ResultDelivery.Deliver takes the withheld text; BridgeEnvironment.AfterSend is a test fault point.
  • Round 2: AbandonmentInterceptor observes every RPC on a connection; SubmissionGuard and SubmissionHandler track whether each request's stream opened and its response was read to the end, and an RST_STREAM the client writes; BriosaConnection.CallAbandoned, part of Unusable; ServerText verifies names against the compiled request and result messages; EvidenceConsistency exposes its output-name rule and restriction parsing.
  • Second review: BriosaConnection.Verified; ServerText also verifies the operation's service, RPC and method and transport.method, and records an empty code.
  • Third review, evidence only (nothing is decided by it): SubmissionGuard.Opened and AbandonedMethod, exposed as BriosaConnection.RequestsWritten and AbandonedMethod; the interceptor names the failed call when the connection carries an abandoned request. MpOutcome.NamedFieldGuidance names the existing guidance text, and ServerText.Finish replaces it with WithheldFieldGuidance when keep_result_local withheld the field path.

The CLI never reads Unusable or the new evidence, never sets the MCP-only options, and its envelopes and files are unchanged.

Dependency

ModelContextProtocol.Core 2.4.0 is added to Directory.Packages.props and the CLI project; the lock files are updated (offline restore from the local cache, empty RestoreSources, NuGetAudit=false). With the CLI's framework reference to Microsoft.AspNetCore.App, package pruning leaves two new packages in the shipped graph:

Package Declared license (nuspec) Source
ModelContextProtocol.Core 2.4.0 Apache-2.0 modelcontextprotocol/csharp-sdk at 4cbf42ef107763f0bc75c358af8cb2dfe47a769a
Microsoft.Extensions.AI.Abstractions 10.11.0 MIT dotnet/extensions at 25f07afa51034e37b334210642d7dc5f191c142d (from the spike)

Neither nupkg carries license or notice text; slice C adds the reviewed evidence (see the issue's spike comments). Shared files, measured at bb80fa27 (the same sizes as at adabd432; 2acae253 changes only a test name) with the package script's release properties (self-contained win-x64 publishes of the CLI and the server): the two share 335 files, all byte-identical by SHA-256. The CLI adds six files, 2,559,796 bytes: Briosa.Cli.exe (162,816), Briosa.Cli.dll (352,256), Briosa.Cli.deps.json (56,303), Briosa.Cli.runtimeconfig.json (525), ModelContextProtocol.Core.dll (1,308,672) and Microsoft.Extensions.AI.Abstractions.dll (679,224). Only the DLL grows with the code: 2,549,556 bytes at 8cf433d6 (reproduced by the third review), 2,544,948 at b737405c (measured by the second review), and 2,492,224 at e4cba6d5. No package script or license evidence file changed.

NuGet audit: it cannot be evaluated offline. The spike's audit against the advisory snapshot through 2026-11-27 reported no diagnostic for these exact versions; CI's audit on this pull request is the authority.

Tests

All portable, against the in-process fake server; no SpatialAnalyzer, license or real worker. The MCP server is driven through its stream transport over pipes, with hand-written JSON-RPC, and every line it writes is checked (UTF-8, no BOM, one JSON-RPC 2.0 object, a response has exactly one of result and error). One test drives the built Briosa.Cli.exe over real pipes.

  • Protocol and surface: McpProtocolTests (initialize for five requested versions, ping, the five tools with schemas, annotations and description sentences pinned as literals, unknown tool, 7 malformed tools/call envelopes, unreadable lines, the 2026-07-28 path, shutdown), McpStdioTests (the stdout guard, refused command lines, the cap option, the built executable), McpOutputGuardTests (32 malformed lines dropped, 8 passed byte for byte, 14 error messages rewritten).
  • Arguments: McpArgumentTests (62 schema violations, the reporting order, nothing sent or echoed, every session state unchanged) and McpSchemaConformanceTests (2,394 cases from the advertised schemas against an independent evaluator).
  • Outcomes: McpQueryOutcomeTests (the slice A matrix through briosa_query: envelope, isError, pinned notice, retry rule, MP request count, the restriction header once; strict input; spill, cap, keep_result_local, failed spill) and McpDiscoveryAndContentTests (each discovery tool; hostile text only as JSON string values).
  • Session: McpSessionTests, McpAttachCommitTests, McpAbandonedCallTests (every abandonment path, stalled responses included), McpCancellationAndConcurrencyTests, McpSendBoundaryTests (faults after the send never report request_sent: false; the fallback's shape; blocked stdout ends within the grace), SubmissionGuardTests.
  • Server text: ServerTextTests and McpLocalServerTextTests (sentinels in every withheld field, both copies, with and without keep_result_local).
  • Second review: McpSecondReviewTests. Third review: McpThirdReviewTests and McpNoticeTableTests (below).

Mutations. Every round's mutants were applied to the product, the tests that cover them run, and the file restored; the numbers are under how I verified it.

How I verified it

Everything ran locally with offline restore (an empty RestoreSources folder and NuGetAudit=false) and no SpatialAnalyzer, license or real worker; nothing was registered with any AI host. Heavy steps ran under the shared verification lock.

At 2acae253 (the fourth review's wording changes), under the lock: the full harness for the 2026 target passed every step: locked restore, the no-SpatialAnalyzer host check, Control Center smoke, interop inspector and artifacts, Verify-Protocol against origin/main (d93c8945), the MP naming policy, the Release build with 0 warnings, CI-filtered tests (Protocol 56, Worker 415, LicensedProbes 445, Cli 3,260, Server 1,565), the debug reflection and manual-startup tests, the Windows package, protocol and conformance package scripts and the client scenarios, every root check, and both performance steps. Test-CrossTargetPropagation (the same single advisory finding), Test-CrossTargetProtocol, Verify-CiWorkflow.ps1 and Test-CiWorkflowPolicyChecks.ps1 passed. Every MCP, submission-guard and server-text test passed (2,899). The source diff since adabd432 changes only string literals and comments. The unfiltered run was last made at 8cf433d6; the publish comparison above is at bb80fa27.

At adabd432 (the third review's changes): the same harness (Cli 3,252), cross-target checks and CI workflow policy scripts, all passed, and the mutations below.

Mutations for the third review. 29 mutants, each applied, its tests run, and the file restored: all 29 killed. They take away each piece of evidence (the requests a call wrote, a call's own count on an attached connection, the abandoned method and when it is named, the attach path's evidence); each choice the notice makes from it (the discovery-only texts, the unreachable, connection-replaced, cancellation, refusal and incompatible variants, the abandoned-discovery notice on a path that does not invalidate); each validation variant and the withheld-field guidance; each fault reason with its line, notice and guidance; the attached line for an attachment committed as invalid; the internal-error text; the stdout line; the three description sentences; and the clean-loss mutant that survived the second review.

Earlier rounds, each under the lock, every step passed:

  • e4cba6d5 (slice B): the full harness for both targets, the shared-file comparison, and 33 mutants, all killed.
  • d45685b2 (merge of main): the unfiltered 2026 run with a hang detector, and the root and cross-target checks.
  • 88b2b634 (schema-invalid arguments as tool results): the full 2026 harness, the unfiltered run, the cross-target checks, and 9 mutants, all killed.
  • 196304a8 (review round 3): the full 2026 harness, the unfiltered run, the cross-target checks, and 60 mutants, all killed.
  • b737405c (round 2, after merging Keep a CLI call from waiting forever on a lost HTTP/2 response, and make test-job hangs and load failures attributable #470): the full 2026 harness, the unfiltered run, the cross-target checks, both CI workflow policy scripts, and 24 mutants, all killed.
  • 8cf433d6 (second review): the full 2026 harness (Cli 3,134), the unfiltered run (56 / 415 / 445 / 3,134 / 1,572), the cross-target checks, both CI workflow policy scripts, the publish comparison, and 21 mutants: 19 killed, and two reported then as surviving. The third review showed that the first of them, a first attachment whose clean connection loss is not committed, is not equivalent (the reason changes from the connection ending to a fault) and that the fake can produce it; this round kills it. The second, dropping the revision-shape check of the handshake exception, stays equivalent under the pinned SDK 2.4.0, which refuses every string it does not know with -32022 before any filter runs.

Expected cross-target finding: ./eng/Test-CrossTargetPropagation.ps1 -BaseRef origin/main reports one advisory one-sided change, Directory.Packages.props (2026 only, because the 2024 target has no CLI).

CI note: at 8cf433d6 the non-required retained-client job for the 2024 target's .NET client 0.5.0 timed out in its large-result scenario, and its gate failed with it; the same job passed at b737405c, and nothing it builds changed in between (tracked in #450).

Review

Four independent review passes (GPT 6.2 Astra), each finding reproduced before anything changed:

Head Requested
88b2b634 Safety and robustness: a completed read reported as unsent, a permit leak in the single-submission guard, a failed reattachment installed, blocked stdout at end of input, the validator differing from the advertised schemas, caller text in protocol errors, a stricter stdout guard, requests before the handshake, unbounded test waits
b737405c A verified first attachment lost after an abandoned call, legacy requests before initialize, unverified method names under keep_result_local, unchecked error members in the output guard, an empty diagnostic, the abandoned-discovery notice, guide and description facts, three surviving mutants, stalled-response tests
8cf433d6 Texts the evidence of their own call contradicted (an abandoned first listing called unsent, a validation notice naming a withheld field, a known outcome called unrecorded), the description, a table of every notice and stderr line with neighbouring cases, and a clean-disconnect test
adabd432 Confirmed the earlier defects resolved and that the diff preserved session transitions, single submission, outcome classification, retry flags and withholding (both of its mutations were caught); requested wording changes only: a request counted from its opening frame was said to be sent when no byte of it had been written, two overstatements in the guide and this description, and a missing usage line

The fourth pass's changes are in 36aa5357 (texts and tests), bb80fa27 (guide) and 2acae253 (one test name that still said "sent"); no logic that decides anything changed. On 2026-11-28 the maintainer decided to merge after them without a fifth pass.

Changed texts in the fourth review, old → new:

  • Abandoned-discovery notice: … the discovery request <rpc> was sent to the Briosa server and abandoned before its response was read in full. → No operation was submitted: Briosa began sending the discovery request <rpc>, which may or may not have reached the Briosa server, and abandoned it before a complete response was read.
  • Notice ending: This session is now invalid: a request this call sent was abandoned before its response was read in full, … → … a request this call began sending was abandoned before a complete response was read, …
  • Refusal reason: … a request on its verified connection was abandoned after it was sent, before its response was read in full, … → … a request that Briosa began sending on its verified connection was abandoned before a complete response was read, …
  • completion_evidence_unavailable: DO NOT RETRY. The request was sent, and no trustworthy evidence … → DO NOT RETRY. Briosa began sending the request, and no trustworthy evidence … (the outcome and do_not_retry: true are unchanged).
  • server_unreachable for a discovery request that was not abandoned: … the Briosa server answered the discovery request <rpc> with a failure; … → … the discovery request <rpc> failed; …
  • Warning session-invalidated: A request this call sent was abandoned before its response was read in full, … → A request this call began sending was abandoned before a complete response was read, …
  • Guidance after an abandoned request: … was abandoned after it was sent, before its response was read in full: it was cancelled, timed out, or its response could not be read. → A request that Briosa began sending on this session's verified connection was abandoned before a complete response was read: it was cancelled, it timed out, or what came back could not be read.
  • Standard error: session invalid: a call was abandoned after it was sent → session invalid: a request was abandoned after Briosa began sending it
  • briosa_status description: … when a call on it is abandoned after it was sent, … → … when a request on it is abandoned after Briosa began sending it, …
  • briosa_query description: once sent, it waits …, after the MP request was sent, before its response has been read in full, and any request that is sent and then abandoned before its response has been read in full → once Briosa begins sending it, the call waits …, after Briosa began sending the MP request, before a complete response has been read, and any request that Briosa begins sending and then abandons before a complete response has been read.
  • Standard error table: usage_error (usage-missing-value), usage_error (usage-duplicate-option) and usage_error (usage-unexpected-argument) added; the code already wrote them.

Left as they are, for the maintainer's eye: the CLI's own completion-evidence-unavailable warning, The request was sent, and no trustworthy evidence of how it ended came back. The operation may have run., which the MCP result carries in warnings, has the same imprecision; it is slice A's text, and changing it would change the CLI's envelope. No operation was submitted, and only discovery requests were sent stays, because it is chosen only when no request was abandoned, so every request the call wrote was answered.

Third independent review (Astra, of 8cf433d6)

It found the second round's items 1 to 5 resolved, the publish numbers reproduced and the succeeded row right, and asked that no notice, stderr line, guide or description sentence state something the evidence of that call contradicts. Each finding was reproduced first: the 34 new and changed cases that compile against the code at 8cf433d6 (the table needs the new evidence) were run there, and 22 failed; all pass now. No safety logic changed: no session transition, isError, do_not_retry, single-submission or withholding rule.

# Finding Reproduced at 8cf433d6 Cause Fix Tests
1 A first-attachment listing timeout said "Nothing was sent" Yes: both discovery requests received, the listing stalled after three bytes, and the notice said Nothing was sent: the Briosa server could not be reached The discovery text depended on this call having made the session invalid, which a first attachment and a failed reattachment never do The connection records, as evidence only, how many requests each call wrote and which failed call found it abandoned; the notice is chosen from that on every path, and the sentence that the session is now invalid follows only when this call made it so AnAbandonedFirstListingSaysItWasBegunAndLeavesTheSessionUnattached (the 15-second deadline, keep_result_local); table rows for a first attachment, a reattachment and an attached session
2 A validation notice promised a field that was withheld Yes, with field_path: null and the old sentence The notice did not look at what the result returns The notice follows the returned field_path: a name, empty, withheld, or no detail; a rejected restriction header is called a defect in Briosa. The envelope guidance that names the field is replaced, under keep_result_local, when the field path was withheld AValidationNoticeNamesTheFieldOnlyWhenTheResultReturnsIt (8 cases), ARejectedRestrictionHeaderIsCalledADefectInBriosa
3 Stderr called a known outcome unrecorded Yes: succeeded, then session invalid: the outcome of a call could not be recorded One reason, Fault, served both a command that threw and bookkeeping that failed after a returned result Two reasons, each with its own stderr line, refusal notice and guidance (a call failed inside Briosa; the session could not be updated after a call returned its result). A first attachment committed as invalid writes only its reason, never attached. The guide says a success writes no outcome line, and that session lines such as attached can appear ASessionFaultAfterAKnownOutcomeSaysWhatFailed (4 cases), ACommandThatFailsInsideBriosaIsReportedAsSuch
4 The description contradicted tested behaviour Yes The attachment, cancellation and handshake paragraphs above; the provenance table rows for execution.disposition and transport.status; the notice variables (the discovery RPC); the escape example; history now marked as such
5 Make the class hard to reintroduce McpNoticeTableTests: the table below, with a case for each text and the clause pairs McpNoticeTableTests: 43 notice rows and 16 standard error rows, each checked against its case; 33 notice clause pairs and 9 standard error pairs (44, 19, 36 and 9 after the fourth review)
6 Guide, descriptions and instructions against the table Yes, beyond the review's findings Nothing was sent after the discovery requests (local refusals, incompatible servers, the connection-replaced path, internal errors); "a call has no time limit" although the discovery requests have deadlines; the describe sentence about the first invalid field; the status sentence on when the session becomes invalid (failures inside Briosa); the stdout line, which said "after input ended" also when the process was told to stop; attached written for a first attachment committed as invalid; "sends nothing to any server" on the connection-replaced path; the handshake summary; "a reattachment replaces the connection" (it can); "never connects anything" in the status description the table; pinned description sentences in McpProtocolTests
7 A clean disconnect after the first full response (non-blocking) Yes, as the reviewer showed Tested; the reason is asserted, so the former surviving mutant is killed AConnectionThatEndsCleanlyAfterTheFirstFullResponseIsReportedAsEnded, the table's invalid-ended and refused-session-ended rows

The notice table

Every notice before the data statement that ends it; <id> is the attachment ID. Case says how its test produces the evidence: end to end (MCP server and fake Briosa server), through the session (only a cancellation produces it, and a host's cancellation suppresses the response on the wire), through the transport guard (a write that fails under a counted frame), or constructed (a race, or a state the engine never reaches).

Notice (before the data statement) Chosen when Case
Nothing was sent: the arguments do not fit the input schema of <tool>. <rule's fixed detail> Correct the arguments and call the tool again. the arguments break the tool's schema; the call never reaches the session end to end
Completed: the operation returned MP code 2, and every output was retrieved. succeeded, briosa_query end to end
Succeeded. succeeded, a discovery tool end to end
DO NOT RETRY. The operation completed with MP code 4 (partial success) … partial_success end to end
DO NOT RETRY. The operation completed, but at least one output, or its whole result, was not delivered … outputs_incomplete end to end
DO NOT RETRY. The operation ran in SpatialAnalyzer and did not succeed (a completed MP failure) … mp_failed end to end
DO NOT RETRY. The operation completed, but its result could not be delivered … output_write_failed end to end
DO NOT RETRY. The server reports that the operation may have started and that its outcome is unknown … started_outcome_unknown end to end
DO NOT RETRY. Briosa began sending the request, and no trustworthy evidence of how it ended came back: the operation may have run … completion_evidence_unavailable: the MP request was handed to the transport (read in full without trustworthy evidence, or client-fault-after-send) end to end, both
the same, then This session is now invalid: a request this call began sending was abandoned before a complete response was read, … reattach_attachment_id "<id>" before the next call. this call abandoned its MP request and so made the session invalid end to end
Nothing ran: the server did not start the operation … not_started end to end
Nothing ran: the server rejected the request before running it. failure.request_validation names the first invalid field the server found and the constraint it broke; … invalid_request; the returned field_path holds a name end to end
… failure.request_validation gives the constraint the request broke, but the server named no field; … the server's field_path is empty end to end
… gives the constraint the request broke; the field path the server gave could not be verified against the operation's schema, so it was withheld. … keep_result_local withheld field_path end to end
Nothing ran: the server rejected the request before running it, without naming a field; see failure.diagnostic_code, … no validation detail end to end
Nothing ran: the server rejected the restriction header that Briosa sent, which is a defect in Briosa, not in the request; do not call it again unchanged. the server code caller-restriction-invalid end to end
Nothing was sent: this session is invalid because its verified connection to the Briosa server ended. Briosa sends nothing more until you reattach: call briosa_status with reattach_attachment_id "<id>". refused before any request; the connection ended (also cleanly after the last full response) through the session
the same with … because a request that Briosa began sending on its verified connection was abandoned before a complete response was read, … the reason is an abandoned request end to end
the same with … because an earlier call on it failed inside Briosa. a command threw: on an attached session, or on a first attachment after its server was verified end to end, both
the same with … because Briosa could not update it after an earlier call returned its result. the session's bookkeeping failed after a command returned end to end
Nothing was sent: reattach_attachment_id is accepted only while the session is invalid. a reattachment while not invalid end to end
Nothing was sent: reattach_attachment_id does not name this session's invalid attachment, which is "<id>". a reattachment with another ID end to end
Nothing was sent: the call was cancelled before Briosa sent it. cancelled; no request written through the session
No operation was submitted, and only discovery requests were sent: the call was cancelled before it finished. cancelled after both discovery requests were answered in full constructed: the cancellation must land between the listing and the MP request
Nothing was sent: Briosa refused the call before sending it; see failure.diagnostic_code and failure.input. rejected_locally; no request written (the request is too large) end to end
No operation was submitted, and only discovery requests were sent: Briosa refused the call; see failure.diagnostic_code and failure.input. rejected_locally after the discovery requests (a tier call does not serve, strict input) end to end
Nothing was sent: the Briosa server could not be reached. Briosa never starts a server; … server_unreachable; no request written end to end
No operation was submitted, and only discovery requests were sent: the discovery request <rpc> failed; see failure.diagnostic_code. server_unreachable; the failing discovery request was not abandoned (answered in full, or without a stream of its own) end to end
Nothing was sent: this session's verified connection to the Briosa server had ended, and Briosa does not open another. server-connection-replaced; no request written constructed: the connection must end between the session's check and the first request
No operation was submitted, and only discovery requests were sent: the connection to the Briosa server ended during the call, and Briosa does not open another. server-connection-replaced after a discovery request was answered constructed: the connection must end between two requests
No operation was submitted: Briosa began sending the discovery request <rpc>, which may or may not have reached the Briosa server, and abandoned it before a complete response was read. a discovery request was written and abandoned, whatever the outcome: a first attachment, which stays unattached (cancelled, and its 15-second deadline); a reattachment, which stays invalid with the same ID; a listing over the client's receive limit (server_incompatible); and the fourth review's case, a write that failed before any byte of the counted request went out through the session; end to end for the deadline and the receive limit; through the transport guard for the failed write
the same, then This session is now invalid: … the same on an attached session, which this call made invalid through the session
No operation was submitted, and only discovery requests were sent: the Briosa server is not one this tool can use; see failure.diagnostic_code and server.verification_problems. server_incompatible after an answer end to end
Nothing was sent: the Briosa server is not one this tool can use; … server_incompatible with no request written constructed: not reachable, incompatibility is learnt from an answer
No operation was submitted: the Briosa MCP server failed unexpectedly; see failure.diagnostic_code. internal_error: the MP request was not handed over, and what else was written is not known end to end
Nothing was sent: the arguments do not fit the input schema of <tool>. usage_error without an argument violation constructed: not reachable, usage_error comes only with one
DO NOT RETRY. Briosa could not report this call's result in full. If the call sent an operation, it may have run; … the result could not be built, for an outcome after which the operation may have run (a success is reported as output_write_failed) end to end
Nothing ran, but Briosa could not report this call's result in full; see outcome and failure.diagnostic_code. the result could not be built, for an outcome after which nothing ran end to end

Clauses and their neighbours. For each factual clause, a case where it holds and a neighbouring case where it would be false and a different text is chosen: Nothing was sent holds for a refusal before any request (a request too large, an invalid session, either reattachment refusal, arguments that break the schema, usage_error), a call cancelled before anything was written, an unreachable server, and the connection-replaced and incompatible texts with nothing written; it is not chosen for a refusal or cancellation after the discovery requests, an abandoned discovery request (first attachment and reattachment), a server that answered with a failure, the connection ending after a written request, an incompatible server that answered, a success, a call that abandoned its MP request, or an internal error. only discovery requests were sent holds after them and not before any request. could not be reached holds with nothing written, and not for a server that answered with a failure, a listing that timed out, or the connection-replaced path. Briosa began sending the discovery request holds for an abandoned listing (stalled, or over the receive limit) and for the failed write, and not for a discovery request that failed without being abandoned, an incompatible server that answered, or a call that wrote nothing; may or may not have reached the Briosa server holds for the failed write and not for an answered request; and only discovery requests were sent is not chosen for the failed write. This session is now invalid holds when this call made the session invalid, and not for evidence unavailable without an abandoned request, a reattachment's abandoned listing, or a first attachment's. names the first invalid field holds with a returned name, and not when the path is withheld, empty, or there is no detail; withheld the other way round; a defect in Briosa for the restriction header and not without detail. Nothing ran holds for not_started, invalid_request and the nothing-ran fallback, and not for mp_failed, evidence unavailable or the do-not-retry fallback. every output was retrieved: success, not outputs_incomplete. Briosa began sending the request: evidence unavailable, not an internal error. Each of the three refusal reasons is not chosen for another reason.

The standard error table

Every line after briosa-cli mcp: .

Line Written when Case
attached a first attachment is committed as attached end to end
reattached a reattachment was verified in full on a usable connection end to end
session invalid: the verified connection ended the verified connection ended, also cleanly after the last full response through the session
session invalid: a request was abandoned after Briosa began sending it a request on a verified connection was abandoned; for a first attachment, instead of attached end to end
session invalid: a call failed inside Briosa a command threw: on an attached session, or on a first attachment after verification (instead of attached) end to end, both
session invalid: the session could not be updated after a call returned its result the bookkeeping failed after a command returned a known outcome, which stands; for a first attachment, instead of attached end to end
<tool>: <outcome>, with (<code>) when printable a call that did not succeed; a success writes none end to end
<tool>: result-report-failed a result could not be built end to end
dropped an incomplete outgoing message bytes after the last newline when standard output is flushed through the output guard
dropped an outgoing message that was not well-formed JSON-RPC a line that is not one well-formed JSON-RPC 2.0 message through the output guard
abandoned writing to standard output: a write was not finished within one second after the server began to shut down a write still unfinished one second after shutdown began, once through the output guard
usage_error (usage-unknown-option), usage_error (usage-missing-value), usage_error (usage-duplicate-option), usage_error (usage-unexpected-argument), usage_error (usage-invalid-value) (exit 2), rejected_locally (endpoint-not-loopback) (exit 3) a command line it cannot use; every usage code the parser can give for mcp, checked against it end to end
internal_error (mcp-server-failed) the server fails unexpectedly (standard input cannot be opened) end to end

Neighbours: attached is not written when a first attachment is committed as invalid (bookkeeping, a failed command or an abandoned request); each session invalid: reason is not written for the other reasons; a successful call writes no outcome line.

New or changed public names and texts in the third review

The notices in the table above, as they stood at adabd432 (the fourth review changed the abandoned-request and completion_evidence_unavailable wording, see review); the two guidances and two standard error lines for a failure inside Briosa and a failed bookkeeping, replacing the single fault text; the withheld-field guidance under keep_result_local; the stdout abandonment line; attached no longer written for an attachment committed as invalid; the briosa_status, briosa_query and briosa_describe_operation description sentences on invalidation, deadlines and the first invalid field; and, all internal, InvalidReason.CommandFailed and BookkeepingFailed (replacing Fault), SessionOutcome.RequestsWritten and AbandonedRequest, SubmissionGuard.Opened, AbandonedMethod and NameAbandoned, BriosaConnection.RequestsWritten and AbandonedMethod, MpOutcome.NamedFieldGuidance, ServerText.WithheldFieldGuidance, AttachmentSession.Line, and McpResults.Notice(McpTool, SessionOutcome, ArgumentViolation?).

Still open: the handshake's revision-shape mutant stays equivalent under the pinned SDK. Five table rows use constructed evidence because no test can make it happen on demand (two races of the connection-replaced path, a cancellation between the listing and the MP request, and two states the engine never reaches), as the table says. The stall tests show the client's side only. Left alone as slice A's CLI texts: briosa-cli.md says a rejected_locally call sent nothing, although call refuses some only after its discovery requests, and the CLI's validation guidance points at the named field also when the server sent an empty path; the MCP notice for that case is exact.

Second independent review (Astra, of b737405c)

Its ten findings are summarized under review; each was reproduced first (33 failing cases at b737405c).

Every string member of a briosa_query envelope with keep_result_local, on every path, refusals included (corrected in the third review: execution.disposition and transport.status are not plain server values):

Members Where the value comes from Why it is safe, or how it is verified
command, outcome, failure.source, execution.disposition_source, execution.completion_evidence, data.result_delivery, data.result_file.reason, .verification, data.result_delivery_error, server.verification_problems[], warnings[], guidance[], mcp.tool, mcp.session.state, mcp.argument_error.rule the CLI's fixed vocabulary fixed literals
execution.disposition the CLI for a call it never sent (EXECUTION_DISPOSITION_NOT_STARTED, source cli) and for a gRPC OK with a consistent result (EXECUTION_DISPOSITION_COMPLETED, source grpc_ok); the server's typed error otherwise (source operation_error) a CLI constant, or the CLI's name for a compiled enum value; an unknown server value stays a number
transport.status the gRPC status of the last RPC, as the client saw it one of the CLI's fixed canonical status names; a status it does not know reads UNKNOWN
failure.kind, failure.policy_denial.rule, failure.request_validation.constraint, execution.recovery_guidance, replay_guidance, replay_safety, mp_execution.state, output_retrievals[].state, data.operation.effect, execution_scope, replay_safety, duration_class, validation_status, admission, risk_flags[] server enum values the CLI's names for compiled enum values; an unknown value stays a number
endpoint, mcp.session.endpoint the configured --endpoint normalized loopback IP literal
mcp.session.attachment_id, reattached_from generated locally 16 random hex characters
mcp.notice, mcp.argument_error.argument fixed text, the attachment ID, a discovery RPC name from the fixed pair (the client's own method name), and the schema's own argument names never caller or server text
execution.caller_restriction, server.expected_spatial_analyzer_target CLI constants fixed
failure.diagnostic_code (source cli or transport) the CLI, or its mapping of a gRPC status fixed literals
failure.diagnostic_code (source server), output_retrievals[].diagnostic_code the server kept when reviewed, otherwise server-diagnostic
failure.input.field_path, suggested_field_name the CLI's strict-input check of the caller's own request the caller's own key, and a field name from the compiled descriptor
server.briosa_version, source_revision, protocol_package, spatial_analyzer_target, interop_fingerprint, data.operation.mp_step, policy_denial.admission_profile the server withheld, always
failure.request_validation.field_path, policy_denial.request_option_field the server kept when every segment resolves exactly in the request message
output_retrievals[].field_name the server kept when it names a field of the result message
policy_denial.caller_admission_profile, caller_denied_flag the server kept when equal to what this call's restriction header sent
policy_denial.denied_flag the server kept when a fixed risk flag name
data.operation.grpc_service, rpc, fully_qualified_method the listing kept when exactly a compiled method's
transport.method a discovery constant, or the call's method kept when a discovery method or a compiled method
data.operation.operation_id, category the listing row, matched exactly to the caller's ID equal to the caller's own ID, and derived from it
data.operation.tier, data.result_message, data.result_summary.fields[].name, .type the CLI's classification and compiled descriptors CLI values
data.result_file.path, other_files[].path, sha256 written by the CLI the spill directory, the UTC time, the validated operation ID and random hex; a computed hash
data.result SpatialAnalyzer null; the result is only in the file

Maintainer decisions, round 2

  1. A call abandoned after it was sent makes the session invalid. A request that was sent and then abandoned before its response was read to the end makes the session invalid; only the explicit reattachment continues. It is decided on the connection: every RPC passes through AbandonmentInterceptor, which asks the submission guard whether that request's stream was opened and its response not read to the end; an RST_STREAM the client writes marks the connection too. Conservative by design: a response that arrived in full but failed to deserialize counts as abandoned, and so does a stream the server reset. Tested for a host's cancellation of a sent query, a response over the 4 MiB receive limit, an unreadable response, a server reset, a discovery deadline and a cancelled discovery call; since the second review also for responses that start and then stall.
  2. With keep_result_local, names are returned only when the schema verifies them (field paths and denial option fields that resolve in the request message, output row names in the result message, caller values equal to what this call sent, fixed risk flag names, enum values); everything free-form is withheld and written to the result file under server_text. Correction of 66dbdd89: in an MP call's denial trailer the caller fields cannot carry a sentinel, because the CLI accepts such a denial only with its own values; a capability row's denial is not checked that way, and ACapabilityRowsCallerFieldsAreReturnedOnlyWhenTheyAreWhatTheSessionSent plants both there end to end.
  3. No default time limit on MP calls.

The texts round 2 introduced (the session-invalidated warning and notice ending, the abandoned-request refusal and guidance, server-text-kept-local and server-text-withheld) are unchanged. Three were replaced later: the fault refusal, guidance and stderr line (split into two reasons in the third review), the briosa_status sentence on when the session becomes invalid, and the briosa_query sentence on time limits (both corrected in the third review).

Held items, now decided

Read-only hints (review item 7). Kept readOnlyHint: true on all five. The descriptions of briosa_query and briosa_status state their one local effect plainly and that SpatialAnalyzer and the Briosa server are never changed. The guide says the hint describes the effect on SpatialAnalyzer, and that result files accumulate, with expiry planned with #446.

Server free text with keep_result_local (6b). Every free-text field the server or SpatialAnalyzer supplied goes into the result file, which becomes {"result":…,"server_text":{…}} keyed by envelope path; a call that ends without a result file drops it with the fixed warning server-text-withheld, and never falls back to returning it. Without keep_result_local nothing changes, and the CLI's envelope never changes.

The HTTP/2 abort path from #470 (decided in round 2)

The upstream defect's second trigger is the client aborting a stream while Kestrel is writing that stream's response, after which the server can leave the next response on that connection unsent. On an attached session that path is reachable, by my reading, through a host's cancellation, the client's 4 MiB receive limit, a discovery deadline and an unreadable response; round 2's rule covers each at the submission guard, and #470's larger stream window closes the window path. Waits without a bound on an attached session: the MP call itself (by decision; PINGs detect a dead connection, not a lost response), a call waiting its turn behind it (cancellable), a stdout write nobody reads while input is open, and local file I/O. Bounded: discovery RPCs (15 s each), connecting (5 s), shutdown (one second after it begins).

Maintainer decisions

Decisions 1 to 5, 7 and 8 proposed in the first version of this description were accepted as recommended: isError only when nothing ran; reattachment by attachment ID; cancellation cancels the gRPC call; the 16 KiB per-server cap with search pages of 10 and at most 25; the envelope plus mcp; PINGs at 30 s with a 20 s timeout; and the CLI's own envelope texts. Decision 6 was changed: arguments that break a tool's schema are tool results. After review round 3, the two held items were decided as described above. In round 2 the maintainer decided that an abandoned call invalidates the session, that keep_result_local returns names only when the schema verifies them, and that MP calls get no default time limit. After the second review, the approved mapping for succeeded stands: isError: false, do_not_retry: false.

Checked as asked: no envelope text returned through MCP tells the reader to run a command-line action. The only --output texts are given only when --output is used, which MCP never does; "Do not run the call again" is a prohibition; "use the Control Center" is an operator action.

Noticed, left alone

  • The SDK always advertises a logging capability; this server sends nothing through it.
  • The SDK answers -32601 with a message that repeats the unknown method name, and some unreadable tools/call shapes with -32603; both are handled (review round 3).
  • The SDK drops responses still pending when standard input closes. It also serves requests that arrive before initialize, which the incoming filter refuses; the SDK has no option for that.
  • Once a client uses the 2026-07-28 per-request metadata, the SDK requires it on every later request of that process.
  • The SDK writes a quotation mark in text content as a six-character Unicode escape (a backslash, u, and 0022), so the text copy of a result is about half again as large on the wire as the structured copy (the model sees the decoded text).
  • The CLI's own validation guidance, Correct the field named in failure.request_validation …, is also given when the server sends an empty field path. That is CLI behaviour from slice A, unchanged here; the MCP notice says that the server named no field.

Refs #445

🤖 Generated with Claude Code

davidalucas and others added 7 commits November 28, 2026 06:59
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Adds docs/operations/briosa-mcp.md, links it from the CLI page, and makes
the two corrections slice A's final review asked for. Tool argument values
now come from the SDK's parsed elements, which keep the request text as
received, and the strict input rules are tested through briosa_query.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A known tool whose arguments object breaks its input schema now gets a
tool result with isError true (usage_error, tool-arguments-invalid, and
mcp.argument_error naming the schema's argument and the rule), as MCP
2025-11-25 asks for input validation errors, instead of JSON-RPC -32602.
An unknown tool and a malformed tools/call envelope stay protocol errors.
Such a call sends nothing and leaves the session unchanged. Only the first
violation is reported, in a documented order.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
davidalucas added a commit that referenced this pull request Nov 28, 2026
- FakeBriosaServer signalled MpCallReceived before it read the reply it would send,
  so a test that changed Reply when the call arrived could change the reply of the
  call already in flight. It now fixes the reply first. No test on main changes the
  reply after the arrival, and in both traced stalls of #467 the reply had already
  been produced, so this is not the cause of that hang.
- SpillDirectoryTests.CreateJunction waited for `cmd /c mklink` with no bound and
  left both redirected streams unread. A child that did not exit, or filled a pipe,
  would have held the whole assembly. It now drains both streams, waits at most 30
  seconds, and ends the child and fails the test with a message when it does not
  exit. Every local hang was named as the fault matrix, not a junction test.

Refs #467

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
davidalucas and others added 5 commits November 28, 2026 11:18
The single-submission guard granted a permit to every request the gRPC
channel sent and kept it when the request ended without opening a
stream: cancelled before its stream opened, cancelled between the grant
and the send, or failed. A later request's resend could then use that
permit, so two streams could carry one request. The handler now retires
every unused permit when a request ends without a response. The class
comment states the invariant: a permit belongs to one request and never
outlives it.

The CLI cannot reach the leak, because a CLI command ends after any
failed RPC and owns its connection; the MCP session keeps its connection
across tool calls and could.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- operation_id: its pattern, with ECMAScript semantics (a trailing
  newline does not match), and its 128-character length are checked
  before the session is touched, so an ID that cannot name an operation
  never attaches.
- Integers are values, not spellings: 10, 10.0 and 1e1 are the same
  integer, 1.5 and 1e-1 are not; magnitudes far out of range are a range
  violation.
- String lengths count Unicode code points, as JSON Schema does.
- risk_flags: every element's type, then every element's name, then
  distinct items, so the rule reported does not depend on where in the
  list a problem is.

McpSchemaConformanceTests derives its cases from the advertised input
schemas, values of every JSON type and around every bound, and checks
the validator against an independent evaluator of the keywords those
schemas use. It kills the category-65 mutant and its siblings
(attachment ID 17, query 201, operation ID 129, limit 26, range bounds).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… handshake

From the review of 88b2b63:

- A call that may have sent its MP request is never reported as unsent.
  The new attachment ID, the only fallible step that does not depend on
  the outcome, is prepared before anything is sent. The engine catches
  every failure after the hand-off to the transport and reports
  completion_evidence_unavailable (client-fault-after-send). The
  session's bookkeeping cannot replace an envelope the command returned;
  a failure there only makes an attached session invalid. A send signal
  tells the dispatcher's last-resort catch whether the request may have
  gone, and a result that cannot be built is a fixed-shape fallback that
  keeps request_sent.
- The session commits to a connection, and takes the ID prepared for it,
  only when the server was verified in full (identity, target,
  compatibility, and listing) on a connection that is still open. A
  failed first attachment stays unattached; a failed reattachment stays
  invalid with the same ID, and the new connection is closed.
- Once standard input ends or the process is told to stop, a write to
  standard output that has not finished one second later is abandoned,
  and so is every later one, so a host that stopped reading cannot keep
  the process alive.
- The output guard passes a line only when it is one whole JSON-RPC 2.0
  message: valid UTF-8, the members of a request, notification, result,
  or error and no others, no member twice. An error message that is not
  one of the server's fixed messages is replaced by a fixed text for its
  code and its data dropped, except the supported versions of -32022, so
  the SDK's -32601 no longer repeats the method name.
- The incoming filter refuses an unreadable tools/call, a string that is
  not valid Unicode included, with -32602 instead of the SDK's -32603,
  and refuses requests other than initialize and ping before the
  handshake with -32600, except those with the 2026-07-28 per-request
  metadata.
- Every wait the MCP tests added is bounded; the concurrency tests no
  longer swap replies or sleep.

FakeBriosaServer.cs and SpillDirectoryTests.cs are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…l effects

Maintainer decisions on the two held review items:

- With keep_result_local, a briosa_query result carries only reviewed
  diagnostic codes, fixed text, and the CLI's own values. Every free-text
  field that the server or SpatialAnalyzer supplied (the server's
  identity claims, the operation's MP step, the text members of a policy
  denial, a validation's field path, output rows' field names, and
  server diagnostic codes that are not reviewed ones) goes into the
  result file, which becomes {"result":...,"server_text":{...}}, and is
  null, or server-diagnostic for a code, in both copies of the envelope.
  A call that ends without a result file, or whose delivery fails, drops
  the text with a fixed warning and never returns it. Without
  keep_result_local nothing changes, and the CLI's envelope never
  changes. Every withheld field is tested with a sentinel.
- readOnlyHint stays true on all five tools. The descriptions of
  briosa_query and briosa_status state their one local effect, a private
  result file kept until someone deletes it, and replacing the session's
  connection on reattachment, and that SpatialAnalyzer and the Briosa
  server are never changed.

The MCP guide documents both, and every change of the review round: the
cap's scope with the measured ratio, the fallback result, the argument
order, the full-verification attach rule, the fixed protocol error
messages, the handshake gate, the output guard, and output abandonment.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The engine's own catch and the dispatcher's last-resort catch produced
the same outward result, so either could be removed without a test
failing. The engine fault now also checks that the engine reported it,
with the method and operation it knew, and a new fault point outside the
session's guarded bookkeeping reaches the dispatcher, whose result must
come from the send signal. Removing the engine's catch, the dispatcher's
use of the signal, or the signal itself now each fails a test.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
davidalucas added a commit that referenced this pull request Nov 28, 2026
…ake test-job hangs and load failures attributable (#470)

* Make a hung test run fail with the test's name, in CI and in the CLI tests

The 2026 test job on main ran for nine minutes with Briosa.Cli.Tests reporting
nothing until the 15-minute job limit cancelled it, so the hung test was unknown.

- ci.yml and release.yml: every dotnet test step now reports a test that runs for
  three minutes as hung (--blame-hang-timeout 3m) and ends its test host. The step
  fails well inside the job limit and the log names the test. In ci.yml the aborted
  assembly's sequence file is uploaded with the test results. No dump is taken
  (--blame-hang-dump-type none), and the upload excludes any *.dmp file in case one
  is ever written: a test host's memory is not shown to hold no secrets. Checked
  locally with VSTest 18.7.1: the project and solution form writes only the
  sequence file; the DLL form ignores "none" and writes a full dump, which is why
  the upload exclusion is there.
- Briosa.Cli.Tests: CliRun bounds each CLI run at 60 seconds. The CLI sets no
  default deadline on an MP call, so a fake that never answered held the whole
  assembly forever; such a run now fails its test with a TimeoutException that says
  why. Checked with a fake that never answers: the run failed at 60.1 s and the
  server still stopped.

The 15-minute job limit stays: the slowest green 2026 job today took 10:00, and a
hang caught at three minutes ends the job by about 12.5 minutes.

Refs #467

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Keep two server test checks from failing when the test process is starved

Two failures of the 2026 job came from the test process itself being starved for
seconds on a loaded runner, not from what the tests check.

- RequestValidationDetailGrpcTests (both targets) failed at Failures == 0: the
  provider's bounded log drain did not finish in its default 2 seconds. The test
  took 2.64 s against 0.30 s when it passed, so it waited out the whole bound. The
  drain runs on a thread-pool thread; with the pool saturated, a local experiment
  saw Dispose wait 8.1 s before the drain ran. The test now gives the drain the
  longest bound the option allows (10 s). A drain that still misses it is counted
  in Failures, so the test still fails on a dropped record, a failed sink, a value
  in any output, or a partial log. GeneratedClientPerformanceEvidenceTests had the
  same pattern and gets the same bound.
- TypedFileUiAndControlOperationTests failed with "An existing connection was
  forcibly closed by the remote host" on its first call, after about 6 seconds,
  from its own loopback Kestrel host. Kestrel's default minimum request-body data
  rate (240 B/s after a 5-second grace) aborts the whole HTTP/2 connection when a
  request body arrives late, and the host's client runs in the same starved
  process. A request body sent 8 s late to a default host gave exactly that error
  chain after 6.1 s; one sent 3 s late succeeded. GrpcTestHost now has
  WithoutMinimumDataRates, applied to all seven in-process test hosts of
  Briosa.Server.Tests in both targets. Production hosting keeps Kestrel's defaults,
  and no call is retried.

Refs #467

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Grant each CLI response a stream window above the receive limit

Product fault: a Briosa.Cli call could wait forever. The ASP.NET Core 10.0.15
runtime the server ships has an HTTP/2 defect (dotnet/aspnetcore#70124, fixed by
dotnet/aspnetcore#70100, in no released runtime yet): when the tail of a response
waits on the client's stream window and a window update races its final write,
the next response on a reused stream of that connection is never sent. A call
sends GetServerInfo, ListCapabilities with denied operations (about 190 KB, more
than the 65,535-byte default window) and then the MP call on one connection, and
an MP call has no default deadline.

This is the Briosa.Cli.Tests hang of #467. The delivery fault matrix makes 664 such
calls against the Kestrel fake. Locally it stalled 3 times in 97 runs of the
assembly under load, each time in that test. A run with HTTP/2 tracing caught one:
the fake received the MP call and completed it, the client sent all of it and
waited, and no frame of the response arrived, while the listing before it had a
stream window update in flight.

The CLI now advertises an initial stream window of the 4 MiB receive limit plus
64 KiB, so no response it accepts ever waits on that window and the condition
cannot arise. StreamWindowTests reads the window from the CLI's first SETTINGS
frame. The operations guide says why.

Refs #467

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Fix two CLI test fixture races that a review of #469 found

- FakeBriosaServer signalled MpCallReceived before it read the reply it would send,
  so a test that changed Reply when the call arrived could change the reply of the
  call already in flight. It now fixes the reply first. No test on main changes the
  reply after the arrival, and in both traced stalls of #467 the reply had already
  been produced, so this is not the cause of that hang.
- SpillDirectoryTests.CreateJunction waited for `cmd /c mklink` with no bound and
  left both redirected streams unread. A child that did not exit, or filled a pipe,
  would have held the whole assembly. It now drains both streams, waits at most 30
  seconds, and ends the child and fails the test with a message when it does not
  exit. Every local hang was named as the fault matrix, not a junction test.

Refs #467

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Cover every CI dotnet test with hang diagnostics and keep each run's sequence file

Review of #470: three test invocations that CI reaches still ran without hang
diagnostics, so a hang there would still run to the job limit unnamed. Both
targets' Test-LocalSpatialAnalyzerHost.ps1 (before the solution tests),
Test-RuntimePerformance.ps1 and Test-ObservabilityPerformance.ps1 now pass
--blame-hang-timeout 3m and --blame-hang-dump-type none, and accept a results
directory.

Every dotnet test reached by ci.yml or release.yml is now covered: in ci.yml the
source-host script, the solution tests, the Debug reflection and manual-startup
tests and the two performance scripts; in release.yml the solution tests and the
Debug tests. No other workflow and no other eng script runs dotnet test or VSTest.

- ci.yml: each test invocation writes its own subdirectory of
  artifacts/test-results, and the upload moves after the last test step, so the
  Debug run's and the scripts' sequence files are kept too.
- Verify-CiWorkflow.ps1 rejects a step of any workflow, or an eng script, that
  runs dotnet test without both settings. The new Test-CiWorkflowPolicyChecks.ps1,
  run in CI and required by the checker, proves the rejection on mutated copies.
  Against the previous head the checker names exactly the six scripts above.
- The comments and eng/security-baseline.md describe the three minutes as VSTest's
  host inactivity timer: test starts and finishes reset it, and more than one test
  can be unfinished when it fires, so the names are candidates. The baseline also
  says what a sequence file holds. Every theory in both targets takes fixed test
  data, so display names carry no path, environment value, user or generated value.

Refs #467

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Keep a timed-out CLI test run and the junction helper from outliving their resources

Review of #470:

- CliRun: a run that missed its 60-second bound failed the test and disposed the
  run's output streams while the CLI kept going, so a late reply wrote to a
  disposed stream and a reserved --output file could outlive the test's directory.
  The CLI now sees the caller's token through a test-owned linked one. After a
  timeout that token is cancelled, the run gets 30 seconds to end, and the timeout
  is still the test's failure. The streams and the token source are disposed only
  when the run has ended, and its outcome is observed. Until a timeout nothing
  about the run changes.
- CreateJunction: Process.Kill only starts the termination. After a timeout the
  helper now waits up to 10 seconds for the child to exit and for both pipe reads
  to end, and after a normal exit it observes both reads, within 10 seconds.

Refs #467

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Pin the shipped two-second log drain bound

Review of #470: the privacy test now accepts a drain of up to 10 seconds and the
blocked-sink test sets 50 ms, so nothing pinned the 2,000 ms default the server
ships. ObservabilityTests (both targets) asserts it from the option's default,
an empty configuration, the packaged appsettings.json, and a provider built from
the defaults.

Refs #467

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Say which causes were reproduced locally and which are inferred for CI

Review of #470: the shared test host's comment (both targets) and the stream
window test's comment stated the hosted failures' causes as fact. The hosted runs
recorded neither the body timing nor Kestrel's abort reason, and the CLI hang has
no trace. They now say what the local experiments showed and that the hosted
cause is inferred. The guide and BridgeContract now limit "never waits" to a unary
response the CLI accepts, and say the MP call would wait until interrupted or the
connection ends rather than forever.

Refs #467

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Describe the theory display-name review as a scan with flagged sources checked

Refs #467

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Check each dotnet test invocation on its own for hang diagnostics

Re-check of #470: Verify-CiWorkflow.ps1 searched a whole workflow step or script
for both settings, so a step whose run block held two dotnet test commands passed
when only one of them carried the settings.

The checker now splits a step's run value, with a literal block kept line by line
and a folded block folded, and each eng script into dotnet test invocations: a
command line, with backtick and backslash continuations joined, from "dotnet test"
to the next unquoted ; && || or |, or a PowerShell argument array written as
@("test", ...). Each invocation must carry both settings itself, and a finding
names the invocation. A comment states what the check does not see: invocations
built from variables or splatting elsewhere, settings appended to an array after
it is written (reported as missing), other runners, and composite actions.
The checker and its mutation test are skipped, since they hold "dotnet test" only
as fixture text.

Test-CiWorkflowPolicyChecks.ps1 adds rejections for two commands in one step with
the settings on the first only, settings on another command in the same line,
and a second argument array in a covered script. It also proves that a command
continued over lines with its settings is accepted.

Refs #467

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Bound a timed-out CLI test run's cleanup with one deadline, and the junction waits

Re-check of #470:

- CliRun awaited the cancellation before it started its 30-second cleanup, so a
  cancellation callback blocked on a lock could hold the test until the outer hang
  detector. One deadline, started before the cancellation, now covers both the
  callbacks and the run's end, and both tasks are observed. The run starts on the
  thread pool, so the 60-second bound also covers synchronous work before the CLI's
  first await. A run that has not ended by the deadline, for example one stalled in
  a synchronous file flush, is reported as abandoned still running and possibly
  holding files it created, such as an --output or spill file; later timeouts in the
  assembly say how many such runs are still running. In process the run cannot be
  stopped; only a process boundary would guarantee it releases its files, and this
  harness does not build one.
- CreateJunction now uses one 10-second deadline after it ends a child that did
  not exit, for the exit and both pipes, so it waits at most 40 seconds in all,
  and its failure says which of the two did not happen.

Refs #467

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
davidalucas and others added 10 commits November 28, 2026 12:18
Maintainer decision: a call that was sent and then abandoned before its
response was read to the end makes the session invalid, so that only the
explicit reattachment (a new, verified connection) continues. The server's
runtime can fail to answer the next call on a connection after an aborted
response (dotnet/aspnetcore#70124).

The connection decides it, so no call site can forget it. Every RPC on a
BriosaConnection passes through an interceptor that, when the call fails,
asks the submission guard whether the request's stream was opened and its
response was not read to the end; the HTTP handler observes the end of
each response, and records a request that failed after its stream opened;
and an RST_STREAM frame the client writes marks the connection too. Only
the MCP session reads the result, so the CLI is unchanged.

The abandoned call's own outcome is reported as before; its result shows
the session invalid with a fixed warning (session-invalidated) and a
notice that names the reattachment. Later calls are refused with
session-invalid, whose notice and guidance now say why. A first
attachment whose server was verified before such a call is committed as
invalid at once. A call cancelled while still queued sends nothing and
leaves the session as it was.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Brings #470: the client
stream window above the receive limit, bounded CLI test runs, and hang
detection on every test invocation. The one conflict, the MP branch of
FakeBriosaServer.HandleAsync, keeps main's order (the reply is fixed
before the arrival is signalled) together with this branch's arrival
semaphore and concurrency count.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…e limit

Each path that abandons a request after it was sent now has a test that
shows the call's own outcome, the session invalid afterwards, the next
call refused with session-invalid and nothing sent, and a successful
reattachment on a new connection: a host's cancellation of a query (on a
first and on a later call), a response over the 4 MiB receive limit, a
response that cannot be read, a stream the server resets, a discovery
deadline, and a cancelled discovery call. A call cancelled while queued
leaves the session attached. Unit tests cover the guard's three signals,
the RST_STREAM frame among them.

The fixed texts now speak of a request this call sent, so they read
right for discovery tools too. The briosa_query description says that a
call has no time limit and that cancelling a sent call leaves its outcome
unknown and invalidates the session; briosa_status says when the session
becomes invalid. The guide explains why, citing dotnet/aspnetcore#70124 as
observed behaviour of the server's runtime, not a guarantee.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ies them

Maintainer decision: with keep_result_local, a name is returned only when
it resolves in that operation's own schema, from the CLI's compiled
descriptors.

- failure.request_validation.field_path, and a denial's
  request_option_field, stay when every dot-separated segment is, in
  order and exactly, a field of the operation's request message.
- Output row names stay when they name a field of the result message, as
  the CLI already reads output rows.
- A denial's caller_admission_profile and caller_denied_flag stay only
  when they equal what this call's restriction header sent; denied_flag
  when it is a fixed risk flag name; enum values always.
- Everything else free-form stays withheld, and unreviewed codes still
  read server-diagnostic. Every text the server supplied, verified or
  not, is still written to the result file, so it stays complete.

Tests cover a resolving name and ones that differ only by case, have an
extra segment, or hold a character a field name cannot have, for each
kind, and a result whose unverifiable output names reach only the file.
This also corrects 66dbdd8's message, which said every withheld field
had a sentinel: the caller profile and flag could not, because the CLI
accepts a server denial only when they hold its own values.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The interceptor's decision covers every failing call, so the HTTP
handler's record of a request that failed after its stream opened, and
its reading of a trailers-only response as complete, had no test of
their own. Unit tests now check each layer directly: a failed request
with and without an opened stream, a trailers-only response and a body
read to the end (not abandoned), and a body left unread (abandoned).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The unit test for this check used an earlier request that had been read
to its end, so it passed whether or not the guard compared request
numbers. It now leaves the earlier request unread, so a call that fails
before reaching the HTTP stack is shown not to be blamed for it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ode gaps

- A verified first attachment is never lost. Once a server was verified
  in full on the session's first connection, no later failure leaves the
  session unattached: an unusable connection, an abandoned request, a
  command that throws, or a fault in the session's own bookkeeping makes
  it invalid under the ID prepared for it. An attached session whose
  command throws becomes invalid too. Before, an abandoned MP call
  followed by a bookkeeping fault left the session unattached, and the
  next ordinary call attached again without a reattachment ID.
- Before initialize, the handshake exception needs a per-request
  protocol version of 2026-07-28 or later. An older revision, null, or a
  value that is not a string is refused with -32600; the SDK served
  2025-11-25 and null before.
- With keep_result_local, the operation's grpc_service, rpc and
  fully_qualified_method stay only when they are exactly a compiled
  method's, on every path, refused calls included; transport.method only
  when it is a discovery method or a compiled one. A refused call with a
  case-changed RPC returned the server's spelling before.
- The output guard rebuilds every error object from its checked parts:
  a fixed message stays only in an error with no member but code and
  message, each once, and data stays only for -32022, as its list of
  supported revisions when every entry is one this server supports.
- An empty server diagnostic is recorded in the file and replaced in the
  envelope like any other unreviewed code.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…nd guide

- An abandoned discovery request no longer reports "Nothing was sent":
  its notice starts "No operation was submitted: the discovery request
  <GetServerInfo|ListCapabilities> was sent to the Briosa server and
  abandoned before its response was read in full."
- The briosa_query description says that cancelling a call invalidates
  the session only before its response has been read in full, and, like
  the keep_result_local schema description, which server text returns:
  names verified against the operation's schema, caller values against
  what the session sent, and codes against the reviewed list.
- The invalid_request notice and the describe description promise the
  first invalid field only when failure.request_validation is present.
- The guide: the 4 MiB limit is the client's receive limit, not a server
  send limit; a successful call writes nothing to standard error, so a
  lost successful result shows only as the abandoned-output line; the
  order of the cancellation lines; the literal " escape; which
  members server_text records; the rebuilt error objects; the handshake
  exception; the never-lost first attachment; the package-root layout
  accepted in #445; and an unambiguous succeeded row (outcome known,
  do_not_retry false, calling again runs it again).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…er fields

- FakeReply.Stall (additive): a response that starts, sends its first
  bytes and then stalls. An MP response stalled after three bytes and
  then cancelled, and a listing stalled after three bytes until its
  15-second deadline, each invalidate the session; the next call is
  refused with nothing sent, and the reattachment opens a new connection.
- A read into an empty buffer is not the end of a response.
- The output grace is pinned at one second, and an abandoned write is
  shown to end after its grace and not before.
- The permit test asserts the intended exception, so a timeout or an
  assertion inside the scripted handler cannot pass as it.
- A capability row's caller profile and flag reach the envelope without
  keep_result_local and are withheld with it, end to end; a wrong
  protocol_package is planted as a sentinel too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The session-returning fault point now sits inside the attached path's
guard, so a command that throws after it returned exercises the branch
that makes the session invalid, and the send-boundary test asserts it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
davidalucas and others added 2 commits November 28, 2026 15:16
The third review found texts that the evidence of their own call
contradicted: a first attachment whose listing was sent and abandoned
said nothing was sent, a validation notice named a field that
keep_result_local had withheld, and standard error called a known
success unrecorded after the session's bookkeeping failed.

Notices are now chosen from what the connection recorded for the call,
as evidence only: how many requests it wrote, and which failed call
found it abandoned. "Nothing was sent" appears only when the call wrote
no request; a call that wrote only its discovery requests says so; an
abandoned discovery request is reported as sent and abandoned on every
path, and "This session is now invalid" follows only when this call
made it so. The invalid_request notice follows the returned field path
(a name, empty, withheld, or no detail) and calls a rejected restriction
header a defect in Briosa; with keep_result_local the guidance that
names the field is replaced when the field path was withheld.

The one fault reason is split into a command that failed inside Briosa
and bookkeeping that failed after a command returned its result, each
with its own standard error line, refusal notice and guidance. A first
attachment committed as invalid reports only its reason, never
"attached". The standard output abandonment line no longer says input
ended when the process was told to stop. The status, query and describe
descriptions state when the session becomes invalid, that the discovery
requests have deadlines, and that the first invalid field is named only
when the result returns it.

No session transition, isError, do_not_retry, single-submission or
withholding rule changes.

McpNoticeTableTests lists every notice and standard error line with the
evidence that selects it, a case that produces that evidence, and, for
each factual clause, a neighbouring case where it would be false.
McpThirdReviewTests covers the three findings and a clean disconnect
after the first full response, asserting its reason.

Refs #445

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Every guide sentence about notices, standard error, cancellation,
attachment and the handshake now matches the tested texts: what a
notice says was sent and why, the invalid_request notice, the
connection-replaced texts, the reasons an attachment becomes invalid
(failures inside Briosa included) and that such an attachment never
reports attached, cancellation of a discovery request before any
server was verified, a reattachment whose connection is not usable,
every standard error line, success writing no outcome line but
possibly a session line, and which per-request versions get -32600
and which the SDK answers with -32022.

Refs #445

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
davidalucas and others added 3 commits November 28, 2026 16:57
The connection counts a request when the guard lets its opening HEADERS
frame through, before the write under it; the fourth review showed a
write that failed before any byte went out, after which the notice said
the discovery request "was sent". The count and the invalidation rule
are unchanged; the texts that rest on them now say that Briosa began
sending the request:

- the abandoned-discovery notice, which adds that the request may or may
  not have reached the server;
- the sentence that this call made the session invalid, the
  session-invalidated warning, the abandoned-request refusal, its
  guidance, and its standard error line;
- the completion_evidence_unavailable notice, which keeps DO NOT RETRY
  and its outcome;
- the briosa_status and briosa_query description sentences.

The server_unreachable notice for a discovery request that failed
without being abandoned now says it failed rather than that the server
answered it, since it may never have had a stream of its own. "Only
discovery requests were sent" stays: it is chosen only when no request
was abandoned, so every request the call wrote was answered.

The notice table gains the reviewer's case through the transport guard,
with neighbours where nothing was written and where the request was
answered, and the standard error table gains every usage line the
parser can give for mcp (usage-missing-value, usage-duplicate-option,
usage-unexpected-argument), checked against the parser's codes, with
the exit code of each refused command line.

No session transition, outcome, isError, do_not_retry, submission or
withholding rule changes.

Refs #445

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The guide said a call that wrote only discovery requests gets the
discovery-only notice, which a successful briosa_status, saying
Succeeded., does not; it now names the three failure outcomes that
use it. It also explains that a request counts from its opening frame,
so a notice claims delivery only for an answered request, and words
the abandoned-request texts, the cancellation bullet and the standard
error list the same way. The retry introduction no longer says that a
call that did run must not be repeated without checking first, which
a plain success contradicts, and the standard error list names every
command-line usage line with its exit code.

Refs #445

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The test asserts that the notice says Briosa began sending the listing;
its name and the class comment still said the listing was sent.

Refs #445

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@davidalucas
davidalucas marked this pull request as ready for review November 28, 2026 22:29
@davidalucas

Copy link
Copy Markdown
Contributor Author

Read of the final diff (adabd432..2acae253)

The fourth independent review confirmed the safety rules intact at adabd432 and requested wording changes only. The maintainer decided on 2026-11-28 that those would be merged after a read by the orchestrating session, without a fifth review pass. This is that read.

  • Scope. 10 files, +200 / -105. Under src/ the diff touches three files (Mcp/AttachmentSession.cs, Mcp/McpResults.cs, Mcp/McpTools.cs) and changes string literals, XML documentation and comments only. No statement that decides anything changed: no session transition, outcome, isError, do_not_retry, submission or withholding rule.
  • Finding 1 (a request said to be sent when no byte was written). Every text that rests on the count of opening frames now says Briosa began sending the request. The abandoned-discovery notice adds that it may or may not have reached the server. The completion_evidence_unavailable notice still starts DO NOT RETRY. and still says the operation may have run. The reviewer's zero-byte case is a new row of the notice table with two neighbouring cases.
  • Finding 2 (overstatements). The guide limits "only discovery requests were sent" to rejected_locally, server_unreachable and server_incompatible calls whose discovery requests were all answered, and says a successful discovery tool reads Succeeded..
  • Finding 3 (missing stderr rows). usage-missing-value, usage-duplicate-option and usage-unexpected-argument are in the table, a new test compares the table with the usage codes the parser can give for mcp, and the command-line cases now assert the exact exit code where they asserted only non-zero.
  • Tests. Other test changes are expected-text updates and one renamed test.

Not changed here and recorded on #445: the CLI's own completion-evidence-unavailable warning, shipped in the first slice and carried in MCP results, still says "The request was sent".

@davidalucas
davidalucas merged commit 0bf601f into main Nov 28, 2026
35 checks passed
@davidalucas
davidalucas deleted the 445-cli-mcp branch November 28, 2026 22:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant