Summary
setLogBasePath() in workflow-logger.ts is never called from any production code path. The entire persistent audit log feature (.gsd/audit-log.jsonl) silently does nothing.
Impact
Critical — The S2-T3 objective from the Single-Writer Engine v3 plan ("audit entries survive context resets") is undelivered despite the code being written.
All logWarning()/logError() calls go to stderr and the in-memory _buffer only. After context reset, every warning and error is gone. The forensics story promised by the engine is broken.
Root Cause
setLogBasePath(basePath) at workflow-logger.ts:56 exists and works correctly, but is called from zero production files. _auditBasePath stays null for the entire process lifetime.
- Every
_push() call at workflow-logger.ts:233 skips the if (_auditBasePath) branch — no entries are ever flushed to disk.
_resetLogs() at workflow-logger.ts:200-203 nulls out _auditBasePath even if it were somehow set, so the next unit start wipes the path. This field should be stable for the process lifetime.
Fix
- Call
setLogBasePath(basePath) in the engine init path — wherever openDatabase() is called or a basePath is first established.
- Change
_resetLogs() to only clear _buffer, not _auditBasePath.
Files
src/resources/extensions/gsd/workflow-logger.ts — lines 56, 200-203, 233
Confidence
97% — verified via codebase-wide search for setLogBasePath references.
Summary
setLogBasePath()inworkflow-logger.tsis never called from any production code path. The entire persistent audit log feature (.gsd/audit-log.jsonl) silently does nothing.Impact
Critical — The S2-T3 objective from the Single-Writer Engine v3 plan ("audit entries survive context resets") is undelivered despite the code being written.
All
logWarning()/logError()calls go to stderr and the in-memory_bufferonly. After context reset, every warning and error is gone. The forensics story promised by the engine is broken.Root Cause
setLogBasePath(basePath)atworkflow-logger.ts:56exists and works correctly, but is called from zero production files._auditBasePathstaysnullfor the entire process lifetime._push()call atworkflow-logger.ts:233skips theif (_auditBasePath)branch — no entries are ever flushed to disk._resetLogs()atworkflow-logger.ts:200-203nulls out_auditBasePatheven if it were somehow set, so the next unit start wipes the path. This field should be stable for the process lifetime.Fix
setLogBasePath(basePath)in the engine init path — whereveropenDatabase()is called or abasePathis first established._resetLogs()to only clear_buffer, not_auditBasePath.Files
src/resources/extensions/gsd/workflow-logger.ts— lines 56, 200-203, 233Confidence
97% — verified via codebase-wide search for
setLogBasePathreferences.