Changes for page Data Model

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

From version 5.1
edited by Robert Schaub
on 2025/12/14 22:27
Change comment: Imported from XAR
To version 6.3
edited by Robert Schaub
on 2025/12/16 20:26
Change comment: Update document after refactoring.

Summary

Details

Page properties
Parent
... ... @@ -1,1 +1,1 @@
1 -FactHarbor.Specification.WebHome
1 +FactHarbor.Archive.FactHarbor V0\.9\.18.Specification.WebHome
Content
... ... @@ -1,6 +1,6 @@
1 1  = Data Model =
2 2  
3 -This page describes the current data model for FactHarbor.
3 +This page describes the current data model for FactHarbor v0.9.1.
4 4  
5 5  == Versioning Strategy ==
6 6  
... ... @@ -42,93 +42,141 @@
42 42  * **ParentVersionID**: Link to previous version (null for first version)
43 43  * **CreatedAt**: Timestamp (ISO 8601, UTC)
44 44  * **AuthorType**: Human | AI | ExternalNode
45 +* **CreatedBy**: Foreign key to User or TechnicalUser
45 45  * **JustificationText**: Brief explanation of changes
47 +* **PublicationMode**: Mode1 (draft) | Mode2 (AI-published) | Mode3 (human-reviewed)
48 +* **ReviewStatus**: Workflow state (draft|in_review|approved|rejected)
49 +* **NodeOrigin**: Node ID where version was created (for federation)
46 46  * **SignatureHash**: Cryptographic signature (Release 1.0)
47 47  
48 48  ----
49 49  
50 -== Core Data Model Refinements ==
54 +== Core Entity Definitions ==
51 51  
56 +=== User Entities ===
57 +
58 +**USER** (base user table):
59 +* ``UserID`` (PK)
60 +* ``UserType`` (Reader|Contributor|Reviewer|Auditor|Expert|Moderator|Maintainer)
61 +* ``DisplayName``
62 +* ``Email`` (for Contributors and above)
63 +* ``RegisteredAt``
64 +* ``LastActive``
65 +* ``Status`` (active|suspended|banned)
66 +
67 +**TECHNICAL_USER** (system processes):
68 +* ``SystemID`` (PK)
69 +* ``SystemName``
70 +* ``Purpose`` (AKEL|FederationSync|BackupService|Monitor|Audit)
71 +* ``CreatedBy`` (FK to Maintainer who created this system user)
72 +* ``CreatedAt``
73 +* ``Status`` (active|paused|deprecated)
74 +* ``ApiKey`` (encrypted)
75 +* ``Permissions`` (JSON - authorized operations)
76 +
77 +**Examples of Technical Users**:
78 +* AKEL instances (AI processing)
79 +* Federation sync bots
80 +* Scheduled audit tasks
81 +* Backup services
82 +* Monitoring systems
83 +* External API integrations
84 +
85 +----
86 +
87 +=== Content Entities ===
88 +
52 52  The system relies on the following versioned core entities:
53 53  
54 -* **CLAIM_CLUSTER**
55 -** ``ClusterID`` (PK), ``EmbeddingVectorRef``, ``Theme``
56 -** Groups related claims into topical clusters.
57 -** One Cluster has many Claims.
58 -** A Claim belongs to exactly one primary cluster.
91 +**CLAIM_CLUSTER**:
92 +* ``ClusterID`` (PK)
93 +* ``EmbeddingVectorRef``
94 +* ``Theme``
95 +* Groups related claims into topical clusters
96 +* One Cluster has many Claims
97 +* A Claim belongs to exactly one primary cluster
59 59  
60 -* **CLAIM / CLAIM_VERSION**
61 -** ``CLAIM`` is the long‑lived anchor for a real‑world claim.
62 -** ``CLAIM_VERSION`` is an immutable snapshot that includes:
63 -*** ``ClaimID`` (FK to CLAIM)
64 -*** ``VersionID`` (PK)
65 -*** ``ParentVersionID`` (FK to prior version, nullable)
66 -*** ``Text``
67 -*** ``Domain``
68 -*** ``ClaimType`` (literal, metaphorical, rhetorical, supernatural...)
69 -*** ``Evaluability`` (empirical, subjective, non-falsifiable)
70 -*** ``SafetyCategory`` (low, medium, high)
71 -*** ``CreatedAt``, ``AuthorType``, ``JustificationText``
72 -*** ``Status`` (active, superseded, merged)
99 +**CLAIM / CLAIM_VERSION**:
100 +* ``CLAIM`` is the long-lived anchor for a real-world claim
101 +* ``CLAIM_VERSION`` is an immutable snapshot that includes:
102 + * ``VersionID`` (PK)
103 + * ``ClaimID`` (FK to CLAIM)
104 + * ``ParentVersionID`` (FK to prior version, nullable)
105 + * ``Text``
106 + * ``Domain``
107 + * ``ClaimType`` (literal|metaphorical|rhetorical|supernatural)
108 + * ``Evaluability`` (empirical|subjective|non-falsifiable)
109 + * ``RiskTier`` (A|B|C) - replaced SafetyCategory for consistency
110 + * ``PublicationMode`` (Mode1|Mode2|Mode3)
111 + * ``ReviewStatus`` (draft|in_review|approved|rejected)
112 + * ``CreatedAt``, ``AuthorType``, ``CreatedBy``, ``JustificationText``
113 + * ``NodeOrigin``, ``SignatureHash``
114 + * ``Status`` (active|superseded|merged)
73 73  
74 -* **SCENARIO / SCENARIO_VERSION**
75 -** ``SCENARIO`` is the anchor for a scenario across time.
76 -** ``SCENARIO_VERSION`` is an immutable snapshot:
77 -*** ``ScenarioID`` (FK to SCENARIO)
78 -*** ``VersionID`` (PK)
79 -*** ``ParentVersionID``
80 -*** ``ClaimID`` (FK to CLAIM)
81 -*** ``Definitions``
82 -*** ``Boundaries``
83 -*** ``Assumptions``
84 -*** ``Context``
85 -*** ``EvaluationMethod``
86 -*** ``SafetyClass``
87 -*** ``CreatedAt``, ``AuthorType``, ``JustificationText``
88 -*** ``Status`` (active, superseded, deprecated)
116 +**SCENARIO / SCENARIO_VERSION**:
117 +* ``SCENARIO`` is the anchor for a scenario across time
118 +* ``SCENARIO_VERSION`` is an immutable snapshot:
119 + * ``VersionID`` (PK)
120 + * ``ScenarioID`` (FK to SCENARIO)
121 + * ``ParentVersionID``
122 + * ``ClaimID`` (FK to CLAIM)
123 + * ``Definitions`` (JSON)
124 + * ``Boundaries`` (JSON)
125 + * ``Assumptions`` (JSON)
126 + * ``Context`` (text)
127 + * ``EvaluationMethod`` (text)
128 + * ``PublicationMode`` (Mode1|Mode2|Mode3)
129 + * ``ReviewStatus`` (draft|in_review|approved|rejected)
130 + * ``CreatedAt``, ``AuthorType``, ``CreatedBy``, ``JustificationText``
131 + * ``NodeOrigin``, ``SignatureHash``
132 + * ``Status`` (active|superseded|deprecated)
89 89  
90 -* **EVIDENCE / EVIDENCE_VERSION**
91 -** ``EVIDENCE`` is the anchor.
92 -** ``EVIDENCE_VERSION`` is the versioned snapshot:
93 -*** ``EvidenceID`` (FK to EVIDENCE)
94 -*** ``VersionID`` (PK)
95 -*** ``ParentVersionID``
96 -*** ``Type`` (paper, dataset, report, transcript, expert...)
97 -*** ``Category`` (empirical, historical, rhetorical, dataset, meta-analysis...)
98 -*** ``Reliability`` (low/med/high)
99 -*** ``Provenance`` (URL, DOI, source metadata)
100 -*** ``ExtractionMethod`` (manual, OCR, API, AKEL)
101 -*** ``CreatedAt``, ``AuthorType``, ``JustificationText``
102 -*** ``Status`` (verified, updated, disputed, retracted, superseded)
134 +**Note**: SafetyClass removed from Scenario - risk tier is at claim level
103 103  
104 -* **VERDICT / VERDICT_VERSION**
105 -** ``VERDICT`` is the anchor.
106 -** ``VERDICT_VERSION`` is the snapshot:
107 -*** ``VerdictID`` (FK to VERDICT)
108 -*** ``VersionID`` (PK)
109 -*** ``ParentVersionID``
110 -*** ``ClaimID`` (FK to CLAIM)
111 -*** ``ScenarioID`` (FK to SCENARIO)
112 -*** ``EvidenceVersionSet`` (list of evidence version IDs used)
113 -*** ``LikelihoodRange`` (0–1, with uncertainty bounds)
114 -*** ``ExplanationChain``
115 -*** ``UncertaintyFactors``
116 -*** ``CreatedAt``, ``AuthorType``, ``JustificationText``
117 -*** ``Status`` (current, outdated, superseded, retracted)
136 +**EVIDENCE / EVIDENCE_VERSION**:
137 +* ``EVIDENCE`` is the anchor
138 +* ``EVIDENCE_VERSION`` is the versioned snapshot:
139 + * ``VersionID`` (PK)
140 + * ``EvidenceID`` (FK to EVIDENCE)
141 + * ``ParentVersionID``
142 + * ``Type`` (paper|dataset|report|transcript|expert|media)
143 + * ``Category`` (empirical|historical|rhetorical|dataset|meta-analysis)
144 + * ``Reliability`` (low|medium|high)
145 + * ``Provenance`` (URL, DOI, source metadata)
146 + * ``ExtractionMethod`` (manual|OCR|API|AKEL)
147 + * ``ContentHash`` (SHA256 of evidence content)
148 + * ``PublicationMode`` (Mode1|Mode2|Mode3)
149 + * ``ReviewStatus`` (draft|verified|disputed|retracted)
150 + * ``CreatedAt``, ``AuthorType``, ``CreatedBy``, ``JustificationText``
151 + * ``NodeOrigin``, ``SignatureHash``
152 + * ``Status`` (active|superseded)
118 118  
154 +**VERDICT / VERDICT_VERSION**:
155 +* ``VERDICT`` is the anchor
156 +* ``VERDICT_VERSION`` is the snapshot:
157 + * ``VersionID`` (PK)
158 + * ``VerdictID`` (FK to VERDICT)
159 + * ``ParentVersionID``
160 + * ``ClaimID`` (FK to CLAIM)
161 + * ``ScenarioVersionID`` (FK to specific SCENARIO_VERSION)
162 + * ``EvidenceVersionSet`` (JSON array of Evidence VersionIDs used)
163 + * ``LikelihoodRange`` (0–1, with uncertainty bounds)
164 + * ``ExplanationChain`` (JSON)
165 + * ``UncertaintyFactors`` (JSON)
166 + * ``PublicationMode`` (Mode1|Mode2|Mode3)
167 + * ``ReviewStatus`` (draft|in_review|approved|retracted)
168 + * ``CreatedAt``, ``AuthorType``, ``CreatedBy``, ``JustificationText``
169 + * ``NodeOrigin``, ``SignatureHash``
170 + * ``Status`` (current|outdated|superseded|retracted)
171 +
119 119  ----
120 120  
121 121  == Many-to-Many Linking Tables ==
122 122  
123 -=== ScenarioEvidenceLink ===
124 -
125 -Links scenario versions to evidence versions with relevance scoring.
126 -
127 -**Fields**:
128 -* ``ScenarioID``
129 -* ``ScenarioVersionID``
130 -* ``EvidenceID``
131 -* ``EvidenceVersionID``
176 +**ScenarioEvidenceLink**:
177 +* Links scenario versions to evidence versions with relevance scoring
178 +* ``ScenarioID``, ``ScenarioVersionID``
179 +* ``EvidenceID``, ``EvidenceVersionID``
132 132  * ``RelevanceScore`` (0–1) - How relevant this evidence is to this scenario
133 133  * ``LinkJustification`` - Brief explanation of relevance
134 134  
... ... @@ -138,22 +138,34 @@
138 138  * Relevance scoring helps prioritize evidence
139 139  * Version-specific linking preserves historical accuracy
140 140  
141 -=== ClaimCluster ===
142 -
143 -Semantic clustering of similar claims.
144 -
145 -**Fields**:
189 +**ClaimCluster**:
190 +* Semantic clustering of similar claims
146 146  * ``ClusterID`` (PK)
147 147  * ``EmbeddingVector`` - Vector representation for semantic search
148 148  * ``MemberList`` - List of ClaimIDs in this cluster
149 149  * ``Theme`` - Human-readable theme description
150 150  
151 -**Purpose**:
152 -* Groups semantically similar claims
153 -* Enables efficient search and discovery
154 -* Supports cross-node claim alignment
155 -* Reduces duplication
196 +----
156 156  
198 +== Key Changes in v0.9.1 ==
199 +
200 +**Updated Field Names**:
201 +* `SafetyCategory` → `RiskTier` (consistency with risk tier system A/B/C)
202 +* `SafetyClass` removed from Scenario (redundant with claim-level RiskTier)
203 +
204 +**Added Fields to All Version Entities**:
205 +* `PublicationMode` - Track Mode 1/2/3 status
206 +* `ReviewStatus` - Track workflow state
207 +* `NodeOrigin` - Federation provenance
208 +* `CreatedBy` - FK to User/TechnicalUser (clarified)
209 +
210 +**New Entity**:
211 +* `TECHNICAL_USER` - Separate system processes from human users
212 +
213 +**Clarifications**:
214 +* `ScenarioVersionID` in Verdict (not just ScenarioID) - links to specific version
215 +* `ContentHash` in Evidence - SHA256 for integrity checking
216 +
157 157  ----
158 158  
159 159  == Data Model Behavior ==
... ... @@ -161,7 +161,6 @@
161 161  === Late-Arriving Evidence ===
162 162  
163 163  When new evidence versions appear:
164 -
165 165  1. Existing verdicts marked as **outdated**
166 166  2. Scenario relevance must be re-evaluated
167 167  3. Re-evaluation engine triggers verdict recomputation
... ... @@ -168,97 +168,43 @@
168 168  4. New verdict versions created
169 169  5. Users notified of updates
170 170  
171 -**Process**:
172 -* New EvidenceVersion imported
173 -* System scans related ScenarioEvidenceLinks
174 -* Checks if evidence affects existing verdicts
175 -* Queues affected verdicts for re-evaluation
176 -* AKEL or reviewer creates new VerdictVersion
177 -* Old verdicts remain accessible (historical record)
178 -
179 179  === Scenario Evolution ===
180 180  
181 181  When a scenario's assumptions or definitions change:
182 -
183 -**Creates new scenario version** (not in-place update):
184 -* New ScenarioVersion with updated fields
185 -* ParentVersionID points to previous version
233 +* Creates new scenario version (not in-place update)
186 186  * All dependent verdicts must be recalculated
187 187  * Previous scenario versions remain accessible
236 +* Version lineage preserved
188 188  
189 -**Triggers**:
190 -* Refined definitions
191 -* Changed assumptions
192 -* Expanded or narrowed boundaries
193 -* Updated evaluation methods
194 -* Safety classification changes
195 -
196 -**Impact**:
197 -* Verdicts based on old scenario version remain valid (historical)
198 -* New verdicts required for new scenario version
199 -* Users can compare old vs new scenarios
200 -* Evidence links may need re-assessment
201 -
202 202  === Federated Nodes ===
203 203  
204 204  Each node may share partial data:
205 -
206 -**Claims and scenarios**: Shared if relevant to node's domain
207 -
208 -**Evidence metadata**: Shared, but not always full evidence files
209 -
210 -**Verdict lineage**: Shared only if not locally overridden
211 -
212 -**Version synchronization**:
213 -* Remote versions imported with provenance metadata
214 -* Conflicts detected via ParentVersionID comparison
241 +* Claims and scenarios shared if relevant
242 +* Evidence metadata shared, not always full files
243 +* Version synchronization via NodeOrigin tracking
215 215  * Branching allowed for divergent interpretations
216 -* Local node retains authority over local versions
217 217  
218 -**Trust and acceptance**:
219 -* Trusted nodes: auto-import versions
220 -* Neutral nodes: import but flag for review
221 -* Untrusted nodes: manual import only
222 -
223 223  ----
224 224  
225 -== Entity-Relationship Overview ==
248 +== Visual Diagrams ==
226 226  
227 -**Core relationships**:
250 +The following diagrams provide visual representations of the data model structure and relationships.
228 228  
229 -```
230 -CLAIM_CLUSTER (1) ──< (N) CLAIM
231 -CLAIM (1) ──< (N) CLAIM_VERSION
232 -CLAIM (1) ──< (N) SCENARIO
233 -SCENARIO (1) ──< (N) SCENARIO_VERSION
234 -SCENARIO_VERSION (N) ──< (N) EVIDENCE_VERSION [via ScenarioEvidenceLink]
235 -SCENARIO_VERSION (1) ──< (N) VERDICT_VERSION
236 -VERDICT_VERSION references specific EvidenceVersionSet
237 -```
252 +=== Core Data Model ERD ===
238 238  
239 -**Version chains**:
254 +{{include reference="Test.FactHarborV09.Specification.Diagrams.Core Data Model ERD.WebHome"/}}
240 240  
241 -Each entity has a version DAG:
242 -```
243 -Version 1 (ParentVersionID=null)
244 - ↓
245 -Version 2 (ParentVersionID=1)
246 - ↓
247 -Version 3 (ParentVersionID=2)
248 -```
256 +=== User Roles Structure ===
249 249  
250 -In federated environments, branching may occur:
251 -```
252 -Version 1
253 - ↓
254 -Version 2
255 - / ↓ ↓
256 -V3a V3b (parallel branches from different nodes)
257 -```
258 +{{include reference="Test.FactHarborV09.Specification.Diagrams.User Roles ERD.WebHome"/}}
258 258  
260 +=== Content Workflow ===
261 +
262 +{{include reference="Test.FactHarborV09.Specification.Diagrams.Content Workflow ERD.WebHome"/}}
263 +
259 259  ----
260 260  
261 -## Related Pages ==
266 +== Related Pages ==
262 262  
263 263  * [[Federation & Decentralization>>FactHarbor.Specification.Federation & Decentralization.WebHome]]
264 264  * [[AKEL (AI Knowledge Extraction Layer)>>FactHarbor.Specification.AI Knowledge Extraction Layer (AKEL).WebHome]]