feat(runtime): Effect v4 foundation — vendored source, boundary module, conventions (#wave 3.5 stage 0) - #153
Conversation
git-subtree-dir: repos/effect git-subtree-split: 81485ef0288a3321e75d7d4ae32b7e0e06b6f86b
…ule, conventions (wave 3.5 stage 0)
- exact-pin effect@4.0.0-rc.112 (rc.113 is unpublished; documented) as a
runtime-package dependency only; no entry imports it yet
- src/effect/boundary.ts: sole Effect.run* edge, AbortSignal <-> interruption
bridges, error-channel mapping onto the existing typed Agent* errors
- rslint effect-boundary/no-ad-hoc-run custom rule + unit tests
- agent-patterns/effect-{stream,scope,concurrency,errors}.md written from the
vendored source; docs/effect-conventions.md with pin/boundary/error tables
- @effect/language-service wired via tsconfig.base.json (outdatedApi and
serviceNotAsClass as warnings); .vscode + tsconfig + rslint exclude repos/**
- hook cold-start baseline: median 39.74ms (scripts/measure-hook-cold-start.mjs)
🦋 Changeset detectedLatest commit: 341a970 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
💡 Codex ReviewWhen this helper is created while the signal is live but the returned lazy Effect is not run until after the controller aborts, this eager check sees agent-bundle/scripts/eslint-plugin-effect-boundary.ts Lines 68 to 70 in 341a970 When callers rename the Effect namespace, for example ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
Codex P2s addressed in #164 (merged as Recheck aborted state when the Effect starts. Both boundary bridges now share the same pattern: Track aliased Effect namespaces. |
Summary
Wave 3.5 stage 0: the Effect v4 foundation plus the agentic feedback loop, with zero behavior change to any published entry.
effect@4.0.0-rc.112on@agent-bundle/runtimeonly. The brief namedrc.113, which is not on the registry (latest published RC isrc.112); the deviation is documented indocs/effect-conventions.mdfor the re-pin chore. Nothing imports it from an entry graph yet — verified noeffectcode lands indist/{index,state,state/sqlite,plugin}.js.repos/effectvia git subtree (Effect-TS/effectmain, squashed). Editor excludes in.vscode/settings.json(search/files/watcher/auto-import);repos/**also excluded from rslint (globalIgnores) and the root tsconfig. Test-pool and pnpm-workspace globs are root-anchored (packages/*,packages/**/tests/**) so they never sweptrepos/in.repos/effect/LLMS.md(verified it exists) + agent-patterns before writing Effect code, never import fromrepos/**.agent-patterns/effect-{stream,scope,concurrency,errors}.md, written from the vendored v4 source/tests, each < 70 lines.packages/rsc-runtime/src/effect/boundary.tsis the only legalEffect.run*site:runPromise(effect, { signal }),interruptWhenAborted(AbortSignal→interruption),scopedAbortSignal(interruption→AbortSignal), and cause mapping onto the existing typed errors (AgentRequestError/AgentContractErrorby instanceof,AgentStateErrorby name so the state kernel stays off the root graph; interrupt-only causes →AbortError). Unit-tested: abort mid-effect interrupts, interruption rejects asAbortError, typed failures round-trip identically.effect-boundary/no-ad-hoc-run(rslint supports TS plugin modules — chosen over the grep stand-in), banningrun*member calls and named imports outsidesrc/effect/boundary.ts, plus unit tests of the rule.@effect/language-servicewired intsconfig.base.jsonwithoutdatedApi/serviceNotAsClassas warnings. Wired manually rather thannpx @effect/tsgo setupbecause setup'spreparepatch mutates the workspacetypescripton every install; noted in the conventions doc.docs/effect-conventions.md+docs/effect-cold-start-baseline.json; re-check viapnpm bench:hook-cold-start -- --check.@agent-bundle/runtime(public dependency metadata changed).Verification (scoped per landing policy)
rslint .green; negative test confirmed the boundary rule reports violationstypecheckgreeneffect