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
captureStarSnapshots: retries batches still rejected after activity/rate-limit handling, once, after a 30s cooldown - most transient GitHub/DB blips no longer leave a permanent snapshot gap for that day.
selfHealStarBackfill: now also sweeps completed-but-newly-gapped repos (via findReposNeedingGapHeal) once per full run, alongside the existing never-completed page scan, so a dropped batch self-heals without manual intervention.
star-snapshot-backfill bin script: new --gapped-only flag targets exactly the repos with a current snapshot gap instead of a full sweep, for fixing a specific gap on demand.
starSnapshotHealthReporting job: the reported gap count now matches the day-list it displays (drops repos whose gap closed between the two underlying queries).
Root cause: a capture batch on 2026-09-22 was dropped after exhausting retries, leaving ~1884 repos missing one day - not a date-boundary bug in the health report.
Test plan
pnpm tsc-check passes
Next 08:00 UTC capture run: verify no repos come up short after a simulated/real batch failure
Next 09:00 UTC self-heal run: verify newly-gapped completed repos get backfilled
Manual: --gapped-only run against a known-gapped repo set
Medium Risk
Changes scheduled Temporal capture and self-heal workflows (including deploy-time patched() behavior) and expands automated backfill dispatch for completed repos; mistakes could affect daily snapshot completeness or GitHub API load.
Overview
Addresses dropped daily star-snapshot capture batches and repos that become gapped after backfill is marked complete (CM-1441).
captureStarSnapshots refactors batch handling so rejected batches are collected instead of immediately counted as failures, then—behind patched('CM-1441-retry-rejected-batches')—runs one extra pass after a 30s sleep before repos are marked failed.
selfHealStarBackfill adds a second paginated scan of completed, non-dead-lettered repos (findReposNeedingGapHeal / findCompletedReposEligibleForGapHeal + gap check) alongside the existing incomplete-backfill scan, with separate cursors and gap-heal-namespaced child workflow IDs (patched for safe mid-deploy replay).
Data layer centralizes batched gap detection in findAllRepoIdsWithStarSnapshotGaps; the backfill CLI gains --gapped-only (separate checkpoint/completed files) to target only repos with a current gap. The health reporting cron uses the shared gap helper and reports gap counts only for repos with missingDays > 0, avoiding over-count when a gap closes between queries.
Reviewed by Cursor Bugbot for commit 7dfa1f9. Bugbot is set up for automated code reviews on this repo. Configure here.
The race explanation is useful, but this comment exceeds the repository's two-line maximum (CLAUDE.md:74-86). It can be reduced without losing the invariant.
Shorten function comment to the non-obvious constraint
This three-line narration exceeds the repository's two-line maximum for allowed comments (CLAUDE.md:74-86). Keep only the non-obvious pagination invariant.
This three-line function header mostly restates the function name and implementation. Keep only the timeout-related pagination constraint in a concise form.
Shorten comment to cursor and page-bound rationale
This three-line comment narrates the newly added control flow. Keep only the non-obvious reason for separate cursors and the page bound, within two lines.
The race explanation is useful, but this comment exceeds the repository's two-line maximum (CLAUDE.md:76-86). Condense it while retaining the concurrency invariant.
Condense comment to separation and pagination invariants
This new comment exceeds the repository's two-line limit (CLAUDE.md:76-86) and mostly narrates the function. Keep only the non-obvious separation and bounded-pagination invariant.
The reason will be displayed to describe this comment to others. Learn more.
Traced the retry-once/cooldown logic in captureStarSnapshots and the dual-cursor continueAsNew handling in selfHealStarBackfill against the patch-ID replay scenarios Copilot and Cursor flagged earlier in this thread; both hold up. The health report fix reconciles the two underlying queries and closes the race that caused the mismatch. Good to merge.
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
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.
Summary
captureStarSnapshots: retries batches still rejected after activity/rate-limit handling, once, after a 30s cooldown - most transient GitHub/DB blips no longer leave a permanent snapshot gap for that day.selfHealStarBackfill: now also sweeps completed-but-newly-gapped repos (viafindReposNeedingGapHeal) once per full run, alongside the existing never-completed page scan, so a dropped batch self-heals without manual intervention.star-snapshot-backfillbin script: new--gapped-onlyflag targets exactly the repos with a current snapshot gap instead of a full sweep, for fixing a specific gap on demand.starSnapshotHealthReportingjob: the reported gap count now matches the day-list it displays (drops repos whose gap closed between the two underlying queries).Root cause: a capture batch on 2026-09-22 was dropped after exhausting retries, leaving ~1884 repos missing one day - not a date-boundary bug in the health report.
Test plan
pnpm tsc-checkpasses--gapped-onlyrun against a known-gapped repo set