Skip to content

Design single-use upload authorization for remote MCP submissions - #724

Draft
Abiorh001 wants to merge 3 commits into
codex/submission-intake-contractsfrom
codex/mcp-single-use-upload-design
Draft

Abiorh001 wants to merge 3 commits into
codex/submission-intake-contractsfrom
codex/mcp-single-use-upload-design

Conversation

@Abiorh001

@Abiorh001 Abiorh001 commented Nov 27, 2026 •

Copy link
Copy Markdown
Collaborator

Why this is needed

PR #708 consolidates submission into one raw-ZIP API request. Its remote MCP adapter still accepts a Base64 ZIP, which makes the MCP request carry the archive and requires MCP to buffer it. An external agent owns the local file and must not receive MCP's ordinary Workstream API credential.

This PR specifies the agreed replacement: the agent calls MCP with small submission/file metadata, receives a temporary single-use credential, and streams its local ZIP directly to the existing submission endpoint.

What this PR changes

Design and documentation only. It adds the implementation contract in docs/spec_mcp_submission_upload.md, reconciles the MCP/submission documentation and capability ledger, and records the completed design in WS-MCP-002-14. It enables no API, token, tool, migration or deployment.

The contract specifies:

  • workstream_submission_upload_authorize and POST /api/v1/tasks/{task_id}/submission-upload-authorizations, replacing the affected Base64 submission tool when implemented.
  • A metadata-bound SubmissionUpload credential with a ten-minute admission deadline, hash-only storage, exact actor/task/assignment/key/count/SHA-256 binding, unused-token rotation and permanent consumption at T1.
  • An AUTH-owned submission context with exact issuing Submitter-grant continuity, issuance/reservation/acceptance evidence, and no generic Flow identity or public-read authority.
  • Atomic consumption with the existing operation, task guard and capacity reservation; streamed count/hash validation before EOF seal/PRE.
  • Symmetric actor/key exclusion between ordinary Flow admission and credential issuance/redemption, with existing actor locks, fresh conflict reads and direct-SQL closure.
  • Private continuation for the original in-flight request; ordinary authenticated operation reads recover lost responses. An admitted attempt never receives another credential for the same key.
  • Existing rate-control ownership, a proposed 30-requests/60-seconds subject bucket, and retained assignment ceilings of 64 credential keys / 256 successful issuance generations. These are explicit design defaults requiring qualification. Recovery stays within those budgets; exhaustion never exposes MCP's ordinary API token.
  • A configured public HTTPS upload origin, closed structured-result validation, secret redaction, concrete client filesystem/streaming-HTTP requirements, and removal of only submission-specific Base64 machinery.
  • An owner/file/migration/deployment map and U01–U27 future acceptance cases, including exact-grant revocation races, SQL closure, rollback, recovery, installed external clients, uploads above the current MCP Base64 limit, and deployed ingress/operational limits.

Dependency and scope

Stacked on codex/submission-intake-contracts / #708 at 4b763013920e79b6d70c99639f2d84e72341952a (main 5c47b924208e4245bb5575e90df310b1b524aae0). This PR does not modify #708's branch or add a delivery prerequisite to its existing scope. It preserves the canonical PRE → T4 → T5 → POST lifecycle and both review-policy branches.

Eight documentation/design files changed; no backend/MCP runtime code changed.

Validation

Final clean candidate: 893639e77e013a9ecedd46bd456ee45a424b6914.

All seven local checks passed:

  • Markdown links.
  • Stale Workstream wording.
  • Stale authorization documentation.
  • Stale artifact contracts.
  • Stale review contracts.
  • Commitrail records against the stacked base.
  • git diff --check.

GitHub Agent Gates passed on this candidate. The Backend workflow was still pending at the final verification snapshot; it is not represented as passed.

Focused design review

Security, architecture/reuse, and documentation reviews covered the design and its consistency with current owners. Architecture and reuse were assessed in one combined reviewer session, not two independent reviews. Final clean-target replay confirms the fixes:

  • ARCH-REUSE-001: close cross-mode actor/key reservation races and symmetric SQL enforcement while preserving existing admitted-operation replay.
  • SEC-001: specify bounded issuance, retained-history limits, refusal effects and the final lost-response limit.
  • SEC-002: require independent PostgreSQL sessions and both revocation orderings at T1, PRE and T4.
  • DOC-MCP-UPLOAD-001: make expiry an admission deadline, including lock waits.
  • DOC-MCP-UPLOAD-002: qualify all reauthorization guidance by remaining issuance budget.
  • DOC-MCP-UPLOAD-003: record completed check evidence rather than a pending rerun instruction.

These are advisory plan reviews, not runtime attestation. U01–U27 specify future implementation proof; none is claimed as executed by this design PR.

This PR remains draft. No merge or deployment was performed.

@coderabbitai

coderabbitai Bot commented Nov 27, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

This branch has not been deployed

No deployments
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