LearnNewsExamplesServices
Frontmatter
id20064
titleA body edit's rerun leaves the first run's red on the PR head
stateClosed
labels
bugaibuild
assigneesneo-opus-vega
createdAtOct 23, 2026, 4:15 PM
updatedAtOct 23, 2026, 5:04 PM
githubUrlhttps://github.com/neomjs/neo/issues/20064
authorneo-opus-vega
commentsCount0
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
contentTrust
projected
quarantined0
signals[]
blockedBy[]
blocking[]
closedAtOct 23, 2026, 5:04 PM
milestonev13.3.1

A body edit's rerun leaves the first run's red on the PR head

neo-opus-vega
neo-opus-vega commented on Oct 23, 2026, 4:15 PM

Context

Operator, 2026-10-23: the second half of the merged-PRs-read-red item (#20061 / PR #20062 took the first). After the controller's post-merge runs leave the merged heads, 7 of the 30 most recently merged PRs still roll up FAILURE, from 8 red contexts of one class: a check that ran twice on the same head and whose first run's conclusion stayed.

red context count PRs
File Size Guard / check-size CANCELLED, a later run of the same name SUCCESS on the same head 6 #20053, #20037, #20032, #20019, #19998
PR Baseline / baseline / PR body FAILURE, a later run SUCCESS on the same head 2 #20000, #19997

GitHub's rollup (the field the PR list icon renders, as "59/60 checks passing" with a red mark) counts every check run on the SHA, not the latest per name: #20032 carries two cancelled check-size runs (07:17Z, 07:20Z) and three green ones (07:22Z, 07:36Z, 08:08Z) and rolls up FAILURE. The merge gate reads the latest run per required context, which is why these PRs merged clean while reading red.

Live specimen and mechanism proof, 14:0xZ: PR #20063 (head a949c64086) opened at 14:00Z; check-size run 39965984915 (created 14:00:42Z) was cancelled when the body-edit run 39966042076 arrived at 14:01:05Z under the workflow's cancel-in-progress: true group; the edit run passed; rollup FAILURE. gh run rerun 39965984915 at 14:11:51Z → attempt 2 success at 14:12:39Z → rollup SUCCESS (63 green, 1 skipped), the cancelled entry gone: a re-run replaces the conclusion in place.

Prior sightings on the record: Mnemosyne read the cancelled check-size as a superseded duplicate on PR #19352 (10-01) and PR #19587 (10-11) and adopted a workaround (edit the body before the push or after green); Grace (08-17) found that a re-run replays the frozen event payload, so a body gate reading github.event.pull_request.body can never pass on re-run, which is why the baseline's pr-body job now fetches the body live (reusable-pr-baseline.yml v0.1.55:468–489), as does file-size-guard.yml:43–55. That property is what the fix below depends on.

Live latest-open sweep: the newest 20 open issues at 14:13Z, no equivalent (#20061 is the controller half). A2A claims in the last hour: none on this surface. Memory Core rationale sweep: the three sightings above, no prior fix. Own open assignments: #20061 (the sibling), none else on this surface.

The Problem

Two workflows re-run on an unchanged head when the PR body changes (pull_request: edited), by design: both read the body (the size ratchet's justification marker, the PR-body anchors). Each edited event starts a new workflow run, a new check suite with check runs of the same names, and the earlier suite's conclusions stay on the SHA:

  1. File Size Guard cancels the in-progress run of the same ref when the edit arrives (concurrency.group: file-size-guard-${ref}, cancel-in-progress: true, file-size-guard.yml:21-23). The cancelled run is a red check run on the head for good; agents edit the body right after opening a PR, so the cancellation is routine (6 of 30 PRs).
  2. PR Baseline / PR body fails on a body that misses an anchor and passes once the author edits it, the designed fail-fix-pass flow. The first run's FAILURE stays beside the later SUCCESS (2 of 30). File Size Guard's own ratchet has the same designed flow (fail, add the justification, pass): 0 of 30 today, structural all the same.

Neither workflow can fix this from inside a run: check runs cannot be deleted, and GitHub offers no latest-per-name rollup. What does work is re-running the first run after the head has a green run of the same workflow: re-runs replace the conclusion in place (the specimen above), and both jobs read the live PR, so the re-run judges the corrected body, not the frozen payload.

The Architectural Reality

  • .github/workflows/file-size-guard.yml:7-10 triggers on opened, edited, synchronize, ready_for_review with a paths filter; :21-23 the concurrency group with cancellation; :43-55 fetches the live body for --pr-body-file. The repo-wide run_attempt == '1' && github.ref || github.run_id idiom (#15593) governs workflows that cancel; a workflow with no concurrency block is outside its scope by construction.
  • .github/workflows/pr-baseline.yml:55-57 triggers on the same four events and calls neomjs/neo-agent-skills/.github/workflows/reusable-pr-baseline.yml@v0.1.55; it has no concurrency block, so its runs never cancel each other (0 cancellations in the data). Its ten jobs are required contexts in the dev ruleset (gh api repos/neomjs/neo/rules/branches/dev); the file's header still says dev carries no required_status_checks rule, a comment drift noted as a defect-note, not touched here.
  • reusable-pr-baseline.yml v0.1.55 pr-body (:438-520) fetches the body with pulls.get and runs neo-agent-skills-pr-body; no checkout.
  • GitHub: workflow_run runs execute in the base repository from the default branch's workflow file, with a token that may hold actions: write, and anchor their own check runs on the default-branch commit they ran from (github.sha), while the payload carries the triggering run's head_sha, workflow_id and run_number; actions.listWorkflowRuns filters by workflow_id + head_sha; actions.reRunWorkflow / reRunWorkflowFailedJobs start a new attempt whose job conclusions replace the previous attempt's in the suite (the specimen); re-runs keep the original run's actor, SHA and ref.
  • The durable home for the repair is the Skills corpus' reusable baseline, which every consumer repository calls; a consumer cannot change it from here and the tag pin moves by release. The repository-local shape below is the one that ships in the v13.3.1 window; it retires when the upstream shape lands (sunset condition in Out of Scope).

Design authority: #15593's rerun-isolation contract is the idiom for workflows that cancel; removing File Size Guard's cancellation takes it out of that contract's scope rather than bending it. The body-edit trigger stays load-bearing (pr-baseline.yml:15-20); nothing here changes what is linted or when.

The Fix

  1. file-size-guard.yml: delete the concurrency block (3 lines). Two runs on the same head both complete; a synchronize run's predecessor finishes on the old SHA, invisible on the new head. Cost: one redundant ~40 s job per rapid body edit.
  2. New .github/workflows/same-head-check-repair.yml: on: workflow_run: workflows: [PR Baseline, File Size Guard], types: [completed], permissions: actions: write, one github-script job that, when the completed run is success from a pull_request event on an open PR, lists that workflow's runs on the same head_sha and re-runs each completed run whose conclusion is failure, cancelled or timed_out, whose run_attempt is 1 and whose per-workflow run_number is lower than the witness's (failed jobs only for failure, all jobs for cancelled / timed_out); API errors become core.warning, never a failed job, because the job's own check run sits on the dev commit the event ran from and a red there is a red on dev. The loop terminates: a repaired run completes green and lists nothing to repair, the attempt bound stops a run that fails twice, and the run-number bound keeps an old green that finishes late from spending a newer red run's retry before the author's fix has run (Euclid's RA-1 on PR #20066).
  3. Nothing else: PR Baseline's caller, the reusable workflow, the ruleset and both lint scripts are untouched.

Contract Ledger Matrix

Target Surface Source of Authority Proposed Behavior Fallback Docs Evidence
File Size Guard runs on one head the workflow's trigger set (unchanged) every run completes; none cancels a sibling on the same ref none needed the file's trigger comment AC-1
Same-Head Check Repair (new) workflow_run of the two body-reading workflows after a green run on a head, red runs of the same workflow on that head with a lower run number are re-run once the repair job never fails; an API refusal is a warning and the stale red stays, as today workflow header AC-2, AC-3
required contexts baseline / * dev ruleset unchanged (the latest run per name already governs the gate) — — the ruleset read

Decision Record impact

none.

Acceptance Criteria

  • AC-1 No same-head cancellation: file-size-guard.yml has no concurrency key; on this ticket's PR, a body edit during an in-flight check-size run leaves two check-size SUCCESS entries and no CANCELLED entry in the head's rollup (the PR touches the guard's own file, so the guard runs).
  • AC-2 Repair, evaluated: the committed repair script, run against a mocked actions API with runs [A: failure attempt 1, B: the completed success (self), C: cancelled attempt 2, D: in_progress, N: a newer failure attempt 1], re-runs exactly A (failed jobs) and nothing else; with C at attempt 1 it re-runs A and C (C all jobs); an older green completing after the newer failure N re-runs nothing, and a later green re-runs N once; with the PR closed, or the triggering run not success, or its event not pull_request, it re-runs nothing. Output in the PR body.
  • AC-3 Never red itself: the same harness with every actions call throwing ends with warnings and no setFailed.
  • AC-4 Post-merge only: for the first PR after this lands whose PR body job fails and then passes on a body edit, the head's rollup shows the first run at attempt 2 success within minutes of the green run and no stale FAILURE; receipt on this ticket.

Out of Scope

  • The upstream home: a neomjs/neo-agent-skills ticket to fold the repair into reusable-pr-baseline.yml (serving every consumer), filed as the follow-up; when it ships and the pin moves, same-head-check-repair.yml loses its PR Baseline entry, and retires once File Size Guard moves there too.
  • Retroactive repair of the 7 merged PRs: a re-run of a merged PR's check-size checks out a merge ref that no longer exists; the baseline's pr-body has no checkout and would repair; the operator's call whether old history is worth touching.
  • pr-baseline.yml's header drift (says no required contexts; the ruleset requires all ten): defect-note.
  • The dev commit list's red (test runs cancelled by the next merge): a runner-budget decision.
  • Two green witnesses completing within the same seconds may both request the same re-run; GitHub refuses the second (the run is already in progress) and the refusal is a warning. Not exercised against GitHub; the first week's Same-Head Check Repair run logs show it if it happens.

Avoided Traps

  • cancel-in-progress: false for File Size Guard: keeps one running and one pending job and cancels a third arrival's predecessor; three events within a run's 40 s still leave a cancelled entry.
  • Re-running on edited instead of a fresh run: the fresh run is the event's own evidence; the repair re-runs the old run only after a green one exists, so a re-run can never outrank a green with a red (Grace's 08-17 trap, in reverse).
  • Completion order as "earlier": a success that completes later is not a later success; the witness relation is the per-workflow run number (RA-1).
  • Status-context verdicts for the lints: latest-write-wins would need the required contexts rebound in the ruleset (#17171's domain) and a change to the reusable workflow.
  • Dropping edited: the body gates stop re-judging corrected bodies (pr-baseline.yml:15-20).

Related

#20061 / PR #20062 (the controller half), #15593 (rerun isolation), #17171 (required-context policy), #19352 and #19587 (prior sightings), #20022 (the cut), PR #20066.

Retrieval Hint: "same-head rerun stale red check-size cancelled PR body failure rollup repair workflow_run"

— Vega (Claude Fable 5.1, Claude Code) 🌿

tobiu referenced in commit c393d9f - "feat(ci): a green rerun repairs the same head's earlier red runs (#20064) (#20066) on Oct 23, 2026, 5:04 PM
tobiu closed this issue on Oct 23, 2026, 5:04 PM