Skip to content

orpc-v2: createPlugin restructure (Layer-based initialize, errorStatusMap, scope lifecycle) #259

Description

@elliotBraem

Ticket ID: B2

Parent

#248 — orpc-v2: consolidate fork into everything-dev and migrate platform to oRPC v2 + Effect 4 (epic)

What to build

Stage B, step 2: restructure every-plugin's createPlugin for v2 + Effect 4:

  • initialize composes Effect Layers; scoped resources (db pools, repositories, caches, publishers) bind to the plugin lifecycle scope via Layer semantics — replacing the tools/buildService pattern.
  • Per-plugin context bridging moves to effect/context composed by a base-builder middleware — the per-plugin context-bridge modules go away.
  • errorStatusMap plumbing lands here with custom entries TIMEOUT: 504 and CONNECTION_ERROR: 502 (v2's default TIMEOUT: 408 would change current HTTP behavior).
  • v2 removes middleware dedup — audit middleware call sites and add context-flag guards where double-apply was relied on.

Acceptance criteria

  • createPlugin's new contract implemented with Layer-based initialize; tools/buildService removed
  • Scope-lifecycle tests prove resources release on plugin shutdown
  • errorStatusMap carries TIMEOUT: 504, CONNECTION_ERROR: 502
  • Middleware double-apply sites guarded; every-plugin suite green

Blocked by

Activity

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

    ready-for-agentFully specified, ready for an AFK agent

    Type

    No type

    Fields

    Priority

    None yet

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions