Skip to content

wave 3.5: Effect-native internals #152

Description

@ScriptedAlchemy

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

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestmeta-frameworkAgent Bundle compiler-coupled meta-framework

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions