Skip to content

fix(worktree-reaper): unique run-log name per run (#5716) - #5718

Merged
dezren39 merged 1 commit into
mainfrom
creator-b/5716-runlog-unique
Nov 5, 2026
Merged

dezren39 merged 1 commit into
mainfrom
creator-b/5716-runlog-unique

Conversation

@dezren39

@dezren39 dezren39 commented Nov 5, 2026 •

Copy link
Copy Markdown
Member

Fixes #5716.

The worktree-reaper's run log was named run-{ts}-{pid}.jsonl with ts at
second resolution, so two runs in the same second from one process shared a
path: the later run truncated the earlier run's audit log, and the gate
suite — which drives main() in-process and reads decisions by diffing the
runs/ listing — saw no new log and died with KeyError (verified 6/6
full-suite failures on main @ af0847d; each test passed standalone).

  • worktree_reaper.py: log stamp gains the microsecond fraction, the log
    is created exclusively ("x"), and any residual clash gets a numeric
    suffix instead of overwriting.
  • New RunLogCollisionTests regression test: two back-to-back runs in a
    fresh synthetic repo both return their decisions and leave two distinct
    log files.

Verification (laptop, worktree @ 9af72ab): python3 -m unittest discover -s infra/worktree-reaper/tests — OK, 10 of 10 consecutive runs (8 tests,
including the new one); on unpatched main the same command failed 6 of 6.


Autofix with [code]smith
Open in [code]smith · Need help on this PR? Tag @codesmith-bot with what you need.

ts has second resolution, so same-second runs from one process shared run-{ts}-{pid}.jsonl and the later run truncated the earlier audit log; the gate suite harness reads decisions by directory diff, so it saw no new log and KeyErrored (6/6 full-suite failures). Add the microsecond fraction, create exclusively, and suffix on residual clashes. New RunLogCollisionTests regression test; suite passes 10/10 consecutive runs.
@dezren39
dezren39 requested a review from a team as a code owner November 5, 2026 00:32
@dezren39
dezren39 merged commit cddb887 into main Nov 5, 2026
@dezren39
dezren39 deleted the creator-b/5716-runlog-unique branch November 5, 2026 00:32
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-05T00:34:26.844267Z cddb887 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

worktree-reaper: run-log filename collides for same-second runs — gate suite fails 6/6 and a second run overwrites the first run's audit log

1 participant