Skip to content

[codex] Refactor project and workspace Effect services#3190

Merged
juliusmarminge merged 4 commits into
mainfrom
codex/effect-service-server-workspace-project
Jun 20, 2026
Merged

[codex] Refactor project and workspace Effect services#3190
juliusmarminge merged 4 commits into
mainfrom
codex/effect-service-server-workspace-project

Conversation

@juliusmarminge

@juliusmarminge juliusmarminge commented Jun 20, 2026

Copy link
Copy Markdown
Member

Summary

  • hoisted the project, workspace, and server-environment Effect services into canonical domain-root modules
  • colocated schemas, inline Context.Service contracts, real make implementations, and canonical layer exports, using Service["Service"] instead of standalone shape types
  • updated in-scope consumers to service-module namespace imports while keeping contracts, utility packages, config-free helpers, and implementation helpers as named imports
  • preserved module, service-contract, method, and implementation documentation while moving implementations
  • removed the legacy Services/ and Layers/ compatibility modules and rewired every remaining caller to canonical domain-root modules

Scope

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

  • changed backend suites: 21 files, 369 tests passed
  • vp check: 0 errors; 20 pre-existing warnings
  • vp run typecheck: 15/15 tasks passed
  • canonical audit: 8 root service modules with inline contracts and exported make/layer
  • import audit: no whole-package contracts namespace imports and no namespace imports for pure helper modules
  • test declarations: 2,228 before and after
  • git diff --check
  • no unresolved review threads

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 the Context.Service tag, make, and exported layer. It deletes the old project/workspace/environment Services/ and Layers/ compatibility files and rewires orchestration, CLI, MCP, relay, assets, and integration tests to namespace imports (e.g. WorkspacePaths.layer, RepositoryIdentityResolver.RepositoryIdentityResolver).

ProjectSetupScriptRunner is 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, WorkspaceFileSystemError with cause, etc.). WebSocket RPC handlers map many workspace failures to generic client messages (e.g. "Failed to search workspace entries.") while retaining cause on the error object.

