[codex] normalize server process and preview Effect services#3191
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
🚀 Expo continuous deployment is ready!
|
ApprovabilityVerdict: Approved Mechanical refactoring that normalizes Effect service definitions across the codebase. Changes are type-level (interface inlining, import style) and organizational (exporting make functions directly) with no runtime behavior changes. You can customize Macroscope's approvability policy. Learn more. |
d7cdba3 to
60671a6
Compare
Dismissing prior approval to re-evaluate 60671a6
Co-authored-by: codex <codex@users.noreply.github.com>
60671a6 to
c0c72a7
Compare
Dismissing prior approval to re-evaluate c0c72a7
What changed
ProcessRunner,ExternalLauncher,PreviewManager,PortDiscovery, andPreviewAutomationBrokerService["Service"]makeandlayerdefinitionsSchema.TaggedErrorClasserrors with messages derived from their attributesWhy
These services now follow the single-file Effect module convention used by relay infrastructure and newer client runtime code. No tests were added solely for the structural refactor.
Orchestration modules and
McpInvocationContext/McpSessionRegistryremain intentionally excluded because orchestration is being replaced by #2829.Validation
vp check(passes with unrelated existing warnings)vp run typecheckNote
Medium Risk
Process error types now use Schema tagged classes with computed messages, which can affect logging or callers that assumed empty messages; service API surface is structurally the same but import paths and test factories changed.
Overview
Aligns ProcessRunner, ExternalLauncher, PreviewManager, PortDiscovery, and PreviewAutomationBroker with the single-file Effect module pattern: standalone
*Shapeinterfaces are removed in favor of types inlined onContext.Service, implementations returnService.of(...), andmakeis exported for tests instead of hidden__testinghooks.Imports move from barrel
effectto explicit submodule paths (effect/Effect,effect/unstable/process/ChildProcess, etc.), and call sites/tests use namespace imports (ProcessRunner.ProcessRunner,ProcessRunner.layer).ProcessRunner errors switch from
Data.TaggedErrortoSchema.TaggedErrorClasswith shared invocation fields andmessagegetters built from command/args/cwd (spawn, stdin, output limit, read, timeout). Runtime behavior ofrunis unchanged aside from error presentation/serialization semantics.Tests are updated to match the new module-qualified tags and the public
PreviewAutomationBroker.makeentry point.Reviewed by Cursor Bugbot for commit c0c72a7. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Normalize process and preview Effect services to use namespaced exports and schema-based errors
*Shapeinterfaces acrossProcessRunner,PreviewManager,PortDiscovery,ExternalLauncher, andPreviewAutomationBroker, inlining service API types directly intoContext.Servicegenerics.makefactories directly from each service module and removes__testingescape hatches, makingmakethe standard construction path in tests and production.effect/DataTaggedErrorwitheffect/SchemaTaggedErrorClassfor all process error types, adding human-readablemessagestrings that include command, args, cwd, and other context.effect/unstable/processto explicit module pathseffect/unstable/process/ChildProcessandeffect/unstable/process/ChildProcessSpawner.messagestrings; any code that previously relied on default error message formatting will see different output.Macroscope summarized c0c72a7.