Repository navigation
Effect Service Conventions: 1 issue found
apps/server/src/github/GitHubWaitpointStore.ts: theregister:reloadinvariant failure constructsnew Error("Inserted waitpoint could not be reloaded.")solely to populate the requiredcausefield. Conventions prohibit manufacturing anErrormerely to populatecause; makecauseoptional onGitHubWaitpointStoreError(or model this invariant as its own error class) and fail with structural attributes only.
One inline comment was 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: commit 13537f5 (fix(orchestration): preserve GitHub delivery retries), the only change since the previously reviewed 25ff158. Files touched: apps/server/src/github/GitHubWaitpointService.ts, GitHubWaitpointStore.ts, and their two test files.
Verified as conforming:
- Both
GitHubWaitpointServiceShapeandGitHubWaitpointStoreShapewere removed and the interfaces are now declared inline inContext.Service, with the inferred shape referenced asGitHubWaitpointService["Service"]["get"]— this resolves two prior findings. storeErrornow passes an existingGitHubWaitpointStoreErrorthrough instead of re-wrapping it, keeping the preciseoperation(e.g.register:reload) rather than burying it incause— this resolves the third prior finding.- Effect modules are imported as subpath namespaces; local service modules (
GitHubWaitpointStore,GitHubPullRequestProbe,ThreadManagementService) are namespace-imported and accessed through their module shape. - Dependencies are acquired from the environment via
yield*insideLayer.effect; noManagedRuntime.make,runPromise, or service-instance parameters were introduced in production code. TheLayer.succeedoccurrences added in the tests are legitimate test seams. - Error messages remain derived from structural attributes (
operation), not fromcause.
The only new deviation is the synthesized Error used as cause for the reload invariant in GitHubWaitpointStore.ts (lines 292-295).
🔍 Agent activity — 1 tool call
💭 I'm examining the PR diff to understand what changes were made. The diff is massive at 248k lines, which suggests the branch has diverged significantly from the merge base. Since the previous review focused on specific files in the GitHub waitpoint service, I need to identify what's changed between those commits and get a focused view of the relevant modifications. Let me query the GitHub API directly to pull the PR file list instead of trying to parse the enormous diff. I need to focus on the actual feature files in this massive PR rather than all 820 changed files. The merge base is 6154b46 and it looks like this branch is built on top of PR #2829's V2, so I should trace back through the commits to find the relevant feature changes. I need to figure out what commits are between the feature commit and the current head, which are likely rebases or merges of the base branch. Looking at the convention for schema predicates — this private constant
isGitHubWaitpointStoreErrorshould probably be exported directly rather than kept private, since the convention expects direct schema predicates to be exported. But it's being used internally withinstoreError, so I need to think through whether this violates the pattern or if there's a legitimate reason to keep it private here. The author already implemented the passthrough fix based on a prior review comment, so I shouldn't re-flag that. Now I need to check theoperation: stringandcause: unknownfields in the error definition, then review the full files for convention compliance around exports likemakeandLayer.effectusage. I'm checking the error handling conventions in this file. TheGitHubWaitpointStoreErrorfollows the acceptable pattern with a multi-value operation discriminator and aSchema.Defect()cause, but I need to verify that the defect's tag and fields properly identify the failure structurally rather than relying on the message alone. Looking at the convention requirements, the error should capture stable domain context like the waitpoint ID at the call site, but it's only capturing the operation. This is a retained issue from an earlier commit that wasn't flagged before — I need to decide whether to report it now since it's within the changed scope. For the new changes: the privateisGitHubWaitpointStoreErrorpredicate isn't a violation since it's not a redundant wrapper with the same signature asstoreError. But thecausefield is manufacturing an Error just to populate it, which directly violates the convention against that pattern. The author should either makecauseoptional in the schema or create a separate error class for the reload invariant, since this error can legitimately occur without an underlying failure. This is a flaggable violation I need to raise. The operation field is now correctly preserving "register:reload" through the passthrough, which is good. Now I need to check the rest of GitHubWaitpointService.ts to verify it follows the conventions around error handling, service injection, and async patterns. I'm noticing a potential issue whereerrorMessage()is copying raw error text directly into thelastErrorpersisted field, which violates the convention of keeping direct error attributes bounded and safe from arbitrary defect text. I should investigate whether this diagnostic column needs stricter handling. Looking at the actual changes in this commit, the pre-existing concerns aboutprocess.cwd()and error message copying aren't new violations. The real flag here is the manufactured Error object created just to populate thecausefield — that's explicitly against convention. The test files use legitimate test seams withLayer.succeedandCrypto.make, which are fine. I've confirmed only four files changed in this commit, so the manufactured Error is the one finding worth reporting. The convention explicitly forbids manufacturing an Error just to fill the cause field, so this is a legitimate violation worth flagging. Since the check defaults to failure when findings exist, I'll post an inline comment on line 294 pointing out thatcauseshouldn't be omitted here — the error needs either an actual underlying cause or the field should be made optional in the schema. I'm keeping the comment focused on this specific issue rather than expanding into pre-existing problems like missing waitpoint ID context.
1. modify_pr — One convention finding in the follow-up fix commit: the register:reload invariant failure now manufactures an Error purely to satisfy the required cause field. Everything else in this commit (inlined Context.Service interfaces, GitHubWaitpointService["Service"]["get"], and store-error passthrough) matches the conventions.
Agent Credits: 93 credits