Skip to content

Feature/saved searches - #172

Open
HereIsMuhammad wants to merge 9 commits into
sajeetharan:mainfrom
HereIsMuhammad:feature/saved-searches
Open

Feature/saved searches#172
HereIsMuhammad wants to merge 9 commits into
sajeetharan:mainfrom
HereIsMuhammad:feature/saved-searches

Conversation

@HereIsMuhammad

Copy link
Copy Markdown
Contributor

Closes #166

Summary

Adds saved developer searches with opt-in, per-search new-match alerts.

Signed-in users can save a search using a free-text query and/or structured filters such as country, language, and minimum score. They can re-run, rename, or delete saved searches.

See docs/prd/saved-searches.md for the full spec and API contract.

What's included

  • lib/saved-search.js — criteria validation/normalization, structured + text filtering, privacy guard, and incremental deduplicated new-match detection (diffNewMatches)
  • lib/saved-search-store.js — Cosmos-backed CRUD store with in-memory fallback, following lib/watchlist-store.js conventions
  • lib/saved-search-run.js — executes saved searches using text/vector/hybrid mode against live data, reusing /api/search's existing Cosmos/embedding patterns
  • GET/POST /api/saved-searches — list and create
  • PATCH/DELETE /api/saved-searches/[id] — rename, update alert frequency, delete
  • POST /api/saved-searches/[id]/run — run now, return results + deduplicated new matches, and update the persisted seen-set
  • tests/saved-search.test.js — 21 tests covering validation, structured/text filtering, privacy exclusion, and incremental dedup

Acceptance criteria covered

  • Save, rename, run, and delete search criteria
  • Support current text/vector mode and structured filters
  • New-match detection is incremental and deduplicated
  • Alerts are opt-in with per-search frequency controls
  • Private or pending profiles never appear

Out of scope

  • Alert delivery (scheduled job + email/notification on the daily/weekly cadence). This PR ships the opt-in setting and dedup primitive; a future job will handle delivery.
  • Saved Searches UI (save button, management screen) — API contract first, UI as a follow-up

Testing

node --test tests/saved-search.test.js — 21/21 passing, covering validation, structured/text filtering, privacy exclusion, and incremental dedup.

API routes follow the same auth/Cosmos/fallback pattern used by lib/watchlist-store.js and lib/feed-store.js.

The GitHub OAuth flow was not verified locally because it requires a separately configured OAuth app. Happy to have this checked on a deploy preview if useful.

@vercel

vercel Bot commented Aug 16, 2026

Copy link
Copy Markdown

@HereIsMuhammad is attempting to deploy a commit to the sajeetharan's projects Team on Vercel.

A member of the Team first needs to authorize it.

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.

Feature: Saved developer searches with new-match alerts

1 participant