Skip to content

MCP: authenticated controller-side bounded-frame stream transport (OSS-387) - #547

Merged
athNdev merged 5 commits into
mainfrom
codex/mcp-controller-stream
Nov 19, 2026
Merged

athNdev merged 5 commits into
mainfrom
codex/mcp-controller-stream

Conversation

@athNdev

@athNdev athNdev commented Nov 19, 2026 •

Copy link
Copy Markdown
Owner

Authoritative pending-set count: NINE (9)

Resolved from the exact committed head d96a38e8eca61e273c5717c749e79c5f63f13c4b:
internal/mcp/integration_pending.go contains 9 PendingInventory entries and
the STRICT gate TestFamilyAudit/SupportedOperationsGate reports
9 supported operations are not listed, reachable and verified with exactly
9 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:

  1. /carbonpanel.v1.FileService/DownloadArchive
  2. /carbonpanel.v1.FileService/ExportWorld
  3. /carbonpanel.v1.FileService/GetFile
  4. /carbonpanel.v1.FileService/InitFileDownload
  5. /carbonpanel.v1.FileService/SaveUploadedFile
  6. /carbonpanel.v1.UploadService/InitUpload
  7. /carbonpanel.v1.UploadService/UploadChunk
  8. surface:rest_upload_stream
  9. surface:rest_download_stream

Why 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.go header: "the four scoped_stream_* tools are
advertised"; the knowledge page says the same). It also appears as
VerifiedSurfaces:4 inside the STRICT gate's matrix-baseline log line, which is
a 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;
PendingInventory has contained 9 entries since the path-B hold commit
18348416 and still has 9 at 0752403b.

Gate and CI outcomes (exact head)

  • Ordinary regression gate: GREEN (192/192 non-pending verified, 9 pending
    explicitly excluded).
  • STRICT publication gate: RED / BLOCKED (9 gaps). No waiver, no false
    full-coverage claim.
  • 25/25 required CI checks PASS on prior head 0752403 (CI re-running on final head d96a38e), 0 pending / 0 failing, including Go Race
    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)

  • Controller RPCs OpenStream / ReadStreamFrame / CloseStream, bounded
    256 KiB frames + cumulative SHA-256, exact server binding,
    files/read[server_id] RBAC, admission caps.
  • The four scoped_stream_* tools are mounted from production NewServer;
    gateway holds only an opaque handle. Commit uses fresh
    files:create[server_id] via typed SaveUploadedFile.
  • Service-owned bounded session contexts, bounded TTL reaper, idempotent
    same-index retry, terminal partial/over-cap reads, clean
    Server.Shutdown -> FileService.Stop -> StopStreams release.
  • Size contract: declared size is an admission upper bound; final frame
    offset is the authoritative actual byte count.
  • Gateway: per-session mutex, completion + controller-SHA validation, bounded
    staging, one-at-a-time commit lease pinning budget, ambiguous final-save
    verification (no blind re-upload), deterministic terminal/retry states.
  • Fixtures: 307 KiB framed transfer with SHA equality; 4-way parallel streams;
    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 --check match; knowledge lint pass; frontend
check/test/build green. No merge, release, GHCR or registry write requested.

…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.
@athNdev
athNdev merged commit 9e81679 into main Nov 19, 2026
36 of 37 checks passed
@athNdev
athNdev deleted the codex/mcp-controller-stream branch November 19, 2026 02:05
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