Skip to content

Audit Trail

Tamper-proof SHA-256 chained audit trail for all GitWire decisions.

How It Works

Every significant GitWire action creates an immutable audit trail entry:

  1. The entry payload is serialized as JSON
  2. A SHA-256 hash is computed
  3. The prev_hash field links to the previous entry
  4. The entry is inserted and never updated or deleted
mermaid
graph LR
    E1[Entry 1] -->|prev_hash| E2[Entry 2]
    E2 -->|prev_hash| E3[Entry 3]
    E3 -->|prev_hash| E4[Entry 4]

Categories

CategoryEvents
ai_decisionTriage, CI diagnosis, fix generation
auto_mergeMerge queue operations
policy_bypassEnforcement exceptions
branch_ruleBranch protection changes
config_changeRepository configuration changes
vulnerability_dismissedSecurity advisory dismissals
quarantineFlaky test quarantine
healCI healing actions
rollbackMerge rollbacks
review_gateAI review decisions

Actor Types

TypeDescription
humanA GitHub user triggered the action
botGitWire bot account
systemScheduled/automated process

Chain Verification

bash
curl https://gitwire.yourdomain.com/api/audit/verify \
  -H "Authorization: Bearer YOUR_API_KEY"

Returns:

json
{
  "valid": true,
  "entries_checked": 142,
  "gaps": 0,
  "hash_mismatches": 0
}

PostgreSQL JSONB Normalization

PostgreSQL normalizes JSONB key order on storage, which means re-reading a payload produces a different string than the original. To handle this, chain verification checks prev_hash linkage (each entry points to the previous) rather than rehashing round-tripped payloads.

Querying the Audit Trail

bash
# All entries (paginated)
curl https://gitwire.yourdomain.com/api/audit/entries \
  -H "Authorization: Bearer YOUR_API_KEY"

# Statistics
curl https://gitwire.yourdomain.com/api/audit/stats \
  -H "Authorization: Bearer YOUR_API_KEY"

Export

bash
curl -X POST https://gitwire.yourdomain.com/api/audit/export \
  -H "Authorization: Bearer YOUR_API_KEY"

Compliance Frameworks

Each entry can tag relevant compliance frameworks:

FrameworkTag
SOC 2soc2
ISO 27001iso27001
GDPRgdpr
HIPAAhipaa

Compliance Reports

Released under the MIT License.