Skip to content

refactor(file): effectify FileService as scoped service#17845

Merged
kitlangton merged 3 commits intodevfrom
effectify-file
Mar 16, 2026
Merged

refactor(file): effectify FileService as scoped service#17845
kitlangton merged 3 commits intodevfrom
effectify-file

Conversation

@kitlangton
Copy link
Contributor

@kitlangton kitlangton commented Mar 16, 2026

Summary

  • Convert File namespace functions (init, status, read, list, search) to FileService class extending ServiceMap.Service with Effect.fn methods
  • File cache uses lazy initialization via init() matching original Instance.state semantics — production bootstrapper calls init() immediately, tests only pay for Ripgrep scanning when they opt in
  • Pure helpers (extension sets, MIME detection, encoding logic) moved to module scope
  • Legacy promise facade preserved via runPromiseInstance
  • Register FileService in Instances layer map
  • Fix Windows path separator in list() subdirectory test

Test plan

  • All 48 file tests pass (status, list, search, read with diff/patch)
  • Full suite passes (1340 pass, 0 fail)
  • Typecheck clean
  • Windows path normalization fix for subdirectory listing test

Restacked from #17678 onto dev after parent merge.

Stack

Base: dev

Current / Remaining

  1. #17845 effectify-file - current
  2. #17810 effectify-skill

Cover previously untested File service functions: status() with
modified/untracked/deleted/binary files, list() with sorting/filtering/
gitignore/security, search() with fuzzy matching/type filters/limits,
and read() git diff/patch code paths.
Convert File namespace functions (init, status, read, list, search) to
FileService class extending ServiceMap.Service with Effect.fn methods.
File cache uses lazy initialization via init() matching original
Instance.state semantics. Legacy promise facade preserved.
@kitlangton kitlangton merged commit 69381f6 into dev Mar 16, 2026
15 checks passed
@kitlangton kitlangton deleted the effectify-file branch March 16, 2026 20:18
ConanXu-math pushed a commit to ConanXu-math/opencode that referenced this pull request Mar 17, 2026
AvatarGanymede pushed a commit to AvatarGanymede/opencode-dev that referenced this pull request Mar 19, 2026
demostanis pushed a commit to demostanis/opencode that referenced this pull request Mar 19, 2026
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