Skip to content

Use Effect Schema decoding in diagnostics parsers#3743

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

Use Effect Schema decoding in diagnostics parsers#3743
cursor[bot] wants to merge 2 commits into
mainfrom
cursor/idiomatic-effect-patterns-afc2

Conversation

@cursor

@cursor cursor Bot commented Jul 6, 2026

Copy link
Copy Markdown
Contributor

What Changed

  • Replaced ad-hoc diagnostics JSON.parse handling with Effect Schema decoding for trace NDJSON records and Windows process JSON output.
  • Added targeted coverage for malformed trace input and Windows process JSON null/invalid rows.
  • Switched the touched ProcessDiagnostics tests from expect to assert and added an explicit tagged-error guard for narrowing.

Why

This keeps diagnostics parsing more idiomatic Effect: JSON inputs now flow through Schema decoding, malformed input remains safely ignored/countable, and tests use the preferred @effect/vitest assertion style.

Checklist

  • This PR is small and focused
  • I explained what changed and why
Open in Web View Automation 

Note

Replace JSON.parse with Effect Schema decoding in diagnostics parsers

  • Replaces JSON.parse try/catch blocks in TraceDiagnostics.ts and ProcessDiagnostics.ts with Schema.decodeUnknownOption-based decoders.
  • Adds WindowsProcessRecord, TraceRecord, and TraceEventRecord Effect Schema structs to validate parsed data; invalid records are silently dropped rather than causing exceptions.
  • Exports parseWindowsProcessRows for external use.
  • Behavioral Change: non-conforming Windows process records and trace lines that previously may have passed loose typeof checks are now excluded from results.

Macroscope summarized edcebbd.

cursoragent and others added 2 commits July 6, 2026 16:05
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:M 30-99 changed lines (additions + deletions). labels Jul 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:M 30-99 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