fix(disk-cleanup): protect cron/jobs.json from deletion#32436
Closed
KeyArgo wants to merge 1 commit into
Closed
Conversation
guess_category() classified every file under cron/ and cronjobs/ as cron-output, which is pruned after 14 days. This included jobs.json — the live cron registry — causing scheduled jobs to silently vanish. Exempt jobs.json when it sits directly under the cron top-level dir (depth == 2). All other cron output remains classified as ephemeral. Closes NousResearch#32164
Collaborator
Contributor
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
guess_category()indisk_cleanup.pyclassifies every file under$HERMES_HOME/cron/andcronjobs/ascron-output, which gets pruned after 14 days:cron/jobs.jsonis the live cron registry — losing it silently deletes all scheduled jobs. It is a persistent config file, not ephemeral output.Fix: Exempt
jobs.jsonwhen it sits at depth 2 (direct child ofcron/). All other files undercron/remain classified as ephemeral output.Test plan
$HERMES_HOME/cron/jobs.jsonand a dummy$HERMES_HOME/cron/run_12345.logjobs.jsonis not deleted;run_12345.logis deletedCloses #32164
🤖 Contributed via Claude Code