Skip to content

feat: implement prefix matching experiment (#2947) - #3002

Open
krish-mittal1 wants to merge 1 commit into
go-task:mainfrom
krish-mittal1:feat/prefix-matching
Open

feat: implement prefix matching experiment (#2947)#3002
krish-mittal1 wants to merge 1 commit into
go-task:mainfrom
krish-mittal1:feat/prefix-matching

Conversation

@krish-mittal1

Copy link
Copy Markdown

Description

Closes #2947

This PR introduces an experimental feature for Shortest Unique Prefix Matching (segment-wise abbreviation matching) behind the PREFIX_MATCHING experiment flag (TASK_X_PREFIX_MATCHING=1 or .taskrc.yml).

Summary of Changes:

  • Segment Prefix Matching: Checks input against task names and aliases segment-by-segment separated by : (e.g. task a:o:e or task api:o matches api:openapi:export).
  • Conflict Handling: Halts execution and returns a TaskNameConflictError listing all candidate matches when an input prefix is ambiguous.
  • Precedence: Ensures direct matches, alias matches, and wildcard matches always take precedence over prefix matching.
  • Internal Task Protection: Excludes internal tasks from prefix matching candidates.
  • Documentation & Schema: Added experiment documentation (website/src/next/docs/experiments/prefix-matching.md) and updated .taskrc.yml JSON schema.
  • Testing: Added comprehensive unit and integration tests covering single-segment, multi-segment, alias prefixes, ambiguity, and precedence rules.

Checklist

  • I have read and followed the Contribution Guide.
  • I have disclosed the use of any AI-generated content in this pull request per the AI Usage Policy.
  • I fully understand the changes and have hand-written the description (No AI) of this pull request.

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.

Short prefix / namespace matching

1 participant