Operate / Reports & audit

Reports & audit

Every decision is stored in an embedded ClickHouse database on the device. Read it in the local console, query it with SQL, or export it for an audit.

Morning summary

Open http://127.0.0.1:8000 and choose Reports. You get the last 24 hours at a glance: incidents, what was handled automatically, what waited for a person, and what was escalated.

Where the data lives

The database sits in ~/.nightwatch/audit. Records are append-only and partitioned by month. Hourly rollups are kept for 90 days.

ColumnContents
tsDecision time, millisecond precision.
stationStation name.
tool, laneThe action picked and the policy lane it landed in.
latency_msTime from burst to decision.
pii_countsHow many emails, IPs, VINs, tokens and usernames were redacted.
log_sha256Hash of the raw window. The raw text itself is not stored in the report.
prev_hash, hashLinks each record to the one before it.

Query with SQL

Queries are read-only. Run them from the CLI or from the console's SQL tab.

shell
nightwatch query "SELECT tool, lane, count() AS n FROM triage WHERE ts > now() - INTERVAL 1 DAY GROUP BY tool, lane ORDER BY n DESC"

Verify the audit chain

Each record stores the SHA-256 hash of the previous one. If any record is edited or removed, verification points to the first broken link.

$ nightwatch audit verify
ok  88 of 88 records · chain intact since 2026-11-01

Export

Export a period to CSV for audits and team reviews. Exports include redacted summaries only (zero raw log text).

shell
nightwatch report export --since 30d --out ./nightwatch-november.csv