production-auto-publish-reconcile job in
Cron Control checks, once an hour,
that automatic production publication has left nothing behind. It only
reads: it never dispatches a workflow, writes a GitHub variable, secret or
setting, or changes a Cloudflare Worker, version or deployment. It reports
through the shared root operator alert, the same path as SLO burn and cost
alerts (observability).
The job is registered but disabled: it is not listed in
CRON_CONTROL_ENABLED_JOBS. Admitting it is a staged transition (see
Enable) that needs the release owner’s approval.
What it flags
Any other fence value publishes, so only
stopped and the stopped: form
are checked. The first sighting of each production SHA is kept as a single
pending-work item in the Cron Control ledger, so the lag window starts when
the ref moved rather than at the commit’s own date. Credential expiry is not
checked here; the token rotation reminder owns it.
The automatic Workers are listed in
apps/cron-control/src/processors/auto-publish-reconcile/catalog.ts. They are
the serving Workers of scripts/ci/serving-workers-apps.mjs, read at each
app’s first origin, and a test fails when the two lists differ. Admin and the
vinext families join when their own automatic publication lands.
Windows can be tuned with optional text bindings, each a whole number within
bounds; anything else keeps the default:
AUTO_PUBLISH_RECONCILE_STOP_WINDOW_HOURS (1 to 720),
AUTO_PUBLISH_RECONCILE_SPLIT_TTL_MINUTES and
AUTO_PUBLISH_RECONCILE_LAG_WINDOW_MINUTES (30 to 10,080).
Credentials
Both are operator-installed Worker secrets, read by name and sent only to their own provider. Neither appears in logs, alert text or alert data.AUTO_PUBLISH_RECONCILE_CLOUDFLARE_TOKEN: an account API token with Workers Scripts Read only, no zone permissions. It reads deployments; it cannot upload, stage, promote or roll back. The account comes from the existingCLOUDFLARE_ACCOUNT_IDbinding.AUTO_PUBLISH_RECONCILE_GITHUB_TOKEN: a fine-grained token for thetutur3u/platformrepository only, with Variables: read and Contents: read. GitHub has no narrower grant for a named variable, so the token can read every repository variable value, which are not secrets, but cannot read secrets or write variables, refs or settings.
Bounds
A variable listing longer than five pages fails the run instead of paging on,
so a fence is never missed silently. A refused, rate-limited or timed-out
Cloudflare read ends that run’s Cloudflare reads.
Deduplication and outcomes
An alert’s dedupe key isauto-publish:reconcile:<32 hex of SHA-256 over the sorted finding ids>.
Each id names its fact: the variable and its update time, the Worker and its
deployment id, a dark Worker with its production SHA, or the Worker with
its live and production SHAs. The same
state on later slots reuses the key, and private.send_root_operator_alert
answers null without notifying anyone. A new fact makes a new key and one
new alert. A clean state sends nothing. A dark Worker uses the same finding ID whether
one or both reads are unavailable. A malformed alert response leaves the
delivery outcome unknown. The next slot uses the same key if the findings
are unchanged.
Five consecutive failed slots exhaust the job’s failure budget and stop it,
like any Cron Control job.
Stop and resume
The job checks its durable ledger stop before the GitHub reads, before the production ref read, before each Worker and before the alert. The operator stop needs no deploy:resume lifts the stop.
Removing the id from CRON_CONTROL_ENABLED_JOBS disables it in the next
publication.
Read-only rehearsal before enabling
Keep the job disabled. Ask the release owner for a known 100%/0% deployment from an independently authorized rehearsal. Record the Worker, deployment ID, and expected version IDs. Use these requests from a disposable operator session and keep credentials and unrelated variable values out of the evidence.- With the account token scoped to Workers Scripts Read only, send
GET https://api.cloudflare.com/client/v4/accounts/{id}/workers/scripts/{script}/deployments. Expect HTTP 200 and check thatresult.deployments[0]matches the known active deployment. Itsversionsmust contain the serving ID at 100 and the candidate ID at 0. Record the two percentages and whether the IDs matched. The API schema lists a 0.01 minimum, while the gradual deployment tooling supports zero. Keep the job disabled if the GET omits, rounds or rejects the candidate, or if no known staged deployment is available. - With a fine-grained token scoped only to
tutur3u/platformand Variables: Read plus Contents: Read, sendGET https://api.github.com/repos/tutur3u/platform/actions/variables?per_page=30&page=1. Read subsequent pages only as needed, through page 5. Expect HTTP 200 and complete coverage of the reported total. Confirm any configuredPRODUCTION_AUTO_PUBLISHandPRODUCTION_AUTO_PUBLISH_<FAMILY>entries. With the same token, sendGET https://api.github.com/repos/tutur3u/platform/git/ref/heads/productionand record the 40-characterobject.sha. - Without credentials, send
GET https://{catalog-origin}/api/build-infofor each catalog Worker. Expect HTTP 200 and a validcommitHashorcommit. Record the observed SHA and compare it with the production ref. Give Iris the readback before requesting activation.
Enable
- Install both secrets on
tuturuuu-cron-controlwith the permissions above. - In one reviewed change, add
production-auto-publish-reconciletoCRON_CONTROL_ENABLED_JOBSinapps/cron-control/cloudflare.config.ts, updatescripts/ci/fixtures/cf-worker-parity/cron-control.json(the serving identity becomespreviousIdentity, the new listidentity) with atransition.decisionthat names the job, and update the registration test inapps/cron-control/src/auto-publish-reconcile.test.ts, which fails while the job is listed. The trigger set does not change: the job runs at minute 0 of the existing*/30 * * * *trigger. - Publish Cron Control through its workflow after the release owner’s
approval, then confirm the first hourly slot in
GET /control/jobs.
Cost envelope
At 24 slots a day a run makes at most 38 GETs across GitHub, the Cloudflare deployment API and public build-info, at most one database RPC and about 15 ledger calls. The six build-info reads are Worker requests on the serving Workers: 144 a day.apps/cron-control/src/auto-publish-reconcile.test.ts counts
calls through the healthy, flagged, repeated, stopped, failing, restarted,
paged and slow cases.