fix: address codex review — use clock for cutoff + early-exit harvest
- cycle.py: use supplied `clock` parameter (not wall time) for the lookback cutoff, so deterministic tests/experiments get reproducible harvest windows - harvest.py: break (not continue) when a file is older than since_iso, since files are sorted newest-first by mtime — avoids scanning the entire transcript directory for quiet projects with large histories Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -294,7 +294,9 @@ def harvest(
|
||||
if not _project_matches(d.project or "", scope, invoked_project):
|
||||
continue
|
||||
if since_iso and d.ended_at and d.ended_at < since_iso:
|
||||
continue
|
||||
# Files are sorted newest-first by mtime; once we see one that
|
||||
# is older than the cutoff, all remaining files are older too.
|
||||
break
|
||||
digests.append(d)
|
||||
if limit and len(digests) >= limit:
|
||||
break
|
||||
|
||||
Reference in New Issue
Block a user