BIT-3602: orchestrator for multi-source fact verification #18

Merged
spark merged 3 commits from task/BIT-3602-multi-source-fact-verification into main 2026-05-12 11:51:01 +01:00
3 Commits
Author SHA1 Message Date
XikaandCursor 2a68c1f3b2 fix(lint): align verification-report.js with ESLint (BIT-21863)
ai-news-writer-ci / test (pull_request) Successful in 51s
Apply eslint --fix indentation for chained calls and replace loose
equality for confidence display with explicit null/undefined checks.

Refs: BIT-3602, BIT-21863
Co-authored-by: Cursor <[email protected]>
2026-05-12 10:49:40 +00:00
Xika e77fc46a70 BIT-3602: Persist verification_report and editorial verification column
ai-news-writer-ci / test (pull_request) Failing after 17s
Run verifyArticle before appending article JSONL via persistGeneratedArticle
(index, CLI write/listen). Article rows store a bounded snapshot; /ui dashboard
shows Verificação with per-source details in a disclosure.

Paperclip-Issue: BIT-21733
Paperclip-Run: 87279bca-68e7-410b-bdc5-ff25cc08e671
2026-05-12 03:55:01 +00:00
Xika 7bec3ed03f feat(research): BIT-3602 wire orchestrator for multi-source fact verification
ai-news-writer-ci / test (pull_request) Successful in 38s
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