Repository navigation
fix(worktree-reaper): unique run-log name per run (#5716) - #5718
Merged
Merged
Conversation
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.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #5716.
The worktree-reaper's run log was named
run-{ts}-{pid}.jsonlwithtsatsecond 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 theruns/listing — saw no new log and died withKeyError(verified 6/6full-suite failures on main @ af0847d; each test passed standalone).
worktree_reaper.py: log stamp gains the microsecond fraction, the logis created exclusively (
"x"), and any residual clash gets a numericsuffix instead of overwriting.
RunLogCollisionTestsregression test: two back-to-back runs in afresh 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.
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.