fix(effect): harden v4 beta runtime boundaries - #28
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR hardens @putdotio/vref’s Effect v4 beta runtime boundaries by pinning Effect dependencies, moving key runtime/CLI paths into typed Effects, and tightening server lifecycle management via scoped resources, while removing the retired “Effect source readiness” workflow.
Changes:
- Pin
effectand introduce@effect/platform-nodeat4.0.0-beta.107, plus related pnpm policy updates. - Switch manifest decoding/validation to Effect Schema while preserving the existing Promise-facing surface and timestamp expectations.
- Rework
serveinto a scoped acquired resource with typed listen/start errors and more robust shutdown behavior; run the CLI viaNodeRuntime.runMainand format boundary failures consistently.
Reviewed changes
Copilot reviewed 13 out of 15 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| test/vref.test.ts | Adds tests for timestamp parsing, scoped server shutdown, and CLI boundary error/interrupt behavior. |
| src/serve.ts | Converts HTTP server to a scoped Effect resource with typed listen/dir errors and improved request pipeline handling. |
| src/output.ts | Uses Effect Predicate helpers for object checks when selecting fields / computing untrusted text paths. |
| src/manifest.ts | Replaces hand-rolled validation with Effect Schema decoding and keeps additional semantic validation (e.g., file safety). |
| src/errors.ts | Reworks VrefError as an Effect Schema.TaggedError and normalizes error-to-JSON formatting. |
| src/cli.ts | Moves sync failures into typed Effects, scopes serve, and runs CLI under canonical NodeRuntime with cause-aware recovery. |
| scripts/smoke.ts | Aligns JSON “record” validation with Effect Predicate helpers. |
| scripts/prepare-effect-source.sh | Removes the retired Effect source preparation script. |
| pnpm-workspace.yaml | Adds release-age exclusions for pinned Effect beta packages. |
| pnpm-lock.yaml | Updates the lockfile to the pinned Effect beta.107 + platform-node dependency graph. |
| package.json | Pins effect and adds @effect/platform-node; removes effect:prepare script. |
| CONTRIBUTING.md | Removes docs for the retired Effect source preparation workflow. |
| AGENTS.md | Documents the new “read Effect guidance from installed package” workflow. |
| .worktreeinclude | Stops including the removed .repos/effect checkout path. |
| .gitignore | Removes ignore entry for .repos/effect since it’s no longer used. |
Files not reviewed (1)
- pnpm-lock.yaml: Generated file
Suppressed comments (1)
src/serve.ts:48
serveis an Effect generator, but this branch currently doesreturn yield* new VrefError(...). AVrefErroris not an Effect, so this won’t typecheck/run as intended; it should fail in the typed error channel (e.g.Effect.fail(...)).
return yield* new VrefError(
"VREF_SERVE_DIR_NOT_DIRECTORY",
`serve dir is not a directory: ${options.dir}`,
);
}
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
putio-releaser Bot
added a commit
that referenced
this pull request
Aug 10, 2026
## [1.2.1](v1.2.0...v1.2.1) (2026-08-10) ### Bug Fixes * **effect:** harden v4 beta runtime boundaries ([#28](#28)) ([a2514c6](a2514c6))
Contributor
|
🎉 This PR is included in version 1.2.1 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Pin vref to the reproducible Effect v4 beta.107 release, harden its Effect boundaries and scoped server lifecycle, and remove the retired Effect source-readiness workflow.
Changed
effectand@effect/platform-nodeto4.0.0-beta.107with matching pnpm lock/release-age policy. The old floatingeffect: betaselector was replaced because npmlatestis still Effect v3 and a tag is not reproducible.VrefError(code, message), metadata, and accepted date-only/offset-less timestamps.scripts/prepare-effect-source.sh,.worktreeinclude,.repos/effectconfiguration,effect:prepare, and supporting contributor guidance.node_modules/effect/AGENTS.mdandnode_modules/effect/srcare now the only documented Effect source path.Review aids
The dependency/source workflow changes from a floating beta plus a vendored source clone to exact beta.107 packages plus installed-package guidance.
Risks
@effect/platform-nodebrings its canonical Node runtime dependencies, including the auto-resolvedioredispeer. A fresh strict-peer consumer install and packaged CLI run passed; this weight is intentional for signal-aware runtime behavior.Verification
pnpm install --frozen-lockfilepnpm run verify(format/lint, typecheck, build/declarations, structured smoke, 33 tests, npm pack dry-run)@putdotio/vref@1.2.0declarations compared byte-for-byte with rebuilt declarationspnpm --strict-peer-dependenciesinstall andvref describeorigin/main: clean after validated fixes/dispositionsComplexity
Moderate. The public surface remains compatible; most complexity is localized to manifest decoding, the CLI runtime boundary, and server resource ownership.