Skip to content

Refactor server diagnostics with Effect-native APIs#4156

Draft
cursor[bot] wants to merge 3 commits into
mainfrom
cursor/idiomatic-effect-patterns-b43d
Draft

Refactor server diagnostics with Effect-native APIs#4156
cursor[bot] wants to merge 3 commits into
mainfrom
cursor/idiomatic-effect-patterns-b43d

Conversation

@cursor

@cursor cursor Bot commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

What Changed

  • Replaced Node fs/promises and Effect.tryPromise in workspace file reads with the injected Effect FileSystem, scoped handles, FileSystem.Size, and Option.
  • Replaced unchecked Windows process JSON.parse/record traversal with Schema.fromJsonString, per-record Schema decoding, and Option normalization.
  • Added focused coverage for bounded file previews, normalized platform errors, Windows arrays/singletons, invalid records, and malformed JSON.

Why

These paths now stay inside Effect APIs end-to-end, making filesystem behavior layer-testable and process payload parsing typed and explicit while preserving existing behavior.

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • UI changes are not applicable
Open in Web View Automation 

Note

Refactor server diagnostics and workspace file reading to use Effect-native APIs

  • Rewrites parseWindowsProcessRows in ProcessDiagnostics.ts to use Schema-based decoding, skipping invalid records and returning [] for malformed JSON. The function is now exported.
  • Rewrites readFile in WorkspaceFileSystem.ts to use the Effect FileSystem service for realPath, open, stat, and readAlloc, replacing direct node:fs/promises calls.
  • Behavioral Change: readFile error causes are now PlatformError values instead of NodeJS.ErrnoException; resource management is scoped rather than manual close.

Macroscope summarized a47c24e.

cursoragent and others added 3 commits July 19, 2026 16:07
Co-authored-by: Julius Marminge <juliusmarminge@users.noreply.github.com>
Co-authored-by: Julius Marminge <juliusmarminge@users.noreply.github.com>
Co-authored-by: Julius Marminge <juliusmarminge@users.noreply.github.com>
@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:L 100-499 changed lines (additions + deletions). labels Jul 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L 100-499 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant