[codex] migrate Effect.fn in apps/server/src/orchestration/projector.ts#1630
[codex] migrate Effect.fn in apps/server/src/orchestration/projector.ts#1630juliusmarminge wants to merge 2 commits intomainfrom
Conversation
Co-authored-by: codex <codex@users.noreply.github.com>
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
ApprovabilityVerdict: 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. |
Summary
() => Effect.gen(...)wrapper inapps/server/src/orchestration/projector.tstoEffect.fnWhy
Effect.genwrappers out of the codebaseValidation
bun fmtbun lintpackages/shared: bun run test src/DrainableWorker.test.tsapps/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.tsapps/server: bun run test src/orchestration/projector.test.tsapps/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
bun run testandbun typecheckat the repo root currently fail inapps/webbecause@effect/atom-reactcannot be resolvedapps/serverstill has unrelated pre-existing typecheck failures outside this fileNote
Migrate
projectEventswitch-case bodies toEffect.fnhelpers in projectorExtracts each case body in the
projectEventswitch statement in projector.ts into a dedicatedEffect.fnhelper (projectThreadCreated,projectThreadMessageSent,projectThreadSessionSet,projectThreadProposedPlanUpserted,projectThreadTurnDiffCompleted). The switch cases now delegate to these helpers. Logic is unchanged; only an inline comment in thethread.turn-diff-completedcase was removed.Macroscope summarized 7e4c80c.
Note
Low Risk
Low risk refactor that restructures
projectEventby extracting several thread-related switch cases intoEffect.fnhelpers; behavior should remain the same aside from comment removal.Overview
Refactors
apps/server/src/orchestration/projector.tsby extracting thethread.created,thread.message-sent,thread.session-set,thread.proposed-plan-upserted, andthread.turn-diff-completedswitch-case bodies into dedicatedEffect.fnhelpers and delegating to them.No functional changes are intended; the only semantic diff is removing an inline explanatory comment in the
thread.turn-diff-completedhandling.Written by Cursor Bugbot for commit 7e4c80c. This will update automatically on new commits. Configure here.