Skip to content

Audit log is permanently dead — setLogBasePath() never called #10

@igouss

Description

@igouss

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

  1. 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.
  2. Every _push() call at workflow-logger.ts:233 skips the if (_auditBasePath) branch — no entries are ever flushed to disk.
  3. _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

  1. Call setLogBasePath(basePath) in the engine init path — wherever openDatabase() is called or a basePath is first established.
  2. 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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions