You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Child of #107. Inserted between Wave 3 (complete: #139-#151) and Wave 4 by owner decision on 2026-09-01.
Why
The internals keep hand-rolling what Effect provides: typed error unions (AgentRequestError, typed Observed reasons, AB fail-closed contracts), resource lifecycles (request leases, EpochStore staging/leases/recovery, session teardown), backpressure (#145's pull-gated decode), and manual AbortSignal threading. Waves 4-6 build the biggest concurrency surfaces yet (hook thin-clients under host deadlines, the MCP progress projector, the notices ledger, warm-runtime lifecycle) — building those Effect-native now is cheaper than migrating them later.
Version and surface
Exact pin effect@4.0.0-rc.113 (unified ecosystem version). Full surface available including effect/unstable/* — latest and greatest by default; the exact pin controls exposure, RC bumps are a named re-pin chore (same treadmill pattern as React, #107 R4), and each unstable-module adoption gets a one-line note in docs/effect-conventions.md so re-pins know what to re-verify.
Hard boundary rules
The public authoring surface stays Promise + zod: await agent(), route modules, defineState, every subpath export, generated artifact signatures. The four-concept newcomer ledger is untouched; Effect never appears in user-facing types, docs, or examples' user code.
Effect lives in internals of @agent-bundle/runtime and packages/agent-bundle/src/dev + the state kernel; each package gets exactly one boundary module (src/effect/boundary.ts) owning runPromise edges, AbortSignal ↔ interruption bridges, and error-channel mapping to the existing typed contracts. Ad-hoc runPromise outside boundary modules is mechanically enforced.
zod stays at all schema boundaries (MCP SDK interop; recorded G-decisions).
Stages
Stage 0 — foundation + agentic feedback loop: exact pin; vendored Effect source at repos/effect via git subtree (squash) with AGENTS.md read-only-reference rules and editor excludes; agent-patterns/effect-{stream,scope,concurrency,errors}.md generated from the vendored source; boundary module + bridges; docs/effect-conventions.md; tsgo language service with v4-aware diagnostics; boundary lint enforcement; stdio-hook cold-start baseline (the stage-2 budget gate).
Stage 1 — state kernel internals (the exemplar): Provide an optional durable Agent state kernel #98's kernel + both drivers on Effect (Scope for txn/connection lifecycles, typed error channel) behind the unchanged API. Parity: the 18-case conformance suite, cross-process + SIGKILL proofs, packaging boundary, eval:spot.
Stage 2 — runtime dispatcher internals: feat(runtime): stream Suspense replacements through Flight #145's pipeline on Effect Stream/fibers (native backpressure, interruption), dispatch()/stream() byte-compatible; parity: event-contract tests + example + eval:spot + the cold-start budget.
Stage 3 — dev seam, one subsystem per PR (highest value, highest risk, last): EpochStore → Scope/acquireRelease; coalescing rebuilds → fiber + Semaphore/Latch; SSE hub → PubSub-backed with the identical wire contract; MCP session lifecycles (the fix(dev): fail MCP tool calls closed when the pinned epoch vanishes #134 fail-closed contract) as scoped resources. Parity: unchanged DTO/SSE wire contracts + dev/workbench e2e suites.
Compiler pipeline migration, Effect Schema at the public zod boundaries, any public API change.
Landing bar
Scoped tests + typecheck + lint per PR, merge on green (owner policy); parity means existing tests unchanged and green. Fragile-seam discipline: stage 3 PRs land only with full parity; per-test rstest retries cover known flakes.
Child of #107. Inserted between Wave 3 (complete: #139-#151) and Wave 4 by owner decision on 2026-09-01.
Why
The internals keep hand-rolling what Effect provides: typed error unions (
AgentRequestError, typedObservedreasons, AB fail-closed contracts), resource lifecycles (request leases,EpochStorestaging/leases/recovery, session teardown), backpressure (#145's pull-gated decode), and manualAbortSignalthreading. Waves 4-6 build the biggest concurrency surfaces yet (hook thin-clients under host deadlines, the MCP progress projector, the notices ledger, warm-runtime lifecycle) — building those Effect-native now is cheaper than migrating them later.Version and surface
Exact pin
effect@4.0.0-rc.113(unified ecosystem version). Full surface available includingeffect/unstable/*— latest and greatest by default; the exact pin controls exposure, RC bumps are a named re-pin chore (same treadmill pattern as React, #107 R4), and each unstable-module adoption gets a one-line note indocs/effect-conventions.mdso re-pins know what to re-verify.Hard boundary rules
await agent(), route modules,defineState, every subpath export, generated artifact signatures. The four-concept newcomer ledger is untouched; Effect never appears in user-facing types, docs, or examples' user code.@agent-bundle/runtimeandpackages/agent-bundle/src/dev+ the state kernel; each package gets exactly one boundary module (src/effect/boundary.ts) owningrunPromiseedges,AbortSignal↔ interruption bridges, and error-channel mapping to the existing typed contracts. Ad-hocrunPromiseoutside boundary modules is mechanically enforced.Stages
repos/effectvia git subtree (squash) with AGENTS.md read-only-reference rules and editor excludes;agent-patterns/effect-{stream,scope,concurrency,errors}.mdgenerated from the vendored source; boundary module + bridges;docs/effect-conventions.md; tsgo language service with v4-aware diagnostics; boundary lint enforcement; stdio-hook cold-start baseline (the stage-2 budget gate).Scopefor txn/connection lifecycles, typed error channel) behind the unchanged API. Parity: the 18-case conformance suite, cross-process + SIGKILL proofs, packaging boundary,eval:spot.Stream/fibers (native backpressure, interruption),dispatch()/stream()byte-compatible; parity: event-contract tests + example + eval:spot + the cold-start budget.EpochStore→ Scope/acquireRelease; coalescing rebuilds → fiber + Semaphore/Latch; SSE hub → PubSub-backed with the identical wire contract; MCP session lifecycles (the fix(dev): fail MCP tool calls closed when the pinned epoch vanishes #134 fail-closed contract) as scoped resources. Parity: unchanged DTO/SSE wire contracts + dev/workbench e2e suites.Out of scope
Compiler pipeline migration, Effect Schema at the public zod boundaries, any public API change.
Landing bar
Scoped tests + typecheck + lint per PR, merge on green (owner policy); parity means existing tests unchanged and green. Fragile-seam discipline: stage 3 PRs land only with full parity; per-test rstest retries cover known flakes.