Skip to content

[finding] check-shard-attestation.mjs is attempt-blind — after a filter death, rerun-failed-jobs can NEVER converge: prior-attempt attestations poison every later attempt of the same run #11998

Description

@os-zhuang

Filed as recording; measured live on PR #11987, run 32806633489 (2026-08-25). The PR itself is unblocked by a base-branch merge (new run, clean artifact namespace) — this card is about the class.

The sequence, measured

  1. Attempt 1: the filter job died environmentally (##[error]other side closed while dorny/paths-filter fetched the changed-file list — before any path judgement). Per THE FILTER CONTRACT (filter job 一旦失败,Test Core / Build Core / Dogfood 会全部 skipped 而分支保护判为通过 —— 隐式 success() 今天已第三次咬人 #4928, fail-open by design: !cancelled() && outputs.X != 'false'), every downstream shard ran — all 6 Test Core shards and all 3 dogfood shards passed and uploaded their attestation artifacts. The rollups (Test Core, Dogfood Regression Gate) failed on the dead filter. Run conclusion: failure, with three failed jobs: filter + the two rollups.
  2. rerun_failed_jobs (the standard remedy for a pre-judgement environmental death): attempt 2 re-ran exactly those three. filter now succeeded and judged the diff honestly — docs-only (.claude/**), zero test legs. The shard jobs stayed skipped (correct this attempt).
  3. But artifacts persist across attempts of one run. The rollups' download-artifact collected attempt 1's attestations, and the verify refused each one: Test Core: unexpected attestation 'test-1-of-6' that no declared leg accounts for. × 6 (and the dogfood twin × 3). The rollups are red again, now for the opposite reason.
  4. No attempt of this run can ever converge: the verify checks record.run_id !== runId (scripts/check-shard-attestation.mjs:263) but records no attempt number, so attempt-1 credentials are indistinguishable from current-attempt ones. A full rerun_workflow_run hits the identical wall — filter green ⇒ legs undeclared ⇒ stale attestations still present ⇒ red. The only exits are a new run (push/merge-commit) or manual artifact deletion.

Why this is worth a card

  • The trap arms itself on exactly the runs where rerun_failed_jobs is the prescribed move (an infra death before any judgement), and the resulting red reads like a genuine gate failure ("unexpected attestation" sounds like foul play), inviting mis-diagnosis.
  • The strictness itself is correct — refusing credentials no declared leg accounts for is the fail-closed direction and should stay. The defect is only that the credential lacks the one field (run_attempt, available as ${{ github.run_attempt }}) that would let the verify scope its judgement to the current attempt.
  • Docs-only PRs are the common victim: any PR whose filter verdict is "skip the shards" + one filter flake = a permanently red run.

Possible directions (triage, not a recommendation)

  • Stamp run_attempt into each attestation at upload; verify ignores (or explicitly logs-and-discards) attestations from earlier attempts. Small, closes the class, keeps fail-closed for same-attempt foreigners.
  • Alternatively verify could treat "leg skipped this attempt + attestation from an earlier attempt of this run" as the one tolerated shape — narrower but more conditional.
  • Do nothing and document "a filter death is unrecoverable in-run; sync the branch to mint a new run" in the runbook — zero code, but leaves the mis-diagnosis trap armed.

Generated by Claude Code

Metadata

Metadata

Assignees

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions