Repository navigation
[codex] align server auth Effect services - #3180
.completall.A
All clear. ThisThis PR refactors the auth-layerror handling and service definitions to follow the Effect service conventions, and the changes are consistent with them.
Verified across the changed scope (apps/server/src/auth/*, apps/server/src/cloud/*, apps/desktopop/src.ts):
- Imports: Effect modules are imported as subpath namespaces; local service modules (
ServerConfig,ServerSecretStore,SessionStore,PairingGrantStore,EnvironmentAuthPolicy) are now namespace-imported withX.Xtag access. No consolidatedfrom "effect"imports were introduced. Error-only imports (e.g. indpop.ts) remain named, which the conventions permit. - Service definitions:
FooShapeinterfaces were removed and inlined intoContext.Service; references useFoo["Service"].makeis a realEffect.genconstructor andlayer = Layer.effect(...)is canonical. - Errors/predicates: Failures are modeled with
Schema.TaggedErrorClass, distinct tags split semantically distinct failures,messagegetters derive from structural attributes (never fromcause), real causes are preserved viaSchema.Defect(),Schema.Unionaggregates are exported, and predicates are directexport const isFoo = Schema.is(Foo). The one multi-value discriminator (SessionClaimsEncodingError.operation) uses the permitted single-error + generic-message pattern. Caller-visible reason strings are preserved viaserverAuthCredentialReason/serverAuthInvalidRequestReason. - File layout: Files stayed in place (in-file refactor), so no compatibility shims were needed; consumers were mechanically updated.
No convention violations were found in the PR's changed scope. Pre-existing *Shape interfaces elsewhere in the repo are outside this PR's scope and not flagged.',
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.
Method: reviewed the full diff and inspected EnvironmentAuth.ts, SessionStore.ts, PairingGrantStore.ts, ServerSecretStore.ts, dpop.ts, cloud/http.ts, and call sites (http.ts, ws.ts). Confirmed no consolidated effect imports and no retained *Shape types in the touched auth/cloud files (remaining *Shape references are in unrelated, untouched modules). Confirmed error classes preserve cause, derive messages from structural fields, and that caller-visible reason mapping is retained at HTTP boundaries.
The agent made no additional tool calls beyond your initial Check Run Agent prompt.
Agent Credits: 108 credits