Changes for page Data Model (From Specification Chat)
Last modified by Robert Schaub on 2025/12/24 20:35
From version 8.2
edited by Robert Schaub
on 2025/11/27 23:15
on 2025/11/27 23:15
Change comment:
There is no comment for this version
To version 2.1
edited by Robert Schaub
on 2025/11/27 12:05
on 2025/11/27 12:05
Change comment:
There is no comment for this version
Summary
-
Page properties (1 modified, 0 added, 0 removed)
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,13 +61,6 @@ 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 -= Core Data Model ERD (Versioned) = 68 - 69 -This diagram shows the full core data model with all versioned entities. 70 - 71 71 {{mermaid}} 72 72 erDiagram 73 73 CLAIM_CLUSTER { ... ... @@ -158,14 +158,9 @@ 158 158 159 159 SCENARIO ||--o{ VERDICT : assessed 160 160 VERDICT ||--o{ VERDICT_VERSION : versions 150 + 161 161 {{/mermaid}} 162 162 163 -{{info}} 164 -All key entities are explicitly versioned here (…VERSION tables). 165 -This reflects the versioning requirements in the textual Data Model chapter. 166 -{{/info}} 167 - 168 - 169 169 **Important points:** 170 170 171 171 * Scenarios and Evidence are **linked via their versions** ... ... @@ -178,7 +178,7 @@ 178 178 179 179 ---- 180 180 181 -= 5.3 Data Use & Review ERD = 165 += 5.3 Data Use & Review ERD (expanded, versioned) = 182 182 183 183 The **Data Use** model captures who does what with which versioned data: 184 184 ... ... @@ -186,165 +186,87 @@ 186 186 * Roles and role assignments 187 187 * Review actions on versioned entities 188 188 189 -{{comment}} Data Use ERD (Mermaid, from /Specification/Diagrams/Data Use ERD) {{/comment}} 190 -{{include document="FactHarbor.Playground.Data Use ERD Page (from Specification chat).WebHome" reference="FactHarbor.Playground.data.Data Use ERD Page (from Specification chat).WebHome"/}} 191 - 192 -= Data Use ERD (Roles, Review & Versioned Entities) = 193 - 194 -This diagram shows how users, roles, and review actions relate to the 195 -versioned core entities. 196 - 197 197 {{mermaid}} 198 198 erDiagram 199 - %% Core clusters shown for context 200 - CLAIM_CLUSTER { 201 - string ClusterID PK 202 - string EmbeddingVectorRef 203 - string Theme 204 - } 205 205 206 - CLAIM { 207 - string ClaimID PK 208 - string ClusterID FK 209 - string Status 210 - datetime CreatedAt 176 + USER { 177 + string userId 178 + string displayName 179 + string email 180 + string userType %% "human" or "technical" 181 + datetime createdAt 211 211 } 212 212 213 - CLAIM_VERSION { 214 - string ClaimVersionID PK 215 - string ClaimID FK 216 - string Text 217 - string ClaimType 218 - string Domain 219 - datetime CreatedAt 184 + TECHNICAL_USER { 185 + string technicalUserId 186 + string userIdFk 187 + string description 188 + string systemIdentifier 220 220 } 221 221 222 - SCENARIO {223 - string ScenarioID PK224 - string C laimID FK225 - string Name226 - datetimeCreatedAt191 + ROLE { 192 + string roleId 193 + string code %% e.g. READER, CONTRIBUTOR, REVIEWER, TRUSTED_CONTRIBUTOR, MODERATOR, SYSTEM_ADMIN, FEDERATION_OPERATOR, FEDERATION_ADMIN 194 + string description 195 + boolean isFederationRole 227 227 } 228 228 229 - SCENARIO_VERSION { 230 - string ScenarioVersionID PK 231 - string ScenarioID FK 232 - string Definitions 233 - string Assumptions 234 - string Boundaries 235 - datetime CreatedAt 198 + USER_ROLE_MEMBERSHIP { 199 + string membershipId 200 + string userIdFk 201 + string roleIdFk 202 + datetime grantedAt 203 + string grantedByUserIdFk 236 236 } 237 237 238 - EVIDENCE { 239 - string EvidenceID PK 240 - string SourceType 241 - string URL 242 - float ReliabilityScore 206 + REVIEW_ACTION { 207 + string reviewActionId 208 + string subjectType %% e.g. CLAIM_VERSION, SCENARIO_VERSION... 209 + string subjectVersionId 210 + string actionType %% APPROVE, REJECT, FLAG, COMMENT, REQUEST_CHANGES... 211 + string outcome %% ACCEPTED, REJECTED, ESCALATED... 212 + string comment 213 + string createdByUserIdFk 214 + datetime createdAt 243 243 } 244 244 245 - EVIDENCE_VERSION { 246 - string EvidenceVersionID PK 247 - string EvidenceID FK 248 - string Summary 249 - float ReliabilityScore 250 - datetime CreatedAt 251 - } 217 + %% Versioned data entities (references from the core model) 252 252 253 - VERDICT { 254 - string VerdictID PK 255 - string ScenarioID FK 219 + CLAIM_VERSION { 220 + string claimVersionId 256 256 } 257 257 258 - VERDICT_VERSION { 259 - string VerdictVersionID PK 260 - string VerdictID FK 261 - float Verdict 262 - float Confidence 263 - string Reasoning 264 - datetime CreatedAt 223 + SCENARIO_VERSION { 224 + string scenarioVersionId 265 265 } 266 266 267 - %% Users and roles 268 - USER { 269 - string UserID PK 270 - string Handle 271 - string Email 227 + EVIDENCE_VERSION { 228 + string evidenceVersionId 272 272 } 273 273 274 - TECHNICAL_USER { 275 - string UserID PK 276 - string SystemName 231 + SCENARIO_EVIDENCE_LINK_VERSION { 232 + string scenarioEvidenceLinkVersionId 277 277 } 278 278 279 - CONTRIBUTING_USER { 280 - string UserID PK 281 - string DisplayName 235 + VERDICT_VERSION { 236 + string verdictVersionId 282 282 } 283 283 284 - TRUSTED_CONTRIBUTOR { 285 - string UserID PK 286 - string TrustLevel 287 - } 239 + %% Relationships 288 288 289 - REVIEWER { 290 - string UserID PK 291 - string Domain 292 - } 241 + USER ||--o{ TECHNICAL_USER : may_be 242 + USER ||--o{ USER_ROLE_MEMBERSHIP : has_role 243 + ROLE ||--o{ USER_ROLE_MEMBERSHIP : assigned_to 293 293 294 - EXPERT { 295 - string UserID PK 296 - string ExpertiseArea 297 - } 298 - 299 - FEDERATION_NODE { 300 - string NodeID PK 301 - string Region 302 - } 303 - 304 - FEDERATION_ADMIN { 305 - string UserID PK 306 - string Permissions 307 - } 308 - 309 - REVIEW_ACTION { 310 - string ReviewActionID PK 311 - string UserID FK 312 - string TargetEntityType 313 - string TargetEntityVersionID 314 - string ActionType 315 - string Comment 316 - datetime Timestamp 317 - } 318 - 319 - %% Inheritance / specialization (modelled as relationships) 320 - USER ||--o{ TECHNICAL_USER : "is a" 321 - USER ||--o{ CONTRIBUTING_USER : "is a" 322 - 323 - CONTRIBUTING_USER ||--o{ TRUSTED_CONTRIBUTOR : "subset" 324 - CONTRIBUTING_USER ||--o{ REVIEWER : "subset" 325 - CONTRIBUTING_USER ||--o{ EXPERT : "subset" 326 - 327 - TECHNICAL_USER ||--o{ FEDERATION_NODE : "operates" 328 - TECHNICAL_USER ||--o{ FEDERATION_ADMIN : "administers" 329 - 330 - %% Review actions on versioned entities 331 331 USER ||--o{ REVIEW_ACTION : performs 332 332 333 - REVIEW_ACTION }o--|| CLAIM_VERSION : reviews 334 - REVIEW_ACTION }o--|| SCENARIO_VERSION : reviews 335 - REVIEW_ACTION }o--|| EVIDENCE_VERSION : reviews 336 - REVIEW_ACTION }o--|| VERDICT_VERSION : reviews 247 + CLAIM_VERSION ||--o{ REVIEW_ACTION : is_reviewed_in 248 + SCENARIO_VERSION ||--o{ REVIEW_ACTION : is_reviewed_in 249 + EVIDENCE_VERSION ||--o{ REVIEW_ACTION : is_reviewed_in 250 + SCENARIO_EVIDENCE_LINK_VERSION ||--o{ REVIEW_ACTION : is_reviewed_in 251 + VERDICT_VERSION ||--o{ REVIEW_ACTION : is_reviewed_in 337 337 {{/mermaid}} 338 338 339 -{{info}} 340 -This diagram focuses on *who* uses and reviews *which* versioned entities. 341 -USER is the base type; TECHNICAL_USER and CONTRIBUTING_USER are specializations. 342 -Other roles (REVIEWER, EXPERT, TRUSTED_CONTRIBUTOR, FEDERATION_ADMIN, FEDERATION_NODE) 343 -are modelled as specializations or technical subtypes. 344 -{{/info}} 345 - 346 - 347 - 348 348 Notes: 349 349 350 350 * Most roles (READER, CONTRIBUTOR, TRUSTED_CONTRIBUTOR, REVIEWER, MODERATOR, ... ... @@ -374,7 +374,7 @@ 374 374 * It may inherit some links from earlier scenarios, or start empty depending 375 375 on the change classification (cosmetic vs. conceptual). 376 376 * All verdicts for that scenario are recalculated and stored as new 377 -{{code}}VERDICT_VERSION{{/code}} entries. 283 + {{code}}VERDICT_VERSION{{/code}} entries. 378 378 379 379 * REVIEW_ACTIONs are always attached to the **exact version** that was seen by 380 380 the reviewer. This preserves a faithful audit trail if data later changes. ... ... @@ -411,191 +411,3 @@ 411 411 Federation-specific entities (such as {{code}}FEDERATION_NODE{{/code}}, 412 412 replication logs, and trust rules) are described in the Federation & 413 413 Decentralization chapter and build on top of the core data model defined here. 414 - 415 - 416 - 417 -USER 418 -├── TECHNICAL_USER 419 -│ ├── FEDERATION_ADMIN 420 -│ └── AKEL_AGENT (optional future) 421 - 422 -READER 423 -└── CONTRIBUTING_USER 424 - ├── TRUSTED_CONTRIBUTOR 425 - ├── REVIEWER 426 - ├── EXPERT 427 - ├── MODERATOR 428 - 429 - 430 -ADMIN 431 - 432 -FEDERATION_ADMIN (administrative, but human) 433 - 434 - 435 -== 1. Overall analysis & review of the data model == 436 - 437 -=== 1.1 Strengths of the current design === 438 - 439 -* ((( 440 -**Identity vs. version pattern** 441 -Using base entities plus version entities (CLAIM + CLAIM_VERSION, SCENARIO + SCENARIO_VERSION, etc.) is exactly how modern knowledge systems handle: 442 - 443 -* auditability 444 -* time evolution 445 -* re-evaluation triggers 446 -* federation and partial replication 447 -))) 448 -* ((( 449 -**Scenario-centric reasoning** 450 -Separating //Claim// (what people argue about) from //Scenario// (interpretive frame) is very aligned with “truth landscape” style systems: 451 - 452 -* Scenarios explain //why people disagree//. 453 -* Verdicts are tied to specific scenario versions → avoids mixing incompatible assumptions. 454 -))) 455 -* **Evidence and verdicts as first-class entities** 456 -Evidence is explicit, linked to scenarios, and verdicts are per scenario. This matches good practice from fact-checking, scientific assessment panels, and trust graphs. 457 -* ((( 458 -**Cluster level (CLAIM_CLUSTER)** 459 -Grouping related claims avoids duplication and lets you: 460 - 461 -* reuse scenarios across paraphrases 462 -* share embeddings / semantic search 463 -* keep the system scalable as the corpus grows. 464 -))) 465 -* ((( 466 -**Explicit review layer (REVIEW_ACTION, roles, etc.)** 467 -Separating “data” from “who reviewed what” keeps the model clean, and is exactly what you want for: 468 - 469 -* governance 470 -* permissions 471 -* audit trails 472 -* future trust scoring per user / role. 473 -))) 474 - 475 ----- 476 - 477 -=== 1.2 Design decisions I’m locking in (based on our discussions) === 478 - 479 -To make the model consistent and “state-of-the-art”, I will assume the following as //current intended design//: 480 - 481 -1. ((( 482 -**Claims vs Scenarios** 483 - 484 -* CLAIM is the stable identity for “what people argue about”. 485 -* CLAIM_VERSION are individual phrasings / formulations / metadata. 486 -* ((( 487 -SCENARIO belongs to a **CLAIM**, not to a specific CLAIM_VERSION. 488 -Rationale: 489 - 490 -* Many different phrasings share the //same// scenario. 491 -* You avoid duplicating scenarios per wording. 492 -))) 493 -* SCENARIO_VERSION holds detailed definitions, assumptions, boundaries, etc. 494 -))) 495 -1. ((( 496 -**Version-specific reasoning** 497 - 498 -* **Verdicts** are always attached to SCENARIO_VERSION (not base SCENARIO). 499 -* **Evidence links** are between SCENARIO_VERSION and EVIDENCE_VERSION. 500 -→ This is what we agreed when we said //“SCENARIO_EVIDENCE_LINK should link the respective versions instead”//. 501 -))) 502 -1. ((( 503 -**Clusters** 504 - 505 -* CLAIM_CLUSTER groups Claims (semantically close claims). 506 -* It is visible in **both diagrams** (Core Data Model and Data Use). 507 -))) 508 -1. ((( 509 -**Review vs data** 510 - 511 -* ((( 512 -All review happens **on versioned entities**: 513 - 514 -* CLAIM_VERSION 515 -* SCENARIO_VERSION 516 -* EVIDENCE_VERSION 517 -* SCENARIO_EVIDENCE_LINK_VERSION 518 -* VERDICT_VERSION 519 -))) 520 -* REVIEW_ACTION is the generic log of //who// did //what// on //which version//. 521 -))) 522 -1. ((( 523 -**Users & roles** 524 - 525 -* USER has an attribute (or a linked entity) that distinguishes **technical users** from normal accounts. 526 -* We //keep// TECHNICAL_USER as a specialisation of USER (strictly technical accounts). 527 -* All human & technical accounts can hold roles via USER_ROLE_MEMBERSHIP. 528 -* ((( 529 -Roles include: 530 - 531 -* READER 532 -* CONTRIBUTOR 533 -* TRUSTED_CONTRIBUTOR 534 -* REVIEWER 535 -* MODERATOR 536 -* SYSTEM_ADMIN / MAINTAINER 537 -* FEDERATION_OPERATOR 538 -* FEDERATION_ADMIN 539 -(all present in the Data Use ERD, but as rows of ROLE rather than separate entities). 540 -))) 541 -))) 542 - 543 ----- 544 - 545 -=== 1.3 Gaps / potential problems === 546 - 547 -These are the main issues & missing areas I see: 548 - 549 -1. ((( 550 -**Versioning text in chapter 5 is currently too thin (‘…’ placeholders)** 551 - 552 -* ((( 553 -The spec does not yet //verbally// spell out: 554 - 555 -* the identity vs version pattern, systematically 556 -* how re-evaluation triggers are derived from version changes 557 -* how this aligns with federation (which versions are replicated where). 558 -))) 559 -))) 560 -1. ((( 561 -**No explicit “provenance granularity” in the model** 562 - 563 -* ((( 564 -EVIDENCE is a single entity. For more advanced use cases, you may later want: 565 - 566 -* EVIDENCE_SOURCE (the whole article/report/video) 567 -* EVIDENCE_FRAGMENT (specific paragraph/clip with its own reliability, quote, etc.) 568 -))) 569 -* For now, I’ll keep EVIDENCE/EVIDENCE_VERSION as is, but I’ll mention this as a possible extension. 570 -))) 571 -1. ((( 572 -**Review target polymorphism** 573 - 574 -* ((( 575 -REVIEW_ACTION can apply to multiple entity types. In the diagram this shows as multiple relationships: 576 - 577 -* CLAIM_VERSION → REVIEW_ACTION 578 -* SCENARIO_VERSION → REVIEW_ACTION 579 -* etc. 580 -))) 581 -* A more “pure” relational modeling would use a generic “subjectType + subjectId” or an intermediate “REVIEW_TARGET” table. 582 -* For readability, I’ll keep the simpler multi-edge representation and mention the polymorphism in text. 583 -))) 584 -1. ((( 585 -**Federation details missing from core ERD** 586 - 587 -* There is no explicit FEDERATION_NODE / REPLICATION_LOG in the Data Model chapter. 588 -* 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. 589 -))) 590 -1. ((( 591 -**Automation / AKEL artifacts left implicit** 592 - 593 -* ((( 594 -The Data Model chapter currently doesn’t describe: 595 - 596 -* AKEL task queues 597 -* extraction runs 598 -* model versions 599 -))) 600 -* That’s fine for now; I’ll just clarify that those belong to a “Processing / AKEL” submodel, not the core logical data model. 601 -)))