Skip to content

feat(primitives): shared file stores on both tiers and patchy add shared-store #407

Closed

Description

@allisonmahmood

Part of #384. Implements spec §10's shared file stores; decisions composition points 1, 2, 9 and 11, the reference CRM (tier 1 consumption, store dependants, shared samples).

What to build

  • Sharing a store: files(description, { shared: true }), shared whole. Sharing publishes read access to every file in the store; the docs say so.
  • Declaring: uses: { kind: "sharedStore", patchId, store, id, revision }, the revision stamping the source's inventory with a stale stamp warning as for tables; patchy add shared-store <patchId>/<store> --as <alias>.
  • Tier 1 reads through the broker with patchy.shared.<alias>.list/get/url/download by name. Tier 2 reads through ctx.shared.<alias>: list and metadata in a query, bytes in an action. There are no shared writes.
  • The gate: a tier 1 tool may read a tier 2 patch's shared store. A consumer document below its own patch's served tier gets server_required. Every read and redemption re-checks live that the viewer can open the source and the store is still shared, otherwise access_denied.
  • Reverse states, matching tables: omission and rollback never change sharing; unshare, retire and delete list live dependants and refuse without force; unsharing advances the store's revision and the source's lifecycle revision; restore brings consumers back unchanged; a new patch under the source's old name never rebinds.
  • Discovery: patchy list <patch> <store> shows shared, declarable and the add hint. The portal card's dependants line covers stores. Store dependants are reported as stores, not in a table field.
  • Dev: refresh lays down a missing fixtures/shared-<alias>/ named after the source's store; dev loads it at start without overwriting. To change a source locally, edit the fixture and restart dev; authority changes are not simulated.
  • The skill: a shared-stores sibling of patchy-shared-tables; "stores are not shareable" removed from patchy-loop.

Admitted at merge

Shared stores publish and read on both tiers.

Done when

A tier 1 and a tier 2 consumer read a shared store; an unshare refuses without force and names the consumer; with force, the consumer's next read is access_denied and a reshare recovers it; a rollback of the consumer never changes the source's sharing.

Surfaces

ADR-0004 (add shared-store), packages/patchy/README.md, the wire (docs/API.md), the Primitives glossary (Shared file store), docs/product.md § Primitives (shared stores), the skills.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:cliarea:primitivesready-for-agent

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions