Fix regex patterns to support multi-segment reference prefixes#14
Open
hailsalex91 wants to merge 2 commits intoaha-develop:mainfrom
Open
Fix regex patterns to support multi-segment reference prefixes#14hailsalex91 wants to merge 2 commits intoaha-develop:mainfrom
hailsalex91 wants to merge 2 commits intoaha-develop:mainfrom
Conversation
Aha supports compound product prefixes (e.g. TSP-S-148) but the regex patterns only matched single-segment prefixes like DEVELOP-123. This caused get_record to fail with "Invalid reference number format" for any reference with a multi-part prefix, before even reaching the API. Also swaps the check order so REQUIREMENT_REF_REGEX is tested before FEATURE_REF_REGEX, since the requirement pattern is more specific and would otherwise be shadowed by the updated feature regex. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- Add GetInitiative GraphQL query to queries.ts - Add InitiativeResponse type to types.ts - Fall back to initiative query in get_record when feature lookup returns "Record not found" (initiatives share the same reference format as features) - Default search_documents to search both Initiative and Page types when no searchableType is specified - Update tool descriptions to reflect initiative support Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.
Problem
Aha supports compound product prefixes (e.g.
TSP-S-148) but the regexpatterns only matched single-segment prefixes like
DEVELOP-123. This causedget_recordto fail with "Invalid reference number format" for any referencewith a multi-part prefix, before ever reaching the API.
Changes
FEATURE_REF_REGEX,REQUIREMENT_REF_REGEX, andNOTE_REF_REGEXin
src/types.tsto support multi-segment prefixes via(?:-[A-Z][A-Z0-9]*)*src/handlers.tssoREQUIREMENT_REF_REGEXis testedbefore
FEATURE_REF_REGEX, since the requirement pattern is more specific andwould otherwise be shadowed by the updated feature regex
Examples that now work
TSP-S-148→ featureTSP-S-148-1→ requirementTSP-S-N-5→ noteDEVELOP-123→ still works as before