Skip to content

[codex] Refactor checkpointing Effect services#3181

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

[codex] Refactor checkpointing Effect services#3181
juliusmarminge merged 1 commit into
mainfrom
codex/effect-service-server-checkpointing

Conversation

@juliusmarminge

@juliusmarminge juliusmarminge commented Jun 20, 2026

Copy link
Copy Markdown
Member

Summary

  • move the canonical CheckpointDiffQuery and CheckpointStore service modules and their existing tests to the checkpointing domain root
  • inline service interfaces and use Service["Service"] for implementation and test-double types
  • export each module's concrete make value and module-level layer, with namespace imports in the in-scope consumers
  • preserve existing module, service-contract, checkpoint-behavior, and error documentation, and remove the moved test’s stale lint baseline
  • delete the two legacy CheckpointStore compatibility shims and migrate orchestration and integration-harness consumers to the canonical namespace

Why

Checkpointing still used split Services/ and Layers/ modules with standalone *Shape interfaces. The domain-root modules now match the repository's target Effect service layout. The requirement is an exported layer; Layer.effect is used here because both make values are genuinely effectful, not to force a constructor pattern.

The follow-up migration includes the checkpoint reactor, its tests, and the integration harness so no compatibility import paths remain. Other orchestration and MCP service modules remain out of scope for this refactor.

Compatibility

  • checkpointing/Layers/CheckpointStore.ts and checkpointing/Services/CheckpointStore.ts are deleted
  • every consumer imports the canonical root module as * as CheckpointStore and uses CheckpointStore.CheckpointStore / CheckpointStore.layer
  • the obsolete CheckpointDiffQuery service path remains removed without a shim

Impact

This is a structural refactor. Checkpoint capture, restore, and diff behavior is unchanged. No test cases or assertions were added; the moved CheckpointDiffQuery test uses @effect/vitest because its canonical root path is covered by the repository's no-manual-Effect-runtime lint rule.

The existing checkpoint errors remain schema-backed structured errors with messages derived from their attributes.

Validation

  • focused checkpoint/server/integration/lint-rule test run — 6 files, 143 tests passed and 1 skipped
  • vp check — passed with 0 errors; 20 pre-existing warnings remain
  • vp run typecheck — all 15 workspace tasks passed
  • git diff --check origin/main — passed
  • canonical audit — 0 standalone *Shape contracts, 2/2 concrete make exports, 2/2 layer exports, and no redundant Effect.succeed wrappers
  • compatibility audit — 0 legacy CheckpointStore paths or CheckpointStoreLive references; 4/4 consumers use the canonical namespace
  • test inventory audit — declarations remain exactly 5/3/98 for the moved diff/store tests and server.test.ts (106 before and after)

Note

Refactor checkpointing services to co-locate tags, implementations, and layers

  • Consolidates CheckpointStore and CheckpointDiffQuery from separate Services/ and Layers/ files into single modules at CheckpointStore.ts and CheckpointDiffQuery.ts.
  • Converts both from interface-based service shapes to Context.Service classes, exporting layer instead of CheckpointStoreLive/CheckpointDiffQueryLive.
  • Updates all consumers (orchestration, server wiring, tests, and docs) to use the new namespaced import pattern (* as CheckpointStore) and CheckpointStore.layer.
  • Deletes the now-redundant Services/CheckpointStore.ts, Services/CheckpointDiffQuery.ts, and Layers/CheckpointStore.ts files.
  • Adds a new test suite for CheckpointDiffQuery covering full-thread diffs, canonical turn-0 refs, whitespace handling, and missing-thread failure cases.

Macroscope summarized 8be2b32.


Note

Low Risk
Structural import and module-layout refactor only; checkpoint logic is moved and re-exported without intentional behavior changes, with existing tests preserved.

Overview
Checkpointing is reorganized to match the repo’s target Effect layout: CheckpointStore and CheckpointDiffQuery now live as single modules under checkpointing/ with the service tag, implementation (make), and layer colocated. Standalone *Shape interfaces are dropped in favor of Service["Service"] typing.

The old split under checkpointing/Services/ and checkpointing/Layers/ (including CheckpointStoreLive and separate diff-query layer files) is removed with no compatibility shims. Wiring in server.ts, ws.ts, CheckpointReactor, the integration harness, and related tests now uses import * as CheckpointStore / CheckpointDiffQuery and CheckpointStore.layer / CheckpointDiffQuery.layer.

CheckpointDiffQuery.test.ts moves to the domain root and runs via @effect/vitest (replacing manual Effect.runPromise in the deleted Layers test). Docs and the oxlint legacy baseline are updated for the new paths. Runtime behavior for capture, restore, and diff is unchanged.

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

@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: 1b6052c1-527b-4588-a7c1-93fcf5210552

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-checkpointing

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

