Skip to content

[EPIC] Files on every data plane: one store, one API, and the authority behind it #1750

Open
1 of 24 issues completed

Description

@peteski22

Problem

api/routes/files.py and services/files/ hold no control plane references, and the bytes already move through FileStoragePort with local, S3 and fsspec adapters. But a data plane that holds no database cannot serve files at all, because a file's record has nowhere to live.

Direction

Decided in #1606.

  • Otari's store is the source of truth for a file's bytes in both directions. An uploaded file's provider copy is never read back, and a produced file is copied in before the response that mentions it is forwarded.
  • A provider copy is a tracked derivative with its own expiry, never the record.
  • Bytes move by Try-Confirm-Cancel with a scoped grant, per Decide how a data plane reaches the code-execution backend: control-plane proxy, or a scoped grant #1603. The record exists before the bytes, quota is enforced at Try, and Confirm is retried to exhaustion and then parked rather than dropped.
  • In hybrid, the platform supplies the bucket, and the grant is a presigned write to it. An operator-owned bucket is deferred to Decide the authority model for an operator-owned bucket in hybrid #1749.
  • A download streams and never redirects, because files_backend: local has no URL and one public endpoint must behave the same on every backend.
  • Files is one service with two bindings. Nothing on the request path asks which mode it is running in.

The work

Foundations. The wire contract comes first, because the port and the adapter implement it.

Serving it, after #1741.

Provider copies and deletion.

Store and service hardening. Independent of the work above.

Decisions and documentation.

Rules for implementers

The rules for every capability on the seam are on #1790. Two are specific to files.

  • Files is core. One service with two bindings, never two services. The public files router is never an overlay contribution.
  • Every file write goes through the files service. Call FileService.store or store_produced, which own the allocate, reserve, write, stamp and give-back sequence. Do not write that sequence out again.

Not in scope

OpenAI native code execution input staging, a Gemini-specific files integration, provider copies made only to speed up reading an attachment, and file transfer between unrelated deployments.

Done when

  • One set of public files tests passes against a standalone and a hybrid deployment, with the same assertions.
  • No module under services/files/ names a runtime mode.
  • A peer can implement the files half of the protocol from docs/hybrid-mode-protocol.md alone.

Related: #1603, #1688.

Activity

  1. self-assigned this
    on Sep 25, 2026
  2. added sub-issues on Oct 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

area/apiAPI design and behaviorarea/backendBackend service implementation

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions