Skip to content

Use more idiomatic Effect parsing helpers#3707

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

Use more idiomatic Effect parsing helpers#3707
cursor[bot] wants to merge 2 commits into
mainfrom
cursor/idiomatic-effect-patterns-7bc6

Conversation

@cursor

@cursor cursor Bot commented Jul 5, 2026

Copy link
Copy Markdown
Contributor

What Changed

  • Replaced the VCS action target key JSON.parse/JSON.stringify path with a hoisted Schema.fromJsonString codec for symmetric encode/decode.
  • Converted CLI duration parsing to return Option<Duration> instead of Duration | null.
  • Added focused @effect/vitest coverage for the Schema JSON key round trip and duration shorthand/invalid parsing.

Why

These are small Effect idiom improvements that keep parsing behavior centralized in Effect Schema and model missing parse results with Option instead of nullable values.

UI Changes

None.

Checklist

  • This PR is small and focused
  • I explained what changed and why
  • I included before/after screenshots for any UI changes
  • I included a video for animation/interaction changes
Open in Web View Automation 

Note

Use Effect schema helpers for duration and VCS action target key parsing

  • Refactors parseDurationInput in config.ts to return Option<Option<Duration>> and replaces null checks with Option.none/Option.some throughout.
  • Introduces VcsActionTargetKeyJson in vcsAction.ts as a Schema.fromJsonString codec for target keys, replacing manual JSON.stringify/JSON.parse calls.
  • Adds encodeVcsActionTargetKey and updates decodeVcsActionTargetKey to use schema-based encoding/decoding consistently.
  • Adds tests for duration shorthand decoding, rejection of invalid durations, and a round-trip test for VCS action target keys.

Macroscope summarized 311a8f7.

cursoragent and others added 2 commits July 5, 2026 16:06
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 5, 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