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

Version 1.1 by Robert Schaub on 2026/01/20 21:40

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 * Job creation and completion timestamps
33 * Job execution events (start, progress, errors)
34 * No entity-level versioning
35 * No user attribution (no user system)
36
37 = Target Architecture (Future) =
38
39 {{mermaid}}
40
41 erDiagram
42 USERS ||--o{ EDITS : makes
43 CLAIMS ||--o{ EDITS : tracks
44 EVIDENCE ||--o{ EDITS : tracks
45 SOURCES ||--o{ EDITS : tracks
46 KEY_FACTORS ||--o{ EDITS : tracks
47
48 USERS {
49 uuid id PK
50 text name
51 text email
52 }
53
54 CLAIMS {
55 uuid id PK
56 text text
57 }
58
59 EVIDENCE {
60 uuid id PK
61 uuid claim_id FK
62 }
63
64 SOURCES {
65 uuid id PK
66 text name
67 }
68
69 KEY_FACTORS {
70 uuid id PK
71 uuid claim_id FK
72 text question
73 }
74
75 EDITS {
76 uuid id PK
77 text entity_type
78 uuid entity_id
79 uuid user_id FK
80 text change_type
81 boolean is_automated
82 jsonb changes
83 text reason
84 timestamp created_at
85 }
86
87 {{/mermaid}}
88
89 **Target features:**
90 * Full entity versioning (Claims, Evidence, Sources, KeyFactors)
91 * User attribution for all changes
92 * AKEL vs human edit distinction
93 * Hot/cold storage tiering (PostgreSQL + S3)
94
95 See [[Data Model>>FactHarbor.Specification.Data Model.WebHome]] for complete target architecture.