Wiki source code of POC Requirements (POC1 & POC2)

Version 1.1 by Robert Schaub on 2025/12/23 16:05

Hide last authors
Robert Schaub 1.1 1 = POC Requirements =
2
3 **Status:** ✅ Approved for Development
4 **Version:** 3.0 (Aligned with Main Requirements)
5 **Goal:** Prove that AI can extract claims and determine verdicts automatically without human intervention
6
7 {{info}}
8 **Core Philosophy:** POC validates the [[Main Requirements>>FactHarbor.Specification.Requirements.WebHome]] through simplified implementation. All POC features map to formal FR/NFR requirements.
9 {{/info}}
10
11
12 == 1. POC Overview ==
13
14 === 1.1 What POC Tests ===
15
16 **Core Question:**
17 > Can AI automatically extract factual claims from articles and evaluate them with reasonable verdicts?
18
19 **What we're proving:**
20 * AI can identify factual claims from text
21 * AI can evaluate those claims with structured evidence
22 * Quality gates can filter unreliable outputs
23 * The core workflow is technically feasible
24
25 **What we're NOT proving:**
26 * Production-ready reliability (that's POC2)
27 * User-facing features (that's Beta 0)
28 * Full IFCN compliance (that's V1.0)
29
30 === 1.2 Requirements Mapping ===
31
32 POC1 implements a **subset** of the full system requirements defined in [[Main Requirements>>FactHarbor.Specification.Requirements.WebHome]].
33
34 **Scope Summary:**
35 * **In Scope:** 8 requirements (7 FRs + 1 NFR)
36 * **Partial:** 3 NFRs (simplified versions)
37 * **Out of Scope:** 19 requirements (deferred to later phases)
38
39
40 == 2. POC1 Scope ==
41
42 {{success}}
43 **Authoritative Source for Phase Mapping:** [[Requirements Roadmap Matrix>>Test.FactHarbor.Roadmap.Requirements-Roadmap-Matrix.WebHome]]
44
45 The Roadmap Matrix is the single source of truth for which requirements are implemented in which phases. This page provides POC1-specific implementation details only.
46 {{/success}}
47
48 **POC1 implements these formal requirements:**
49
50 |= Formal Req |= Implementation in POC1 |= Notes
51 | **FR4** | Analysis Summary | Basic format; quality metadata deferred to POC2
52 | **FR7** | Automated Verdicts | Full implementation with quality gates (NFR11)
53 | **NFR11** | Quality Assurance Framework | 4 quality gates implemented
54
55 **POC1 also implements these workflow components** (detailed as FR1-FR6, FR8, FR11, FR13 in implementation sections below):
56 * Claim extraction (FR1)
57 * Claim context (FR2)
58 * Multiple scenarios (FR3)
59 * Evidence collection (FR5)
60 * Source quality assessment (FR6)
61 * Time evolution tracking (FR8) - deferred to POC2
62 * Audit trail (FR11) - deferred to Beta 0
63 * In-article highlighting (FR13) - deferred to Beta 0
64
65 **Partial implementations:**
66 * NFR1 (Explainability) - Basic only
67 * NFR2 (Performance) - Functional but not optimized
68 * NFR3 (Transparency) - Basic only
69
70 **Detailed POC1 implementation specifications continue below...**
71
72
73
74 == 3. POC Simplifications ==
75
76 === 3.1 FR1: Claim Extraction (Full Implementation) ===
77
78 **Main Requirement:** AI extracts factual claims from input text
79
80 **POC Implementation:**
81 * ✅ AKEL extracts claims using LLM
82 * ✅ Each claim includes original text reference
83 * ✅ Claims are identified as factual/non-factual
84 * ❌ No advanced claim parsing (added in POC2)
85
86 **Acceptance Criteria:**
87 * Extracts 3-5 claims from typical article
88 * Identifies factual vs non-factual claims
89 * Quality Gate 1 validates extraction
90
91
92 === 3.2 FR3: Multiple Scenarios (Full Implementation) ===
93
94 **Main Requirement:** Generate multiple interpretation scenarios for ambiguous claims
95
96 **POC Implementation:**
97 * ✅ AKEL generates 2-3 scenarios per claim
98 * ✅ Scenarios capture different interpretations
99 * ✅ Each scenario is evaluated separately
100 * ✅ Verdict considers all scenarios
101
102 **Acceptance Criteria:**
103 * Generates 2+ scenarios for ambiguous claims
104 * Scenarios are meaningfully different
105 * All scenarios are evaluated
106
107
108 === 3.3 FR4: Analysis Summary (Basic Implementation) ===
109
110 **Main Requirement:** Provide user-friendly summary of analysis
111
112 **POC Implementation:**
113 * ✅ Simple text summary generated
114 * ❌ No rich formatting (added in Beta 0)
115 * ❌ No visual elements (added in Beta 0)
116 * ❌ No interactive features (added in Beta 0)
117
118 **POC Format:**
119 ```
120 Claim: [extracted claim]
121 Scenarios: [list of scenarios]
122 Evidence: [supporting/opposing evidence]
123 Verdict: [probability with uncertainty]
124 ```
125
126
127 === 3.4 FR5-FR6: Evidence Collection & Evaluation (Full Implementation) ===
128
129 **Main Requirements:**
130 * FR5: Collect supporting and opposing evidence
131 * FR6: Evaluate evidence source reliability
132
133 **POC Implementation:**
134 * ✅ AKEL searches for evidence (web/knowledge base)
135 * ✅ **Mandatory contradiction search** (finds opposing evidence)
136 * ✅ Source reliability scoring
137 * ❌ No evidence deduplication (added in POC2)
138 * ❌ No advanced source verification (added in POC2)
139
140 **Acceptance Criteria:**
141 * Finds 2+ supporting evidence items
142 * Finds 1+ opposing evidence (if exists)
143 * Sources scored for reliability
144
145
146 === 3.5 FR7: Automated Verdicts (Full Implementation) ===
147
148 **Main Requirement:** AI computes verdicts with uncertainty quantification
149
150 **POC Implementation:**
151 * ✅ Probabilistic verdicts (0-100% confidence)
152 * ✅ Uncertainty explicitly stated
153 * ✅ Reasoning chain provided
154 * ✅ Quality Gate 4 validates verdict confidence
155
156 **POC Output:**
157 ```
158 Verdict: 70% likely true
159 Uncertainty: ±15% (moderate confidence)
160 Reasoning: Based on 3 high-quality sources...
161 Confidence Level: MEDIUM
162 ```
163
164 **Acceptance Criteria:**
165 * Verdicts include probability (0-100%)
166 * Uncertainty explicitly quantified
167 * Reasoning chain explains verdict
168
169
170 === 3.6 NFR11: Quality Assurance Framework (LITE VERSION) ===
171
172 **Main Requirement:** Complete quality assurance with 7 quality gates
173
174 **POC Implementation:** **2 gates only**
175
176 **Quality Gate 1: Claim Validation**
177 * ✅ Validates claim is factual and verifiable
178 * ✅ Blocks non-factual claims (opinion/prediction/ambiguous)
179 * ✅ Provides clear rejection reason
180
181 **Quality Gate 4: Verdict Confidence Assessment**
182 * ✅ Validates ≥2 sources found
183 * ✅ Validates quality score ≥0.6
184 * ✅ Blocks low-confidence verdicts
185 * ✅ Provides clear rejection reason
186
187 **Out of Scope (POC2+):**
188 * ❌ Gate 2: Evidence Relevance
189 * ❌ Gate 3: Scenario Coherence
190 * ❌ Gate 5: Source Diversity
191 * ❌ Gate 6: Reasoning Validity
192 * ❌ Gate 7: Output Completeness
193
194 **Rationale:** Prove gate concept works. Add remaining gates in POC2 after validating approach.
195
196
197 === 3.7 NFR1-3: Performance, Scalability, Reliability (Basic) ===
198
199 **Main Requirements:**
200 * NFR1: Response time < 30 seconds
201 * NFR2: Handle 1000+ concurrent users
202 * NFR3: 99.9% uptime
203
204 **POC Implementation:**
205 * ⚠️ **Response time monitored** (not optimized)
206 * ⚠️ **Single-threaded processing** (no concurrency)
207 * ⚠️ **Basic error handling** (no advanced retry logic)
208
209 **Rationale:** POC proves functionality. Performance optimization happens in POC2.
210
211 **POC Acceptance:**
212 * Analysis completes (no timeout requirement)
213 * Errors don't crash system
214 * Basic logging in place
215
216
217 == 4. What's NOT in POC Scope ==
218
219 === 4.1 User-Facing Features (Beta 0+) ===
220
221 {{warning}}
222 **Deferred to Beta 0:**
223 {{/warning}}
224
225 **Out of Scope:**
226 * ❌ User accounts and authentication (FR8)
227 * ❌ User corrections system (FR9, FR45-46)
228 * ❌ Public publishing interface (FR10)
229 * ❌ Social sharing (FR11)
230 * ❌ Email notifications (FR12)
231 * ❌ API access (FR13)
232
233 **Rationale:** POC validates AI capabilities. User features added in Beta 0.
234
235
236 === 4.2 Advanced Features (V1.0+) ===
237
238 **Out of Scope:**
239 * ❌ IFCN compliance (FR47)
240 * ❌ ClaimReview schema (FR48)
241 * ❌ Archive.org integration (FR49)
242 * ❌ OSINT toolkit (FR50)
243 * ❌ Video verification (FR51)
244 * ❌ Deepfake detection (FR52)
245 * ❌ Cross-org sharing (FR53)
246
247 **Rationale:** Advanced features require proven platform. Added post-V1.0.
248
249
250 === 4.3 Production Requirements (POC2, Beta 0) ===
251
252 **Out of Scope:**
253 * ❌ Security controls (NFR4, NFR12)
254 * ❌ Code maintainability (NFR5)
255 * ❌ System monitoring (NFR13)
256 * ❌ Evidence deduplication
257 * ❌ Advanced source verification
258 * ❌ Full 7-gate quality framework
259
260 **Rationale:** POC proves concept. Production hardening happens in POC2 and Beta 0.
261
262
263 == 5. POC Output Specification ==
264
265 === 5.1 Required Output Elements ===
266
267 For each analyzed claim, POC must produce:
268
269 **1. Claim**
270 * Original text
271 * Classification (factual/non-factual/ambiguous)
272 * If non-factual: Clear reason why
273
274 **2. Scenarios** (if factual)
275 * 2-3 interpretation scenarios
276 * Each scenario clearly described
277
278 **3. Evidence** (if factual)
279 * Supporting evidence (2+ items)
280 * Opposing evidence (if exists)
281 * Source URLs and reliability scores
282
283 **4. Verdict** (if factual)
284 * Probability (0-100%)
285 * Uncertainty quantification
286 * Confidence level (LOW/MEDIUM/HIGH)
287 * Reasoning chain
288
289 **5. Quality Status**
290 * Which gates passed/failed
291 * If failed: Clear explanation why
292
293
294 === 5.2 Example POC Output ===
295
296 {{code language="json"}}
297 {
298 "claim": {
299 "text": "Switzerland has the highest life expectancy in Europe",
300 "type": "factual",
301 "gate1_status": "PASS"
302 },
303 "scenarios": [
304 "Switzerland's overall life expectancy is highest",
305 "Switzerland ranks highest for specific age groups"
306 ],
307 "evidence": {
308 "supporting": [
309 {
310 "source": "WHO Report 2023",
311 "reliability": 0.95,
312 "excerpt": "Switzerland: 83.4 years average..."
313 }
314 ],
315 "opposing": [
316 {
317 "source": "Eurostat 2024",
318 "reliability": 0.90,
319 "excerpt": "Spain leads at 83.5 years..."
320 }
321 ]
322 },
323 "verdict": {
324 "probability": 0.65,
325 "uncertainty": 0.15,
326 "confidence": "MEDIUM",
327 "reasoning": "WHO and Eurostat show similar but conflicting data...",
328 "gate4_status": "PASS"
329 }
330 }
331 {{/code}}
332
333
334 == 6. Success Criteria ==
335
336 {{success}}
337 **POC Success Definition:** POC validates that AI can extract claims, find balanced evidence, and compute reasonable verdicts with quality gates improving output quality.
338 {{/success}}
339
340 === 6.1 Functional Success ===
341
342 POC is successful if:
343
344 ✅ **FR1-FR7 Requirements Met:**
345 1. Extracts 3-5 factual claims from test articles
346 2. Generates 2-3 scenarios per ambiguous claim
347 3. Finds supporting AND opposing evidence
348 4. Computes probabilistic verdicts with uncertainty
349 5. Provides clear reasoning chains
350
351 ✅ **Quality Gates Work:**
352 1. Gate 1 blocks non-factual claims (100% block rate)
353 2. Gate 4 blocks low-quality verdicts (blocks if <2 sources or quality <0.6)
354 3. Clear rejection reasons provided
355
356 ✅ **NFR11 Met:**
357 1. Quality gates reduce hallucination rate
358 2. Blocked outputs have clear explanations
359 3. Quality metrics are logged
360
361
362 === 6.2 Quality Thresholds ===
363
364 **Minimum Acceptable:**
365 * ≥70% of test claims correctly classified (factual/non-factual)
366 * ≥60% of verdicts are reasonable (human evaluation)
367 * Gate 1 blocks 100% of non-factual claims
368 * Gate 4 blocks verdicts with <2 sources
369
370 **Target:**
371 * ≥80% claims correctly classified
372 * ≥75% verdicts are reasonable
373 * <10% false positives (blocking good claims)
374
375
376 === 6.3 POC Decision Gate ===
377
378 **After POC1, we decide:**
379
380 **✅ PROCEED to POC2** if:
381 * Success criteria met
382 * Quality gates demonstrably improve output
383 * Core workflow is technically sound
384 * Clear path to production quality
385
386 **⚠️ ITERATE POC1** if:
387 * Success criteria partially met
388 * Gates work but need tuning
389 * Core issues identified but fixable
390
391 **❌ PIVOT APPROACH** if:
392 * Success criteria not met
393 * Fundamental AI limitations discovered
394 * Quality gates insufficient
395 * Alternative approach needed
396
397
398 == 7. Test Cases ==
399
400 === 7.1 Happy Path ===
401
402 **Test 1: Simple Factual Claim**
403 * Input: "Paris is the capital of France"
404 * Expected: Factual, 1 scenario, verdict ~95% true
405
406 **Test 2: Ambiguous Claim**
407 * Input: "Switzerland has the highest income in Europe"
408 * Expected: Factual, 2-3 scenarios, verdict with uncertainty
409
410 **Test 3: Statistical Claim**
411 * Input: "10% of people have condition X"
412 * Expected: Factual, evidence with numbers, probabilistic verdict
413
414
415 === 7.2 Edge Cases ===
416
417 **Test 4: Opinion**
418 * Input: "Paris is the best city"
419 * Expected: Non-factual (opinion), blocked by Gate 1
420
421 **Test 5: Prediction**
422 * Input: "Bitcoin will reach $100,000 next year"
423 * Expected: Non-factual (prediction), blocked by Gate 1
424
425 **Test 6: Insufficient Evidence**
426 * Input: Obscure factual claim with no sources
427 * Expected: Blocked by Gate 4 (<2 sources)
428
429
430 === 7.3 Quality Gate Tests ===
431
432 **Test 7: Gate 1 Effectiveness**
433 * Input: Mix of 10 factual + 10 non-factual claims
434 * Expected: Gate 1 blocks all 10 non-factual (100% precision)
435
436 **Test 8: Gate 4 Effectiveness**
437 * Input: Claims with varying evidence availability
438 * Expected: Gate 4 blocks low-confidence verdicts
439
440
441 == 8. Technical Architecture (POC) ==
442
443 === 8.1 Simplified Architecture ===
444
445 **POC Tech Stack:**
446 * **Frontend:** Simple web interface (Next.js + TypeScript)
447 * **Backend:** Single API endpoint
448 * **AI:** Claude API (Sonnet 4.5)
449 * **Database:** Local JSON files (no database)
450 * **Deployment:** Single server
451
452 **Architecture Diagram:** See [[POC1 Specification>>FactHarbor.Specification.POC.Specification]]
453
454
455 === 8.2 AKEL Implementation ===
456
457 **POC AKEL:**
458 * Single-threaded processing
459 * Synchronous API calls
460 * No caching
461 * Basic error handling
462 * Console logging
463
464 **Full AKEL (POC2+):**
465 * Multi-threaded processing
466 * Async API calls
467 * Evidence caching
468 * Advanced error handling with retry
469 * Structured logging + monitoring
470
471
472 == 9. POC Philosophy ==
473
474 {{info}}
475 **Important:** POC validates concept, not production readiness. Focus is on proving AI can do the job, with production quality coming in later phases.
476 {{/info}}
477
478 === 9.1 Core Principles ===
479
480 **1. Prove Concept, Not Production**
481 * POC validates AI can do the job
482 * Production quality comes in POC2 and Beta 0
483 * Focus on "does it work?" not "is it perfect?"
484
485 **2. Implement Subset of Requirements**
486 * POC covers FR1-7, NFR11 (lite)
487 * All other requirements deferred
488 * Clear mapping to [[Main Requirements>>FactHarbor.Specification.Requirements.WebHome]]
489
490 **3. Quality Gates Validate Approach**
491 * 2 gates prove the concept
492 * Remaining 5 gates added in POC2
493 * Gates must demonstrably improve quality
494
495 **4. Iterate Based on Results**
496 * POC results determine next steps
497 * Decision gate after POC1
498 * Flexibility to pivot if needed
499
500
501 === 9.2 Success = Clear Path Forward ===
502
503 POC succeeds if we can confidently answer:
504
505 ✅ **Technical Feasibility:**
506 * Can AI extract claims reliably?
507 * Can AI find balanced evidence?
508 * Can AI compute reasonable verdicts?
509
510 ✅ **Quality Approach:**
511 * Do quality gates improve output?
512 * Can we measure and track quality?
513 * Is the gate approach scalable?
514
515 ✅ **Production Path:**
516 * Is the core architecture sound?
517 * What needs improvement for production?
518 * Is POC2 the right next step?
519
520
521 == 10. Related Pages ==
522
523 * **[[Main Requirements>>FactHarbor.Specification.Requirements.WebHome]]** - Full system requirements (this POC implements a subset)
524 * **[[POC1 Specification (Detailed)>>FactHarbor.Specification.POC.Specification]]** - Detailed POC1 technical specs
525 * **[[POC Summary>>FactHarbor.Specification.POC.Summary]]** - High-level POC overview
526 * **[[Implementation Roadmap>>FactHarbor.Roadmap.WebHome]]** - POC1, POC2, Beta 0, V1.0 phases
527 * **[[User Needs>>FactHarbor.Specification.Requirements.User Needs.WebHome]]** - What users need (drives requirements)
528
529
530 **Document Owner:** Technical Team
531 **Review Frequency:** After each POC iteration
532 **Version History:**
533 * v1.0 - Initial POC requirements
534 * v2.0 - Updated after specification cross-check
535 * v3.0 - Aligned with Main Requirements (FR/NFR IDs added)
536