Version / branch / commit
Source-reviewed on main at 99721c7.
OS and environment
Linux amd64; Go 1.26.6. AI-assisted source review. No long-duration disk-exhaustion or memory benchmark was executed.
Steps to reproduce
Suggested bounded test/benchmark, using disposable Store data:
- Create a cron job.
- Append increasing numbers of valid RunRecord entries with AppendRun.
- Observe runs.jsonl size and measure allocations/time for Runs after each increase.
- Confirm there is no retention or paging boundary as the history grows.
Expected behavior
A recurring background feature should have a bounded way to inspect recent history and a defined retention/rotation mechanism, without silently deleting history users expect to keep. The concrete policy needs maintainer agreement.
Actual behavior / source evidence
AppendRun:303-340 appends one JSON line for each run without rotation or retention.
Runs:343-364 scans the complete file and appends every valid record to a slice. The 1 MiB Scanner limit bounds one record, not total history size. Disk use grows with run count; read time and retained memory grow with the history rather than the requested recent window.
Suggested fix / regression coverage
Add a bounded recent-history/pagination path and agree on a retention policy by count or bytes. If compacting, do it atomically under the existing job lock. Verify newest records survive compaction and concurrent reads remain consistent.
Related work
#971 concerns session directories and checkpoint retention, not cron runs.jsonl. No matching cron-history report was found.
Verification
Existing go test ./... and focused race tests for internal/cron passed. Growth follows directly from the append/read loops; no OOM, disk-full incident, or measured threshold is claimed.
Version / branch / commit
Source-reviewed on main at 99721c7.
OS and environment
Linux amd64; Go 1.26.6. AI-assisted source review. No long-duration disk-exhaustion or memory benchmark was executed.
Steps to reproduce
Suggested bounded test/benchmark, using disposable Store data:
Expected behavior
A recurring background feature should have a bounded way to inspect recent history and a defined retention/rotation mechanism, without silently deleting history users expect to keep. The concrete policy needs maintainer agreement.
Actual behavior / source evidence
AppendRun:303-340 appends one JSON line for each run without rotation or retention.
Runs:343-364 scans the complete file and appends every valid record to a slice. The 1 MiB Scanner limit bounds one record, not total history size. Disk use grows with run count; read time and retained memory grow with the history rather than the requested recent window.
Suggested fix / regression coverage
Add a bounded recent-history/pagination path and agree on a retention policy by count or bytes. If compacting, do it atomically under the existing job lock. Verify newest records survive compaction and concurrent reads remain consistent.
Related work
#971 concerns session directories and checkpoint retention, not cron runs.jsonl. No matching cron-history report was found.
Verification
Existing go test ./... and focused race tests for internal/cron passed. Growth follows directly from the append/read loops; no OOM, disk-full incident, or measured threshold is claimed.