Last modified by Robert Schaub on 2025/12/24 20:35

From version 7.1
edited by Robert Schaub
on 2025/11/27 12:41
Change comment: There is no comment for this version
To version 1.2
edited by Robert Schaub
on 2025/11/27 12:03
Change comment: Update document after refactoring.

Summary

Details

Page properties
Content
... ... @@ -1,7 +5,3 @@
1 -(((
2 -
3 -)))
4 -
5 5  = 5. Data Model =
6 6  
7 7  The FactHarbor data model centers on four fully versioned, immutable entities:
... ... @@ -45,10 +45,10 @@
45 45   (scenarios live at the *claim* level, not per individual phrasing).
46 46  * Verdicts and Scenario–Evidence links are always attached to **versions**:
47 47  * {{code}}SCENARIO_VERSION{{/code}} +
48 -{{code}}EVIDENCE_VERSION{{/code}} →
49 -{{code}}SCENARIO_EVIDENCE_LINK_VERSION{{/code}}
44 + {{code}}EVIDENCE_VERSION{{/code}} →
45 + {{code}}SCENARIO_EVIDENCE_LINK_VERSION{{/code}}
50 50  * {{code}}SCENARIO_VERSION{{/code}} →
51 -{{code}}VERDICT_VERSION{{/code}}
47 + {{code}}VERDICT_VERSION{{/code}}
52 52  
53 53  This ensures that when a Scenario or Evidence changes, old verdicts and links
54 54  remain intact as historical records and can be revisited.
... ... @@ -61,187 +61,229 @@
61 61  The convention is that fields ending in {{code}}Id{{/code}} are primary keys,
62 62  and fields with {{code}}...IdFk{{/code}} are foreign keys.
63 63  
64 -{{comment}} Core Data Model ERD (Mermaid, from /Specification/Diagrams/Data Model) {{/comment}}
65 -{{include document="FactHarbor.Playground.Core Data Model ERD Page (from Specification chat).WebHome" reference="FactHarbor.Playground.data.Core Data Model ERD Page (from Specification chat).WebHome"/}}
66 -
67 -**Important points:**
68 -
69 -* Scenarios and Evidence are **linked via their versions**
70 - ({{code}}SCENARIO_VERSION{{/code}} and {{code}}EVIDENCE_VERSION{{/code}}).
71 -* Verdicts are **per ScenarioVersion** and stored in {{code}}VERDICT_VERSION{{/code}}.
72 -* {{code}}CLAIM_CLUSTER{{/code}} is shared across diagrams; it is shown here and in the Data Use / Review model.
73 -
74 -All version entities are immutable: once created, they are never changed, only
75 -superseded by newer versions.
76 -
77 -----
78 -
79 -= 5.3 Data Use & Review ERD (expanded, versioned) =
80 -
81 -The **Data Use** model captures who does what with which versioned data:
82 -
83 -* Users (including technical users)
84 -* Roles and role assignments
85 -* Review actions on versioned entities
86 -
87 -{{comment}} Data Use ERD (Mermaid, from /Specification/Diagrams/Data Use ERD) {{/comment}}
88 -{{include document="FactHarbor.Playground.Data Use ERD Page (from Specification chat).WebHome" reference="FactHarbor.Playground.data.Data Use ERD Page (from Specification chat).WebHome"/}}
89 -
90 -= Data Use ERD (Roles, Review & Versioned Entities) =
91 -
92 -This diagram shows how users, roles, and review actions relate to the
93 -versioned core entities.
94 -
95 95  {{mermaid}}
96 96  erDiagram
97 - %% Core clusters shown for context
62 +
98 98   CLAIM_CLUSTER {
99 - string ClusterID PK
100 - string EmbeddingVectorRef
101 - string Theme
64 + string claimClusterId
65 + string theme
66 + string embeddingVectorRef
67 + string language
68 + datetime createdAt
102 102   }
103 103  
104 104   CLAIM {
105 - string ClaimID PK
106 - string ClusterID FK
107 - string Status
108 - datetime CreatedAt
72 + string claimId
73 + string claimClusterIdFk
74 + string status
75 + datetime createdAt
109 109   }
110 110  
111 111   CLAIM_VERSION {
112 - string ClaimVersionID PK
113 - string ClaimID FK
114 - string Text
115 - string ClaimType
116 - string Domain
117 - datetime CreatedAt
79 + string claimVersionId
80 + string claimIdFk
81 + string text
82 + string language
83 + string claimType
84 + string domain
85 + string authorType
86 + datetime createdAt
118 118   }
119 119  
120 120   SCENARIO {
121 - string ScenarioID PK
122 - string ClaimID FK
123 - string Name
124 - datetime CreatedAt
90 + string scenarioId
91 + string claimIdFk
92 + string key
93 + string title
94 + boolean isDeprecated
125 125   }
126 126  
127 127   SCENARIO_VERSION {
128 - string ScenarioVersionID PK
129 - string ScenarioID FK
130 - string Definitions
131 - string Assumptions
132 - string Boundaries
133 - datetime CreatedAt
98 + string scenarioVersionId
99 + string scenarioIdFk
100 + string versionTag
101 + string definitionsJson
102 + string assumptionsJson
103 + string boundariesJson
104 + string notes
105 + datetime createdAt
134 134   }
135 135  
136 136   EVIDENCE {
137 - string EvidenceID PK
138 - string SourceType
139 - string URL
140 - float ReliabilityScore
109 + string evidenceId
110 + string canonicalSourceId
111 + string mainUrl
112 + string evidenceType
113 + string language
141 141   }
142 142  
143 143   EVIDENCE_VERSION {
144 - string EvidenceVersionID PK
145 - string EvidenceID FK
146 - string Summary
147 - float ReliabilityScore
148 - datetime CreatedAt
117 + string evidenceVersionId
118 + string evidenceIdFk
119 + string snapshotLocation
120 + string extractionSummary
121 + string reliabilityModel
122 + datetime collectedAt
123 + datetime createdAt
149 149   }
150 150  
126 + SCENARIO_EVIDENCE_LINK {
127 + string scenarioEvidenceLinkId
128 + string scenarioIdFk
129 + string evidenceIdFk
130 + }
131 +
132 + SCENARIO_EVIDENCE_LINK_VERSION {
133 + string scenarioEvidenceLinkVersionId
134 + string scenarioEvidenceLinkIdFk
135 + string scenarioVersionIdFk
136 + string evidenceVersionIdFk
137 + float relevance
138 + string direction %% SUPPORTS / CONTRADICTS / MIXED / CONTEXT
139 + string rationale
140 + datetime createdAt
141 + }
142 +
151 151   VERDICT {
152 - string VerdictID PK
153 - string ScenarioID FK
144 + string verdictId
145 + string scenarioIdFk
146 + string verdictType %% e.g. likelihood, classification
154 154   }
155 155  
156 156   VERDICT_VERSION {
157 - string VerdictVersionID PK
158 - string VerdictID FK
159 - float Verdict
160 - float Confidence
161 - string Reasoning
162 - datetime CreatedAt
150 + string verdictVersionId
151 + string verdictIdFk
152 + string scenarioVersionIdFk
153 + float probability
154 + float confidence
155 + string reasoningSummary
156 + string uncertaintyFactorsJson
157 + datetime createdAt
163 163   }
164 164  
165 - %% Users and roles
160 + %% Relationships
161 +
162 + CLAIM_CLUSTER ||--o{ CLAIM : contains
163 + CLAIM ||--o{ CLAIM_VERSION : has_versions
164 + CLAIM ||--o{ SCENARIO : has_scenarios
165 + SCENARIO ||--o{ SCENARIO_VERSION : has_versions
166 +
167 + EVIDENCE ||--o{ EVIDENCE_VERSION : has_versions
168 +
169 + SCENARIO ||--o{ SCENARIO_EVIDENCE_LINK : may_link
170 + EVIDENCE ||--o{ SCENARIO_EVIDENCE_LINK : may_link
171 +
172 + SCENARIO_EVIDENCE_LINK ||--o{ SCENARIO_EVIDENCE_LINK_VERSION : has_versions
173 +
174 + SCENARIO_VERSION ||--o{ SCENARIO_EVIDENCE_LINK_VERSION : uses_evidence
175 + EVIDENCE_VERSION ||--o{ SCENARIO_EVIDENCE_LINK_VERSION : is_used_in
176 +
177 + SCENARIO ||--o{ VERDICT : has_verdicts
178 + VERDICT ||--o{ VERDICT_VERSION : has_versions
179 + SCENARIO_VERSION ||--o{ VERDICT_VERSION : assessed_in
180 +{{/mermaid}}
181 +
182 +**Important points:**
183 +
184 +* Scenarios and Evidence are **linked via their versions**
185 + ({{code}}SCENARIO_VERSION{{/code}} and {{code}}EVIDENCE_VERSION{{/code}}).
186 +* Verdicts are **per ScenarioVersion** and stored in {{code}}VERDICT_VERSION{{/code}}.
187 +* {{code}}CLAIM_CLUSTER{{/code}} is shared across diagrams; it is shown here and in the Data Use / Review model.
188 +
189 +All version entities are immutable: once created, they are never changed, only
190 +superseded by newer versions.
191 +
192 +----
193 +
194 += 5.3 Data Use & Review ERD (expanded, versioned) =
195 +
196 +The **Data Use** model captures who does what with which versioned data:
197 +
198 +* Users (including technical users)
199 +* Roles and role assignments
200 +* Review actions on versioned entities
201 +
202 +{{mermaid}}
203 +erDiagram
204 +
166 166   USER {
167 - string UserID PK
168 - string Handle
169 - string Email
206 + string userId
207 + string displayName
208 + string email
209 + string userType %% "human" or "technical"
210 + datetime createdAt
170 170   }
171 171  
172 172   TECHNICAL_USER {
173 - string UserID PK
174 - string SystemName
214 + string technicalUserId
215 + string userIdFk
216 + string description
217 + string systemIdentifier
175 175   }
176 176  
177 - CONTRIBUTING_USER {
178 - string UserID PK
179 - string DisplayName
220 + ROLE {
221 + string roleId
222 + string code %% e.g. READER, CONTRIBUTOR, REVIEWER, TRUSTED_CONTRIBUTOR, MODERATOR, SYSTEM_ADMIN, FEDERATION_OPERATOR, FEDERATION_ADMIN
223 + string description
224 + boolean isFederationRole
180 180   }
181 181  
182 - TRUSTED_CONTRIBUTOR {
183 - string UserID PK
184 - string TrustLevel
227 + USER_ROLE_MEMBERSHIP {
228 + string membershipId
229 + string userIdFk
230 + string roleIdFk
231 + datetime grantedAt
232 + string grantedByUserIdFk
185 185   }
186 186  
187 - REVIEWER {
188 - string UserID PK
189 - string Domain
235 + REVIEW_ACTION {
236 + string reviewActionId
237 + string subjectType %% e.g. CLAIM_VERSION, SCENARIO_VERSION...
238 + string subjectVersionId
239 + string actionType %% APPROVE, REJECT, FLAG, COMMENT, REQUEST_CHANGES...
240 + string outcome %% ACCEPTED, REJECTED, ESCALATED...
241 + string comment
242 + string createdByUserIdFk
243 + datetime createdAt
190 190   }
191 191  
192 - EXPERT {
193 - string UserID PK
194 - string ExpertiseArea
246 + %% Versioned data entities (references from the core model)
247 +
248 + CLAIM_VERSION {
249 + string claimVersionId
195 195   }
196 196  
197 - FEDERATION_NODE {
198 - string NodeID PK
199 - string Region
252 + SCENARIO_VERSION {
253 + string scenarioVersionId
200 200   }
201 201  
202 - FEDERATION_ADMIN {
203 - string UserID PK
204 - string Permissions
256 + EVIDENCE_VERSION {
257 + string evidenceVersionId
205 205   }
206 206  
207 - REVIEW_ACTION {
208 - string ReviewActionID PK
209 - string UserID FK
210 - string TargetEntityType
211 - string TargetEntityVersionID
212 - string ActionType
213 - string Comment
214 - datetime Timestamp
260 + SCENARIO_EVIDENCE_LINK_VERSION {
261 + string scenarioEvidenceLinkVersionId
215 215   }
216 216  
217 - %% Inheritance / specialization (modelled as relationships)
218 - USER ||--o{ TECHNICAL_USER : "is a"
219 - USER ||--o{ CONTRIBUTING_USER : "is a"
264 + VERDICT_VERSION {
265 + string verdictVersionId
266 + }
220 220  
221 - CONTRIBUTING_USER ||--o{ TRUSTED_CONTRIBUTOR : "subset"
222 - CONTRIBUTING_USER ||--o{ REVIEWER : "subset"
223 - CONTRIBUTING_USER ||--o{ EXPERT : "subset"
268 + %% Relationships
224 224  
225 - TECHNICAL_USER ||--o{ FEDERATION_NODE : "operates"
226 - TECHNICAL_USER ||--o{ FEDERATION_ADMIN : "administers"
270 + USER ||--o{ TECHNICAL_USER : may_be
271 + USER ||--o{ USER_ROLE_MEMBERSHIP : has_role
272 + ROLE ||--o{ USER_ROLE_MEMBERSHIP : assigned_to
227 227  
228 - %% Review actions on versioned entities
229 229   USER ||--o{ REVIEW_ACTION : performs
230 230  
231 - REVIEW_ACTION }o--|| CLAIM_VERSION : reviews
232 - REVIEW_ACTION }o--|| SCENARIO_VERSION : reviews
233 - REVIEW_ACTION }o--|| EVIDENCE_VERSION : reviews
234 - REVIEW_ACTION }o--|| VERDICT_VERSION : reviews
276 + CLAIM_VERSION ||--o{ REVIEW_ACTION : is_reviewed_in
277 + SCENARIO_VERSION ||--o{ REVIEW_ACTION : is_reviewed_in
278 + EVIDENCE_VERSION ||--o{ REVIEW_ACTION : is_reviewed_in
279 + SCENARIO_EVIDENCE_LINK_VERSION ||--o{ REVIEW_ACTION : is_reviewed_in
280 + VERDICT_VERSION ||--o{ REVIEW_ACTION : is_reviewed_in
235 235  {{/mermaid}}
236 236  
237 -{{info}}
238 -This diagram focuses on *who* uses and reviews *which* versioned entities.
239 -USER is the base type; TECHNICAL_USER and CONTRIBUTING_USER are specializations.
240 -Other roles (REVIEWER, EXPERT, TRUSTED_CONTRIBUTOR, FEDERATION_ADMIN, FEDERATION_NODE)
241 -are modelled as specializations or technical subtypes.
242 -{{/info}}
243 -
244 -
245 245  Notes:
246 246  
247 247  * Most roles (READER, CONTRIBUTOR, TRUSTED_CONTRIBUTOR, REVIEWER, MODERATOR,
... ... @@ -271,7 +271,7 @@
271 271  * It may inherit some links from earlier scenarios, or start empty depending
272 272   on the change classification (cosmetic vs. conceptual).
273 273  * All verdicts for that scenario are recalculated and stored as new
274 -{{code}}VERDICT_VERSION{{/code}} entries.
312 + {{code}}VERDICT_VERSION{{/code}} entries.
275 275  
276 276  * REVIEW_ACTIONs are always attached to the **exact version** that was seen by
277 277   the reviewer. This preserves a faithful audit trail if data later changes.
... ... @@ -308,173 +308,3 @@
308 308  Federation-specific entities (such as {{code}}FEDERATION_NODE{{/code}},
309 309  replication logs, and trust rules) are described in the Federation &
310 310  Decentralization chapter and build on top of the core data model defined here.
311 -
312 -----
313 -
314 -== 1. Overall analysis & review of the data model ==
315 -
316 -=== 1.1 Strengths of the current design ===
317 -
318 -* (((
319 -**Identity vs. version pattern**
320 -Using base entities plus version entities (CLAIM + CLAIM_VERSION, SCENARIO + SCENARIO_VERSION, etc.) is exactly how modern knowledge systems handle:
321 -
322 -* auditability
323 -* time evolution
324 -* re-evaluation triggers
325 -* federation and partial replication
326 -)))
327 -* (((
328 -**Scenario-centric reasoning**
329 -Separating //Claim// (what people argue about) from //Scenario// (interpretive frame) is very aligned with “truth landscape” style systems:
330 -
331 -* Scenarios explain //why people disagree//.
332 -* Verdicts are tied to specific scenario versions → avoids mixing incompatible assumptions.
333 -)))
334 -* **Evidence and verdicts as first-class entities**
335 -Evidence is explicit, linked to scenarios, and verdicts are per scenario. This matches good practice from fact-checking, scientific assessment panels, and trust graphs.
336 -* (((
337 -**Cluster level (CLAIM_CLUSTER)**
338 -Grouping related claims avoids duplication and lets you:
339 -
340 -* reuse scenarios across paraphrases
341 -* share embeddings / semantic search
342 -* keep the system scalable as the corpus grows.
343 -)))
344 -* (((
345 -**Explicit review layer (REVIEW_ACTION, roles, etc.)**
346 -Separating “data” from “who reviewed what” keeps the model clean, and is exactly what you want for:
347 -
348 -* governance
349 -* permissions
350 -* audit trails
351 -* future trust scoring per user / role.
352 -)))
353 -
354 -----
355 -
356 -=== 1.2 Design decisions I’m locking in (based on our discussions) ===
357 -
358 -To make the model consistent and “state-of-the-art”, I will assume the following as //current intended design//:
359 -
360 -1. (((
361 -**Claims vs Scenarios**
362 -
363 -* CLAIM is the stable identity for “what people argue about”.
364 -* CLAIM_VERSION are individual phrasings / formulations / metadata.
365 -* (((
366 -SCENARIO belongs to a **CLAIM**, not to a specific CLAIM_VERSION.
367 -Rationale:
368 -
369 -* Many different phrasings share the //same// scenario.
370 -* You avoid duplicating scenarios per wording.
371 -)))
372 -* SCENARIO_VERSION holds detailed definitions, assumptions, boundaries, etc.
373 -)))
374 -1. (((
375 -**Version-specific reasoning**
376 -
377 -* **Verdicts** are always attached to SCENARIO_VERSION (not base SCENARIO).
378 -* **Evidence links** are between SCENARIO_VERSION and EVIDENCE_VERSION.
379 -→ This is what we agreed when we said //“SCENARIO_EVIDENCE_LINK should link the respective versions instead”//.
380 -)))
381 -1. (((
382 -**Clusters**
383 -
384 -* CLAIM_CLUSTER groups Claims (semantically close claims).
385 -* It is visible in **both diagrams** (Core Data Model and Data Use).
386 -)))
387 -1. (((
388 -**Review vs data**
389 -
390 -* (((
391 -All review happens **on versioned entities**:
392 -
393 -* CLAIM_VERSION
394 -* SCENARIO_VERSION
395 -* EVIDENCE_VERSION
396 -* SCENARIO_EVIDENCE_LINK_VERSION
397 -* VERDICT_VERSION
398 -)))
399 -* REVIEW_ACTION is the generic log of //who// did //what// on //which version//.
400 -)))
401 -1. (((
402 -**Users & roles**
403 -
404 -* USER has an attribute (or a linked entity) that distinguishes **technical users** from normal accounts.
405 -* We //keep// TECHNICAL_USER as a specialisation of USER (strictly technical accounts).
406 -* All human & technical accounts can hold roles via USER_ROLE_MEMBERSHIP.
407 -* (((
408 -Roles include:
409 -
410 -* READER
411 -* CONTRIBUTOR
412 -* TRUSTED_CONTRIBUTOR
413 -* REVIEWER
414 -* MODERATOR
415 -* SYSTEM_ADMIN / MAINTAINER
416 -* FEDERATION_OPERATOR
417 -* FEDERATION_ADMIN
418 -(all present in the Data Use ERD, but as rows of ROLE rather than separate entities).
419 -)))
420 -)))
421 -
422 -----
423 -
424 -=== 1.3 Gaps / potential problems ===
425 -
426 -These are the main issues & missing areas I see:
427 -
428 -1. (((
429 -**Versioning text in chapter 5 is currently too thin (‘…’ placeholders)**
430 -
431 -* (((
432 -The spec does not yet //verbally// spell out:
433 -
434 -* the identity vs version pattern, systematically
435 -* how re-evaluation triggers are derived from version changes
436 -* how this aligns with federation (which versions are replicated where).
437 -)))
438 -)))
439 -1. (((
440 -**No explicit “provenance granularity” in the model**
441 -
442 -* (((
443 -EVIDENCE is a single entity. For more advanced use cases, you may later want:
444 -
445 -* EVIDENCE_SOURCE (the whole article/report/video)
446 -* EVIDENCE_FRAGMENT (specific paragraph/clip with its own reliability, quote, etc.)
447 -)))
448 -* For now, I’ll keep EVIDENCE/EVIDENCE_VERSION as is, but I’ll mention this as a possible extension.
449 -)))
450 -1. (((
451 -**Review target polymorphism**
452 -
453 -* (((
454 -REVIEW_ACTION can apply to multiple entity types. In the diagram this shows as multiple relationships:
455 -
456 -* CLAIM_VERSION → REVIEW_ACTION
457 -* SCENARIO_VERSION → REVIEW_ACTION
458 -* etc.
459 -)))
460 -* A more “pure” relational modeling would use a generic “subjectType + subjectId” or an intermediate “REVIEW_TARGET” table.
461 -* For readability, I’ll keep the simpler multi-edge representation and mention the polymorphism in text.
462 -)))
463 -1. (((
464 -**Federation details missing from core ERD**
465 -
466 -* There is no explicit FEDERATION_NODE / REPLICATION_LOG in the Data Model chapter.
467 -* This is ok for “core logical data model”, but I’ll add a short note that federation metadata is handled in the Federation chapter and via additional entities.
468 -)))
469 -1. (((
470 -**Automation / AKEL artifacts left implicit**
471 -
472 -* (((
473 -The Data Model chapter currently doesn’t describe:
474 -
475 -* AKEL task queues
476 -* extraction runs
477 -* model versions
478 -)))
479 -* That’s fine for now; I’ll just clarify that those belong to a “Processing / AKEL” submodel, not the core logical data model.
480 -)))