[codex] Refactor desktop settings Effect services#3188
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!
|
ApprovabilityVerdict: Approved Mechanical refactor converting error classes to use You can customize Macroscope's approvability policy. Learn more. |
50b4ddb to
3236e4a
Compare
Dismissing prior approval to re-evaluate 3236e4a
3236e4a to
a17e8af
Compare
Dismissing prior approval to re-evaluate a17e8af
a17e8af to
d83af36
Compare
Dismissing prior approval to re-evaluate d83af36
554e0ac to
d84fb7e
Compare
Dismissing prior approval to re-evaluate d84fb7e
d84fb7e to
6ec2bb6
Compare
Co-authored-by: codex <codex@users.noreply.github.com>
Co-authored-by: codex <codex@users.noreply.github.com>
6ec2bb6 to
c9ad561
Compare
Dismissing prior approval to re-evaluate c9ad561
Summary
Context.Servicetags.Service["Service"]types.makevalues andlayerconstants for all four services without synthetic wrappers.Scope
The final diff is limited to the desktop settings and connection-catalog services plus focused error-classification tests. There are no orchestration, MCP, or server-exposure changes.
Validation
vp check— passed; 20 pre-existing unrelated warningsvp run typecheck— passedgit diff --check origin/main...HEAD— passedSchema.Defect()causes or message-discriminating switches in the four servicesNote
Medium Risk
Changes error typing and wiring across encrypted catalogs, saved-environment secrets, and on-disk settings writes—security-sensitive persistence paths—but scope is refactor-only with broad test coverage and no described behavior changes.
Overview
Refactors four desktop Effect persistence services—app settings, client settings, saved environments, and the connection catalog—so each exposes an exported
makefactory andlayer = Layer.effect(..., make), with the service API defined inline onContext.Serviceinstead of separate*Shapeinterfaces.Tagged errors move from generic
Data.TaggedError+ opaquecausetoSchema.TaggedErrorClasspayloads withoperation, affectedpath(or catalog/registry path), and a safedetailstring. Read vs JSON/document decode vs encrypted-payload decode are split into distinct error types; migration failures record which legacy step failed (and optionalenvironmentIdfor secret reads). Invalid base64/secret material is reported without echoing raw secret bytes in messages.Persistence, encryption, legacy migration, and server-exposure semantics are intended unchanged; tests were updated and extended to assert the new error shapes and failure stages.
Reviewed by Cursor Bugbot for commit c9ad561. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Refactor desktop settings error classes to use structured fields for operation, path, and detail
DesktopAppSettings,DesktopClientSettings,DesktopSavedEnvironments, andDesktopConnectionCatalogStorefromData.TaggedErrortoSchema.TaggedErrorClasswith structuredoperation,path/catalogPath/registryPath, anddetailfields.create-directory,replace-settings-file,read-legacy-registry) so callers can distinguish failure modes without parsing error messages.DesktopConnectionCatalogStoreDocumentDecodeError,DesktopSavedEnvironmentsDocumentDecodeError,DesktopSavedEnvironmentSecretDecodeError) rather than being lumped into read errors.Layerdefinition into amakefactory consumed viaLayer.effect.Macroscope summarized c9ad561.