feat(SO-19): fuzzy title similarity endpoint#33
Merged
Conversation
Adds a static, non-expiring API key that enables external tools to access the Mesa API without relying on ephemeral per-run agent keys. Changes: - New --api-key <key> CLI flag (also MESA_API_KEY_EXTERNAL env) - Auth middleware checks the external key before DB lookup - External key resolves to a synthetic 'external' agent in context - New GET /api/v1/issues endpoint for listing all issues (with ?status= and ?limit= filters) - 3 new tests covering external key auth (valid, wrong value, not set) The external key is intended for orchestration tools, CI/CD pipelines, and external agents that need to create issues, read status, or post comments without being part of the internal agent roster. Usage: mesa --api-key my-secret-key -t enterprise 3001 curl -H 'Authorization: Bearer my-secret-key' http://localhost:3001/api/v1/issues
…similarity
Implements duplicate-detection endpoint per SO-19 acceptance criteria.
- New POST /api/v1/issues/similarity accepts {title} and returns
[{key, title, similarity_score}] for active (non-terminal) issues
above 0.70 normalized Levenshtein threshold, sorted desc by score.
- ListActiveIssueTitles DB method scans todo/in_progress/in_review/blocked issues.
- Unit tests cover exact match, near-match, below-threshold, empty DB,
terminal-issue filtering, sorted order, and missing-title 400.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Owner
|
LGTM, than you @bketelsen ! |
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.
Summary
POST /api/v1/issues/similarity— accepts{"title": "..."}and returns[{key, title, similarity_score}]for non-terminal issues above 0.70 normalized Levenshtein threshold, sorted by score descendingListActiveIssueTitlesDB method scans issues with status not in (done, cancelled, wont_do)Test plan
TestSimilarIssues_ExactMatch— score = 1.0 for identical titleTestSimilarIssues_NearMatch— near-match title returns above thresholdTestSimilarIssues_BelowThreshold— unrelated title returns empty listTestSimilarIssues_EmptyDatabase— empty DB returns[]TestSimilarIssues_SkipsTerminalIssues— done/cancelled issues excludedTestSimilarIssues_SortedByScore— results sorted descendingTestSimilarIssues_MissingTitle— missing title returns 400go test ./...all greenCloses SO-19
🤖 Generated with Claude Code