Files
Xika 7bec3ed03f
ai-news-writer-ci / test (pull_request) Successful in 38s
feat(research): BIT-3602 wire orchestrator for multi-source fact verification
Add src/research/index.js as the single entry point that composes the
existing source modules already on main (Google Fact Check, ClaimBuster,
cross-reference) plus extractClaims and aggregateVerificationResults
into one verifyArticle(article) call.

Behaviour:
- Honours researchConfig() — short-circuits with status:'disabled'
  when RESEARCH_ENABLED is false (opt-in feature flag, no default
  network calls).
- Returns status:'skipped' for empty articles.
- Queries the three sources in parallel via Promise.all.
- Wraps each source in safeQuery so a thrown error is contained as
  status:'error', logged, and excluded from the aggregate — partial
  outage of one source never blocks the publish pipeline.
- Result shape: { status, overall_confidence, sources, claims }
  matching the surface aggregateVerificationResults already produces.

Tests: 5 new cases in src/research/index.test.js cover disabled,
empty article, three-source aggregation (matches aggregator weighted
contract: 0.50/0.35/0.15 → 72), partial-outage containment, and
all-skipped → status:'skipped'.

Source modules and their tests (aggregator, claims, config, sources/*)
are not touched: prior PRs already merged refined versions of those
files to main; this change only adds the missing orchestrator that
wires them together.

Paperclip-Issue: BIT-3602
Paperclip-Run: 31991727-135e-4c6b-ba11-982068f121de
2026-05-12 03:47:05 +00:00
..