Skip to content

init/adopt/update: write .builders watcher+search excludes into the project's .vscode/settings.json #1704

Description

@amrmelsayed

Problem

Every afx spawn creates a full worktree under .builders/ inside the open workspace. On a real adopter workspace measured in the field, one spawn checks out ~248k files / 4.3 GB (2.8 GB of it node_modules), and the farm had accumulated 17 worktrees totalling 71 GB. During each spawn the editor's file watcher and git integration re-scan that farm: the VS Code extension host bursts to 100% CPU, with fseventsd and Spotlight indexing piling on. The user experiences this as "high CPU consumption on spawns".

Bugfix #1022 diagnosed and fixed exactly this class ("VSCode dev config must not walk the builder worktree farm"), but only for this repository's own .vscode/settings.json. Adopter projects get no such config: codev init / codev adopt do not touch .vscode/settings.json, so every adopter workspace is exposed by default, and the fix has to be rediscovered per project. This is now the second workspace bitten by the same defect.

Fix shape (hypothesis, for the builder to validate)

codev init and codev adopt ensure the project's .vscode/settings.json contains:

"files.watcherExclude": { "**/.builders/**": true, "**/node_modules/**": true },
"search.exclude":       { "**/.builders/**": true, "**/node_modules/**": true }

Constraints:

  • Merge, never clobber: preserve existing user settings and any existing entries in those two sections; only add the missing keys. Create the file (and .vscode/) if absent.
  • codev update should ensure the same on existing projects, so current adopters get the fix without re-running init.
  • Do NOT touch files.exclude — architects still open builder files in the explorer; only the watcher and search need to stay out of the farm.
  • Consider a codev doctor check that warns when a workspace has .builders/ worktrees but no watcher exclude, as the belt-and-braces path for projects that hand-manage their settings.
  • The VSCode dev config: exclude .builders/ + node_modules from watch/search; drop Extension Test Runner recommendation #1022 regression test guards this repo's own settings file; the new behavior needs its own tests against a scratch project (fresh init, adopt onto a project with pre-existing .vscode/settings.json, idempotent re-run).

Out of scope

  • Spotlight/mds indexing of .builders/ (OS-level, needs user action in System Settings).
  • Worktree-farm retention/cleanup policy (accumulated retired worktrees make every scan worse, but that is a separate lifecycle concern).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/scaffoldArea: Install path — codev init/adopt/update/doctor, codev-skeleton, four-tier resolver

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions