[codex] Structure empty mobile pairing payload errors - #3372
Merged
Merged
MacroscopeApp / Macroscope - Effect Service Conventions
succeeded
Jun 20, 2026 in 4m 12s
: Effect Service Conventions: Complete. No issues found
:
Details
Note
Your check run agent prompt is: .macroscope/check-run-agents/effect-service-conventions.md
More information about how Check Run Agents work can be found in our Help Center.
Files reviewed
apps/mobile/src/connection//pairing.tsapps/mobile/src/features/connection/pairing.test.ts
Analysis
This PR introduces a new PairairQQQrPayloadEmptyError and switches extractPairingUrlFromQrPayload from throwing a bare Error to throwing the tagged error. It checks out against the Effect conventions:
- Imports:
import * as Schema from "effect/Schema"uses the correct subpath namespace import, matching the repo-wide pattern forSchema.TaggedErrorClasserror declarations. - Tagged error: The failure is modeled with
Schema.TaggedErrorClassand a precise tag (PairingQrPayloadEmptyError), consistent with conventions. - No redundant fields / no fabricated cause: This is a pure validation/domain error raised when the scanned QR payload is empty. There is no underlying failure and no additional variable context to capture, so the empty fields object
{}and the absence of acauseare appropriate — conventions explicitly state pure validation/domain errors created without an underlying failure do not need a cause, and a precise tag need not invent a redundant singleton field. - Message: The
messagegetter returns a fixed string derived solely from the (static) nature of the error, not from a stringified cause or a stored unstructured message field. The previously caller-visible message is preserved, and the test asserts both the error type and the exact message. - No discriminator misuse, no switch tables, no standalone shape interfaces, no compatibility shims.
No convention violations introduced or retained in the changed scope.
The agent made no additional tool calls beyond your initial Check Run Agent prompt.
Agent Credits: 36 credits
Loading