Skip to content

adopt Effect.fn for service method definitions (effect-patterns.md drift) #538

Open

Description

@elliotBraem

Summary

docs/agents/effect-patterns.md says: prefer Effect.gen + Effect.fn("name") — do not create functions that return Effect.gen; use Effect.fn so stack traces and spans attach to the effect.

All api services currently define methods as arrow functions returning Effect.gen:

  • api/src/services/nodes.ts
  • api/src/services/places.ts
  • api/src/services/validators.ts
  • api/src/services/tenants.ts
  • (+ any plugin services following the same shape)

Suggested approach

Repo-wide mechanical pass, not per-PR churn (flagged in review on #530): convert each method to Effect.fn("NodesService.list")-style definitions so traces/spans name the method. Verify the tracing/observability layering still holds with the current Effect version, and that ORPC error channels are unchanged.

Acceptance

  • services use Effect.fn with span-friendly names
  • effect-patterns.md example matches the real service shape
  • no behavior change in route handlers / error codes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions