Skip to content

MEMORY_LOG_DATE is evaluated at source time, so a process alive across midnight writes into yesterday's log file #705

Closed

Description

@fdaviddpt

Observed by @jqit-ricky while tracing #660, and filed here so it does not stay buried in that thread.

scripts/log.sh:855 sets MEMORY_LOG_DATE when the file is sourced, not when a line is written:

MEMORY_LOG_DATE=$(date +%Y-%m-%d)   # evaluated once, at source time

A process that sources log.sh and then lives across midnight — a long-running session, a backgrounded save, a consolidation round that starts at 23:58 — keeps writing into yesterday's memory-YYYY-MM-DD.log for the rest of its life. The entries are not lost, but they are filed under a date that is not theirs, which is exactly the shape that makes a log unreadable when someone is trying to reconstruct what happened at 00:10.

The same class of bug has already been fixed once in this repo on the staging side (the UTC-midnight race in the daily fold); this is the logging side of it, still open.

Acceptance

[AI-generated]

Activity

  1. added
    bug
    priority:low
    lane-diagnostics
    on Sep 16, 2026
  2. self-assigned this
    on Sep 16, 2026
  3. added 3 commits that reference this issue on Sep 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

buglane-diagnosticspriority:low

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions