XRAPH/Work/Audit trail
Go · since 2026

Chronicle

An append-only audit log where every event carries the hash of the one before it, so an edit or a deletion breaks the chain and shows up in verification. Per-subject encryption means a GDPR erasure request destroys a key rather than a row, and the chain still verifies afterwards. Exports SOC 2, HIPAA and EU AI Act reports.

Language
Go
Category
Audit trail
Since
2026
Stars
0
Repository Docs
01

Highlights

3 claims
H.01
SHA-256
Every event linked

Each event carries the hash of its predecessor. Tampering with one breaks the chain, and the break is detectable.

H.02
Crypto-erasure
GDPR without a rewrite

Per-subject AES-256-GCM encryption. Destroying the key makes the data unrecoverable while the hash chain stays structurally valid.

H.03
Fourframeworks
Reports on request

SOC2, HIPAA, the EU AI Act and custom reports from one call, exported as JSON, CSV, Markdown or HTML.

02

What it does

6 entries

An audit log that can prove it was not edited, and can still forget a person when the law says it must.

02.1
Integrity

A hash chain over the events

Every event is linked by SHA-256 to the one before it. Editing an event in place breaks the chain, so the store cannot quietly disagree with its own history.

SHA-256
02.2
Erasure

Forget the subject, keep the proof

Each subject gets its own AES-256-GCM key. Destroying that key makes the subject unrecoverable while leaving the chain valid, which is the only way I found to satisfy both the auditor and the regulation.

AES-256-GCMGDPR
02.3
Reporting

Four frameworks from one call

SOC2, HIPAA, the EU AI Act and custom report shapes, exported as JSON, CSV, Markdown or HTML.

SOC2HIPAA
02.4
Tenancy

Stamped by middleware

Scope middleware writes the App and tenant onto every event, and query isolation follows from that, with no filter for a caller to forget.

Automatic
02.5
Plugins

Before and after record

Hooks enrich or drop events on the way in, and an alert handler fires in real time when severity or category matches.

HooksAlerts
02.6
Storage

In-memory to Postgres

Development runs in memory and production runs on Postgres or Bun ORM. A store of your own is about thirty-six methods.

Pluggable
03

Anatomy

3 modules
01

Chain

Hash-linked entries; tampering breaks the link.

02

Crypto-erasure

Deleting the key deletes the content, not the chain.

03

Query

Who did what to which record, answerable months later.

04

Why it exists

Design notes

#What it is

Chronicle is an immutable audit trail. Every event is linked to the one before it by SHA-256, so editing or deleting an event breaks the chain and shows up in verification.

It does not prevent tampering, since nothing prevents someone with database access from writing to the database. It makes tampering detectable, which is the property auditors are actually asking about.

#GDPR without breaking the chain

An append-only hash-linked log and a right to erasure are not compatible in their naive forms. Chronicle resolves it with per-subject AES-256-GCM encryption: personal data in an event is ciphertext under a key belonging to that data subject, and the key lives outside the log.

Destroy the key and the ciphertext stays exactly where it is with its hash unchanged, so the chain still verifies end to end, while the plaintext is unrecoverable.

You delete the key, not the record.

The catch is that key management becomes the whole problem, including backups of the key store, and that a key vault with a thirty-day soft-delete window quietly invalidates the claim.

#What else it does

  • Multi-tenant scoping from context, so cross-tenant queries are impossible rather than filtered.
  • Compliance reports for SOC 2 Type II, HIPAA, the EU AI Act and custom frameworks, exported to JSON, CSV, Markdown or HTML.
  • Pluggable stores: Postgres via pgx, Grove, SQLite, Redis as a cache layer, memory for tests.
  • Pluggable sinks for fire-and-forget outputs (stdout, file, S3, custom) that never block the pipeline.
  • Retention policies with scheduled archival and purge.
  • 21 admin endpoints covering events, verification, erasure, retention, compliance and stats.

#The design constraint

An audit event has a fixed shape: actor, action, resource, outcome, scope, timestamp. Every request to add a free-form field has been refused. That is why a compliance report is a query rather than a text-mining project.

05

Signals

GitHub
Stars
0
Language
Go
Since
2026
Adopters
00

Shipping something on Chronicle? Nobody is listed here yet. Tell me what you built and you will be the first.

Get listed