Repository navigation
Description
Part of #384. Implements the dev half of spec §13; decisions repo and dev loop points 2, 5, 12–14, the execution service (dev runs the production engine), limits §1 (contract limits in dev, the PGlite gap).
What to build
patchy devon the production engine: the supervised local executor with the local runtime as host, over PGlite, the same callback path and contract limits as production.- Live server rebinding: dev's watcher re-reads
server/(a new module is callable with no restart; dev logsnew server module leads: run pnpm patchy refresh for types). A rebuild binds bundle and descriptors as one new binding. Admitted calls, including nestedctx.run, finish on the binding they were admitted on. Every open subscription re-runs on the new binding as a wake, and a run finishing after the swap is discarded and run again. A removed handler or a breaking args change ends its subscription permanently. A failed build or import refusal is logged and the last good binding keeps serving. Asrc/rebuild reloads the shell, as today. - The colleague mount on both tiers: the second listener serves the patch as the fixture non-admin member;
--jsongainscolleagueUrlon tiers 1 and 2. The primary mount is the machine token's user. dev.log: one line per call (viewer, handler, outcome, ms, then itsctx.loglines, and in dev only ahandler_failedmessage and stack), the full wide event behind--json.dev logs --jsonkeeps{ ok, log, text }. Dev writes no runtime-log rows.- Fixtures from handlers: handlers read shared-table and connection fixtures in dev.
- The promise in the skills (
patchy-dev-loopin the repo,patchy-serverandpatchy-loopin the SDK): "patchy devruns the same handler engine and callback path as production. It does not reproduce production's scheduling, limits or containment. A handler that spins forever times out, and a health check restarts the dev engine, which can interrupt other calls in flight." Plus: PGlite reproduces neither contention nor serialization conflicts, so dev is not evidence forbusyorwrite_conflict.
Admitted at merge
The full tier 2 dev loop.
Done when
An edit to a server/ handler is live in about 120 ms without dropping an in-flight call; an open subscription re-runs on the new binding; the colleague mount on a tier 1 patch writes as the colleague. Acceptance owned here: ctx.connections over TLS verify-full with a non-superuser role; handlers read shared-table and connection fixtures; the dev log attributes each call to its viewer.
Surfaces
ADR-0004 (colleagueUrl), packages/patchy/README.md, docs/DEVELOPMENT.md, the patchy-dev-loop skill (containment, the colleague mount on both tiers), the Publishing glossary (Colleague mount), the dev runner if it changes.
Activity
feat(patchy): initialize tier 2 repos and switch tiers with refresh (#…
feat(patchy): run local dev on the production engine