Skip to content

refactor: replace hardcoded lane constants with lane helpers #383

@joryirving

Description

@joryirving

Parent: #381

Goal

Replace hardcoded lane assumptions with calls into the lane configuration helper introduced by #382.

Dispatch currently has lane names embedded in types, filters, route handlers, UI copy, and tests. This makes it hard to add or remove lanes safely.

Scope

Audit and update Dispatch app code only.

Likely areas to inspect:

  • src/types/index.ts
  • agent queue helpers
  • issue reconciliation helpers
  • API route validation
  • board/list/filter UI
  • tests that assert exact lane sets

Requirements

  • Remove or minimize string-union assumptions like normal | escalated | backlog from runtime logic.
  • Prefer lane helper functions over local string checks.
  • Keep TypeScript helpful without forcing installs to use only the default lanes.
  • Treat unknown lanes consistently:
    • reject invalid input at API boundaries when appropriate
    • avoid writing unknown lane values from internal code
  • Preserve current behavior for the default lane config.

Non-goals

  • Do not change the database schema unless unavoidable.
  • Do not change external workflow repos.
  • Do not introduce new lane names in this issue.
  • Do not change routing/classification behavior beyond using helpers.

Acceptance criteria

  • Runtime logic uses the central lane helper/config where practical.
  • Tests still pass with the default normal, escalated, backlog config.
  • At least one test proves a custom configured lane is accepted by helper-backed logic.
  • No API route has an unreviewed hardcoded allowlist that would reject valid custom lanes.

Validation

  • npm run lint
  • npm run typecheck
  • npm run test
  • npm run build

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions