Skip to content

fix: upgrade Effect v4 runtime boundaries - #60

Merged
altaywtf merged 8 commits into
mainfrom
chore/effect-v4-beta-107-audit
Aug 10, 2026
Merged

fix: upgrade Effect v4 runtime boundaries#60
altaywtf merged 8 commits into
mainfrom
chore/effect-v4-beta-107-audit

Conversation

@altaywtf

@altaywtf altaywtf commented Aug 10, 2026

Copy link
Copy Markdown
Member

Summary

  • Upgrade all existing Effect v4 packages coherently from 4.0.0-beta.102 to 4.0.0-beta.107
  • Audit and harden Effect runtime boundaries, cancellation, typed failures, retries, and package resource safety
  • Remove the obsolete Effect source checkout/readiness machinery and its report

Changed

  • Migrate schema-backed errors to the beta.107 Schema.TaggedError constructor API
  • Compose Effect interruption with request timeouts at every touched Roku HTTP boundary
  • Restrict screenshot retries to the intended typed error while preserving terminal diagnostics
  • Write Roku ZIPs through a scoped same-directory temporary file and atomic rename
  • Add interruption, retry-exhaustion, ZIP replacement, failure-preservation, and cleanup coverage
  • Point agent learning at installed node_modules/effect/AGENTS.md and node_modules/effect/src
  • Delete scripts/prepare-effect.sh, its package hook/test/worktree configuration, docs/READINESS.md, and all supporting references

Review aids

flowchart LR
  CLI["rokit package / install"] --> Effect["Effect typed operation"]
  Effect --> ZIP["Scoped temp ZIP"]
  ZIP --> Rename["Same-directory atomic rename"]
  Effect --> HTTP["Roku HTTP boundary"]
  HTTP --> Signal["Effect interrupt + timeout signal"]
  Signal --> Failure["Typed contextual failure"]
Loading

The hardware-free proof uses the packed npm tarball as a consumer: package dry-run, real generic Roku ZIP creation, schema introspection, and install dry-run. No put.io product fixtures or physical Roku behavior changed.

Risks

  • Vite+ 0.2.6 requires package-name release-age exclusions; Effect stays exact in package.json and the config records the re-pin condition
  • Effect v4 remains beta; exact versions and lockfile keep the three direct packages coherent
  • Request cancellation now reaches native fetch; tests cover interruption and retry failure surfacing
  • ZIP replacement semantics changed; tests prove successful replacement, preservation on write failure, and scoped temp cleanup
  • Physical Roku deploy remains a local/manual check because CI has no developer-enabled hardware

Verification

  • Fresh isolated Vite+ 0.2.6 install — supply-chain policy passes for 270 lock entries
  • Live npm dist-tags: beta is 4.0.0-beta.107 for effect, @effect/platform-node, and @effect/vitest; effect latest remains v3
  • pnpm install --frozen-lockfile
  • pnpm verify — format/lint, TypeScript, build, CLI version/help, 12 test files / 88 tests, npm pack dry-run
  • Isolated packed consumer — public imports, describe package schema v5, package dry-run, real ZIP entries, no temp entries, install dry-run
  • Negative-state repository search — no obsolete prepare script, .repos/effect, readiness report, or inbound references
  • Autoreview branch mode — Claude Opus 5/high, final result clean

Complexity

Medium. The public CLI stays compatible; changes are concentrated at Effect API and external-resource boundaries.

Follow-Ups

None.

Copilot AI lite review requested due to automatic review settings August 10, 2026 08:00

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR upgrades the repo’s Effect v4 dependency set to 4.0.0-beta.107 and tightens runtime-boundary behavior (notably cancellation/timeout propagation and typed failure handling) across Roku HTTP, packaging, and installer operations, while removing the previously-maintained local Effect source checkout/readiness machinery.

