Tighten structural Effect error checks#3213
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: Needs human review Changes to You can customize Macroscope's approvability policy. Learn more. |
Summary
Schema.Defect()errorsWhy
PR #3188 exposed a mechanical refactor pattern that replaced typed failures with opaque defects. The check now enforces structural error modeling instead of accepting an artificial
causefield.Validation
vp checkvp run typecheckgit diff --checkNote
Low Risk
Documentation-only change to a check-run agent; no runtime or application code is modified.
Overview
Extends the Effect service conventions check agent (
.macroscope/check-run-agents/effect-service-conventions.md) so reviewers flag weak error modeling, not just missingTaggedErrorClassusage.New Errors and predicates rules require flagging
Schema.Defect()-style errors that only carry an opaquecause, insist on stable serializable domain context (operation, resource, category, detail) mapped at the failure site, and clarify that realcausevalues are optional diagnostics—not manufactured defects and not a replacement for structured upstream errors.Reviewed by Cursor Bugbot for commit c46afb5. Bugbot is set up for automated code reviews on this repo. Configure here.
Note
Tighten error modeling guidance in Effect service conventions
Adds three bullet points to the 'Errors and predicates' section of effect-service-conventions.md to clarify correct error modeling:
Schema.Defectis not a substitute for structured error classesSchema.DefectMacroscope summarized c46afb5.