Skip to content

Use idiomatic Effect services for orchestration and open launching#2583

Closed
cursor[bot] wants to merge 4 commits intomainfrom
cursor/idiomatic-effect-patterns-4a46
Closed

Use idiomatic Effect services for orchestration and open launching#2583
cursor[bot] wants to merge 4 commits intomainfrom
cursor/idiomatic-effect-patterns-4a46

Conversation

@cursor
Copy link
Copy Markdown
Contributor

@cursor cursor Bot commented May 7, 2026

What Changed

  • Use DateTime.now / DateTime.formatIso for orchestration-generated timestamps.
  • Use Random.nextUUIDv4 for orchestration event IDs instead of crypto.randomUUID().
  • Launch editors through Effect ChildProcessSpawner instead of native node:child_process.spawn.
  • Added focused deterministic tests with TestClock, deterministic Random.Random, and a mocked child process spawner.

Why

This keeps orchestration timestamps and IDs testable through Effect services, and makes detached editor launching mockable without running real child processes in unit tests.

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

Verification:

  • bun fmt
  • bun lint
  • bun typecheck
  • bun run test src/open.test.ts src/orchestration/decider.clock.test.ts
  • bun run test src/orchestration/decider.clock.test.ts
Open in Web View Automation 

Note

Use Effect services for time, UUID generation, and process spawning in orchestration and open launching

  • Replaces new Date().toISOString() and crypto.randomUUID() in decider.ts with Effect DateTime and Random.nextUUIDv4, making timestamps and event IDs controllable via Effect layers in tests.
  • Refactors launchDetached in open.ts to use the Effect ChildProcessSpawner service instead of Node's child_process.spawn directly, with explicit stdio ignore and shell mode on Windows.
  • Updates tests in open.test.ts and decider.clock.test.ts to inject mock Effect services and assert deterministic output.
  • Behavioral Change: openBrowser now returns void instead of the underlying library's return value.

Macroscope summarized 328bf03. (Automatic summaries will resume when PR exits draft mode or review begins).

@github-actions github-actions Bot added size:L 100-499 changed lines (additions + deletions). vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. labels May 7, 2026
cursoragent and others added 4 commits May 7, 2026 19:20
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>
Co-authored-by: Julius Marminge <juliusmarminge@users.noreply.github.com>
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.

2 participants