on Macro Lifecycle Event
Responds to the outer solver's lifecycle events to safely manage file streams.
INITIALIZED: Opens the file in append mode. Writes the header row if the file is completely empty.
COMPLETED / ERROR: Flushes the buffer and releases the OS file lock.
@param status The execution lifecycle status emitted by the macro solver.