Skip to content

refactor(file): use AppFileSystem instead of raw Filesystem#19458

Merged
kitlangton merged 3 commits intodevfrom
worktree-file-appfs
Mar 28, 2026
Merged

refactor(file): use AppFileSystem instead of raw Filesystem#19458
kitlangton merged 3 commits intodevfrom
worktree-file-appfs

Conversation

@kitlangton
Copy link
Copy Markdown
Contributor

Summary

  • File service now yields AppFileSystem.Service in its layer
  • read method: replaced Filesystem.exists/readText/readBytes with appFs.exists/readFileString/readFile
  • list method: replaced Filesystem.exists/readText with appFs.readFileString/readDirectory
  • Added File.defaultLayer providing AppFileSystem.defaultLayer
  • scan and status methods kept as-is (need fs.Dirent / complex git pipelines)

Stacked on #19457

Test plan

  • bun run typecheck passes
  • bun test test/file/ — 91 pass, 0 fail
  • CI

Replace Filesystem.exists/readText/readBytes with AppFileSystem.Service
in the File service read and list methods. Adds defaultLayer providing
AppFileSystem.defaultLayer.
@kitlangton kitlangton changed the base branch from kit/format-child-process-spawner to dev March 27, 2026 20:57
…/isFile types

- readDirectoryEntries: returns DirEntry[] with name+type using
  readdir({ withFileTypes: true }) — preserves symlink/Dirent semantics
- existsSafe: returns Effect<boolean> with no error channel
- isDir/isFile: narrowed to Effect<boolean> (errors already swallowed)
- File.list: uses readDirectoryEntries instead of stat() per entry,
  fixing symlink-follows-through and broken-symlink-disappears regressions
- File.read: uses existsSafe instead of exists+catch
@kitlangton kitlangton marked this pull request as ready for review March 28, 2026 14:25
@kitlangton kitlangton merged commit aa9ed00 into dev Mar 28, 2026
8 checks passed
@kitlangton kitlangton deleted the worktree-file-appfs branch March 28, 2026 14:25
Copilot AI pushed a commit to ian-morgan99/opencode that referenced this pull request Mar 28, 2026
…o#19458)

Co-authored-by: ian-morgan99 <106852423+ian-morgan99@users.noreply.github.com>
e-n-0 pushed a commit to e-n-0/opencode that referenced this pull request Mar 29, 2026
loocor pushed a commit to loocor/opencode that referenced this pull request Mar 30, 2026
afanty2021 pushed a commit to afanty2021/opencode that referenced this pull request Mar 30, 2026
balcsida pushed a commit to balcsida/opencode that referenced this pull request Apr 8, 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