Skip to content

Extract workspace entry indexing into project service#1524

Open
juliusmarminge wants to merge 2 commits intomainfrom
t3code/effect-workspace-service
Open

Extract workspace entry indexing into project service#1524
juliusmarminge wants to merge 2 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
Moderate risk because it refactors workspace search into a new Effect service and extends GitCore.execute semantics (stdin + truncation flags), which can impact git command handling and cache invalidation paths used by the websocket API and checkpoint flows.

Overview
Workspace entry search is refactored into a new Effect service. Adds WorkspaceEntries (search + invalidate) with a cached per-cwd index built either from git (ls-files + check-ignore) or a bounded-concurrency filesystem walk, including query ranking and explicit truncation tracking.

GitCore is extended to support the new indexing flow. execute now supports stdin and returns stdoutTruncated/stderrTruncated; new helpers isInsideWorkTree, listWorkspaceFiles, and chunked filterIgnoredPaths are added, with updated tests.

Runtime wiring and invalidation behavior changes. WorkspaceEntriesLive is added to server/orchestration layers; wsServer uses the service for projects.searchEntries and calls workspaceEntries.invalidate after projects.writeFile, and CheckpointReactor replaces clearWorkspaceIndexCache with service invalidation. Legacy workspaceEntries.ts implementation and tests are removed and replaced with layer/service tests plus a websocket test covering invalidation.

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

Note

Extract workspace entry indexing into a WorkspaceEntries Effect service

  • Introduces a new WorkspaceEntries service (WorkspaceEntries.ts) with search and invalidate methods, replacing the removed global workspaceEntries.ts module.
  • The service builds a cached workspace index (15s TTL, 4-key LRU) via git (ls-files + check-ignore) when available, falling back to a concurrency-limited filesystem walk; ignores .git, .convex, node_modules, etc., and caps results at 25,000 entries.
  • Adds isInsideWorkTree, listWorkspaceFiles, and filterIgnoredPaths methods to GitCore, with chunked stdin batching for check-ignore (256 KiB max) and NUL-separated output parsing with truncation support.
  • CheckpointReactor and wsServer now consume WorkspaceEntries from the Effect environment; projectsWriteFile invalidates the cache after writing so subsequent searches reflect new files.
  • Risk: collectOutput in GitCore now returns {text, truncated} instead of a plain string — all callers have been updated, but this is a breaking internal API change.

Macroscope summarized 060fb64.

- 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: 14cbf400-f455-4c37-a8d4-edfbdf9682ef

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
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