Wiki source code of POC Requirements (POC1 & POC2)

Last modified by Robert Schaub on 2025/12/23 17:40

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