Wiki source code of Federation & Decentralization

Version 1.1 by Robert Schaub on 2025/12/16 20:34

Show last authors
1 = Federation & Decentralization =
2
3 FactHarbor is designed to operate as a **federated network of nodes** rather than a single central server.
4
5 Decentralization provides:
6 * **Resilience** against censorship or political pressure
7 * **Autonomy** for local governance and moderation
8 * **Scalability** across many independent communities
9 * **Trust** without centralized control
10 * **Domain specialization** (health-focused nodes, energy-focused nodes, etc.)
11
12 FactHarbor draws inspiration from the Fediverse but uses stronger structure, versioning, and integrity guarantees.
13
14
15 == 1. Federated FactHarbor Nodes ==
16
17 Each FactHarbor instance ("node") maintains:
18 * Its own database
19 * Its own AKEL instance
20 * Its own reviewers, experts, and contributors
21 * Its own governance rules
22
23 Nodes exchange structured information:
24 * Claims
25 * Scenarios
26 * Evidence metadata (not necessarily full files)
27 * Verdicts (optional)
28 * Hashes and signatures for integrity
29
30 Nodes choose which external nodes they trust.
31
32
33 == 2. Global Identifiers ==
34
35 Every entity receives a globally unique, linkable identifier.
36
37 **Format**:
38 `factharbor://node_url/type/local_id`
39
40 **Example**:
41 `factharbor://factharbor.energy/claim/CLM-55812`
42
43 **Supported types**:
44 * `claim`
45 * `scenario`
46 * `evidence`
47 * `verdict`
48 * `user` (optional)
49 * `cluster`
50
51 **Properties**:
52 * Globally consistent
53 * Human-readable
54 * Hash-derived
55 * Independent of database internals
56 * URL-resolvable (future enhancement)
57
58 This allows cross-node references and prevents identifier collisions in federated environments.
59
60
61 == 3. Trust Model ==
62
63 Each node maintains a **trust table** defining relationships with other nodes:
64
65 === 3.1 Trust Levels ===
66
67 **Trusted Nodes**:
68 * Claims auto-imported
69 * Scenarios accepted without re-review
70 * Evidence considered valid
71 * Verdicts displayed to users
72 * High synchronization priority
73
74 **Neutral Nodes**:
75 * Claims imported but flagged for review
76 * Scenarios require local validation
77 * Evidence requires re-assessment
78 * Verdicts shown with "external node" disclaimer
79 * Normal synchronization priority
80
81 **Untrusted Nodes**:
82 * Claims quarantined, manual import only
83 * Scenarios rejected by default
84 * Evidence not accepted
85 * Verdicts not displayed
86 * No automatic synchronization
87
88 === 3.2 Trust Affects ===
89
90 * **Auto-import**: Whether claims/scenarios are automatically added
91 * **Re-review requirements**: Whether local reviewers must validate
92 * **Verdict display**: Whether external verdicts are shown to users
93 * **Synchronization frequency**: How often data is exchanged
94 * **Reputation signals**: How external reputation is interpreted
95
96 === 3.3 Local Trust Authority ===
97
98 Each node's governance team decides:
99 * Which nodes to trust
100 * Trust level criteria
101 * Trust escalation/degradation rules
102 * Dispute resolution with partner nodes
103
104 Trust is **local and autonomous** - no global trust registry exists.
105
106
107 == 4. Data Sharing Model ==
108
109 === 4.1 What Nodes Share ===
110
111 **Always shared** (if federation enabled):
112 * Claims and claim clusters
113 * Scenario structures
114 * Evidence metadata and content hashes
115 * Integrity signatures
116
117 **Optionally shared**:
118 * Full evidence files (large documents)
119 * Verdicts (nodes may choose to keep verdicts local)
120 * Vector embeddings
121 * Scenario templates
122 * AKEL distilled knowledge
123
124 **Never shared**:
125 * Internal user lists
126 * Reviewer comments and internal discussions
127 * Governance decisions and meeting notes
128 * Access control data
129 * Private or sensitive content marked as local-only
130
131 === 4.2 Large Evidence Files ===
132
133 Evidence files are:
134 * Stored locally by default
135 * Referenced via global content hash
136 * Optionally served through IPFS
137 * Accessible via direct peer-to-peer transfer
138 * Can be stored in S3-compatible object storage
139
140
141 == 5. Synchronization Protocol ==
142
143 Nodes exchange data using multiple synchronization methods:
144
145 === 5.1 Push-Based Synchronization ===
146
147 **Mechanism**: Webhooks
148
149 When local content changes:
150 1. Node builds signed bundle
151 2. Sends webhook notification to subscribed nodes
152 3. Remote nodes fetch bundle
153 4. Remote nodes validate and import
154
155 **Use case**: Real-time updates for trusted partners
156
157 === 5.2 Pull-Based Synchronization ===
158
159 **Mechanism**: Scheduled polling
160
161 Nodes periodically:
162 1. Query partner nodes for updates
163 2. Fetch changed entities since last sync
164 3. Validate and import
165 4. Store sync checkpoint
166
167 **Use case**: Regular batch updates, lower trust nodes
168
169 === 5.3 Subscription-Based Synchronization ===
170
171 **Mechanism**: WebSub-like protocol
172
173 Nodes subscribe to:
174 * Specific claim clusters
175 * Specific domains (medical, energy, etc.)
176 * Specific scenario types
177 * Verdict updates
178
179 Publisher pushes updates only to subscribers.
180
181 **Use case**: Selective federation, domain specialization
182
183 === 5.4 Large Asset Transfer ===
184
185 For files >10MB:
186 * S3-compatible object storage
187 * IPFS (content-addressed)
188 * Direct peer-to-peer transfer
189 * Chunked HTTP transfer with resume support
190
191
192 == 6. Federation Sync Workflow ==
193
194 Complete synchronization sequence for creating and sharing new content:
195
196 === 6.1 Step 1: Local Node Creates New Versions ===
197
198 User or AKEL creates:
199 * New claim version
200 * New scenario version
201 * New evidence version
202 * New verdict version
203
204 All changes tracked with:
205 * VersionID
206 * ParentVersionID
207 * AuthorType
208 * Timestamp
209 * JustificationText
210
211 === 6.2 Step 2: Federation Layer Builds Signed Bundle ===
212
213 Federation layer packages:
214 * Entity data (claim, scenario, evidence metadata, verdict)
215 * Version lineage (ParentVersionID chain)
216 * Cryptographic signatures
217 * Node provenance information
218 * Trust metadata
219
220 Bundle format:
221 * JSON-LD for structured data
222 * Content-addressed hashes
223 * Digital signatures for integrity
224
225 === 6.3 Step 3: Bundle Includes Required Data ===
226
227 Each bundle contains:
228 * **Claims**: Full claim text, classification, domain
229 * **Scenarios**: Definitions, assumptions, boundaries
230 * **Evidence metadata**: Source URLs, hashes, reliability scores (not always full files)
231 * **Verdicts**: Likelihood ranges, uncertainty, reasoning chains
232 * **Lineage**: Version history, parent relationships
233 * **Signatures**: Cryptographic proof of origin
234
235 === 6.4 Step 4: Bundle Pushed to Trusted Neighbor Nodes ===
236
237 Based on trust table:
238 * Push to **trusted nodes** immediately
239 * Queue for **neutral nodes** (batched)
240 * Skip **untrusted nodes**
241
242 Push methods:
243 * Webhook notification
244 * Direct API call
245 * Pub/Sub message queue
246
247 === 6.5 Step 5: Remote Nodes Validate Lineage and Signatures ===
248
249 Receiving node:
250 1. Verifies cryptographic signatures
251 2. Validates version lineage (ParentVersionID chain)
252 3. Checks for conflicts with local data
253 4. Validates data structure and required fields
254 5. Applies local trust policies
255
256 Validation failures → reject or quarantine bundle
257
258 === 6.6 Step 6: Accept or Branch Versions ===
259
260 **Accept** (if validation passes):
261 * Import new versions
262 * Maintain provenance metadata
263 * Link to local related entities
264 * Update local indices
265
266 **Branch** (if conflict detected):
267 * Create parallel version tree
268 * Mark as "external branch"
269 * Allow local reviewers to merge or reject
270 * Preserve both version histories
271
272 **Reject** (if validation fails):
273 * Log rejection reason
274 * Notify source node (optional)
275 * Quarantine for manual review (optional)
276
277 === 6.7 Step 7: Local Re-evaluation Runs if Required ===
278
279 After import, local node checks:
280 * Does new evidence affect existing verdicts?
281 * Do new scenarios require re-assessment?
282 * Are there contradictions with local content?
283
284 If yes:
285 * Trigger AKEL re-evaluation
286 * Queue for reviewer attention
287 * Update affected verdicts
288 * Notify users following related content
289
290
291 == 7. Cross-Node AI Knowledge Exchange ==
292
293 Each node runs its own AKEL instance and may exchange AI-derived knowledge:
294
295 === 7.1 What Can Be Shared ===
296
297 **Vector embeddings**:
298 * For cross-node claim clustering
299 * For semantic search alignment
300 * Never includes training data
301
302 **Canonical claim forms**:
303 * Normalized claim text
304 * Standard phrasing templates
305 * Domain-specific formulations
306
307 **Scenario templates**:
308 * Reusable scenario structures
309 * Common assumption patterns
310 * Evaluation method templates
311
312 **Contradiction alerts**:
313 * Detected conflicts between claims
314 * Evidence conflicts across nodes
315 * Scenario incompatibilities
316
317 **Metadata and insights**:
318 * Aggregate quality metrics
319 * Reliability signal extraction
320 * Bubble detection patterns
321
322 === 7.2 What Can NEVER Be Shared ===
323
324 **Model weights**: No sharing of trained model parameters
325
326 **Training data**: No sharing of full training datasets
327
328 **Local governance overrides**: AKEL suggestions can be overridden locally
329
330 **User behavior data**: No cross-node tracking
331
332 **Internal review discussions**: Private content stays private
333
334 === 7.3 Benefits of AI Knowledge Exchange ===
335
336 * Reduced duplication across nodes
337 * Improved claim clustering accuracy
338 * Faster contradiction detection
339 * Shared scenario libraries
340 * Cross-node quality improvements
341
342 === 7.4 Local Control Maintained ===
343
344 * Nodes accept or reject shared AI knowledge
345 * Human reviewers can override any AKEL suggestion
346 * Local governance always has final authority
347 * No external AI control over local content
348 * Privacy-preserving knowledge exchange
349
350
351 == 8. Decentralized Processing ==
352
353 Each node independently performs:
354 * AKEL processing
355 * Scenario drafting and validation
356 * Evidence review
357 * Verdict calculation
358 * Truth landscape summarization
359
360 Nodes can specialize:
361 * Health-focused node with medical experts
362 * Energy-focused node with domain knowledge
363 * Small node delegating scenario libraries to partners
364 * Regional node with language/culture specialization
365
366 Optional data sharing includes:
367 * Embeddings for clustering
368 * Claim clusters for alignment
369 * Scenario templates for efficiency
370 * Verdict comparison metadata
371
372
373 == 9. Scaling to Thousands of Users ==
374
375 Nodes scale independently through:
376 * Horizontally scalable API servers
377 * Worker pools for AKEL tasks
378 * Hybrid storage (local + S3/IPFS)
379 * Redis caching for performance
380 * Sharded or partitioned databases
381
382 Federation allows effectively unlimited horizontal scaling by adding new nodes.
383
384 Communities may form:
385 * Domain-specific nodes (epidemiology, energy, climate)
386 * Language or region-based nodes
387 * NGO or institutional nodes
388 * Private organizational nodes
389 * Academic research nodes
390
391 Nodes cooperate through:
392 * Scenario library sharing
393 * Shared or overlapping claim clusters
394 * Expert delegation between nodes
395 * Distributed AKEL task support
396 * Cross-node quality audits
397
398
399 == 10. Federation and Release 1.0 ==
400
401 **POC**: Single node, optional federation experiments
402
403 **Beta 0**: 2-3 nodes, basic federation protocol
404
405 **Release 1.0**: Full federation support with:
406 * Robust synchronization protocol
407 * Trust model implementation
408 * Cross-node AI knowledge exchange
409 * Federated search and discovery
410 * Distributed audit collaboration
411 * Inter-node expert consultation
412
413
414 == 11. Related Pages ==
415
416 * [[AKEL (AI Knowledge Extraction Layer)>>Test.FactHarborV09.Specification.AI Knowledge Extraction Layer (AKEL).WebHome]]
417 * [[Data Model>>Test.FactHarborV09.Specification.Data Model.WebHome]]
418 * [[Architecture>>Test.FactHarborV09.Specification.Architecture.WebHome]]
419 * [[Workflows>>Test.FactHarborV09.Specification.Workflows.WebHome]]