Skip to content

fix(cron): exclude jobs.json registry from disk-cleanup pattern#33834

Closed
sweetcornna wants to merge 1 commit into
NousResearch:mainfrom
sweetcornna:fix/32164-cleanup-protect-jobs-json
Closed

fix(cron): exclude jobs.json registry from disk-cleanup pattern#33834
sweetcornna wants to merge 1 commit into
NousResearch:mainfrom
sweetcornna:fix/32164-cleanup-protect-jobs-json

Conversation

@sweetcornna

Copy link
Copy Markdown
Contributor

Summary

  • plugins/disk-cleanup/disk_cleanup.py::guess_category() classified every top-level path under HERMES_HOME/cron/ (and the legacy cronjobs/ alias) as cron-output, which made the durable scheduler registry (~/.hermes/cron/jobs.json, .tick.lock) eligible for automatic deletion.
  • Restrict the cron-output label to cron/output/** only, matching the actual disposable-artifact subtree. Top-level cron control-plane files now return None and are never auto-tracked.
  • Update the existing test_cron_subtree_categorised to use a real cron/output/ path and add three regression tests covering jobs.json, .tick.lock, and the cronjobs/ alias.

Closes #32164

Test plan

  • python3 -m pytest tests/plugins/test_disk_cleanup_plugin.py::TestGuessCategory — 9/9 pass (3 new regression tests + adjusted cron-output test).
  • Confirm no other call sites assumed the old top == "cron" blanket classification.

@alt-glitch alt-glitch added type/bug Something isn't working comp/cron Cron scheduler and job management comp/plugins Plugin system and bundled plugins P1 High — major feature broken, no workaround labels May 28, 2026
@teknium1

Copy link
Copy Markdown
Contributor

Merged via #34840. Your disk-cleanup fix was cherry-picked onto current main with your authorship preserved in git log (commit d473e7c). This was the cleanest of the competing fixes — cron/output/ subtree restriction plus regression tests for jobs.json, .tick.lock, and the legacy cronjobs alias. Bundled with @Bartok9's snapshot safety net into one PR closing the silent cron-loss bug. Thanks!
#34840

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

comp/cron Cron scheduler and job management comp/plugins Plugin system and bundled plugins P1 High — major feature broken, no workaround type/bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

disk-cleanup misclassifies cron/jobs.json as cron-output and can delete the live cron registry

3 participants