Skip to content

Fix regex patterns to support multi-segment reference prefixes#14

Open
hailsalex91 wants to merge 2 commits intoaha-develop:mainfrom
hailsalex91:fix/multi-segment-reference-prefixes
Open

Fix regex patterns to support multi-segment reference prefixes#14
hailsalex91 wants to merge 2 commits intoaha-develop:mainfrom
hailsalex91:fix/multi-segment-reference-prefixes

Conversation

@hailsalex91
Copy link
Copy Markdown

Problem

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 ever reaching the API.

Changes

  • Updated FEATURE_REF_REGEX, REQUIREMENT_REF_REGEX, and NOTE_REF_REGEX
    in src/types.ts to support multi-segment prefixes via (?:-[A-Z][A-Z0-9]*)*
  • Swapped check order in src/handlers.ts 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

Examples that now work

  • TSP-S-148 → feature
  • TSP-S-148-1 → requirement
  • TSP-S-N-5 → note
  • DEVELOP-123 → still works as before

hailsalex91 and others added 2 commits March 27, 2026 09:20
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>
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.

1 participant