Wiki source code of Audit Trail (v2.6.33 + Target)

Last modified by Robert Schaub on 2026/02/08 08:31

Show last authors
1 {{warning}}
2 **Implementation Status (v2.6.33)** - Full audit trail with EDIT table is **not yet implemented**. Current implementation uses ##JobEvents## table for job execution logs and JSON blob storage (no versioned entities).
3 {{/warning}}
4
5 = Current Implementation =
6
7 {{mermaid}}
8
9 erDiagram
10 JOBS ||--o{ JOB_EVENTS : logs
11
12 JOBS {
13 int JobId_PK
14 string Status
15 datetime CreatedAt
16 datetime UpdatedAt
17 json ResultJson
18 text ReportMarkdown
19 }
20
21 JOB_EVENTS {
22 int Id_PK
23 int JobId_FK
24 datetime TsUtc
25 string Level
26 string Message
27 }
28
29 {{/mermaid}}
30
31 **Current audit capabilities:**
32
33 * Job creation and completion timestamps
34 * Job execution events (start, progress, errors)
35 * No entity-level versioning
36 * No user attribution (no user system)
37
38 = Target Architecture (Future) =
39
40 {{mermaid}}
41
42 erDiagram
43 USERS ||--o{ EDITS : makes
44 CLAIMS ||--o{ EDITS : tracks
45 EVIDENCE ||--o{ EDITS : tracks
46 SOURCES ||--o{ EDITS : tracks
47 KEY_FACTORS ||--o{ EDITS : tracks
48
49 USERS {
50 uuid id_PK
51 text name
52 text email
53 }
54
55 CLAIMS {
56 uuid id_PK
57 text text
58 }
59
60 EVIDENCE {
61 uuid id_PK
62 uuid claim_id_FK
63 }
64
65 SOURCES {
66 uuid id_PK
67 text name
68 }
69
70 KEY_FACTORS {
71 uuid id_PK
72 uuid claim_id_FK
73 text question
74 }
75
76 EDITS {
77 uuid id_PK
78 text entity_type
79 uuid entity_id
80 uuid user_id_FK
81 text change_type
82 boolean is_automated
83 jsonb changes
84 text reason
85 timestamp created_at
86 }
87
88 {{/mermaid}}
89
90 **Target features:**
91
92 * Full entity versioning (Claims, Evidence, Sources, KeyFactors)
93 * User attribution for all changes
94 * AKEL vs human edit distinction
95 * Hot/cold storage tiering (PostgreSQL + S3)
96
97 See [[Data Model>>Archive.FactHarbor 2026\.02\.08.Specification.Data Model.WebHome]] for complete target architecture.