ServerRuntimeStartupError now carries mode / host / port and a required cause instead of a command-readiness stage 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.Service tags and consolidated module paths

  • Replaces scattered Services/* and Layers/* module paths with consolidated per-feature modules (e.g. WorkspacePaths, ProjectFaviconResolver, RepositoryIdentityResolver, ServerEnvironment, ProjectSetupScriptRunner) each exporting a layer and a Context.Service tag.
  • Rewrites WorkspacePaths, WorkspaceEntries, WorkspaceFileSystem, and ProjectSetupScriptRunner with typed tagged error classes (e.g. WorkspaceRootNotExistsError, WorkspaceEntriesCurrentProjectRequiredError, ProjectSetupScriptOperationError) replacing generic error strings.
  • Adds ProjectSetupScriptRunner as a proper Effect service with runForThread, typed success/failure results, and tests covering no-script and terminal-start paths.
  • Adds WorkspaceFileSystem as a new service with readFile enforcing root containment, file-type validation, size limits, and binary detection.
  • Updates all consumers across orchestration, CLI, relay, MCP, cloud, and integration layers to use the new module paths and .layer exports.
  • Behavioral Change: RPC error messages for workspace search, list, read-file, and browse are now generic strings (e.g. "Failed to search workspace entries.") rather than including internal cause.detail text.

Macroscope summarized 8fd3f54.

@coderabbitai

coderabbitai Bot commented Jun 20, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: b5d4cc3c-f149-4977-95b8-597e2f11a797

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/effect-service-server-workspace-project

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:XXL 1,000+ changed lines (additions + deletions). labels Jun 20, 2026
@juliusmarminge juliusmarminge changed the title Refactor project and workspace Effect services [codex] Refactor project and workspace Effect services Jun 20, 2026
@github-actions

github-actions Bot commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

🚀 Expo continuous deployment is ready!

  • Project → t3-code
  • Platforms → android, ios
  • Scheme → t3code-preview
  🤖 Android 🍎 iOS
Fingerprint fe5a51f2e189da69dfc4c2cd458e6cfb5fdff2ea ae3bd597809dfd7771d0898f735d172973d4c1c8
Build Details Build Permalink
DetailsDistribution: INTERNAL
Build profile: preview:dev
Runtime version: fe5a51f2e189da69dfc4c2cd458e6cfb5fdff2ea
App version: 0.1.0
Git commit: 4110b7ef4c76a5d3c990eb7ab6dfce6c771c624c
Build Permalink
DetailsDistribution: INTERNAL
Build profile: preview:dev
Runtime version: ae3bd597809dfd7771d0898f735d172973d4c1c8
App version: 0.1.0
Git commit: 4110b7ef4c76a5d3c990eb7ab6dfce6c771c624c
Update Details Update Permalink
DetailsBranch: pr-3190
Runtime version: fe5a51f2e189da69dfc4c2cd458e6cfb5fdff2ea
Git commit: 4110b7ef4c76a5d3c990eb7ab6dfce6c771c624c
Update Permalink
DetailsBranch: pr-3190
Runtime version: ae3bd597809dfd7771d0898f735d172973d4c1c8
Git commit: 4110b7ef4c76a5d3c990eb7ab6dfce6c771c624c
Update QR

Comment thread apps/server/src/workspace/WorkspaceFileSystem.ts
@juliusmarminge juliusmarminge marked this pull request as ready for review June 20, 2026 02:06
@macroscopeapp

macroscopeapp Bot commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: 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.

@juliusmarminge juliusmarminge force-pushed the codex/effect-service-server-workspace-project branch 2 times, most recently from 41c4584 to 467c615 Compare June 20, 2026 02:53
macroscopeapp[bot]
macroscopeapp Bot previously approved these changes Jun 20, 2026
@juliusmarminge juliusmarminge force-pushed the codex/effect-service-server-workspace-project branch from 467c615 to 3278f2b Compare June 20, 2026 03:10
@macroscopeapp macroscopeapp Bot dismissed their stale review June 20, 2026 03:10

Dismissing prior approval to re-evaluate 3278f2b

macroscopeapp[bot]
macroscopeapp Bot previously approved these changes Jun 20, 2026
@juliusmarminge juliusmarminge force-pushed the codex/effect-service-server-workspace-project branch from 3278f2b to 711d999 Compare June 20, 2026 03:32
@macroscopeapp macroscopeapp Bot dismissed their stale review June 20, 2026 03:32

Dismissing prior approval to re-evaluate 711d999

@juliusmarminge juliusmarminge force-pushed the codex/effect-service-server-workspace-project branch 2 times, most recently from f67b906 to bd621c3 Compare June 20, 2026 04:09
macroscopeapp[bot]
macroscopeapp Bot previously approved these changes Jun 20, 2026
@juliusmarminge juliusmarminge force-pushed the codex/effect-service-server-workspace-project branch from bd621c3 to 6cca072 Compare June 20, 2026 04:34
@macroscopeapp macroscopeapp Bot dismissed their stale review June 20, 2026 04:35

Dismissing prior approval to re-evaluate 6cca072

@juliusmarminge juliusmarminge force-pushed the codex/effect-service-server-workspace-project branch 2 times, most recently from ff916a0 to e4625d7 Compare June 20, 2026 04:54
macroscopeapp[bot]
macroscopeapp Bot previously approved these changes Jun 20, 2026
@juliusmarminge juliusmarminge force-pushed the codex/effect-service-server-workspace-project branch from e4625d7 to 91d61c1 Compare June 20, 2026 05:06
@macroscopeapp macroscopeapp Bot dismissed their stale review June 20, 2026 05:06

Dismissing prior approval to re-evaluate 91d61c1

@juliusmarminge juliusmarminge force-pushed the codex/effect-service-server-workspace-project branch 4 times, most recently from 678babb to bfe0f6d Compare June 20, 2026 05:57
@juliusmarminge juliusmarminge force-pushed the codex/effect-service-server-workspace-project branch from bfe0f6d to 5e909de Compare June 20, 2026 06:02
macroscopeapp[bot]
macroscopeapp Bot previously approved these changes Jun 20, 2026
@juliusmarminge juliusmarminge force-pushed the codex/effect-service-server-workspace-project branch 2 times, most recently from cb7b3f2 to 273e7f9 Compare June 20, 2026 06:38
juliusmarminge and others added 4 commits June 19, 2026 23:52
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>
@juliusmarminge juliusmarminge force-pushed the codex/effect-service-server-workspace-project branch 2 times, most recently from 46dbceb to 8fd3f54 Compare June 20, 2026 06:58
@macroscopeapp macroscopeapp Bot dismissed their stale review June 20, 2026 06:58

Dismissing prior approval to re-evaluate 8fd3f54

@juliusmarminge juliusmarminge merged commit b0a3a50 into main Jun 20, 2026
16 checks passed
@juliusmarminge juliusmarminge deleted the codex/effect-service-server-workspace-project branch June 20, 2026 07:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XXL 1,000+ changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant