Repository navigation
Effect Service Conventions: 1 issue found
1 finding
apps/desktop/src/app/DesktopLifecycle.ts:32— newly addedexport { resolveDesktopRelaunchPlan } from "./resolveDesktopRelaunchOptions.ts";is an unused re-export shim that creates a second import path for a helper owning its own canonical module, and it also breaks the canonical file order (imports, errors,Context.Servicetag,make,layer). Suggested fix posted inline.
No other convention violations found in the changed scope.
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.
Checked
apps/desktop/src/electron/ElectronApp.ts: newreleaseSingleInstanceLock: Effect.Effect<void>is declared inline in theContext.Serviceinterface and implemented inmake; canonical order andLayer.succeedusage unchanged. Test/layer updates inElectronApp.test.ts,DesktopAppIdentity.test.ts,DesktopLifecycle.test.ts,DesktopTelemetryPublisher.test.ts,DesktopApplicationMenu.test.tsare mechanical interface updates — acceptable.apps/desktop/src/app/DesktopLifecycle.ts: dependencies still acquired viayield* ElectronApp.ElectronApp/DesktopEnvironment/DesktopState; noManagedRuntime.make, no newrunPromise/runPromiseExitin service construction (Effect.runPromiseWith(context)inregisteris pre-existing and used only for Electron event callbacks).DesktopLifecycleRelaunchErroris constructed at the failure boundary with the realcausepreserved andmessagederived fromreasononly.apps/desktop/src/app/resolveDesktopRelaunchOptions.ts: pure helper module with named exports and no Effect dependencies — named imports are correct here per the conventions; namespace import not required.apps/desktop/src/app/scheduleAppImageRelaunch.ts: clearly named imperative adapter that must outlive the runtime and process exit; it is not an Effect service and is not injected as a dependency of one, so the runtime-boundary rule is not violated.node:*imports carry the required diagnostics suppression comment.apps/desktop/src/app/DesktopLifecycle.relaunch.test.ts: covers new relaunch behavior (a genuine behavior change, not a mechanical refactor), importseffect/Effectas a namespace, and uses no mocks of core logic.
🔍 Agent activity — 1 tool call
💭 I'm looking at the changed files to check for convention violations, particularly in
scheduleAppImageRelaunch.ts— a Promise-returning function that uses node's child_process and gets called withEffect.tryPromisefrom DesktopLifecycle. The question is whether this counts as a runtime boundary violation since it's not a service and doesn't use ManagedRuntime or runPromise, though it's an imperative helper that needs to outlive the runtime. Then there's the re-export inDesktopLifecycle.tsofresolveDesktopRelaunchPlanfrom another module — I'm checking if this violates the compatibility re-export shim rule. The re-export creates two import paths to the same pure helper module, which might be problematic depending on whether it's meant to be a migration shim or just a convenience export. I also notice the filenameresolveDesktopRelaunchOptions.tsexports "Plan" rather than "Options", which is a naming inconsistency. The test file looks fine usingit.effectwithEffect.syncand importing from the Effect namespace. I need to check the actual files to see if this re-export was already in use and whether there's a convention around Node builtin imports and diagnostics comments. I'm identifying a re-export shim on line 32 that's unused and violates the module structure convention—it should be deleted rather than kept as a compatibility layer, and its placement between the error class and tag definition breaks the canonical file organization. Looking at the error handling patterns, theDesktopLifecycleRelaunchErrorwith itscausefield is pre-existing, and the error gets constructed in both thetryPromisecatch block and thecatchCausepath, which is fine. ThescheduleAppImageRelaunchhelper is an imperative Promise adapter justified by a comment, so while it usesprocess.envas a default parameter, the justification makes it acceptable. The file name mismatch and non-readonly array in a readonly interface aren't listed conventions, so I won't flag those. ThetryPromisecatch is producing the error withreasonandcausefields— the reason is caller-supplied rather than capturing the operation stage, which the convention suggests should be included, but since this is reusing an existing error type, it's not a clear violation. The newresolveDesktopRelaunchOptions.tsmodule with its named imports is fine as pure helpers. The unused re-export shim is the concrete issue—it's a newly added re-export of a helper from a service module that breaks the canonical file order. Given the guidance that a clear convention violation may fail the check, I'm leaning toward posting an inline comment and marking this neutral rather than failing outright. Actually, reconsidering: the re-export is genuinely dead code with no consumers, and it violates both the "no re-export shims" rule and the canonical module ordering. That's a clear violation, so I should report it as failure with an inline comment. Let me verify by grep that nothing importsresolveDesktopRelaunchPlanfromDesktopLifecycle—confirmed, only the canonical module and the new test use it. The re-export is definitely unused. I should also double-check theElectronAppservice definition ordering and thatreleaseSingleInstanceLockwas added correctly, then verify the test file'sit.effectwrapping aroundEffect.promiseforscheduleAppImageRelaunchto ensure it's testing actual behavior change, not just mechanical refactoring. The ElectronApp addition fits the pattern. I'm weighing whether to add a re-export, checking if there's guidance in the repo conventions, though it might not be necessary. I'm also noticing that the newscheduleAppImageRelaunch.tsfile usesprocess.envwith a default parameter and calls Node's child_process directly rather than using Effect's Command/CommandExecutor — the conventions don't explicitly address this beyond "runtime boundaries," but the code has a doc comment explaining the choice. I'll leave an inline comment on line 32 of DesktopLifecycle.ts about the dead re-export. That line is in the diff, so it's a valid location. The re-export creates a second import path for the same helper, which violates the rule against compatibility shims and breaks the canonical single-file ordering. I'm marking this as a finding with minor severity — it's a clear enough convention violation to report.
1. modify_pr — One convention finding: a dead re-export shim added to DesktopLifecycle.ts for a helper that lives in its own canonical module. Everything else (the new ElectronApp.releaseSingleInstanceLock member and its layer/test updates, namespace effect/* imports, error construction at the failure boundary with a real cause, and the behavior-focused relaunch tests) matches the service conventions.
Agent Credits: 50 credits