@github-actions github-actions Bot added vouch:trusted PR author is trusted by repo permissions or the VOUCHED list. size:XL 500-999 changed lines (additions + deletions). 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: 4110b7ef4c76a5d3c990eb7ab6dfce6c771c624c
Build Permalink
DetailsDistribution: INTERNAL
Build profile: preview:dev
Runtime version: ae3bd597809dfd7771d0898f735d172973d4c1c8
App version: 0.1.0
Git commit: 4110b7ef4c76a5d3c990eb7ab6dfce6c771c624c
Update Details Update Permalink
DetailsBranch: pr-3181
Runtime version: fe5a51f2e189da69dfc4c2cd458e6cfb5fdff2ea
Git commit: c01d172f98eef62ff7af6e02b806b55c640638df
Update Permalink
DetailsBranch: pr-3181
Runtime version: ae3bd597809dfd7771d0898f735d172973d4c1c8
Git commit: c01d172f98eef62ff7af6e02b806b55c640638df
Update QR

@juliusmarminge juliusmarminge marked this pull request as ready for review June 20, 2026 02:06
macroscopeapp[bot]
macroscopeapp Bot previously approved these changes Jun 20, 2026
@macroscopeapp

macroscopeapp Bot commented Jun 20, 2026

Copy link
Copy Markdown
Contributor

Approvability

A prior Macroscope approval was dismissed. Re-evaluating 8be2b32

@juliusmarminge juliusmarminge force-pushed the codex/effect-service-server-checkpointing branch from 2464be4 to 21b79a2 Compare June 20, 2026 02:34
@macroscopeapp macroscopeapp Bot dismissed their stale review June 20, 2026 02:34

Dismissing prior approval to re-evaluate 21b79a2

macroscopeapp[bot]
macroscopeapp Bot previously approved these changes Jun 20, 2026
@juliusmarminge juliusmarminge force-pushed the codex/effect-service-server-checkpointing branch from 21b79a2 to b2492ff Compare June 20, 2026 02:56
@macroscopeapp macroscopeapp Bot dismissed their stale review June 20, 2026 02:56

Dismissing prior approval to re-evaluate b2492ff

macroscopeapp[bot]
macroscopeapp Bot previously approved these changes Jun 20, 2026
@juliusmarminge juliusmarminge force-pushed the codex/effect-service-server-checkpointing branch from b2492ff to 104eace Compare June 20, 2026 03:14
@macroscopeapp macroscopeapp Bot dismissed their stale review June 20, 2026 03:14

Dismissing prior approval to re-evaluate 104eace

macroscopeapp[bot]
macroscopeapp Bot previously approved these changes Jun 20, 2026
@juliusmarminge juliusmarminge force-pushed the codex/effect-service-server-checkpointing branch from 104eace to 3954c73 Compare June 20, 2026 03:34
@macroscopeapp macroscopeapp Bot dismissed their stale review June 20, 2026 03:34

Dismissing prior approval to re-evaluate 3954c73

@github-actions github-actions Bot added size:L 100-499 changed lines (additions + deletions). and removed size:XL 500-999 changed lines (additions + deletions). labels Jun 20, 2026
macroscopeapp[bot]
macroscopeapp Bot previously approved these changes Jun 20, 2026
@juliusmarminge juliusmarminge force-pushed the codex/effect-service-server-checkpointing branch 2 times, most recently from 09dfa5b to 8fd3784 Compare June 20, 2026 04:42
@macroscopeapp macroscopeapp Bot dismissed their stale review June 20, 2026 04:43

Dismissing prior approval to re-evaluate 8fd3784

macroscopeapp[bot]
macroscopeapp Bot previously approved these changes Jun 20, 2026
@juliusmarminge juliusmarminge force-pushed the codex/effect-service-server-checkpointing branch from 8fd3784 to a5ddaf0 Compare June 20, 2026 04:55
@macroscopeapp macroscopeapp Bot dismissed their stale review June 20, 2026 04:55

Dismissing prior approval to re-evaluate a5ddaf0

@github-actions github-actions Bot added size:XL 500-999 changed lines (additions + deletions). and removed size:L 100-499 changed lines (additions + deletions). labels Jun 20, 2026
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-checkpointing branch from a5ddaf0 to 8be2b32 Compare June 20, 2026 05:02
@macroscopeapp macroscopeapp Bot dismissed their stale review June 20, 2026 05:02

Dismissing prior approval to re-evaluate 8be2b32

@juliusmarminge juliusmarminge merged commit 7118e43 into main Jun 20, 2026
15 checks passed
@juliusmarminge juliusmarminge deleted the codex/effect-service-server-checkpointing branch June 20, 2026 05:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XL 500-999 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