Changes:

  • Upgrade effect, @effect/platform-node, and @effect/vitest to 4.0.0-beta.107 and migrate schema-backed errors to Schema.TaggedError constructor usage.
  • Ensure interruption propagates to in-flight fetch calls by composing Effect interruption signals with request timeouts at touched HTTP boundaries.
  • Write package ZIPs via a scoped same-directory temp file and atomic rename; add tests for interruption, retry exhaustion behavior, ZIP replacement, and cleanup.

Reviewed changes

Copilot reviewed 35 out of 36 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
test/roku.test.ts Adds coverage that Effect interruption aborts in-flight ECP fetch requests.
test/roku-capture.test.ts Adds coverage that screenshot retry exhaustion surfaces the underlying failure detail.
test/package-zip.test.ts Adds coverage for atomic ZIP replacement and temp-file cleanup on write failure.
test/errors.test.ts Updates tests to construct tagged errors via new ...() after Effect upgrade.
test/cli.test.ts Removes CI/local Effect-checkout test now that prepare script is deleted.
src/timing.ts Adds helper to combine interruption signals with request timeouts.
src/screenshot.ts Updates tagged error usage and composes interruption + timeout for screenshot HTTP; refines retry logic.
src/runtime.ts Updates runtime-thrown errors to new ...() constructors.
src/roku-context-requirements.ts Updates required-context/password failures to new ...() constructors.
src/rokit-effect.ts Updates InvalidInput failure construction to new ...().
src/polling.ts Refactors pollUntilEffect into Effect.fn-style implementation.
src/package-zip.ts Switches ZIP writes to scoped temp file + rename; updates errors for new TaggedError API.
src/installer.ts Composes interruption + timeout for installer HTTP; updates tagged error API usage.
src/errors.ts Migrates all repo error types to Schema.TaggedError and constructor instantiation.
src/ecp.ts Composes interruption + timeout for ECP HTTP and updates tagged error API usage.
src/discovery.ts Updates InvalidInput construction for discovery timeout validation.
src/device.ts Composes interruption + timeout for device status fetch.
src/debug.ts Uses Effect Clock.currentTimeMillis and updates DebugPortUnavailable construction.
src/cli.ts Updates CLI parse failures to new InvalidInput constructor usage.
src/cli-runner.ts Updates command runner InvalidInput failures to constructor usage.
src/cli-node-condition.ts Updates CLI usage error to constructor usage.
src/cli-input-source.ts Updates input source validation error to constructor usage.
src/cli-input-json-read.ts Updates JSON parsing/decoding error mapping to constructor usage.
src/cli-command.ts Updates CLI parsing error normalization to constructor usage.
src/cli-artifact-commands.ts Updates package output usage errors to constructor usage.
skills/rokit/SKILL.md Removes obsolete guidance about local Effect source setup.
skills/rokit/references/live-proof.md Removes references to deleted readiness doc.
scripts/prepare-effect.sh Deleted (removes local Effect source checkout machinery).
README.md Bumps required Node version and removes readiness doc link.
pnpm-workspace.yaml Excludes new Effect beta versions from minimum release age gating.
pnpm-lock.yaml Locks Effect ecosystem upgrades and transitive dependency updates.
package.json Updates Effect versions and removes prepare script hook.
docs/READINESS.md Deleted (removes obsolete readiness report).
docs/DISTRIBUTION.md Updates wording after readiness doc removal.
AGENTS.md Points Effect learning to installed node_modules/effect/AGENTS.md and source.
.worktreeinclude Removes .repos/effect from worktree include list.
Files not reviewed (1)
  • pnpm-lock.yaml: Generated file

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/screenshot.ts
@altaywtf
altaywtf merged commit bb7b84d into main Aug 10, 2026
2 checks passed
putio-releaser Bot added a commit that referenced this pull request Aug 10, 2026
## [2.4.3](v2.4.2...v2.4.3) (2026-08-10)

### Bug Fixes

* upgrade Effect v4 runtime boundaries ([#60](#60)) ([bb7b84d](bb7b84d))
@putio-releaser

Copy link
Copy Markdown
Contributor

🎉 This PR is included in version 2.4.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants