* fix: wire setLogBasePath into engine init to resurrect audit log
_auditBasePath was always null — setLogBasePath() existed but was never
called from any production code path. Every logWarning/logError call hit
the if (_auditBasePath) guard as false, so nothing was ever written to
.gsd/audit-log.jsonl.
Two independent fixes:
1. Remove _auditBasePath = null from _resetLogs() — the base path must
survive unit resets, it's stable for process lifetime
2. Call setLogBasePath(base) after s.basePath = base in both the fresh-
start path (bootstrapAutoSession) and the resume path (startAuto)
Adds two tests verifying disk persistence and that _resetLogs doesn't
kill the audit path.
Fixes#2722
* refactor: clean up audit log tests and avoid redundant mkdirSync
- Use makeTempDir/cleanup from test-utils.ts instead of inline mkdtempSync/rmSync
- Add afterEach in audit describe block to reset _auditBasePath via
setLogBasePath("") — prevents state bleed into subsequent tests since
_resetLogs() no longer clears it
- Drop four raw imports (mkdtempSync, rmSync, tmpdir — join was already used)
- Guard mkdirSync in _push() with _auditDirEnsured flag — was calling
mkdirSync on every log entry; now called once per base path
* revert: remove _auditDirEnsured flag
mkdirSync({ recursive: true }) on an existing dir is a cheap stat, not
meaningful overhead on a low-frequency warn/error path. The flag added
mutable state for no real gain.