- Flush buffer before appendAgentLogBatch to prevent rowid ordering inversion when callers interleave buffered and direct writes (P1) - Wrap size-triggered flush in try-catch for consistency with timer path - Move bumpLastModified inside transactions for atomicity - Expose db.path getter and include DB path in all flush error logs Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>