Repository navigation
Closed
Labels
ready-for-agentFully specified, ready for an AFK agent
Description
Part of #193. Implements spec §5 and the bytes routes of §11; decisions The tables surface (bounds), Publish for a patch repo § Stated and Tier 1 serving § Bytes.
What to build
- In
packages/api: the fourfiles.*operation schemas;listanswers{ name, size, contentType, updatedAt }pages with a cursor. Filesinpackages/primitives: a store is an inventory row (patchy.stores), provisioned by the same diff as tables (new store allowed, omission reported, nothing dropped). Bytes are immutable objects in the content store underfiles/<patchId>/<store>/<objectId>, keyed by patch and store, never by version; the indexpatchy.files (patch_id, store, name, object_id, size, content_type, sha256, updated_at)is the pointer.putwrites a new object then upserts the row under per-name serialisation (a failed byte write leaves the previous row),getreads the row's object,list(prefix, keyset on name),deleteremoves the row, idempotent; objects no row names are swept by ticket 3's sweep. Names:/-separated segments, 1–512 bytes, no.or..; per-file cap 20 MiB (too_large). Nothing underfiles/is served at a URL; retrievals areno-storeand authorised live.- The bytes routes from ticket 4 get their handlers with ticket 4's admission (
PUTwith exact Origin,GETwithSec-Fetch-Site: same-origin, both with the wire and principal headers). TheArrayBuffertransfer on the envelope is ticket 12's. - Rollback and version cleanup never touch stored files: a test.
Admitted at merge
Manifests with files.
Done when
- A store provisions on publish; an omitted store is reported and its bytes stay;
putthengetround-trips 20 MiB and refuses one byte more; two concurrentputs of one name leave the row pointing at one object whose size and hash match it; aputracing adeletenever leaves a dangling row; a name with..isinvalid_request;listpages by prefix;deletetwice is fine. - Fetching with a session that cannot open the patch is refused; the response is
no-store; mutations appear in the runtime log with store and name as the resource.
Surfaces
The wire, vocabulary (File store in Primitives), docs/product.md § Primitives (files).
Metadata
Metadata
Assignees
Labels
ready-for-agentFully specified, ready for an AFK agent
Activity
feat(primitives): add persistent file stores
feat(primitives): add persistent files to patches (#215)