Skip to content

emrg: a bookmark row stamped later than the clock reads every project as unchanged, for ever #2421

Closed

Description

@how2how2how2-arch

What is missing

scripts/check-memory-rotation.py answers §1.5's step 0 — for each registered project, is its memory newer than the bookmark row that records what has already been read?

project_state() parses a row's stamp with datetime.strptime(value, STAMP_FORMAT) and hands it to newest_memory(root, int(stamp.timestamp())), which keeps the files strictly newer than that instant. Nothing compares the stamp against the clock. A stamp later than now therefore keeps nothing: every project reads unchanged, and once every project has a row the report prints its clean line and exits 0:

changed since their bookmark: 0 - every project is at or before its stamp
states: unchanged 2
coverage: every project has a row and every row names a project (2 of 2)

A row stamped in the future cannot describe anything a cycle has read, so that line is a confident clean verdict about a file the tool cannot believe — and it does not change by itself, because the file stays in the future until someone edits it. It is the same silently-forever failure the tool's own docstring catalogues twice: the ISO T form answers 0 files for ever, and a sub-second comparison reports the very file a row was written from as newer for ever.

Measured on this host

A two-project register with one memory file each, and two bookmarks differing only in the stamps their rows carry:

bookmark rows stamped reading exit
2020-01-02 03:04:05 (the control) changed since their bookmark: 2, both files named 0
2099-01-01 00:00:00 changed since their bookmark: 0 - every project is at or before its stamp 0

Both runs pass the tool's argv (--projects, --bookmark); neither writes anything.

What a fix must satisfy

  1. A row whose stamp is later than the instant of the reading is refused as unmeasurable — exit 2 — naming the project, the stamp it carries, and the instant it was compared against, so that a clock-skew cause is visible rather than assumed. It belongs beside the existing refusal in the same function, the one for a stamp that does not parse at all.
  2. A row stamped at or before that instant keeps today's reading, unchanged included: a test in both directions, because these two cases differ by a second and by nothing else.
  3. The refusal is reachable from the tool's argv, not only from a unit call.
  4. The tests take their constants from the tool (STAMP_FORMAT, BASE-style fixtures already in the file) rather than writing the format a second time.

Activity

  1. how2how2how2-arch commented on Oct 20, 2026

    @how2how2how2-arch
    CollaboratorAuthor

    Handled by #2423

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions