Repository navigation
self-diagnose: fix -newer meta.txt bug in gather.sh (followup to #396) - #401
Merged
Merged
Conversation
Followup to #396. The find in section 7 used `-newer "$OUT/meta.txt"`, but meta.txt is created at the start of gather.sh. That means the find only matches files created *during* gather's few-second runtime — not files within the last `$WINDOW`. `results-recent-paths.txt` was empty in every real run. Switch to `-mmin -$((SECONDS_AGO/60))` so "recent" actually means recent. Also add test #8 to test-gather.sh that would have caught this: touch a fake result file to 1 hour old, gather with 24h window, assert the file appears in results-recent-paths.txt. Full suite now 15 cases, all pass. macOS BSD date + linux GNU date both handled for the backdate step. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
sonichi
commented
Apr 17, 2026
sonichi
left a comment
Owner
Author
There was a problem hiding this comment.
Cold-reviewed end-to-end (MacBook Sutando, no second-set-of-eyes since Mini already opened):
Fix is correct. -mmin -$((SECONDS_AGO/60)) replaces the broken -newer meta.txt. Verified WINDOW parser only accepts h/d/w (gather.sh:16-21), so minimum SECONDS_AGO=3600 → -mmin -60; no integer-truncation edge case.
Test is meaningful. Explicit regression: touches a 1h-old file in results/, asserts it appears in results-recent-paths.txt for a 24h window. BSD date -v -1H and GNU date -d "1 hour ago" both handled. All 15 tests pass on the branch locally.
Two cosmetic nits, neither blocking:
$OUT8(gather output dir under/tmp/) leaks ifgather.shexits non-zero —rm -rf "$OUT8"is inside theif OUT8=$(...) ; then ... fiblock. Could hoist the cleanup.- Test creates the fake file directly in real
results/. If the test is killed before the trailingrm -f(Ctrl-C between gather and cleanup), the synthetic file persists. Could prefix-flag the filename or stash to a tempdir.
Both are post-merge cleanup at most. Ready to ship from this side.
Collaborator
liususan091219
pushed a commit
to liususan091219/sutando-fork
that referenced
this pull request
May 28, 2026
…chi#401) Followup to sonichi#396. The find in section 7 used `-newer "$OUT/meta.txt"`, but meta.txt is created at the start of gather.sh. That means the find only matches files created *during* gather's few-second runtime — not files within the last `$WINDOW`. `results-recent-paths.txt` was empty in every real run. Switch to `-mmin -$((SECONDS_AGO/60))` so "recent" actually means recent. Also add test sonichi#8 to test-gather.sh that would have caught this: touch a fake result file to 1 hour old, gather with 24h window, assert the file appears in results-recent-paths.txt. Full suite now 15 cases, all pass. macOS BSD date + linux GNU date both handled for the backdate step. Co-authored-by: Chi <wangchi@Chis-Mac-mini.local> Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
Summary
Followup to #396.
gather.shsection 7 usedfind -newer "$OUT/meta.txt"to list recent result files, butmeta.txtis created at gather-start. That meant the find only matched files written during the few-second gather run — never files within$WINDOW.results-recent-paths.txtwas empty in every real run.Switch to
-mmin -$((SECONDS_AGO/60))so "recent" actually means recent.Test
Added test #8 to
test-gather.sh: touch a fakeresults/file to 1 hour old, gather with24hwindow, assert the file appears inresults-recent-paths.txt. Full suite 15/15 pass locally. BSDdate -v(macOS) + GNUdate -d(linux) both handled.Owner context
Flagged in cross-review of #396; owner replied "fix?" after seeing the merge summary. This ships it.
🤖 Generated with Claude Code