Skip to content

[codex] migrate Effect.fn in apps/server/src/orchestration/projector.ts#1630

Open
juliusmarminge wants to merge 2 commits intomainfrom
codex/effect-fn-apps-server-src-orchestration-projector
Open

[codex] migrate Effect.fn in apps/server/src/orchestration/projector.ts#1630
juliusmarminge wants to merge 2 commits intomainfrom
codex/effect-fn-apps-server-src-orchestration-projector

Conversation

@juliusmarminge
Copy link
Copy Markdown
Member

@juliusmarminge juliusmarminge commented Apr 1, 2026

Summary

  • migrate the remaining () => Effect.gen(...) wrapper in apps/server/src/orchestration/projector.ts to Effect.fn
  • keep this PR scoped to a single file as part of the checklist split

Why

  • finish the remaining checklist migrations without batching multiple files into one review
  • keep exact-empty-arg Effect.gen wrappers out of the codebase

Validation

  • bun fmt
  • bun lint
  • packages/shared: bun run test src/DrainableWorker.test.ts
  • apps/server: bun run test src/provider/Layers/EventNdjsonLogger.test.ts src/provider/Layers/ProviderRegistry.test.ts src/provider/Layers/ProviderService.test.ts src/provider/Layers/ProviderAdapterRegistry.test.ts src/keybindings.test.ts src/open.test.ts
  • apps/server: bun run test src/orchestration/projector.test.ts
  • apps/server: bun run test src/orchestration/Layers/OrchestrationEngine.test.ts -t "returns deterministic read models for repeated reads"
  • apps/server: bun run test src/orchestration/Layers/OrchestrationEngine.test.ts -t "archives and unarchives threads through orchestration commands"
  • apps/server: bun run test src/orchestration/Layers/OrchestrationEngine.test.ts -t "streams persisted domain events in order"

Notes

  • validation was run from the completed checklist scratch branch before splitting these per-file PRs
  • bun run test and bun typecheck at the repo root currently fail in apps/web because @effect/atom-react cannot be resolved
  • apps/server still has unrelated pre-existing typecheck failures outside this file

Note

Migrate projectEvent switch-case bodies to Effect.fn helpers in projector

Extracts each case body in the projectEvent switch statement in projector.ts into a dedicated Effect.fn helper (projectThreadCreated, projectThreadMessageSent, projectThreadSessionSet, projectThreadProposedPlanUpserted, projectThreadTurnDiffCompleted). The switch cases now delegate to these helpers. Logic is unchanged; only an inline comment in the thread.turn-diff-completed case was removed.

Macroscope summarized 7e4c80c.


Note

Low Risk
Low risk refactor that restructures projectEvent by extracting several thread-related switch cases into Effect.fn helpers; behavior should remain the same aside from comment removal.

Overview
Refactors apps/server/src/orchestration/projector.ts by extracting the thread.created, thread.message-sent, thread.session-set, thread.proposed-plan-upserted, and thread.turn-diff-completed switch-case bodies into dedicated Effect.fn helpers and delegating to them.

No functional changes are intended; the only semantic diff is removing an inline explanatory comment in the thread.turn-diff-completed handling.

Written by Cursor Bugbot for commit 7e4c80c. This will update automatically on new commits. Configure here.

Co-authored-by: codex <codex@users.noreply.github.com>
@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 1, 2026

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 06ded357-f405-4caf-b5f4-7b86bdbc05d4

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/effect-fn-apps-server-src-orchestration-projector

Comment @coderabbitai help to get the list of available commands and usage tips.

@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 Apr 1, 2026
@juliusmarminge juliusmarminge marked this pull request as ready for review April 1, 2026 15:54
@macroscopeapp
Copy link
Copy Markdown
Contributor

macroscopeapp bot commented Apr 1, 2026

Approvability

Verdict: Approved

This is a mechanical refactor migrating inline Effect.gen blocks to named Effect.fn functions. The logic is identical before and after - only the code organization pattern changes, with no runtime behavior impact.

You can customize Macroscope's approvability policy. Learn more.

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