feat: add lane configuration model and defaults#391
Merged
Conversation
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
There was a problem hiding this comment.
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
LaneConfigandLaneConfigSetinterfaces as requested in PR 382. - Defaults: Provides the required default configuration (Normal, Escalated, Backlog) with appropriate
claimablesettings. - Validation: The
validateLaneConfigSetfunction robustly checks for non-empty IDs, unique IDs, non-empty titles, and ensures at least one lane is claimable. - Encapsulation: Uses a private
laneConfigSetand provides a deep copy viagetConfiguredLanes()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
resetLaneConfigfunctionality. - 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
vitestand provides high coverage for the new logic. - Secrets: No secrets are committed.
This was referenced Jun 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
id,title,claimable,description?,color?,defaultAgent?getConfiguredLanes()— all configured lanesgetClaimableLanes()— only claimable lanesisValidLane(id)— is the lane id configured?isClaimableLane(id)— is the lane id configured and claimable?getBacklogLane()— the non-claimable fallback lanegetLaneById(id)— look up a lane by idgetLaneIds()— all configured lane idssetLaneConfig()/resetLaneConfig()for custom configsCompatibility
Existing installs behave exactly the same when no custom config is provided. No database migration required.