Skip to content

[Architecture > Effect]: Migrate Rig to an Effect v4 harness - #8

Merged
rendotdev merged 6 commits into
mainfrom
work/effect-v4-harness
Jul 29, 2026
Merged

rendotdev merged 6 commits into
mainfrom
work/effect-v4-harness

Conversation

@rendotdev

@rendotdev rendotdev commented Jul 28, 2026 •

Copy link
Copy Markdown
Owner

Summary

At the moment, Rig relies on an internal define builder for most construction, while lifecycle reliability is distributed across Promise-based code paths.

This PR migrates Rig to an Effect v4 harness while preserving its existing libraries, public Promise contracts, and Zod-based tool SDK.

  • Pins Effect and the Effect test tooling to 4.0.0-beta.102.
  • Replaces every internal define construction with explicit domain classes, services, and adapters.
  • Removes the legacy src/define.ts module and adds structural tests that prevent it from returning.
  • Adds idiomatic Effect services, layers, tagged errors, scoped resource acquisition, cancellation, and retry schedules at reliability boundaries.
  • Keeps configuration and command hot paths lazy, then bundles the Effect runtime for fast packaged startup.
  • Adds Effect at repos/effect as a shallow git submodule pinned to the matching v4 beta commit for agentic source reference.
  • Adds vp run effect:reference so fresh checkouts can initialize that read-only reference without vendoring Effect into Rig's diff.

Reliability

  • Tool execution acquires and releases database, KV, cache, and collection resources through one scoped lifecycle.
  • Shell interruption terminates complete process groups and escalates from SIGTERM to SIGKILL when necessary.
  • File locks use bounded retries, stale-owner recovery, and owner-safe release.
  • Registry update checks retry transient network and HTTP failures while permanent failures remain immediate.
  • Configuration, cron, updater, and shell boundaries expose typed Effect failures without breaking current callers.

Validation

  • vp run ci
  • vp run bench
  • vp run effect:reference
  • 332 unit and integration tests passed.
  • 30 end-to-end tests passed.
  • Covered production files remain at 100% statements, branches, functions, and lines.
  • Package build, consumer smoke test, npm dry-pack, Effect diagnostics, linting, formatting, and type checking passed.
  • All enforced Bun and Node startup performance budgets passed.

@rendotdev
rendotdev force-pushed the work/effect-v4-harness branch from afcf590 to 804548a Compare July 28, 2026 14:33
@rendotdev
rendotdev marked this pull request as ready for review July 29, 2026 15:52
@rendotdev
rendotdev merged commit 0a7552a into main Jul 29, 2026
2 checks passed
@rendotdev
rendotdev deleted the work/effect-v4-harness branch July 29, 2026 15:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant