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.
| Column | Contents |
|---|---|
ts | Decision time, millisecond precision. |
station | Station name. |
tool, lane | The action picked and the policy lane it landed in. |
latency_ms | Time from burst to decision. |
pii_counts | How many emails, IPs, VINs, tokens and usernames were redacted. |
log_sha256 | Hash of the raw window. The raw text itself is not stored in the report. |
prev_hash, hash | Links 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.
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).
nightwatch report export --since 30d --out ./nightwatch-november.csv