Repository navigation
Description
Destination
A charted Effect v4 port whose decision log reads as the migration spec: every shape decision locked (packages by capability, HTTP shape, SQL, CLI, config, tests, guardrails, order) so the spec can be written and the build filed as ready-for-agent issues, one agent session each. The build itself runs from those issues, not under this map; mid-port decisions come back here as grilling tickets.
Notes
- What "faithful" means. Behaviour at the two user-facing edges — how readers experience served pages and how agents experience the CLI and HTTP API — is preserved. Internals are free to be simpler; the port is also a clean-up.
- Packages by capability, not by layer. The monorepo's packages become swappable capabilities (auth, patches, serving, storage, sql, api, cli) so any one can be ripped out or extended — especially
serving, which tiers 1 and 2 will build on — and each package's test suite isolates problems to their source. YAGNI still applies: a capability with one consumer stays a module until a second appears. - Effect 4 RC, everywhere, pinned through a pnpm
catalog:entry withoverridesforcing every transitiveeffect/@effect/*to it. HTTP, HttpApi, SQL and CLI are alleffect/unstable/*and may break in minors; accepted. Dependabot opens a PR per RC and an agent finishes each bump againstMIGRATION.md. Two merged-but-unreleased breaks are known and planned for: the@effect/sql-pgnative client (int8→bigint, timestamps→epoch ms) and theConfigPascalCase rename. - Package by package on
main. Each port step is one PR;mainstays green; thinEffect.runPromiseadapters at the boundary until the next package moves. No long-lived port branch. - Order: prototype → package decomposition → dev runner (first Effect 4 code; the harness every later PR is smoked on) →
packages/api+--json(Fastify decodes through Schema as the interim adapter) →sql+auth→patches+storage→serving+apps/serveron HttpApi/HttpRouter (Effect lint rules land here) →cli→ wipe self-hosting artefacts, ADRs,CONTEXT-MAP.mdredraw. - Inside the fence:
--jsonwith Effect Schema wire types (#35), the dev runner from Local dev environment and Dev runner supervisor prototype, the Effect half of taste-as-lint (#38), and thedraft → patchrename as a rule: rename what you touch. - Self-hosting is over. Patchy Cloud is the only deployment. The JSON-file DB driver,
docs/SELF_HOSTING.md, the env-registry doc-sync test, the Docker save/verify scripts and the operator's storage-driver choice go with it. - Skills every session consults:
grilling+domain-modelingon grilling tickets;prototypeon the prototype; readnode_modules/effect/AGENTS.mdandMIGRATION.mdonce Effect is installed; the two research write-ups on their branches — Effect 4 landscape and Effect done well for agents — what t3code does.~/Dev/t3codeis the reference codebase for conventions (single-file services,Context.Service,Schema.TaggedError, namespace imports). - ADRs sparingly, in
docs/adr/, only for decisions meeting all three tests; inherited ADR-0000/0001 are retired by the PRs that supersede them. Expected to produce one: Postgres-only, theapicontract package, the CLI's.local/dev/envprecedence.
Settled while charting (2026-08-28, grilled with Allison)
- HTTP shape —
/api/*is anHttpApidefined inpackages/api(typedHttpApiClientfor the CLI, OpenAPI fordocs/API.md,HttpApiTestfor tests); pages (/,/d/*,/report/*,/healthz) are plainHttpRouterroutes owned byserving. The observable status-code contract of the pre-routing target classification (400/404/414) and of auth-before-body (no double rate-limit debit) is kept; the Fastify mechanisms (rewriteUrl+Symbol-marked request,preBody*flags) are dropped in favour of one raw middleware and one API-group middleware. - SQL —
@effect/sql-pg+SqlSchema;sql.withTransactionfor the four manual transactions; row decoding through Schema in one module so the native-client type change lands in one place. Effect'sMigratorreplaces the hand-rolled runner (nothing deployed depends onschema_migrations), provided it composes migrations owned by several capability packages — the prototype checks.prepare: falsereserved for the Neon pooler. - Postgres only — the JSON-file driver is deleted; embedded-postgres is the dev/test store;
app.test.tsmoves onto template-cloned Postgres. ADR. - CLI —
effect/unstable/cli:--jsonviawithGlobalFlags, client derived frompackages/api, Effect owns argv and process lifecycle. Gated by the prototype (esbuild bundling, packed-CLI e2e core). The agent-visible exit-code contract is decided in its own ticket. - Config — Effect
Configper capability,Redactedsecrets, fail-on-first-missing-key (matches today). Trusted-proxy CIDR parsing stays as aSchemabecauseHttpMiddleware.xForwardedHeadershas no allow-list. - Tests —
@effect/vitest(it.effect,it.layer),HttpApiTestfor API routes,NodeHttpServer.layerTestfor raw-socket cases,TestClockfor the mutable clock,Scopefor manual close pairs, fault injection by alternate layers (no mocks).app.test.tssplits by capability as each ports. - Limiter, sweep, analytics — our limiter's semantics (
Retry-After, fails closed at 10k keys) are kept as an Effect service whose interface mirrorsRateLimiter.consume, so a later swap to Effect's limiter + Redis store is a layer change; sweep isEffect.repeat(job, Schedule.spaced("1 hour"))forked in the server scope; analytics is a service whose finalizer flushes under 3 s. PostHog stays. - Agent guardrails —
AGENTS.mdpoints atnode_modules/effect/AGENTS.md;@effect/language-servicediagnostics as errors gatingtypecheck(mechanism decided by a task ticket — TS 6 patch vs@effect/tsgo); the two t3code lint rules written locally for ESLint (no plugin exists); no vendoring, no Macroscope — its two review specs become repo skills for/code-review. - Wire schemas live in
packages/api(schemas +HttpApi+ client), a third thing beside the two contexts;coreshrinks to html-policy + ids. docs/API.mdis rendered fromOpenApi.fromApiby a small local renderer and pinned by a test (Effect has no markdown emitter).
Decisions so far
-
Pin Effect 4 RC and open a Dependabot PR per RC: Effect pinned at
4.0.0-rc.112via pnpm catalog + overrides (@effect/language-service0.87.2 on its own line); Dependaboteffectgroup opens one PR per RC, labelledeffect-rc-bumpby a small labelling workflow; prerelease-following verified in dependabot-core and stops once 4.0.0 ships. PR chore(deps): pin Effect 4 RC and open one Dependabot PR per RC #63. -
Make Effect diagnostics fail typecheck on TS 6:
effect-language-service patchagainst tsc 6.0.3 wins (@effect/tsgoalso worked, rejected for extra deps); t3code's rule set promoted toerror, whole-file Node-style rules left as warnings (46 hits) for port tickets to promote per package; four rules are v3-only and inert. PR ci(effect): fail typecheck on Effect language-service diagnostics #65, stacked on chore(deps): pin Effect 4 RC and open one Dependabot PR per RC #63. -
Turn t3code's Macroscope review specs into repo skills:
effect-service-conventionsandui-consistencyas internal skills under.agents/skills/(outsideskills/, which the CLI bundle copies), pointed at from AGENTS.md so/code-review's Standards axis loads the matching one. PR docs(agents): add Effect and UI review specs for /code-review #64. -
Effect 4 vertical slice: on
prototype/effect-slice. CLI unblocked — esbuild bundle needs thecreateRequirebanner (undici via NodeServices); Effect's error/version/global-flag defaults are agent-hostile, overrides insrc/cli.tshanded to CLI contract on Effect cli: exit codes, --json, signals #60.Migrator.make({})+fromRecordadopted: one global integer id sequence, duplicates fail, today's six migrations run unchanged, all pending in one transaction with an integer ledger. 401 body stays{ ok: false, error }(no TaggedError on the wire). Test template:it.layer+ empty DB migrated by our Migrator,HttpApiTest.groups,NodeHttpServer.layerTest,TestClockreaches the server fiber. Review round: c0c2443. -
Package decomposition by capability: ten packages by capability —
core,api,sql(no tables),auth(migrations 1–2),content-store(renamed fromstorage),patches(migrations 3+, owns the expiry sweep and depends oncontent-store),serving(reads throughpatches),analyticsandlimitsas packages (two consumers),cli;config/dbdeleted; each capability implements its ownHttpApigroup; vocabulary is runtime with tiers,serving= serving to the user; per-packageCONTEXT.md+docs/adr/written by the PR that moves the code; baseline migrations rewritten withpatchnaming (no prod DB exists). Eleven ordered build tickets listed on the resolution for the spec. -
CLI contract on Effect cli: exit codes, --json, signals: exit-code ladder by who acts — 0 ok / 1
local/ 2rejected/ 3unreachable/ 130 interrupted, nothing else;--jsonand--api-urlare global flags, JSON errors carrykindon stderr and success is one stdout document; Effect's signal mapping (130, no128+n) with the hidden prompt's terminal restore as a scope finalizer; Effect's default built-ins kept, bare--version, stacks only at--log-level debug; e2e signal probes are harness mechanism, not contract. One ADR CLI contract for agents (ladder +.local/dev/envprecedence) from thecliport PR. -
AGENTS.md Effect section:
## Effectin AGENTS.md — readnode_modules/effect/AGENTS.md; service-convention gist pointing at the review spec; the ten-package capability map;@effect/vitestpatterns pointing at the prototype'sslice.test.ts; language-service guardrail; RC-bump steps moved under it.MIGRATION.mdis not shipped in the RC package, pointer fixed to upstream. Landed as PR docs(agents): tell agents how Effect is written here #67. -
Write the port spec and file the build tickets: spec is the body of the epic Effect v4 port; eleven
ready-for-agentsub-issues chore(server): remove reports #69–docs: redraw the context map, retire the origin ADRs, wipe self-hosting #79 with real blocked-by edges; wire rename moved to theapiticket; feat: --json on every command with shared Effect Schema wire types and docs/API.md #35 superseded. Map complete — mid-port decisions reopen it as grilling tickets.
Not yet specified
- A shared rate-limiter store for multi-replica production (Effect's Redis store, or a Postgres one) — surfaces with deployment work, which has its own map.
- Neon specifics the port must design around once production points at it: transaction-mode pooler (
prepare: false), scale-to-zero dropping sessions. - What the
patchvocabulary looks like inCONTEXT.mdonce the code renames — lands in theCONTEXT-MAP.mdredraw.
Out of scope
- Feature-by-feature keep/drop of PatchPage-isms (mint, expiry, pins, quotas) — carried faithfully as foundations; decided by the systems that supersede them. Exception, decided on Package decomposition by capability: reports are removed — a free-service valve nothing later builds on, with a reader-facing surface that would otherwise leak into
serving. First build ticket of the spec. - Deployment target, replicas, hosting infra, release channel — their own effort.
- Auth replacement, tier 1/2 runtimes, the integration layer — each its own map; the port only leaves clean seams.
- Self-hosting in any form.
Activity
docs(agents): retarget the review specs at Patchy's real code
docs(agents): add Effect and UI review specs for /code-review (#64)
allisonmahmood commentedon Aug 28, 2026
Route charted: spec and build filed as #68 (#69–#79). Closed with its last ticket; mid-port decisions reopen this map as grilling tickets.
docs: redraw the context map, retire the origin ADRs, wipe self-hosting
docs: redraw the context map, retire the origin ADRs, wipe self-hosting
docs: redraw the context map, retire the origin ADRs, wipe self-hosti…