Skip to content

Use idiomatic Effect decoding for VCS config#2740

Draft
cursor[bot] wants to merge 2 commits into
mainfrom
cursor/effect-codebase-idioms-d099
Draft

Use idiomatic Effect decoding for VCS config#2740
cursor[bot] wants to merge 2 commits into
mainfrom
cursor/effect-codebase-idioms-d099

Conversation

@cursor
Copy link
Copy Markdown
Contributor

@cursor cursor Bot commented May 17, 2026

What Changed

  • Decode .t3code/vcs.json with Schema.fromJsonString / Schema.decodeUnknownOption instead of manual JSON.parse plus a schema guard.
  • Use Option internally for missing VCS config paths and unreadable config contents.
  • Represent the workspace entries cache TTL as Duration.seconds(15) instead of a millisecond constant.
  • Added regression coverage for malformed VCS config JSON.

Why

These are small Effect idiom improvements that keep config parsing schema-driven, make absent values explicit, and avoid raw duration numbers in cache policy code.

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 idiomatic Effect Option decoding for VCS project config

  • Replaces manual JSON.parse + try/catch in VcsProjectConfig.ts with Effect's Schema.fromJsonString and Schema.decodeUnknownOption, returning Option types throughout.
  • findConfigPath and readConfiguredKind now return Option<string> and log a warning on read failure instead of returning null.
  • Adds a test case for malformed JSON in .t3code/vcs.json, asserting resolveKind falls back to 'auto'.
  • Replaces WORKSPACE_CACHE_TTL_MS number constant with Duration.seconds(15) in WorkspaceEntries.ts.

Macroscope summarized 0593260.

cursoragent and others added 2 commits May 17, 2026 16:04
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 May 17, 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