Skip to content

ci(quality): retry transient GitHub collection failures and retain an explicit unavailable receipt #1345

Closed

Description

@EffortlessSteven

Context / classification

Maintenance leaf linked to #1339; related telemetry/calibration #868. This does not become a runtime authority or universal next-release blocker. It is required only for any selected release claim that depends on this scheduled quality dataset; otherwise retain it as non-blocking maintenance and do not claim fresh calibration from failed runs.

Observed on 2026-10-09, main@266260b454dbb7efd383bf1366162a204c4bdf72: Quality Backfill run 37906291833, job 113740447037, builds successfully, then Collect GitHub receipts fails with HTTP 502: 502 Bad Gateway (https://api.github.com/graphql). The compact backfill build is skipped, and publication-tree validation correctly refuses upload of an unbuilt result. Do not weaken that guard. The earlier October 8 run was also red, but this issue does not assert an identical root cause without its log.

Fresh open-issue search for 502/backfill found no dedicated owner. Recheck before implementation.

One-PR outcome

Add bounded retry/classification to the read-only GitHub collection boundary and preserve a small explicit collection-failure receipt when the upstream remains unavailable. Successful complete datasets and unavailable/partial collections cannot be confused.

Scope

  • Inspect .github/workflows/quality-backfill.yml and the current quality GitHub collector entry points; identify the actual failing gh read operation instead of attributing every step failure to the Rust collector.
  • Retry only classified transient transport/5xx failures with an explicit attempt limit, bounded backoff and total deadline. Inject clock/transport for tests. Authentication/permission failures, semantic GraphQL errors, malformed successful payloads and exhausted rate limits retain distinct non-success reasons; do not retry indiscriminately.
  • Validate each successful response before atomically replacing its staged file. Do not commit partial/malformed JSON as a complete source dataset or discard a prior complete snapshot without explicit provenance.
  • Emit bounded metadata for command/operation ID, attempts, status category, source window, collection completeness and final reason; no tokens, authorization headers or unbounded response bodies.
  • Keep prior valid backfill separate and explicitly stale. Never merge missing current sources as empty results, report zero findings or fabricate calibrated success.
  • Retain a dedicated failure diagnostic artifact under its own schema/name when normal backfill creation is skipped. The success publication tree and its verification guard remain unchanged.

Acceptance

  • 502 then valid success retries within budget and produces one validated complete source dataset.
  • Repeated 5xx/timeouts exhaust deterministically, yielding upstream_unavailable or equivalent explicit receipt, not code failure or successful empty calibration.
  • 401/403, rate-limit exhaustion, semantic GraphQL error and malformed JSON have distinct tests and do not enter an unbounded retry loop.
  • Partial write or interruption does not publish a complete-source marker or overwrite valid prior bytes with malformed data.
  • Prior data cannot masquerade as current; dates/window/source completeness are explicit.
  • Failed collection leaves compact-success publication refused while preserving a bounded diagnostic artifact.
  • Retry recovery creates no duplicate collected rows or side effects.
  • Fake-clock/transport tests, workflow/actionlint/policy checks, relevant Rust tests and exact-head required checks pass.

Non-goals / rollback

No new learned policy, provider orchestration, GitHub credentials/permissions change, schedule expansion, package publication or CI-result authority change. Retain fail-closed collection and diagnostic receipts if retry is disabled. No automatic rerun of hosted workflows is authorized by filing this issue.

Activity

  1. EffortlessSteven commented on Oct 10, 2026

    @EffortlessSteven
    MemberAuthor

    Taking the bounded bootstrap repair. The current quality-backfill workflow invokes gh run list and gh pr list directly into final source files under set -e, so a transient GraphQL HTTP502 aborts the lane and can leave a truncated source. The existing publication-tree guard correctly refuses a failed backfill and will remain unchanged.

    Scope: a small owned helper around those two fixed read-only bootstrap queries, classified finite retries/deadline, validated staged JSON, a marker distinguishing complete query results from an unavailable bootstrap, and a separate bounded diagnostic receipt/artifact. Later Rust per-PR collection and gate-artifact downloads keep their current behavior; this will not claim all GitHub I/O is now resilient. Existing previous quality data is never presented as current after bootstrap failure. Local fake-transport/process tests and PR-only workflow validation will execute without tokens or network. No runtime writer, analyzer policy, publishing permission or protection setting changes.

  2. EffortlessSteven commented on Oct 10, 2026

    @EffortlessSteven
    MemberAuthor

    Bounded bootstrap repair merged and verified

    PR #1351 merged normally as 7453db0. A fresh main read confirms tree 1c547fc37bf76930755b10d2fdbecf7336850e52, identical to the exact reviewed/tested d8aac95 candidate.

    The observed boundary is now repaired: both fixed bootstrap queries have bounded classified retries, validated complete source staging, previous-snapshot retention, distinct unavailable diagnostics, and process-group cleanup after timeout. The normal successful-backfill publication guard remains unchanged. Fresh artifact/trend inputs are cleared after bootstrap success so a reused checkout cannot accidentally combine old downloads with current sources.

    Acceptance evidence:

    • HTTP502 recovery and repeated503 exhaustion: executed fake-transport tests with finite attempts/deadline, plus actual helper CLI recovery/exhaustion against an inert fake gh executable.
    • 401/403, rate limit, GraphQL error, malformed/duplicate/nonfinite data: separate tested non-success states, without indiscriminate retries or leaked error text.
    • Partial second query and handled promotion failure: previous source bytes are preserved/restored; new sources become active only after both query results validate.
    • Timeout: a real Linux fork/pipe-inheritance counterexample failed before cleanup repair and passes after it. Output caps and child timeout tests execute real local processes, not only mocked return values.
    • Failure diagnostics and normal artifact publication remain separate in the tested workflow contract. Query coverage explicitly states two bounded queries and limit100, not exhaustive history or successful calibration.
    • Exact-head hosted independent baseline 38040123557, offline bootstrap contract 38040124958 (12 tests), and required gate 38040124957 all pass. Required RIPR was evaluated at 0 new unsuppressed, with no threshold or suppression change.
    • Independent Codex review 6095991521 covers d8aac95 and found no major issues; its earlier path-contract finding was repaired and resolved.

    Full proof and artifact digest: #1351 (comment) .

    This closes the source repair for the observed bootstrap failure. It does not claim that a subsequent live scheduled backfill has succeeded, that every later per-PR/API/artifact download now retries, or that retained old data is current calibration. Those operational outcomes must be observed separately. Guarantees are trusted single-writer/handled-error guarantees, not crash-durable filesystem transactions. No schedule expansion, release publication, credential, protection or CI-result-authority change occurred.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions