Last modified by Robert Schaub on 2026/02/08 08:31

Show last authors
1 {{info}}
2 **Current Implementation (v2.6.33)** - The default pipeline with TypeScript-orchestrated staged workflow. File: ##orchestrated.ts## (~9000 lines)
3 {{/info}}
4
5 = Orchestrated Pipeline Internal Flow =
6
7 {{mermaid}}
8
9 flowchart TB
10 subgraph Entry[Entry Point]
11 INPUT[runFactHarborAnalysis]
12 NORM[Input Normalization]
13 BUDGET[Initialize Budget Tracker]
14 end
15
16 subgraph Step1[Step 1: Understand]
17 UC[understandClaim]
18 LLM1[LLM Call]
19 SCOPE[detectScopes heuristic]
20 CLAIMS[Extract SubClaims]
21 QUERIES[Generate researchQueries]
22 end
23
24 subgraph Step2[Step 2: Research Loop]
25 DECIDE[decideNextResearch]
26 SEARCH[searchWebWithProvider]
27 FETCH[fetchSourceContent parallel]
28 EXTRACT[extractFacts per source]
29 LLM2[LLM Calls]
30 BUDGET_CHECK{Budget exceeded?}
31 end
32
33 subgraph Step3[Step 3: Verdict Generation]
34 CLAIM_V[generateClaimVerdicts]
35 ARTICLE_V[generateArticleVerdict]
36 LLM3[LLM Call]
37 WEIGHT[calculateWeightedVerdictAverage]
38 CONTEST[detectClaimContestation]
39 HARM[detectHarmPotential]
40 end
41
42 subgraph Step4[Step 4: Summary]
43 SUMMARY[generateTwoPanelSummary]
44 end
45
46 subgraph Step5[Step 5: Report]
47 REPORT[generateReport markdown]
48 end
49
50 subgraph Output[Output]
51 RESULT[AnalysisResult JSON]
52 MARKDOWN[Report Markdown]
53 end
54
55 INPUT --> NORM
56 NORM --> BUDGET
57 BUDGET --> UC
58
59 UC --> LLM1
60 LLM1 --> SCOPE
61 SCOPE --> CLAIMS
62 CLAIMS --> QUERIES
63
64 QUERIES --> DECIDE
65 DECIDE --> SEARCH
66 SEARCH --> FETCH
67 FETCH --> EXTRACT
68 EXTRACT --> LLM2
69 LLM2 --> BUDGET_CHECK
70 BUDGET_CHECK -->|No| DECIDE
71 BUDGET_CHECK -->|Yes| CLAIM_V
72
73 CLAIM_V --> WEIGHT
74 WEIGHT --> CONTEST
75 CONTEST --> HARM
76 HARM --> ARTICLE_V
77 ARTICLE_V --> LLM3
78
79 LLM3 --> SUMMARY
80 SUMMARY --> REPORT
81 REPORT --> RESULT
82 REPORT --> MARKDOWN
83
84 {{/mermaid}}
85
86 = Key Functions =
87
88 |= Phase |= Function |= Purpose |= LLM Calls
89 | Entry | ##runFactHarborAnalysis## | Main entry point | 0
90 | Entry | ##normalizeYesNoQuestionToStatement## | Input neutrality normalization | 0
91 | Step 1 | ##understandClaim## | Claim extraction and classification | 1
92 | Step 1 | ##detectScopes## | Heuristic scope pre-detection | 0
93 | Step 2 | ##decideNextResearch## | Generate search queries | 1 per iteration
94 | Step 2 | ##searchWebWithProvider## | Web search (Google CSE or SerpAPI) | 0
95 | Step 2 | ##fetchSourceContent## | Parallel source fetching | 0
96 | Step 2 | ##extractFacts## | Extract facts from sources | 1 per source
97 | Step 3 | ##generateClaimVerdicts## | Per-claim verdicts | 1
98 | Step 3 | ##generateArticleVerdict## | Overall verdict | 1
99 | Step 4 | ##generateTwoPanelSummary## | Format results for UI | 0
100 | Step 5 | ##generateReport## | Markdown report generation | 0
101
102 = Budget Controls =
103
104 |= Parameter |= Default |= Environment Variable
105 | Max iterations per scope | 3 | ##FH_RESEARCH_MAX_ITERATIONS_PER_SCOPE##
106 | Max total iterations | 5 | ##FH_RESEARCH_MAX_TOTAL_ITERATIONS##
107 | Max total tokens | 100000 | ##FH_RESEARCH_MAX_TOTAL_TOKENS##
108
109 = Shared Modules Used =
110
111 * ##scopes.ts## - detectScopes, canonicalizeScopes
112 * ##aggregation.ts## - calculateWeightedVerdictAverage, detectClaimContestation, detectHarmPotential
113 * ##claim-decomposition.ts## - normalizeClaimText, deriveCandidateClaimTexts
114 * ##budgets.ts## - Budget tracking and enforcement
115 * ##provenance-validation.ts## - Fact provenance validation
116
117 = Output Schema =
118
119 Produces **canonical schema** compatible with existing Jobs UI:
120 * ##article## - Input metadata, thesis, scopes
121 * ##claims## - Array of extracted claims with dependencies
122 * ##claimVerdicts## - Per-claim verdicts with truthPercentage
123 * ##articleVerdict## - Overall verdict
124 * ##facts## - Extracted facts from sources
125 * ##sources## - Source metadata with reliability scores