[codex] Refactor checkpointing Effect services#3181
Conversation
|
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 |
|
🚀 Expo continuous deployment is ready!
|
ApprovabilityA prior Macroscope approval was dismissed. Re-evaluating 8be2b32… |
2464be4 to
21b79a2
Compare
Dismissing prior approval to re-evaluate 21b79a2
21b79a2 to
b2492ff
Compare
Dismissing prior approval to re-evaluate b2492ff
b2492ff to
104eace
Compare
Dismissing prior approval to re-evaluate 104eace
104eace to
3954c73
Compare
Dismissing prior approval to re-evaluate 3954c73
09dfa5b to
8fd3784
Compare
Dismissing prior approval to re-evaluate 8fd3784
8fd3784 to
a5ddaf0
Compare
Dismissing prior approval to re-evaluate a5ddaf0
Co-authored-by: codex <codex@users.noreply.github.com>
a5ddaf0 to
8be2b32
Compare
Dismissing prior approval to re-evaluate 8be2b32
Summary
CheckpointDiffQueryandCheckpointStoreservice modules and their existing tests to the checkpointing domain rootService["Service"]for implementation and test-double typesmakevalue and module-levellayer, with namespace imports in the in-scope consumersCheckpointStorecompatibility shims and migrate orchestration and integration-harness consumers to the canonical namespaceWhy
Checkpointing still used split
Services/andLayers/modules with standalone*Shapeinterfaces. The domain-root modules now match the repository's target Effect service layout. The requirement is an exportedlayer;Layer.effectis used here because bothmakevalues 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.tsandcheckpointing/Services/CheckpointStore.tsare deleted* as CheckpointStoreand usesCheckpointStore.CheckpointStore/CheckpointStore.layerCheckpointDiffQueryservice path remains removed without a shimImpact
This is a structural refactor. Checkpoint capture, restore, and diff behavior is unchanged. No test cases or assertions were added; the moved
CheckpointDiffQuerytest uses@effect/vitestbecause 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
vp check— passed with 0 errors; 20 pre-existing warnings remainvp run typecheck— all 15 workspace tasks passedgit diff --check origin/main— passed*Shapecontracts, 2/2 concretemakeexports, 2/2layerexports, and no redundantEffect.succeedwrappersCheckpointStorepaths orCheckpointStoreLivereferences; 4/4 consumers use the canonical namespaceserver.test.ts(106 before and after)Note
Refactor checkpointing services to co-locate tags, implementations, and layers
CheckpointStoreandCheckpointDiffQueryfrom separateServices/andLayers/files into single modules atCheckpointStore.tsandCheckpointDiffQuery.ts.Context.Serviceclasses, exportinglayerinstead ofCheckpointStoreLive/CheckpointDiffQueryLive.* as CheckpointStore) andCheckpointStore.layer.Services/CheckpointStore.ts,Services/CheckpointDiffQuery.ts, andLayers/CheckpointStore.tsfiles.CheckpointDiffQuerycovering 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:
CheckpointStoreandCheckpointDiffQuerynow live as single modules undercheckpointing/with the service tag, implementation (make), andlayercolocated. Standalone*Shapeinterfaces are dropped in favor ofService["Service"]typing.The old split under
checkpointing/Services/andcheckpointing/Layers/(includingCheckpointStoreLiveand separate diff-query layer files) is removed with no compatibility shims. Wiring inserver.ts,ws.ts,CheckpointReactor, the integration harness, and related tests now usesimport * as CheckpointStore/CheckpointDiffQueryandCheckpointStore.layer/CheckpointDiffQuery.layer.CheckpointDiffQuery.test.tsmoves to the domain root and runs via@effect/vitest(replacing manualEffect.runPromisein the deletedLayerstest). 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.