fix(file-search): type binary install failures - #222
Open
tt-a1i wants to merge 1 commit into
Open
Conversation
agnitum2009
reviewed
Aug 28, 2026
agnitum2009
left a comment
Collaborator
There was a problem hiding this comment.
Second review — independent verification against ab2b3c2; all claims confirmed.
Local verification (fetched the branch and ran the stated test plan):
bun run check-> exit 0, the 12 Effect diagnostics inbinaries.tsare gone, no new diagnosticsbun run test-> 934 Node tests + 31 Vitest tests pass
Behavioral verification of the Layer composition (adversarial tests with local servers):
- The
Layer.provide(Layer.succeed(FetchHttpClient.RequestInit)({ redirect: "manual" }))binding works:layerMergedContextcaptures the build-time context and merges it into the request context, so the fetch client still seesredirect: "manual". Verified with a redirect matrix (old vs new composition both return the 302 verbatim instead of following) and an end-to-end live-install test where an https->http downgrade redirect is correctly refused withrefusing non-HTTPS download URLand nothing is materialized on disk. - Tampered payloads still fail with SHA-256 mismatch, so the integrity contract holds.
All #170 acceptance criteria hold.
Non-blocking hardening suggestions:
- The repo has no redirect-behavior regression test, and the manual binding now depends on the subtle build-time-capture semantics of
layerMergedContext— a future refactor that movesLayer.succeed(RequestInit)out ofLayer.provide(or swaps layerFetch for a layer not built vialayerMergedContext) would silently lose the manual-redirect policy with no test catching it. A client-level assertion (302 returned verbatim, not followed) would pin this cheaply. - Cosmetic: unify
Effect.fail(new BinaryInstallError(...))vsyield* new BinaryInstallError(...)to one style. - A one-line comment at
installLayernoting RequestInit is bound at build time would help.
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.
Problem
The file-search binary installer represented expected download, validation, and extraction failures with global
Errorvalues. This erased the Effect failure-channel discriminant, while the live installer also chained multipleEffect.providecalls that could separate Layer lifecycle ownership.Closes #170.
Value
The installer now keeps expected failures type-safe internally and preserves deterministic Layer construction without changing the public installation error contract. This removes the 11
globalErrorInEffectFailurediagnostics and themultipleEffectProvidediagnostic reported by the Effect Language Service.Approach
BinaryInstallErrorfor expected download, redirect, checksum, and extraction failures;InstallErroras the publicBinaryEnv.installfailure and retain the typed internal error as its cause;Validation
bun run check— passed with the 12 reported Effect diagnostics removedbun run test— passed: 934 Node tests and 31 Vitest testsgit diff --check— passedImpact
InstallErrorcontract and conservative failure behavior are unchanged.