Skip to content

feat(search): hackernews + stackexchange + pubmed adapters#63

Merged
askalf merged 1 commit into
masterfrom
feat/research-adapters-2
Jun 9, 2026
Merged

feat(search): hackernews + stackexchange + pubmed adapters#63
askalf merged 1 commit into
masterfrom
feat/research-adapters-2

Conversation

@askalf

@askalf askalf commented Jun 9, 2026

Copy link
Copy Markdown
Owner

Summary

Three more keyless research backends, bringing deepdive to 12 search adapters.

Adapter Flag (+aliases) Notes
Hacker News --search=hackernews (hn) Algolia HN search. Ask/Show HN posts fall back to the thread URL; snippet shows points/comments.
Stack Exchange --search=stackexchange (stackoverflow, so) Q&A search. Default site stackoverflow; DEEPDIVE_STACKEXCHANGE_SITE switches (serverfault, …). Entity-decoded titles; snippet shows score/answers/accepted.
PubMed --search=pubmed Biomedical literature via NCBI E-utilities (esearch → esummary). Abstract-page sources; snippet shows authors/journal/date.

Design

  • Each follows docs/search-adapter.md: searchTimeoutSignal for the hardened timeout, response→SearchResult[] transform in an exported pure mapper (mapHNHits / mapStackExchangeItems / mapPubMedSummary), throws on non-2xx, absolute URLs.
  • PubMed is the two-step esearch→esummary flow; an empty id list short-circuits (no second request).
  • Stack Exchange surfaces the API's error_message (e.g. throttling) as a thrown error.
  • Registered in resolveSearchAdapter; deepdive doctor probes them generically.

Tests

21 new tests (pure mappers, alias resolution, stubbed-fetch request shapes, error paths). 568/568 green, tsc --strict clean. Verified against the live HN / Stack Overflow / PubMed APIs — real URLs, titles, scores, author lists, and abstract links all parse.

Three more keyless research backends:
- hackernews (alias hn): Algolia HN search; Ask/Show HN fall back to the
  thread URL; snippet shows points/comments.
- stackexchange (aliases stackoverflow/so): Q&A search, default site
  stackoverflow (DEEPDIVE_STACKEXCHANGE_SITE to switch); entity-decoded
  titles; snippet shows score/answers/accepted.
- pubmed: NCBI E-utilities esearch->esummary; abstract-page sources;
  snippet shows authors/journal/date.

Each reuses searchTimeoutSignal and keeps its transform in an exported
pure mapper. Registered in resolveSearchAdapter; doctor probes generically.
21 new tests (568 total green); all three verified against live APIs.
deepdive now ships 12 search adapters.
@askalf askalf merged commit da7e48a into master Jun 9, 2026
5 checks passed
@askalf askalf deleted the feat/research-adapters-2 branch June 9, 2026 18:11
@askalf askalf mentioned this pull request Jun 9, 2026
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