Skip to content

MCP upload/commit family seams and executable tools/call evidence - #554

Merged
athNdev merged 1 commit into
mainfrom
codex/mcp-upload-ops
Nov 19, 2026
Merged

athNdev merged 1 commit into
mainfrom
codex/mcp-upload-ops

Conversation

@athNdev

@athNdev athNdev commented Nov 19, 2026

Copy link
Copy Markdown
Owner

Summary

Implements the MCP UPLOAD/COMMIT lane for the nine pending OSS-370 operations (OSS-371/372/373/375). Covers the four upload-family operations only:

Pending operation Tool / composed path Typed procedure Scope
rpc:FileService/SaveUploadedFile file_service_save_uploaded_file /carbonpanel.v1.FileService/SaveUploadedFile files/create[server_id]
rpc:UploadService/InitUpload upload_service_init_upload /carbonpanel.v1.UploadService/InitUpload uploads/create
rpc:UploadService/UploadChunk upload_service_upload_chunk /carbonpanel.v1.UploadService/UploadChunk uploads/create
surface:rest_upload_stream scoped_stream_open → scoped_stream_chunk* → rest_upload_stream_commit (composed → SaveUploadedFile) files/create[server_id]

What changed

New self-contained, lane-owned files only:

  • internal/mcp/family_upload_tools.go — tool implementations and exported seams:
    • UploadFamilyDescriptors, UploadFamilyToolSpecs(), RegisterUploadFamilyTools(),
      UploadFamilyInvocationArgs(), MarshalUploadFamilyDescriptors(),
      UploadFamilyErrorSentinels().
    • The composed rest_upload_stream_commit consumes controller-owned bounded
      stream frames and commits only through the typed upload path. No direct
      filesystem helper writes a destination.
  • internal/mcp/family_upload_descriptors.json — machine-readable descriptor artifact.
  • internal/mcp/family_upload_tools_test.go — executable evidence tests.
  • knowledge/decisions/mcp-upload-commit-family.md (+ regenerated decisions index).

No shared catalog or integration file is edited. The integration owner joins
the exported seams into the generated catalog, registration and invocation harness
after both lanes land. RegisterUploadFamilyTools respects the production
registration allowlist, so the catalog must be regenerated with these specs first.

Evidence (real MCP tools/call over SDK stdio, production auth interceptor)

  • TestUploadFamilyTypedInvocationEvidence — each direct tool reached its typed
    method; every non-confirm argument asserted against the exact generated protobuf
    field; real handler success; ungranted dp_ token denied with a real Connect
    code; invalid token refused as unauthenticated; confirm=true gate observed.
  • TestUploadFamilyFreshCreateAtCommit — uploads/create-only principal can
    create/complete a session but is refused at commit (files/create[server_id])
    with zero destination writes; an entitled caller commits through the typed
    save path only (1 SaveUploadedFile, 0 re-uploads) with exact destination bytes.
  • TestUploadFamilyComposedStreamCommit — 300 KiB source (two 256 KiB frames)
    declared as an upper bound; authoritative final size/SHA asserted; exactly one
    InitUpload + expected UploadChunks + one SaveUploadedFile; exact bytes land.
  • TestUploadFamilyComposedLeaseAndAmbiguous — two parallel commits of one handle
    give exactly one success and one in-flight commit busy result; a lost reply
    after dispatch is verified from the exact destination (size + SHA) with no
    second upload; a never-dispatched save returns truthful UNKNOWN with a recovery
    hint; handle terminal after either outcome.
  • TestUploadFamilyRefusalsZeroWrites — over-cap open, cross-owner claim, cancel,
    expiry, incomplete stream and zero-byte stream are all refused; no upload RPC
    and no destination write on refusal.

Disposable fixtures only (t.TempDir() storage, in-memory SQLite, httptest
Connect handlers wrapped in rpc.NewAuthInterceptor); no user worlds/files.

Verification

Pinned Go 1.26.11:

  • go build ./... — PASS
  • go vet ./... — PASS
  • go test ./... -count=1 — PASS (all packages; internal/mcp 34s)
  • golangci-lint run --new-from-rev=HEAD ./... — 0 issues
  • bun scripts/proto-generate.mjs --check — PASS (generated outputs match)
  • go run ./cmd/knowledge-lint -root . -fix then without -fix — PASS (40/40 queries)
  • go test -tags mcpfullcoverage ./internal/mcp/ -run TestFamilyAuditFullCoverage —
    RED as required: exactly the 9 agreed pending operations, publication BLOCKED.
    This PR does not remove any pending entry or flip the gate.

Head

7570b13b35a88ec9ed8f3fafe6660921053a90d5 (branch codex/mcp-upload-ops, based on origin/main 9e81679b).

No merge, release, GHCR or registry action is requested.

Add a self-contained upload-family hand-off covering the four upload pending
operations (SaveUploadedFile, InitUpload, UploadChunk, rest_upload_stream).
Tools reach the controller only through typed generated clients behind the
production auth interceptor; the composed upload path consumes controller-owned
bounded stream frames and holds a one-at-a-time commit lease.

Exported seams (descriptors, tool specs, registration and invocation args) are
for the single integration owner to join into the shared catalog after both
lanes land. The STRICT publication gate deliberately stays RED with all nine
pending operations; no catalog or pending-inventory file is edited here.

Evidence: real stdio tools/call asserts exact typed-field mapping, handler
outcomes, scope success/denial, fresh files:create[server_id] at commit with
zero writes, exclusive leases, ambiguous-save verification and cap/cancel/
expiry/cross-scope/zero-byte refusals.
@athNdev
athNdev merged commit 7450c14 into main Nov 19, 2026
12 checks passed
@athNdev
athNdev deleted the codex/mcp-upload-ops branch November 19, 2026 03: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