Repository navigation
MCP: authenticated controller-side bounded-frame stream transport (OSS-387) - #547
Merged
Merged
Conversation
…S-387) Add controller-owned OpenStream/ReadStreamFrame/CloseStream RPCs behind the production auth interceptor, with files/read[server_id] scopes and exact server binding. The four scoped_stream_* tools are now mounted from NewServer and carry bytes only through typed RPCs; the gateway never shares panel/node storage. Sessions use service-owned bounded contexts, in-flight admission caps, a TTL reaper, idempotent same-index frame retry, terminal partial/over-cap reads, and clean Server.Shutdown -> FileService.Stop -> StopStreams release. Declared size is documented as an admission upper bound; SHA/Done/commit use the actual transferred bytes. Regenerates proto/catalog/descriptor artifacts and updates knowledge. The STRICT publication gate stays red until all 9 pending operations have real tools/call evidence.
Add a one-at-a-time commit lease on gateway stream sessions: ClaimCommit pins gateway memory for the whole upload, rejects parallel commits before any mutation, and FinishCommit releases budget exactly once with deterministic terminal/retry states. TTL and cancel no longer free a slice still referenced by an in-flight commit. Adds parallel tools/call, lease exclusivity, budget-pinning, idempotent-finish and retryable-failure fixtures. Corrects PR count language in the transport docs via knowledge update.
Distinguish known pre-save failures from post-dispatch uncertainty on SaveUploadedFile. Timeout/cancel/unavailable/unknown/internal outcomes are treated as UNKNOWN: the exact destination is read back and size/SHA compared before any success claim. Verified destinations succeed; unverified ones return a truthful UNKNOWN with a recovery hint and a terminal lease, so no blind re-upload is possible. Adds owned reply-drop/timeout/cancel/never-dispatched fixtures proving one upload sequence and deterministic lease release.
Add PendingOperationCount=9 and a test pinning the exact pending operation list, with a comment explaining that four refers to mounted scoped tools and VerifiedSurfaces, not pending operations. Exact-head audit confirmed 9 inventory entries and 9 STRICT gate gap lines with identical lists.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Authoritative pending-set count: NINE (9)
Resolved from the exact committed head
d96a38e8eca61e273c5717c749e79c5f63f13c4b:internal/mcp/integration_pending.gocontains 9PendingInventoryentries andthe STRICT gate
TestFamilyAudit/SupportedOperationsGatereports9 supported operations are not listed, reachable and verifiedwith exactly9 gap lines. The two sets are identical after stripping the gate's
rpc:prefix. The ordinary gate separately logs
PARTIAL SLICE REGRESSION GATE PASS: 192/192 non-pending operations verified; 9 PENDING explicitly excluded. Nine is the only pending-operation count.The authoritative 9 pending operations are:
/carbonpanel.v1.FileService/DownloadArchive/carbonpanel.v1.FileService/ExportWorld/carbonpanel.v1.FileService/GetFile/carbonpanel.v1.FileService/InitFileDownload/carbonpanel.v1.FileService/SaveUploadedFile/carbonpanel.v1.UploadService/InitUpload/carbonpanel.v1.UploadService/UploadChunksurface:rest_upload_streamsurface:rest_download_streamWhy FOUR appeared earlier: "four" in the exact-head artifacts refers only to
the number of mounted
scoped_stream_*tools, never to pending operations(
integration_pending.goheader: "the four scoped_stream_* tools areadvertised"; the knowledge page says the same). It also appears as
VerifiedSurfaces:4inside the STRICT gate's matrix-baseline log line, which isa verified-surface count, not a pending count. Reading either as a pending count
was a conflation. There is no head or log at which the pending set was four;
PendingInventoryhas contained 9 entries since the path-B hold commit18348416and still has 9 at0752403b.Gate and CI outcomes (exact head)
explicitly excluded).
full-coverage claim.
Detector (9m28s), Backend Test Suite, Proto Breaking/Lint, generated proto
(ubuntu+windows), Frontend Quality & Build, Windows Compile/Runtime, and
Knowledge Base.
Implementation and evidence (same head)
OpenStream/ReadStreamFrame/CloseStream, bounded256 KiB frames + cumulative SHA-256, exact server binding,
files/read[server_id]RBAC, admission caps.scoped_stream_*tools are mounted from productionNewServer;gateway holds only an opaque handle. Commit uses fresh
files:create[server_id]via typedSaveUploadedFile.same-index retry, terminal partial/over-cap reads, clean
Server.Shutdown -> FileService.Stop -> StopStreamsrelease.offsetis the authoritative actual byte count.staging, one-at-a-time commit lease pinning budget, ambiguous final-save
verification (no blind re-upload), deterministic terminal/retry states.
parallel commit of one handle (one upload sequence + busy conflict); lost
reply/timeout/cancel/never-dispatched save verification; early-commit zero
writes; digest mismatch; read-only/revoked/cross-owner/cross-server refusals;
bounded memory and in-flight admission; TTL eviction; runtime shutdown.
Pinned Go 1.26.11 build/vet/test green except the intentional STRICT gate;
golangci-lint new-issues 0; proto
--checkmatch; knowledge lint pass; frontendcheck/test/build green. No merge, release, GHCR or registry write requested.