Skip to content

perf(server): a quiet repository skips the sweep - #289

Merged
sweepies merged 2 commits into
mainfrom
perf/quiet-sweep
Nov 13, 2026
Merged

sweepies merged 2 commits into
mainfrom
perf/quiet-sweep

Conversation

@sweepies

@sweepies sweepies commented Nov 13, 2026 •

Copy link
Copy Markdown
Owner

Consult 7, PR 13 (the user chose N = 6 hours). A sweep exists to notice what no webhook reports: new upstream versions, and time passing. Until now it ran every repository in full each time, at a GitHub cost per repository even when nothing had changed.

What a quiet sweep does

  • At the end of every complete, non-dry run the engine stores a quiet-run entry per repository (credential-scoped): the head commit and branch, a hash of the report row without timestamps, tooling or catalog evidence, next_due and ran_at.
  • next_due is the earliest instant at which time alone changes the answer: a held-back release becoming eligible, a release-age wait ending, the next cron instant of every update and maintenance window, a completed lockfile refresh's deferral, and a prs.perHour hold freeing (the oldest counted pull request's creation plus an hour). Wait arithmetic is checked; an overflow means always run. An input it cannot compute makes next_due now, so the repository always runs.
  • A sweep batch (every claim sweep priority, no check candidates, no deliveries, only sweep causes) first rebuilds each repository's lookup from its cached config and extraction, with no head check and no inventory and with lookups shared across the batch, and compares the hash. A repository is skipped, with no GitHub request beyond refreshing its hinted digests, only when the hash is equal, next_due has not passed, no event arrived since its stored run, and its last full run was under 6 hours ago. Anything else runs normally, and so does any error in the check (logged).
  • A skipped repository's report and public record are left as they are. A person's trigger, a check event and discovery always run in full.

Behaviour change: a missed webhook, or a change no subscribed event reports, is healed within 6 hours instead of at the next sweep. guide/server.mdx ("Quiet sweeps"), internals/engine.md.

Proof

  • crates/engine/tests/sweep.rs: an unchanged repository is quiet with zero requests; an unseen repository runs; the 6-hour bound runs it; a held-back release runs exactly at next_due; a changed catalog answer runs it.
  • Server tests: a skip leaves the record intact; a person, a delivery, a non-sweep cause and discovery each force a full run.
  • a_per_hour_hold_frees_as_the_counted_prs_age_out: with perHour 2 and four pending updates, the sweep does not skip once the counted pull requests age out.
  • Benchmark a_sweep_over_quiet_repositories_makes_no_requests: 4 repositories, 12 requests per sweep before, 0 after. Its cold population run is sequential, so the credential-scoped actor hint is stored by the same repository every time; 50 consecutive runs pass.
  • The fake's tag etags are now content-derived, so it answers a changed tag list with a 200 instead of a constant-etag 304; existing transcripts are unchanged.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Nov 13, 2026 •

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
count-patchula 4ac2ea6 Commit Preview URL

Branch Preview URL
Nov 13 2026, 02:19 AM

sweepies and others added 2 commits November 13, 2026 02:07
A complete run now stores a quiet-run row per repository and credential
scope: the head commit, a hash of the report row (timings, evaluation
timestamps, catalog evidence and tooling excluded) and next_due — the
earliest instant time alone can change the answer. On a batch the sweep
alone enqueued, the server rebuilds each repository's lookup from its
cached extraction and re-evaluates the report off the same catalogs; one
whose report hashes the same, whose next_due has not passed and whose
last full run is under six hours old finishes without a GitHub request
of its own.

Every forcing condition fails open toward a full run: missing state, a
missing cached extraction, a passed due, a changed answer, the six-hour
bound and any batch carrying a person's trigger, a delivered event, a
check callback or a discovery row. A missed webhook is healed within
six hours instead of one.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
The cold population run in the quiet-sweep benchmark seeded the
credential-scoped actor hint under concurrency, so which repository sent
the unfiltered inventory read was scheduling. Run the cold run
sequentially so the recorded multiset is stable; the sweep itself keeps
its zero-request assertion.

A `prs.perHour` hold decays on wall-clock time, but `next_due` ignored
it, so a quiet sweep could defer a now-affordable PR until the six-hour
bound. The lifecycle now reports the oldest owned PR the hourly count
covers; the write path turns it into `per_hour_due` (oldest + 1h, or the
run's own hour when the count is the run's own) and `next_due` folds it
in. Use checked arithmetic for the wait-hours additions, and note that a
quiet repository still refreshes its hinted digests.

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
@sweepies
sweepies merged commit fe450d7 into main Nov 13, 2026
13 checks passed
@sweepies
sweepies deleted the perf/quiet-sweep branch November 13, 2026 02:28
@sweepies-ops sweepies-ops Bot mentioned this pull request Nov 13, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant