Skip to content

feat(patchy): patchy publish from a repo #206

Closed

Description

@allisonmahmood

Part of #193. Implements spec §8 in repo mode, end to end; decision Publish for a patch repo, with Latest-only tooling and What init pulls from the server § Outdated tooling.

What to build

  • patchy publish with no file inside a repo: a persisted attempt under .patchy/publish/ is resent first and its stored response applied; then release check → executeConfig → compare the manifest's declaration stamps with patchy/_generated/index.json (stale_generated: "declarations changed; run patchy refresh") → tsc --noEmit → the Vite single-file build (fail loudly when anything is left outside the HTML; report the largest contributors over 10 MiB) → the evident tier against the declared tier (server/ refused as tier 2; script means at least 1) → persist the whole attempt under .patchy/publish/ → POST /api/publish → write patch into patchy.json on a create → clear the key → print address, tier, version, provisioned and unused as sentences and as --json. File mode is never a fallback for a failed repo build.
  • Server side, the remaining pieces of spec §8's order as one path: replay lookup first; declarations resolved (tickets 7 and 8); the claim and lazy creation of the company database on the first manifest with a table or a store; the bytes uploaded before the platform transaction; the 60 s deadline; the company transaction only when inventory exists or is introduced; rollback and delete on the same row lock; the orphan sweep's evidence (age plus absence).
  • Recovery: a lost reply on a create is resent from the persisted attempt on the next run, before the release check, so an outdated CLI or a changed tree never turns it into a second patch; the stored response carries the id the CLI writes to patchy.json; the body cap is three times the bundle cap.
  • share and delete with no argument inside a repo use patchy.json; a publish onto a deleted patch is 404 and the CLI says to remove patch from patchy.json.

Admitted at merge

Repo publishes at tier 0 and 1 with tables, stores, shared tables and Postgres declarations.

Done when

  • From ticket 11's tree: patchy publish creates the patch, writes the id, provisions the starter table, and the address serves the bundle under the tier 1 CSP; a second publish adding an optional column reports it provisioned; a rename reports the new table and the unused old one; a retype is refused with the fix before any DDL; a tier 0 claim over script is refused by the CLI and, bypassing it, by the server.
  • Interruption at every step (before the bytes, during the company transaction, between the company commit and the platform commit, after the commit with the reply lost, after the reply with the patchy.json write failed) leaves the state spec §8 describes, and the retry with the same key converges to one patch.
  • A stale generated directory is refused before the build; an outdated pin before anything.

Surfaces

The wire, the CLI (README, ADR-0004 for repo-mode publish and its codes), the patchy skill and lock hash, docs/product.md § Building a patch (publish, the publish key), the Patches glossary (Unused definition, Inventory pointer).

Metadata

Metadata

Assignees

No one assigned

    Labels

    ready-for-agent

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions