Skip to content

feat: add lane configuration model and defaults#391

Merged
itsmiso-ai merged 1 commit into
mainfrom
saffron-382-lane-config
Jun 17, 2026
Merged

feat: add lane configuration model and defaults#391
itsmiso-ai merged 1 commit into
mainfrom
saffron-382-lane-config

Conversation

@itsmiso-ai

Copy link
Copy Markdown
Contributor

Fixes #382

Summary

Add a central lane config helper module (src/lib/lane-config.ts) so all lane consumers go through one helper instead of scattered string unions and constants.

Changes

  • LaneConfig interface with id, title, claimable, description?, color?, defaultAgent?
  • Default config: normal (claimable), escalated (claimable), backlog (non-claimable) — equivalent to current behavior
  • Public helpers:
    • getConfiguredLanes() — all configured lanes
    • getClaimableLanes() — only claimable lanes
    • isValidLane(id) — is the lane id configured?
    • isClaimableLane(id) — is the lane id configured and claimable?
    • getBacklogLane() — the non-claimable fallback lane
    • getLaneById(id) — look up a lane by id
    • getLaneIds() — all configured lane ids
  • Validation: unique ids, non-empty id/title, at least one claimable lane
  • Runtime overrides: setLaneConfig() / resetLaneConfig() for custom configs
  • 17 unit tests covering defaults, custom config, and validation edge cases

Compatibility

Existing installs behave exactly the same when no custom config is provided. No database migration required.

Add a central lane config helper module (src/lib/lane-config.ts) so all
lane consumers go through one helper instead of scattered string unions.

- LaneConfig interface with id, title, claimable, description, color, defaultAgent
- Default config: normal (claimable), escalated (claimable), backlog (non-claimable)
- Public helpers: getConfiguredLanes(), getClaimableLanes(), isValidLane(id),
  isClaimableLane(id), getBacklogLane(), getLaneById(id), getLaneIds()
- Validation: unique ids, non-empty id/title, at least one claimable lane
- setLaneConfig() / resetLaneConfig() for runtime overrides
- 17 unit tests covering defaults, custom config, validation edge cases
- Preserves current behavior when no custom config is provided

@its-saffron its-saffron Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AI Automated Review

Full PR review.

Analysis engine: review@https://litellm.jory.dev/v1 (openai) — fast route

Summary

This PR introduces a centralized lane configuration module (src/lib/lane-config.ts) to replace scattered string unions and constants. This allows for a more robust and configurable way to manage execution lanes (Normal, Escalated, Backlog) across the application.

Change-by-change findings

src/lib/lane-config.ts

  • Implementation: Correctly implements the LaneConfig and LaneConfigSet interfaces as requested in PR 382.
  • Defaults: Provides the required default configuration (Normal, Escalated, Backlog) with appropriate claimable settings.
  • Validation: The validateLaneConfigSet function robustly checks for non-empty IDs, unique IDs, non-empty titles, and ensures at least one lane is claimable.
  • Encapsulation: Uses a private laneConfigSet and provides a deep copy via getConfiguredLanes() to prevent accidental mutation of the internal state.

src/lib/lane-config.test.ts

  • Coverage: Comprehensive unit tests covering default configuration, custom configuration, validation error cases (empty array, duplicate IDs, empty IDs, missing titles, all non-claimable), and the resetLaneConfig functionality.
  • Mutation Testing: Includes a test case to verify that getConfiguredLanes() returns a copy and does not allow direct mutation of the internal state.

Linked Issue Fit

  • Requirement Match: The implementation perfectly aligns with the requirements and proposed config shape in PR 382.
  • Acceptance Criteria:
    • Current default lanes are available through the new config helper.
    • A single claimable lane plus backlog can be represented.
    • Multiple claimable lanes plus backlog can be represented.
    • Invalid lane IDs are rejected or ignored with a clear error.
    • Unit tests cover default config and at least one custom config.
  • Compatibility: As stated in the PR, existing installs will behave identically as the defaults match the previous hardcoded behavior.

Standards Compliance

  • Code Standards: Follows repository conventions for error handling (throw new Error) and validation.
  • Testing: Uses vitest and provides high coverage for the new logic.
  • Secrets: No secrets are committed.

@itsmiso-ai itsmiso-ai merged commit 93b5d80 into main Jun 17, 2026
3 checks passed
@itsmiso-ai itsmiso-ai deleted the saffron-382-lane-config branch June 17, 2026 01:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat: add lane configuration model and defaults

1 participant