Repository navigation
Effect Service Conventions: 1 issue found
apps/server/src/vcs/GitVcsDriverCore.ts(line 2138):fileSystem.exists(gitIndexPath)in the newreadWorkingTreeReviewDiffhelper is not mapped toGitCommandError, so a rawPlatformErrorleaks into the helper's error channel (losing operation/cwd context that the adjacentcopyIndex/copySharedIndexmappings capture) and bypasses theEffect.catchTags({ GitCommandError: ... })fallback at the call site, silently producing an empty working-tree diff instead of falling back toreadTrackedWorkingTreeReviewDiff.
Inline comment with a suggested fix has been posted.
Details
Note
Your check run agent prompt is: .macroscope/check-run-agents/effect-service-conventions.md
More information about how Check Run Agents work can be found in our Help Center.
Scope reviewed: apps/server/src/vcs/GitVcsDriverCore.ts and apps/server/src/vcs/GitVcsDriverCore.test.ts.
Checked and found conforming:
- Namespace subpath imports (
effect/Effect,effect/FileSystem,effect/Path, etc.) in both touched files; the now-unusedeffect/Arrayimport was correctly removed. - Service dependency acquisition unchanged:
fileSystem,path, andexecuteGitcome from the constructor environment; noManagedRuntime.make,runPromise, or service-instance parameters were introduced in production code. - Error handling uses the existing
GitCommandError(Schema.TaggedErrorClass) with stable structural attributes (operation,command,cwd, staticdetail) plus the realcause; no raw command output or wire payload is copied intodetail. - Recovery uses
Effect.catchTags({ GitCommandError: ... })rather thancatchTag/catchIf. - New tests cover real behavior changes (rename detection, staged deletions, split index, sparse checkout) and use
ChildProcessSpawnertest handles as legitimate test seams, not mocks of core logic.
The previously flagged unmapped copyFile for the shared index has been addressed in this revision.
🔍 Agent activity — 1 tool call
💭 Now I'm reviewing the new code for convention violations. The error handling looks correct—the
GitCommandErrorhas a staticdetailfield rather than copying from the cause, which aligns with the guidelines. TheEffect.catchTagsis being used properly to handle the error type.… The previous issue has been resolved. Now I'm scanning for other convention violations in this scope. Looking at the GitCommandError definition in contracts—it does have adetailfield, but it's a static description that follows the existing convention in the file, so that's acceptable. I'm noticing thatfileSystem.exists(gitIndexPath)at line 2138 has an unmapped PlatformError leaking through the error channel, which is the same type of issue as the earlier finding with copyFile. SincefileSystem.existsreturnsEffect<boolean, PlatformError>, this needs the same treatment. Wait, I need to reconsider—the prior comment said copyFile was the only unmapped filesystem call, butexistsis also unmapped, andfileSystem.removeis being ignored withEffect.ignore. Let me verify:fileSystem.existsyieldsEffect<boolean, PlatformError>, so readWorkingTreeReviewDiff's error channel includes PlatformError. The error handling catches only GitCommandError and then swallows the rest withEffect.orElseSucceed, which compiles but violates the convention about mapping failures where context is known instead of letting unmapped errors leak through a multi-step pipeline.… I'm noticing thatfileSystem.existsat line 2138 isn't properly mapped to a typed error — it's leaking a raw PlatformError, which violates the convention that service operations should return domain errors with preserved context. This is the same pattern as the copyFile issue the author already fixed, and since thisexistscall is new code in this PR, it should probably be flagged.… Looking at whetherexistsbeing unmapped is actually a problem—I need to check the type signature offileSystem.existsin effect v4, which is(path: string) => Effect<boolean, PlatformError>. The question is whether the driver's declared interface properly accounts for PlatformError leaking through in the result type ofgetReviewDiffPreview.… Checking the imports and verifying theexistsfinding by looking at theexecuteGitsignature to confirm it producesGitCommandError, and making surefileSystemis properly acquired through the constructor. TheEffect.filterusage looks correct, and the environment variable setup withGIT_INDEX_FILEis fine, though the thought trails off atreadWorkingTreeReviewDiff. Now I'm considering whetherEffect.ensuringwithfileSystem.removeshould actually beEffect.acquireReleaseoraddFinalizerinstead, but that's not a listed convention. The unmappedfileSystem.existscall is worth flagging — it's consistent with thecopyFileissue I flagged before that the author fixed, and it undermines the intendedcatchTagsfallback mechanism. Even ifexistswas unmapped in my previous review, flagging it now is still valid because it defeats the error handling discipline. The error channel forreadWorkingTreeReviewDiffincludes bothGitCommandErrorandPlatformError, andgetReviewDiffPreviewcatchesGitCommandErrorto provide a fallback, but thePlatformErrorfromexistswould slip through. I'll post an inline suggestion on line 2138 that wraps thefileSystem.existscall with proper error mapping toGitCommandError, extracting the result into a variable first so the conditional logic stays clean.…
1. modify_pr — Reviewed the new working-tree review-diff helpers against the Effect service conventions. One unmapped platform failure remains in readWorkingTreeReviewDiff.
Agent Credits: 84 credits