Repository navigation
prototype(sdk): patchy init --tier 1, dev over PGlite, publish with manifest - #187
allisonmahmood wants to merge 2 commits into
Conversation
…anifest (#176) Throwaway prototype for the SDK map's init ticket. Adds @patchy/sdk (code-first config and browser client), @patchy/primitives (Tables and Files services plus the /_patchy routes), a publish route that provisions additively before recording the version, and the init/dev/publish/refresh CLI commands. Co-Authored-By: Claude Fable 5.1 <[email protected]>
…docs/API.md Co-Authored-By: Claude Fable 5.1 <[email protected]>
|
DO NOT MERGE!! |
|
Good prototype for 187. Again, remember what i said about building the sdk gradually even for tier 1. |
|
Make sure that when the SDK calls patchy, the production mounts those routes first. |
|
I see a bit of an issue with the way we store things. Like Heres the thing. Will we be saving drafts if they aren't published? If so, that can cause database issues. writing into other patches, corrupting data, etc. We have to find a way for that not to happen. Maybe only one draft at a time per page? Maybe have a saved section and have one default autosaved page at a time. |
|
Make sure when you delete a patch page, we delete everything with it. Tables, schemas, stored files, etc |
|
We should also have a policy on how the sdk and patches interact with users. IE if we share a patch, can the other person edit it (Now this would be a sick feature ngl) . Ie how that would work. |
|
I think something that will help us debug the sdk when building it is by having very specific error handling. WIll make our work a lot easier instead of beating the bush for 3 hours. |
|
Browser app calls patchy -> SDK sends an HTTP request->Vite forwards it to the local Patchy runtime-> Runtime checks the declared table and row fields -> Tables service writes to local PGlite database-> Saved row returns through the same path. |
|
We also need something like the patchy gates to say, hey we cannot do this. But where that line is something we struggled with in the patchy crm. We cannot afford to make the mistake here. How can we not overdo it is gonna be a big question.I think for now drawing strict boundaries between the tiers will do. aka no cron, etc. shit for now. but we dont want that going into the future. |
What changed
Prototype, not for merge. It is up so the team can check it out and try the agent's first ten minutes with a patch repo:
patchy init --tier 1,patchy devover PGlite,patchy publishwith a manifest. The question it answers, and everything learned, is on the ticket: Prototype: patchy init --tier 1, code-first config, first table and file over PGlite, first publish.Today a patch is one HTML file with no repo. The SDK map decided a patch is a file tree with a code-first
patchy.config.ts, tables and file stores provisioned for it on publish, and a local dev loop on the real capability code. Nothing existed to feel whether that shape is right for an agent. This branch builds the smallest version of all three legs on real code:@patchy/sdk:defineConfig / table / files / t.*and a dependency-free browser client typed by inference from the config.@patchy/primitives: theTablesandFilescapability services (additive provisioning from a manifest, bounded reads and writes) and the/_patchy/*routes, composed by the server over Postgres and bypatchy devover PGlite.POST /api/publishon the wire, versions carryingtierandmanifest, tier 1 bundles served under a sandbox CSP.init,dev,publish,refresh.Part of #176 (left open for the verdict; this PR closes nothing).
Try it
Then change
patchy.config.ts: add a column and a table (publish again, see them provisioned), rename a column (refused), settier: 0(refused).How it was verified
pnpm test,pnpm typecheckpass.pnpm lintdoes not: the CLI's flat-directory import rule and template escapes in the laid-down tree strings, left as-is on a throwaway branch.patchyon PATH; it added a table and an image upload and published. Its findings and astra's second-model review are on the ticket.Release impact
Built by Claude Fable 5.1 in Claude Code, working the SDK map.