fix(platform): space the daily governance crons - #3145
Merged
Conversation
The port packed legal-hold releases, the audit-chain verify and the retention sweep into one 30-minute window: 04:15, 04:30 and 04:00. 0.4 ran them at 01:00, 02:00 and 04:00 and both comments said why. Two consequences. A cleared maker-checker release now lands 15 minutes AFTER the sweep starts rather than three hours before, so data it frees waits about a day for the next sweep. And the audit verify runs 30 minutes into the retention window, so it can walk the chain while retention deletes audit prefixes — the overlap 0.4's comment named explicitly. That compounds with the documented anchor change, where the verifier trusts the oldest surviving row. Adds a test on the roster pinning the invariant rather than the times: the three do not share an hour, releases precede the sweep, and the verify is not in the sweep's hour. Nothing guarded this before.
Israeltheminer
force-pushed
the
fix/space-governance-crons
branch
from
September 3, 2026 12:57
0f7e0a7 to
8d4e48e
Compare
Collaborator
Author
|
Rebased onto current That one is kept where it is, because its own comment gives the reason — it runs after retention so rows the sweep just purged reconcile the same night. So it deliberately DOES share the sweep's hour, unlike the three this PR separates. The four now read 01:00 releases → 02:00 verify → 04:00 sweep → 04:45 reconcile. The test gained a case pinning that, so the spacing rule is not read as "spread everything out" and the reconcile moved off the sweep's hour later. Two mutations, both red:
|
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.
The three daily governance jobs were running in one 30-minute window. They are spaced again, and a test now pins the rule rather than the times.
Refs #3142.
Why
Both 0.4 comments state the reasoning. The releases cron: "Picks an off-peak hour so it doesn't compete with the main 04:00 sweep." The verify cron: "02:00 avoids the 01:00 legal-hold release sweep and the 04:00 retention sweep."
Two consequences of the packing:
A maker-checker legal-hold release that clears its cooldown used to free data three hours before the sweep. At 04:15 it lands after the sweep has started, so the data it freed waits roughly a day for the next one.
The audit verify ran 30 minutes into the retention window, so it could walk the chain while retention deletes audit prefixes. That is the overlap the 0.4 comment named, and it compounds with the anchor change
backend/MIGRATION.mddocuments: the verifier trusts the oldest surviving row, and it may now read that row mid-deletion.What changed
Three cron strings, reordered in the file so the sequence reads in the order it runs, with the reasoning written down rather than left to be rediscovered.
Tests
A new
schedules.test.tspins the invariant, not the clock: the three do not share an hour, releases precede the sweep, and the verify is not in the sweep's hour. Plus two roster hygiene checks — unique names, five cron fields each.SCHEDULESis exported for this; it was module-private.Mutation: setting the two times back to
15 4and30 4, which is exactly what main ships, turns three of the five assertions red.Scope
Only the three daily governance jobs move. Every other entry is untouched, including the deliberate staggers already in the file — the two Drive scans on offset 15-minute cadences, and the three 5-minute file-pipeline sweeps on offset minutes.
Does not address the anchor change itself, which is signed off in the ledger as an intentional divergence. This removes the overlap that made it sharper.
Gate:
typecheck,oxlint --type-aware,oxfmt --checkgreen; 5 unit assertions passing.