Skip to content

fix+refactor(vcs): fix HEAD filter bug and effectify VcsService#17634

Closed
kitlangton wants to merge 2 commits intoeffectify-file-watcher-servicefrom
effectify-vcs
Closed

fix+refactor(vcs): fix HEAD filter bug and effectify VcsService#17634
kitlangton wants to merge 2 commits intoeffectify-file-watcher-servicefrom
effectify-vcs

Conversation

@kitlangton
Copy link
Contributor

Summary

  • Fix inverted endsWith("HEAD") filter in Vcs branch detection — was skipping HEAD events instead of filtering for them, so BranchUpdated never fired from the native watcher
  • Convert Vcs from Instance.state namespace to an Effect ServiceMap.Service on the Instances LayerMap
  • Extract InstanceContext to its own file (instance-context.ts) to break circular imports as more services join the LayerMap
  • Add shared withServices test fixture and watcherConfigLayer for instance-scoped Effect service tests
  • Add 4 Vcs tests: branch read (git/non-git), BranchUpdated event on HEAD change, branch state update after HEAD change

Stacked on #17601.

Testing

  • bun run test test/project/vcs.test.ts test/file/watcher.test.ts
  • bunx tsgo --noEmit

opencode-agent bot added a commit that referenced this pull request Mar 15, 2026
opencode-agent bot added a commit that referenced this pull request Mar 15, 2026
opencode-agent bot added a commit that referenced this pull request Mar 15, 2026
opencode-agent bot added a commit that referenced this pull request Mar 15, 2026
opencode-agent bot added a commit that referenced this pull request Mar 15, 2026
opencode-agent bot added a commit that referenced this pull request Mar 15, 2026
opencode-agent bot added a commit that referenced this pull request Mar 16, 2026
opencode-agent bot added a commit that referenced this pull request Mar 16, 2026
opencode-agent bot added a commit that referenced this pull request Mar 16, 2026
opencode-agent bot added a commit that referenced this pull request Mar 16, 2026
opencode-agent bot added a commit that referenced this pull request Mar 16, 2026
opencode-agent bot added a commit that referenced this pull request Mar 16, 2026
opencode-agent bot added a commit that referenced this pull request Mar 16, 2026
opencode-agent bot added a commit that referenced this pull request Mar 16, 2026
opencode-agent bot added a commit that referenced this pull request Mar 16, 2026
opencode-agent bot added a commit that referenced this pull request Mar 16, 2026
opencode-agent bot added a commit that referenced this pull request Mar 16, 2026
opencode-agent bot added a commit that referenced this pull request Mar 16, 2026
opencode-agent bot added a commit that referenced this pull request Mar 16, 2026
opencode-agent bot added a commit that referenced this pull request Mar 16, 2026
opencode-agent bot added a commit that referenced this pull request Mar 16, 2026
@kitlangton kitlangton force-pushed the effectify-file-watcher-service branch from ab633a4 to 99147a7 Compare March 16, 2026 17:02
Two tests pass (branch() reads current branch correctly).
Two tests fail: BranchUpdated never fires because the FileWatcher
event filter in vcs.ts has an inverted condition — it skips HEAD
changes instead of filtering for them.
Convert Vcs from Instance.state namespace to an Effect ServiceMap.Service
on the Instances LayerMap. Uses Instance.bind for the Bus.subscribe
callback (same ALS pattern as FileWatcherService). Branch state is
managed in the layer closure with scope-based cleanup.
@kitlangton kitlangton deleted the branch effectify-file-watcher-service March 16, 2026 17:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant