Skip to content

Extract project/workspace related functionality to Effect services#1524

Merged
juliusmarminge merged 7 commits intomainfrom
t3code/effect-workspace-service
Mar 31, 2026
Merged

Extract project/workspace related functionality to Effect services#1524
juliusmarminge merged 7 commits intomainfrom
t3code/effect-workspace-service

Conversation

@juliusmarminge
Copy link
Copy Markdown
Member

@juliusmarminge juliusmarminge commented Mar 29, 2026

Summary

  • Move workspace entry indexing into a dedicated project service layer.
  • Wire workspace cache invalidation through the new service from checkpoint/orchestration flows.
  • Extend Git core support for worktree detection, workspace file listing, ignore filtering, and stdin-backed commands.
  • Add coverage for workspace indexing, ignore filtering, chunking, and updated Git core behavior.

Testing

  • bun fmt
  • bun lint
  • bun typecheck
  • bun run test

Note

Medium Risk
Refactors core workspace indexing, file writes, and favicon handling into new Effect services and changes GitCore.execute output/truncation semantics (plus stdin support), which could affect multiple call sites and runtime wiring if any consumer assumptions were missed.

Overview
Extracts workspace/project helpers into Effect services and rewires server consumers. Introduces WorkspaceEntries (TTL-cached workspace index + ranked search with git-aware ignore filtering), WorkspacePaths (workspace root normalization + safe relative path resolution), and WorkspaceFileSystem (workspace-root-relative writes that invalidate the entry cache), and updates WebSocket handlers to use these services instead of ad-hoc helpers.

Moves favicon discovery into a dedicated resolver. Adds ProjectFaviconResolver and converts tryHandleProjectFaviconRequest to an Effect-based handler backed by the resolver and FileSystem.

Extends GitCore to support workspace indexing workflows. Adds stdin support to execute, returns explicit stdoutTruncated/stderrTruncated flags (instead of embedding a marker), and adds isInsideWorkTree, listWorkspaceFiles, and chunked filterIgnoredPaths to safely handle large path lists.

Wiring + tests updated. CheckpointReactor now invalidates via WorkspaceEntries.invalidate; server/runtime layers and integration tests are updated accordingly; new test suites cover the new services and git ignore chunking, and legacy workspaceEntries modules/tests are removed.

Written by Cursor Bugbot for commit c6d0fb7. This will update automatically on new commits. Configure here.

Note

Extract workspace entry indexing into dedicated service layer

  • Introduces WorkspaceEntries, WorkspaceFileSystem, and WorkspacePaths as injected Effect services, replacing module-level functions and inline logic in wsServer.ts.
  • WorkspaceEntries builds a cached (TTL 15s, capacity 4) index of up to 25,000 entries using git when available or a bounded filesystem walk (32 concurrent reads), with fuzzy ranking and truncation tracking.
  • WorkspaceFileSystem.writeFile resolves and validates paths within the workspace root, creates parent directories, and invalidates the WorkspaceEntries cache after writing.
  • WorkspacePaths handles workspace root normalization (including ~ expansion) and safe in-root path resolution, rejecting escape attempts.
  • GitCore gains isInsideWorkTree, listWorkspaceFiles, and filterIgnoredPaths (chunked via NUL-separated stdin) and now reports stdout/stderr truncation via flags on ExecuteGitResult.
  • CheckpointReactor now calls workspaceEntries.invalidate(cwd) via the injected service instead of a direct module-level function.
  • Risk: error messages for projects.writeFile and workspace root validation in project.create/project.meta.update change to domain-specific strings from the new services.

Macroscope summarized c6d0fb7.

- Move workspace entry logic under `project/` and wire it into server layers
- Add git workspace listing and ignore filtering support for large repos
- Update checkpoint invalidation to use the new workspace service
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Mar 29, 2026

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: 51f9f43b-a4fc-4256-9da8-372e1d58fdd5

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 t3code/effect-workspace-service

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

@github-actions github-actions bot added size:XXL 1,000+ changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. labels Mar 29, 2026
- move check-ignore chunking coverage into GitCore tests
- modernize WorkspaceEntries tests around Effect-based temp dirs
- Add Effect services for workspace writes and favicon resolution
- Invalidate workspace search after file writes
- Update favicon route to use the shared resolver
- Move workspace path validation and file writes into shared workspace services
- Reuse root normalization for project creation and metadata updates
- Preserve favicon and workspace entry behavior after the module split
- Add module and API docs for cached workspace entry search
- Clarify search and cache invalidation responsibilities
- Split workspace path failures into typed errors with message getters
- Surface clearer workspace-root and file-path errors through WS routes
- Update tests for the new error messages and timeout handling
@juliusmarminge juliusmarminge changed the title Extract workspace entry indexing into project service Extract project/workspace related functionality to Effect services Mar 31, 2026
@juliusmarminge juliusmarminge merged commit 2d03847 into main Mar 31, 2026
11 checks passed
@juliusmarminge juliusmarminge deleted the t3code/effect-workspace-service branch March 31, 2026 07:08
aaditagrawal added a commit to aaditagrawal/t3code that referenced this pull request Mar 31, 2026
…lling

Integrates 3 upstream commits:
- Extract project/workspace functionality to Effect services (pingdotgg#1524)
- Replace wait-on with internal desktop resource polling (pingdotgg#1600)
- Bump Effect catalog dependencies (pingdotgg#1594)

Conflict resolution: deleted fork's workspaceEntries.ts (extracted upstream),
accepted upstream's gitCoreLayer extraction in serverLayers, preserved fork's
SessionTextGenerationLive for GitManager, moved runPromise definition earlier
for favicon route handler.
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