Skip to content
Source
Sign inSign up
pingdotgg/t3code

fix(server): honor gitignored files in workspace search #2078

Mergednmharmon8(GitHub profile, opens in a new tab)merged 2 commits intomain fromrefs/pull/2078/headmerged by juliusmarminge View on GitHub

What Changed

Wire GitCoreLive into the server workspace layer so WorkspaceEntriesLive can use the Git-backed workspace index and .gitignore filtering during projects.searchEntries.

Also update the server test harness to match that wiring and add a regression test covering projects.searchEntries excluding a gitignored file.

Why

WorkspaceEntries resolves Git through Effect.serviceOption(GitCore), but the server's WorkspaceLayerLive was building WorkspaceEntriesLive without GitCoreLive.

That meant the Git-backed workspace index path was disabled in practice and projects.searchEntries could fall back to filesystem scanning, which allowed gitignored paths to appear in @ workspace search.

This change keeps the fix narrow:

  • it only adjusts the server workspace layer wiring
  • it does not change the WorkspaceEntries implementation itself
  • it adds one regression test for the RPC path that was affected

Closes #2077

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes
  • I included a video for animation/interaction changes

Note

Medium Risk Changes server runtime dependency wiring for workspace services to always include GitCore, which can affect file discovery and search results across the app; behavior is covered by a new regression test but touches core server composition.

Overview Workspace search over websocket RPC now consistently honors Git-aware workspace indexing and .gitignore filtering by wiring GitCoreLive into the server’s workspace layers (refactoring WorkspaceLayerLive into explicit WorkspaceEntriesLayerLive/WorkspaceFileSystemLayerLive).

The server test harness is updated to provide a default GitCore mock to the workspace layers, and a new integration test asserts projects.searchEntries returns no matches for a gitignored file.

Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 650e69f09e57f97c9f5a5d15260c37c13f67e39d. Bugbot is set up for automated code reviews on this repo. Configure [here](https://www.cursor.com/dashboard/bugbot).

Note

Fix workspace search to exclude gitignored files in projects.searchEntries

  • Wires GitCoreLive into WorkspaceEntriesLive via a new WorkspaceEntriesLayerLive layer in server.ts, so gitignore filtering is applied at runtime during workspace entry enumeration.
  • Refactors WorkspaceLayerLive to compose WorkspaceEntriesLayerLive and WorkspaceFileSystemLayerLive as discrete layers instead of inline provisioning.
  • Adds a test in server.test.ts verifying that projects.searchEntries returns zero results when all paths are gitignored via .venv/.
Macroscope summarized 650e69f.
    1. coderabbitai[bot](GitHub profile, opens in a new tab)commented

      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: ba15cc57-9a35-491b-a805-0d2d60e024c4

      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

      Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

      ❤️ Share
      Comment `@coderabbitai help` to get the list of available commands and usage tips.
    2. github-actions[bot](GitHub profile, opens in a new tab) added labelsvouch:unvouched

    3. macroscopeapp[bot](GitHub profile, opens in a new tab)commented

      Approvability

      Verdict: Approved

      Straightforward bug fix that wires GitCore into the workspace layer to properly filter gitignored files from search results. The scope is limited to layer composition changes and includes test coverage. The open review comment about dead code shadowing is a low-severity cleanup item that doesn't affect correctness.

      You can customize Macroscope's approvability policy. [Learn more](https://docs.macroscope.com/approvability#example-custom-eligibility-rules).
    4. Cursor Bugbot has reviewed your changes and found 1 potential issue.

      Fix All in Cursor ❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the [Cursor dashboard](https://www.cursor.com/dashboard/bugbot). Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 650e69f09e57f97c9f5a5d15260c37c13f67e39d. Configure [here](https://www.cursor.com/dashboard/bugbot).
      @@ -373,3 +378,21 @@
      378+ truncated: false,
      379+ }),
      380+ filterIgnoredPaths: (_cwd, relativePaths) => Effect.succeed(relativePaths),
      381+ ...options?.layers?.gitCore,
      382+ });
      373383 const gitManagerLayer = Layer.mock(GitManager)({
      374384 ...options?.layers?.gitManager,
      375385 });
      386+ const workspaceEntriesLayer = WorkspaceEntriesLive.pipe(
      387+ Layer.provide(WorkspacePathsLive),
      388+ Layer.provideMerge(gitCoreLayer),
      389+ );
      390+ const workspaceAndProjectServicesLayer = Layer.mergeAll(
      391+ WorkspacePathsLive,
      392+ workspaceEntriesLayer,
      393+ WorkspaceFileSystemLive.pipe(
      394+ Layer.provide(WorkspacePathsLive),
      395+ Layer.provide(workspaceEntriesLayer),
      396+ ),
      397+ ProjectFaviconResolverLive,
      398+ );
      cursor[bot](GitHub profile, opens in a new tab)commented

      Local variable shadows module-level constant creating dead code

      Low Severity

      The new local workspaceAndProjectServicesLayer inside buildAppUnderTest shadows the module-level constant of the same name (line 196). The only usage at line 543 is inside buildAppUnderTest, so the module-level definition is now dead code. Worse, the module-level version lacks GitCoreLive — so if someone mistakenly removes the local redefinition assuming it's redundant, the gitignore fix silently regresses. The module-level constant needs to be removed or the local variable renamed.

      Additional Locations (1)
      Fix in Cursor Fix in Web
      Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit 650e69f09e57f97c9f5a5d15260c37c13f67e39d. Configure [here](https://www.cursor.com/dashboard/bugbot).
    5. juliusmarminge merged thised6b7fb

    6. juliusmarminge closed this

Sign in to join this conversation.