Repository navigation
Effect Service Conventions: 1 issue found
apps/server/src/vcs/GitVcsDriverCore.ts (lines 1533-1544) — the new unborn-HEAD fallback in readStatusDetailsLocal runs both runGitStdout calls with allowNonZeroExit = true, so a real git diff failure yields empty stdout instead of the typed GitCommandError this call site previously raised, causing statusDetails to silently report zero insertions/deletions. Suggested fix: drop the trailing true on both calls.
Previously flagged concerns that are now resolved:
- The fallback is gated on an actual unborn-
HEADstderr check (isUnbornHeadStderr) and fails withGitCommandErrorotherwise. - Focused tests were added for combined staged+unstaged edits and for staged counts on an unborn
HEAD.
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.
Checks performed:
- Imports: no new consolidated
"effect"named imports; no service-module alias imports introduced. - Service definition/layout: no service tag,
make, orlayerchanges; no new files or compatibility shims. - Dependency acquisition: no service-instance parameters,
Layer.succeed,ManagedRuntime.make, or.runPromise/.runPromiseExitadded. - Errors: the new
GitCommandErrorconstruction uses structured, bounded attributes (operation,command,cwd,argumentCount,exitCode,stdoutLength,stderrLength) consistent with the sibling failure path at line 1507; no raw stderr/args copied intodetail;causeis legitimately absent (non-zero exit, no underlying error object).exitCodetyping verified againstGitCommandErrorinpackages/contracts/src/git.tsand the brandedChildProcessSpawner.ExitCode. - Change discipline: backend behavior change (single
git diff HEAD --numstatinstead of summingdiff+diff --cached) is now covered by focused tests.
The only remaining finding is the suppressed failure channel in the fallback commands, reported inline.
🔍 Agent activity — 1 tool call
💭 I'm checking whether the previous issues were actually fixed in the code. The main concern was that the fallback was treating any non-zero exit as an unborn HEAD, but now there's an
isUnbornHeadStderrcheck that properly fails with GitCommandError instead. I need to verify therunGitStdoutsignature, particularly that fourth argument set totrue, and then review the tests that were added. I need to look at the statusDetails code and check the runGitStdout function signature to understand how they work together. Looking at whether the fallback path for unborn repositories aligns with Effect service conventions—specifically around error handling. The concern is that passingallowNonZeroExit = trueto those git commands means genuine failures would return empty stdout silently rather than surfacing as typed errors, which feels inconsistent with Effect's error handling philosophy. Though in practice,git diff --numstatandgit diff --cached --numstatshouldn't fail in the unborn case anyway. There's also the detail string issue: it includes the literal command arguments like "diff HEAD --numstat," but since these are static and not user-supplied data, andgitCommandContextdeliberately restricts exposure to just argument count, this might be acceptable under the convention. I'm noticing thatexitCode: result.exitCodecould potentially be null, and I need to verify whether GitCommandError's exitCode field can accept null values or if it requires explicit handling like the pattern at line 877 that conditionally includes exitCode. Line 1514 sets exitCode directly without null-checking, so there's precedent, but I should confirm the ExecuteGitResult.exitCode type to be sure. I need to verify what the ExitCode type actually is by checking the ChildProcessSpawner.ExitCode definition and the GitCommandError schema to see if it'snumber | null. TheexitCodeis fine andcauseis optional since there's no underlying error object here. Looking at the remaining findings, the new detail about the git diff command failing is just a static description, not raw dynamic arguments or output, which aligns with the existing convention in the codebase where similar error messages like "git ls-files failed" are already used. On theallowNonZeroExit: truein the fallback calls — that's less about violating conventions and more about a correctness issue: it silently swallows real git failures and returns empty stdout, which makes statusDetails report zero insertions incorrectly. The prior check already flagged this and the code changed in response, but kept thetrueanyway, so re-flagging is fair. I should also verify the fallback ordering with the destructured array to make sure the order matches correctly. On unborn HEAD, the staged and unstaged diffs actually sum correctly to the worktree-versus-empty diff, so that's fine. I'm also noticing the code builds a synthetic numstat string by serializing insertions and deletions, then re-parsing it—which is a bit ugly and would mangle paths with tabs, but that's more of a code smell than a violation of the Effect service conventions I'm checking against. Let me review what those conventions actually specify. The fallbackrunGitStdoutcalls are using the right operation names, but I'm noticing thatallowNonZeroExit = trueis suppressing typed errors — this actually violates the convention about preserving typed failures in Effect rather than bypassing them. This is a silent-failure path that the PR introduced, since previously these numstat commands would have thrown typed GitCommandErrors on failure. I should check whethergit diff --numstatactually exits non-zero on unborn HEAD — testing shows it returns 0 in modern git, so thetrueflag seems unnecessary. There's a small risk of false positives with older git versions, so I'll phrase this as a suggestion rather than a hard requirement and add an inline comment in that region. So the check defaults to failure when findings exist, which means I should flag this as a violation. Looking at the Effect Service Conventions, theallowNonZeroExit: truesuppression falls under error handling discipline — it's bypassing the typed error system rather than keeping the failure within Effect. I'll post the suggestion and mark it as a failure, then identify the exact line positions for the comment on the right side. Refining the suggestion to remove thetruearguments while keeping the multi-line array format for readability.
1. modify_pr — One residual finding on the new unborn-HEAD fallback in readStatusDetailsLocal. The classification via isUnbornHeadStderr addresses the earlier concern; the remaining issue is the suppressed failure channel in the fallback commands.
Agent Credits: 113 credits