Skip to content

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

Closed
kitlangton wants to merge 3 commits intoeffectify-formatfrom
effectify-file
Closed

refactor(file): effectify FileService as scoped service#17678
kitlangton wants to merge 3 commits intoeffectify-formatfrom
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

Stack

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