Skip to content

feat(SO-19): fuzzy title similarity endpoint#33

Merged
msoedov merged 2 commits into
msoedov:mainfrom
bketelsen:feat/fuzzy-similarity-endpoint
Apr 20, 2026
Merged

feat(SO-19): fuzzy title similarity endpoint#33
msoedov merged 2 commits into
msoedov:mainfrom
bketelsen:feat/fuzzy-similarity-endpoint

Conversation

@bketelsen

Copy link
Copy Markdown
Contributor

Summary

  • Adds 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 descending
  • New ListActiveIssueTitles DB method scans issues with status not in (done, cancelled, wont_do)
  • Similarity algorithm: normalized Levenshtein (1 − edit_distance/max_len), case-insensitive, threshold 0.70

Test plan

  • TestSimilarIssues_ExactMatch — score = 1.0 for identical title
  • TestSimilarIssues_NearMatch — near-match title returns above threshold
  • TestSimilarIssues_BelowThreshold — unrelated title returns empty list
  • TestSimilarIssues_EmptyDatabase — empty DB returns []
  • TestSimilarIssues_SkipsTerminalIssues — done/cancelled issues excluded
  • TestSimilarIssues_SortedByScore — results sorted descending
  • TestSimilarIssues_MissingTitle — missing title returns 400
  • Full regression: go test ./... all green

Closes SO-19

🤖 Generated with Claude Code

bketelsen and others added 2 commits April 19, 2026 00:33
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>
@msoedov

msoedov commented Apr 20, 2026

Copy link
Copy Markdown
Owner

LGTM, than you @bketelsen !

@msoedov msoedov merged commit 2740aff into msoedov:main Apr 20, 2026
1 check passed
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.

2 participants