Audit log format

Every chat turn, every write, every approval — recorded in a SQLite database at %APPDATA%\HISAB\audit.db.

Schema

turns(
  id TEXT PRIMARY KEY,
  started_at INTEGER, finished_at INTEGER,
  workbook TEXT, user_email TEXT,
  prompt TEXT, completion TEXT,
  model TEXT, tokens_in INT, tokens_out INT
);

writes(
  id INTEGER PRIMARY KEY,
  turn_id TEXT,
  sheet TEXT, address TEXT,
  before TEXT, after TEXT,
  written_at INTEGER
);

approvals(
  id INTEGER PRIMARY KEY,
  turn_id TEXT,
  action TEXT, target TEXT,
  proposed_at INTEGER, decided_at INTEGER,
  decision TEXT  -- 'approved' | 'rejected'
);

Exporting for auditors

Settings → Audit → "Export period". Pick start + end date, output format (CSV, JSON, or PDF report). The export bundles turns, writes, and approvals into a single archive with a SHA-256 manifest.

Retention

Solo: 90 days local. Professional: 1 year local. Team: configurable, default 7 years. Enterprise: configurable + optional offsite backup to your S3 bucket.