Skip to content

Use more idiomatic Effect patterns in readiness and DPoP parsing#3006

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

Use more idiomatic Effect patterns in readiness and DPoP parsing#3006
cursor[bot] wants to merge 2 commits into
mainfrom
cursor/idiomatic-effect-patterns-f2f4

Conversation

@cursor

@cursor cursor Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

What Changed

  • Replaced the SSH readiness catch-all error with structured Schema.TaggedErrorClass variants and an exported union/guard.
  • Stored the last SSH readiness probe failure as an Option instead of null.
  • Replaced manual DPoP JWT JSON.parse/record traversal with compiled Schema.fromJsonString decoders.
  • Updated DPoP tests to use assert from @effect/vitest.

Why

This keeps the codebase closer to idiomatic Effect: structured serializable errors, explicit optional state, Schema-based JSON decoding, and assertion-based Effect tests.

UI Changes

Not applicable; no UI changes.

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

Validation:

  • pnpm test src/dpop.test.ts from packages/shared
  • pnpm test src/tunnel.test.ts from packages/ssh
  • pnpm exec vp check
  • pnpm exec vp run typecheck
Open in Web View Automation 

Note

Refactor DPoP proof parsing and SSH readiness errors to use structured Effect patterns

  • Replaces manual JSON parsing and type guards in verifyDpopProof (dpop.ts) with Schema-based decoders, returning distinct 'Invalid DPoP JWT header.' or 'Invalid DPoP JWT payload.' reasons instead of a generic failure; also rejects headers containing private key material.
  • Replaces the single SshReadinessError class in (errors.ts) with a tagged union of three structured errors: SshReadinessProbeFailedError, SshReadinessProbeTimedOutError, and SshReadinessTimedOutError, each with typed fields for URL, attempt count, and timing.
  • Updates waitForHttpReady in (tunnel.ts) to fail with the specific error variant and track lastFailure as Option for inclusion in the timeout error.
  • Behavioral Change: callers catching SshReadinessError by tag or instance must now handle the union variants; the reason strings for DPoP header/payload failures have changed from 'Invalid DPoP proof.' to variant-specific messages.

Macroscope summarized 6ab7394.

cursoragent and others added 2 commits June 9, 2026 16:08
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 Jun 9, 2026
@github-actions

github-actions Bot commented Jun 9, 2026

Copy link
Copy Markdown
Contributor

🚀 Expo continuous deployment is ready!

  • Project → t3-code
  • Platforms → android, ios
  • Scheme → t3code-preview
  🤖 Android 🍎 iOS
Fingerprint ae17d94b35f91f9c608a63dadbc3ddd9f4ba056e 313e506a7f15a9c3f15b01d787d68a12382432bf
Build Details Build Permalink
DetailsDistribution: INTERNAL
Build profile: preview:dev
Runtime version: ae17d94b35f91f9c608a63dadbc3ddd9f4ba056e
App version: 0.1.0
Git commit: 74367fbb155f7d96fb3c381c668e12a689e0307d
Build Permalink
DetailsDistribution: INTERNAL
Build profile: preview:dev
Runtime version: 313e506a7f15a9c3f15b01d787d68a12382432bf
App version: 0.1.0
Git commit: 74367fbb155f7d96fb3c381c668e12a689e0307d
Update Details Update Permalink
DetailsBranch: pr-3006
Runtime version: ae17d94b35f91f9c608a63dadbc3ddd9f4ba056e
Git commit: 74367fbb155f7d96fb3c381c668e12a689e0307d
Update Permalink
DetailsBranch: pr-3006
Runtime version: 313e506a7f15a9c3f15b01d787d68a12382432bf
Git commit: 74367fbb155f7d96fb3c381c668e12a689e0307d
Update QR

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