Skip to content

[codex] Normalize server core Effect service modules#3187

Merged
juliusmarminge merged 1 commit into
mainfrom
codex/effect-service-server-core
Jun 20, 2026
Merged

[codex] Normalize server core Effect service modules#3187
juliusmarminge merged 1 commit into
mainfrom
codex/effect-service-server-core

Conversation

@juliusmarminge

@juliusmarminge juliusmarminge commented Jun 20, 2026

Copy link
Copy Markdown
Member

Summary

  • normalize config, keybindings, lifecycle events, runtime startup, and server settings around inline Context.Service interfaces plus colocated make / layer exports
  • use Layer.effect only for genuinely effectful service construction; the externally constructed ServerConfig now has a pure value make(config) and Layer.succeed factory
  • namespace-import every relative service module touched by the refactor and access tags, layers, helpers, errors, and types through that namespace
  • replace standalone service shape types with Service["Service"] references across affected consumers
  • model ServerRuntimeStartupError as a structured Schema.TaggedErrorClass whose message is derived from its startup stage
  • preserve parameterized test-layer semantics while moving live dependency wiring to the composition root

Orchestration modules and excluded MCP service files are intentionally unchanged because orchestration is being reworked in #2829.

Impact

This standardizes the server core services on the Effect module layout already used by newer infrastructure. Runtime behavior is unchanged except for the intentionally structured startup error shape and derived message. Each layer now reflects whether construction is pure or effectful instead of wrapping pure service values in synthetic effects.

No test cases were added solely for this structural refactor; existing tests were updated only where their imports or structured error construction changed.

Validation

  • vp check (pass; 20 unrelated existing warnings)
  • vp run typecheck
  • affected server test files: 13 passed, 224 tests passed
  • service import audit: zero named relative imports from Context.Service modules, zero layer as aliases, zero standalone *Shape references

Note

Low Risk
Mechanical refactor with tests updated; the only intentional behavior change is structured ServerRuntimeStartupError shape/message, and ServerSettings secret-store wiring moved to an explicit parent layer.

Overview
Refactors server core Effect services (ServerConfig, Keybindings, ServerLifecycleEvents, ServerRuntimeStartup, ServerSettings) to match the newer module pattern: service APIs live on Context.Service classes (no separate *Shape types), with colocated make / layer exports replacing *Live and ad-hoc Layer.succeed wiring.

ServerConfig gains pure make(config) and layer(config) factories; tests use layerTest as a module export (static ServerConfig.layerTest kept as deprecated shim). Call sites switch to namespace imports and Service["Service"] for config typing.

ServerRuntimeStartupError becomes a Schema.TaggedErrorClass with a stage field (e.g. "command-readiness") and a derived message; tests assert the new wording.

ServerSettings.layer no longer embeds ServerSecretStoreserver.ts provides it at the composition root alongside other runtime layers.

Touched files are mostly import/layer/test updates across CLI, auth tests, provider tests, and HTTP server wiring; orchestration modules are out of scope per the PR description.

Reviewed by Cursor Bugbot for commit f5e74d0. Bugbot is set up for automated code reviews on this repo. Configure here.

Note

Normalize Effect service modules in server core to use namespace imports and inlined service shapes

  • Replaces named imports with namespace-style * as Module imports across server core modules, tests, and CLI code, so service tags and types are accessed as Module.ServiceName (e.g. ServerConfig.ServerConfig, Keybindings.Keybindings).
  • Removes separate *Shape interfaces (e.g. ServerConfigShape, KeybindingsShape, ServerLifecycleEventsShape) and inlines service contracts directly into the Context.Service generic.
  • Renames live layer exports to a consistent layer convention (e.g. KeybindingsLiveKeybindings.layer, ServerSettingsLiveServerSettings.layer, ServerRuntimeStartupLiveServerRuntimeStartup.layer).
  • Replaces Layer.succeed(ServerConfig, config) call sites with ServerConfig.layer(config), meaning layer acquisition/release logic now runs wherever config is provided.
  • Rewrites ServerRuntimeStartupError as a Schema.TaggedErrorClass with a structured stage field; the error message is now always 'Server runtime startup failed before command readiness.' instead of a caller-supplied string.
  • The production ServerSettings.layer no longer internally provides ServerSecretStore.layer; callers must now compose ServerSecretStore.layer explicitly.

Macroscope summarized f5e74d0.

@coderabbitai

coderabbitai Bot commented Jun 20, 2026

Copy link
Copy Markdown

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: ffa77315-adb2-4e09-a0b2-e52582f8da4d

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-service-server-core

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 Jun 20, 2026
@github-actions

github-actions Bot commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

🚀 Expo continuous deployment is ready!

  • Project → t3-code
  • Platforms → android, ios
  • Scheme → t3code-preview
  🤖 Android 🍎 iOS
Fingerprint fe5a51f2e189da69dfc4c2cd458e6cfb5fdff2ea ae3bd597809dfd7771d0898f735d172973d4c1c8
Build Details Build Permalink
DetailsDistribution: INTERNAL
Build profile: preview:dev
Runtime version: fe5a51f2e189da69dfc4c2cd458e6cfb5fdff2ea
App version: 0.1.0
Git commit: 5b4a2a632cd3cfbf0cc350a4f63300ef8a71bdf4
Build Permalink
DetailsDistribution: INTERNAL
Build profile: preview:dev
Runtime version: ae3bd597809dfd7771d0898f735d172973d4c1c8
App version: 0.1.0
Git commit: 5a7182ae66b2070fc19716b30aef093443628423
Update Details Update Permalink
DetailsBranch: pr-3187
Runtime version: fe5a51f2e189da69dfc4c2cd458e6cfb5fdff2ea
Git commit: 5b4a2a632cd3cfbf0cc350a4f63300ef8a71bdf4
Update Permalink
DetailsBranch: pr-3187
Runtime version: ae3bd597809dfd7771d0898f735d172973d4c1c8
Git commit: 5b4a2a632cd3cfbf0cc350a4f63300ef8a71bdf4
Update QR

@juliusmarminge juliusmarminge force-pushed the codex/effect-service-server-core branch from 8c70ad6 to 8c5895c Compare June 20, 2026 01:31
@juliusmarminge juliusmarminge marked this pull request as ready for review June 20, 2026 02:06
@macroscopeapp

macroscopeapp Bot commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

Approvability

Verdict: Approved

Mechanical refactoring that normalizes Effect service module import patterns and type definitions across the server codebase. No runtime behavior changes - only code organization and import styles are updated.

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

macroscopeapp[bot]
macroscopeapp Bot previously approved these changes Jun 20, 2026
Co-authored-by: codex <codex@users.noreply.github.com>
@juliusmarminge juliusmarminge force-pushed the codex/effect-service-server-core branch from 8c5895c to f5e74d0 Compare June 20, 2026 02:22
@macroscopeapp macroscopeapp Bot dismissed their stale review June 20, 2026 02:22

Dismissing prior approval to re-evaluate f5e74d0

@juliusmarminge juliusmarminge merged commit 1cf3647 into main Jun 20, 2026
15 checks passed
@juliusmarminge juliusmarminge deleted the codex/effect-service-server-core branch June 20, 2026 02:58
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