You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Split jobs.json into two files: definitions (git-trackable) and runtime state (gitignored). Currently both live in a single file, making git history noisy with timestamp/status churn after every cron run.
Problem to solve
When cron.store points to a git-tracked file (e.g. ~/clawd/cron/jobs.json), every cron execution mutates runtime fields:
Summary
Split
jobs.jsoninto two files: definitions (git-trackable) and runtime state (gitignored). Currently both live in a single file, making git history noisy with timestamp/status churn after every cron run.Problem to solve
When
cron.storepoints to a git-tracked file (e.g.~/clawd/cron/jobs.json), every cron execution mutates runtime fields:state.lastRunAtMs,state.nextRunAtMs,state.lastDurationMsstate.lastStatus,state.consecutiveErrors,state.lastDeliveryStatusupdatedAtMs(job-level)With ~10 daily jobs this produces 10+ meaningless commits/day, drowning real config changes in noise.
Proposed solution
Split into two files at the same directory level:
On load: merge state into definitions by job id.
On save: strip runtime fields from definitions file; write state separately.
The building blocks already exist in
store.ts:stripRuntimeOnlyCronFields()already stripsstateandupdatedAtMsshouldSkipCronBackupForRuntimeOnlyChanges()already compares stripped versionsA new config option could control the behavior:
Or infer automatically: if a
.gitignore/.jj/exists in the store directory, separate state by default.Alternatives considered
jobs.d/directory (see [Feature]: cron jobs.d/ directory support (one file per job, for NixOS/GitOps declarative setups) #20950) — solves GitOps/NixOS but not the state noise problem; complementary, not a replacement..gitignorepatterns — impossible since definitions and state live in the same file.Impact
Additional context
Related: #20950 (jobs.d/ directory support)