[codex] Refactor project and workspace Effect services#3190
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 This PR consolidates Effect service definitions from separate Layers/Services directories into unified modules. The changes are mechanical reorganization (file moves, import updates, export name standardization) with no runtime behavior changes beyond minor error message improvements. You can customize Macroscope's approvability policy. Learn more. |
41c4584 to
467c615
Compare
467c615 to
3278f2b
Compare
Dismissing prior approval to re-evaluate 3278f2b
3278f2b to
711d999
Compare
Dismissing prior approval to re-evaluate 711d999
f67b906 to
bd621c3
Compare
bd621c3 to
6cca072
Compare
Dismissing prior approval to re-evaluate 6cca072
ff916a0 to
e4625d7
Compare
e4625d7 to
91d61c1
Compare
Dismissing prior approval to re-evaluate 91d61c1
678babb to
bfe0f6d
Compare
bfe0f6d to
5e909de
Compare
cb7b3f2 to
273e7f9
Compare
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
46dbceb to
8fd3f54
Compare
Dismissing prior approval to re-evaluate 8fd3f54
Summary
Services/andLayers/compatibility modules and rewired every remaining caller to canonical domain-root modulesScope
Orchestration, MCP, and integration-harness behavior remains unchanged; their imports and layer references are mechanically rewired to the canonical domain-root modules so no legacy compatibility paths remain.
Validation
Note
Medium Risk
Wide refactor across workspace file I/O, project setup scripts, and server startup error shapes; behavior is mostly preserved but client-visible error messages and failure payloads changed in several paths.
Overview
This PR consolidates several Effect services (
ServerEnvironment,RepositoryIdentityResolver,ProjectFaviconResolver,ProjectSetupScriptRunner,WorkspacePaths,WorkspaceEntries,WorkspaceFileSystem) into canonical domain-root modules that colocate theContext.Servicetag,make, and exportedlayer. It deletes the oldproject/workspace/environmentServices/andLayers/compatibility files and rewires orchestration, CLI, MCP, relay, assets, and integration tests to namespace imports (e.g.WorkspacePaths.layer,RepositoryIdentityResolver.RepositoryIdentityResolver).ProjectSetupScriptRunneris reimplemented at the project root with Schema tagged errors (ProjectSetupScriptOperationError,ProjectSetupScriptProjectNotFoundError) instead of a single message-only error; Git/bootstrap and server tests now expect operation-specific failure text.Workspace browse/search/list and file read/write gain structured error types (
WorkspaceEntriesCurrentProjectRequiredError,WorkspaceEntriesReadDirectoryError,WorkspaceFileSystemErrorwithcause, etc.). WebSocket RPC handlers map many workspace failures to generic client messages (e.g."Failed to search workspace entries.") while retainingcauseon the error object.ServerRuntimeStartupErrornow carriesmode/host/portand a requiredcauseinstead of acommand-readinessstage field; startup tests were updated accordingly.Minor mechanical cleanups include direct Node builtin imports (
createServer,createPublicKey,readdir) where files were touched.Reviewed by Cursor Bugbot for commit 8fd3f54. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Refactor project and workspace services to use
Context.Servicetags and consolidated module pathsServices/*andLayers/*module paths with consolidated per-feature modules (e.g.WorkspacePaths,ProjectFaviconResolver,RepositoryIdentityResolver,ServerEnvironment,ProjectSetupScriptRunner) each exporting alayerand aContext.Servicetag.WorkspacePaths,WorkspaceEntries,WorkspaceFileSystem, andProjectSetupScriptRunnerwith typed tagged error classes (e.g.WorkspaceRootNotExistsError,WorkspaceEntriesCurrentProjectRequiredError,ProjectSetupScriptOperationError) replacing generic error strings.ProjectSetupScriptRunneras a proper Effect service withrunForThread, typed success/failure results, and tests covering no-script and terminal-start paths.WorkspaceFileSystemas a new service withreadFileenforcing root containment, file-type validation, size limits, and binary detection..layerexports."Failed to search workspace entries.") rather than including internalcause.detailtext.Macroscope summarized 8fd3f54.