Skip to content

runtimeHelpers imports infrastructure adapters and branches on plumbing presence #174

Description

@flyingrobots

Migrated from Method backlog

GitHub Issues are now the live work tracker. Repository docs remain Method evidence.

Field Value
Source backlog docs/method/backlog/bad-code/HEX_runtimehelpers-plumbing-composition-leak.md
Archived source docs/archive/backlog/github-issue-migration-2026-06-01/docs/method/backlog/bad-code/HEX_runtimehelpers-plumbing-composition-leak.md
Original lane bad-code
Original id HEX_runtimehelpers-plumbing-composition-leak
Original legend HEX
Original feature materialization-query-index
Original release home v17.0.0

Original backlog card

runtimeHelpers imports infrastructure adapters and branches on plumbing presence

Effort: M

What's Wrong

runtimeHelpers.ts auto-constructs CasBlobAdapter and
CborIndexStoreAdapter from domain-side helpers and uses
persistence.plumbing presence to choose the path. This is another
domain-to-infrastructure composition leak.

Why It Matters

The helper is effectively a hidden composition root inside
src/domain/**. That makes the domain depend on adapter details and
invites more .plumbing peeking over time.

Evidence

  • src/domain/runtimeHelpers.ts:25
  • src/domain/runtimeHelpers.ts:29
  • src/domain/runtimeHelpers.ts:32
  • src/domain/runtimeHelpers.ts:69

Suggested Fix

  1. Remove infrastructure adapter imports from
    src/domain/runtimeHelpers.ts.
  2. Push blob storage and index store construction into a composition
    root or explicit factory.
  3. Replace plumbing-presence inference with explicit injected
    capabilities.

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:queryPrimary work area: query.priority:laterDeferred or speculative work.status:availableOpen and available for prioritization; not blocked or actively in progress.type:debtDebt, rot, or structural risk.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions