Skip to content

CLAUDE.md: document the double-push review-race variant - #249

Merged
dem-extra1 merged 2 commits into
mainfrom
claude/gii-sparta-52amka
Jul 12, 2026
Merged

dem-extra1 merged 2 commits into
mainfrom
claude/gii-sparta-52amka

Conversation

@dem-extra1

Copy link
Copy Markdown
Collaborator

Documentation-only extension of the existing "A canceled review can red-X
require-review" section.

What

Two closely-spaced ordinary pushes (not just a push plus an @claude review comment) trigger the same cancel-in-progress race on
claude-review's concurrency group — the second push's review cancels the
first's. This is correct, intended behavior (only the latest commit's
review matters), not a workflow defect, so no code change accompanies
this — just documentation making that explicit, plus a cheap SHA-comparison
shortcut to skip investigating a stale-commit CI-failure event without an
extra tool call.

Why

Hit live on Lacaedemon/sparta PR #780: two pushes ~3 minutes apart
triggered a require-review failure event on the non-head commit;
confirmed via get_workflow_run that the flagged run's conclusion was
cancelled, matching the existing documented pattern but via a different
trigger (two pushes, not a push + comment). Recording the variant and the
faster diagnostic shortcut for next time.


Generated by Claude Code

…ck shortcut

Extends the existing "canceled review can red-X require-review" section:
the same race also fires from two ordinary pushes close together (not
just a push plus an @claude review comment), and it's not a workflow
defect to fix -- cancel-in-progress on a stale commit is the correct
behavior. Adds a cheap self-check (compare the failing SHA against the
PR's current head) to skip investigation without an extra tool call.
@codecov

codecov Bot commented Jul 12, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ All tests successful. No failed tests found.

Comment thread CLAUDE.md Outdated
rare double-push. The fix is behavioral: batch closely-related changes into
one commit/push instead of two in quick succession.

**Cheap self-check before investigating any CI-failure webhook event:**

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Scope overreach: this shortcut only applies to require-review/claude-review, not "any CI-failure webhook event."

The mechanism this paragraph relies on — a stale run getting canceled by cancel-in-progress: true on supersession — is specific to two jobs in this repo: claude-code-review.yml's claude-review (group claude-review-<PR#>) and preview.yml's preview job. _selftest.yml (which runs check-links, phi-tests, bib, coverage, review-fail-check, etc.) has no concurrency: block at all, so a superseded commit's _selftest job is never canceled — a genuine failure there can coexist with a SHA that no longer matches head (e.g. the reader simply hasn't re-checked after a later push landed).

As written, "before investigating any CI-failure webhook event... the event is almost certainly this exact race" tells a future reader to skip confirming cancelled vs failure for any failing check, not just claude-review/require-review. Applied to a _selftest job, that shortcut would wrongly wave off a real bug as "just the race." Per this file's own rule 4 ("every factual claim... needs either reasoning... and a bare assertion with neither is a finding"), the "any" scope is asserted without the reasoning that actually only supports the two cancel-in-progress jobs.

Suggest narrowing the opening clause:

Suggested change
**Cheap self-check before investigating any CI-failure webhook event:**
**Cheap self-check before investigating a post-push `require-review`/`claude-review` failure:**

(Separately, minor: line 406's "the flagged run" introduces a third term for the same referent this paragraph otherwise calls "the failing check"/"the event" — consider reusing one of those instead for consistency.)

@claude

claude Bot commented Jul 12, 2026

Copy link
Copy Markdown
Contributor

Code review

Documentation-only PR extending the existing "A canceled review can red-X require-review" section in CLAUDE.md to cover the double-push variant of the review race, plus a SHA-comparison shortcut for diagnosing it. Verified the core claims against the actual workflow config:

  • examples/claude-code-review.yml's pull_request trigger includes synchronize, so two back-to-back pushes do fire two separate claude-review runs.
  • claude-review's concurrency: group: claude-review-${{ github.event.pull_request.number || inputs.pr-number }} / cancel-in-progress: true is keyed only on PR number, so the second run does cancel the first — the PR's mechanics claim is accurate.
  • pull_request_read (method get, field head.sha) and actions_get (method get_workflow_run) match this file's own MCP tool table and the real GitHub Actions MCP server's tool surface — no hallucinated APIs.
  • The cited Lacaedemon/sparta PR feat(claude): add dispatch-review-on-agent-push input to claude.yml #780 is a real, open PR in a registered consumer repo (confirmed via gh api) — not a fabricated citation.

One finding posted inline (CLAUDE.md:398): the new "Cheap self-check" paragraph scopes itself to "any CI-failure webhook event," but the underlying mechanism (a canceled run from cancel-in-progress: true) is specific to claude-review/preview — _selftest.yml has no concurrency: block, so applying this shortcut to, say, a genuine check-links or phi-tests failure could wrongly dismiss a real bug as "just the race." Suggested a narrower opening clause there.

No other issues found — the addition matches this file's own established style (bold-lead-in paragraphs, em-dash usage, parenthetical real-world citations), doesn't restate the section it extends (it documents a genuinely distinct trigger: two ordinary pushes colliding, no comment/dispatch involved), and its reasoning against a debounce-based fix is adequately defended.

Verdict

Needs minor revision — one scoping fix suggested inline (a one-line wording change); everything else checks out.

@github-actions

Copy link
Copy Markdown
Contributor

Claude finished review — View run


gh pr comment 249 --repo d-morrison/gha --body "$(cat <<'EOF'

Code review

Documentation-only PR extending the existing "A canceled review can red-X require-review" section in CLAUDE.md to cover the double-push variant of the review race, plus a SHA-comparison shortcut for diagnosing it. Verified the core claims against the actual workflow config:

  • examples/claude-code-review.yml's pull_request trigger includes synchronize, so two back-to-back pushes do fire two separate claude-review runs.
  • claude-review's concurrency: group: claude-review-${{ github.event.pull_request.number || inputs.pr-number }} / cancel-in-progress: true is keyed only on PR number, so the second run does cancel the first — the PR's mechanics claim is accurate.
  • pull_request_read (method get, field head.sha) and actions_get (method get_workflow_run) match this file's own MCP tool table and the real GitHub Actions MCP server's tool surface — no hallucinated APIs.
  • The cited Lacaedemon/sparta PR feat(claude): add dispatch-review-on-agent-push input to claude.yml #780 is a real, open PR in a registered consumer repo (confirmed via gh api) — not a fabricated citation.

One finding posted inline (CLAUDE.md:398): the new "Cheap self-check" paragraph scopes itself to "any CI-failure webhook event," but the underlying mechanism (a canceled run from cancel-in-progress: true) is specific to claude-review/preview — _selftest.yml has no concurrency: block, so applying this shortcut to, say, a genuine check-links or phi-tests failure could wrongly dismiss a real bug as "just the race." Suggested a narrower opening clause there.

No other issues found — the addition matches this file's own established style (bold-lead-in paragraphs, em-dash usage, parenthetical real-world citations), doesn't restate the section it extends (it documents a genuinely distinct trigger: two ordinary pushes colliding, no comment/dispatch involved), and its reasoning against a debounce-based fix is adequately defended.

Verdict

Needs minor revision — one scoping fix suggested inline (a one-line wording change); everything else checks out.
EOF
)"

@github-actions

Copy link
Copy Markdown
Contributor

💰 Cost: $3.1788 (review) — run

The cancel-in-progress mechanism only applies to claude-review/preview,
not every CI job -- _selftest.yml has no concurrency block, so applying
the shortcut there could wrongly dismiss a real failure as the race.
Also drops the redundant "the flagged run" phrasing.
@github-actions

Copy link
Copy Markdown
Contributor

Claude finished review — View run


Code review — PR #249: CLAUDE.md: document the double-push review-race variant

Status: No new findings. The prior review round's one finding has been fixed in the follow-up commit.

What changed since the prior review (commit 46a7437 "narrow the SHA-check shortcut's scope per review", pushed 26 seconds after the prior review at 2026-07-12T03:10:33Z):

  • The flagged sentence — "before investigating any CI-failure webhook event... the event is almost certainly this exact race" — was replaced with the suggested narrower framing: "Cheap self-check before investigating a post-push require-review/claude-review failure:"
  • A new explicit scoping sentence was added, going beyond the suggested one-line fix: "This shortcut is scoped to the two jobs that actually run under cancel-in-progress: true (claude-review/preview) — _selftest.yml's jobs (check-links, phi-tests, bib, coverage, review-fail-check, etc.) have no concurrency: block, so a failure there on a non-head SHA is a real result the reader hasn't re-checked yet, not this race; don't apply the shortcut outside claude-review/require-review/preview."

This directly closes the gap identified in the prior round: a future reader following this section will no longer be told to wave off a genuine _selftest.yml failure as "just the race."

I re-verified the rest of the addition holds up on this pass too:

  • No new unverifiable claims, hallucinated tool/API references, or fabricated citations were introduced by the fix commit.
  • The added scoping sentence is itself internally consistent with the surrounding text's job/workflow names (claude-review, preview, _selftest.yml's check-links/phi-tests/bib/coverage/review-fail-check — all real job names in this repo).
  • Prose style (bold lead-ins, em-dash usage, parenthetical citation) remains consistent with the rest of the file; no AI-authorship tells introduced.
  • The separate minor "flagged run" terminology note from the prior round refers to pre-existing content this PR doesn't touch, so it's out of scope here (per the false-positive list: pre-existing issues aren't re-flagged).

No --comment argument was provided, so no GitHub comment is being posted — this is a terminal-only summary per the review instructions.

Verdict

Ready for merge — the prior verdict's one finding was addressed by commit 46a7437; no new issues found on this pass.

@github-actions

Copy link
Copy Markdown
Contributor

💰 Cost: $0.8083 (review) — run

@dem-extra1
dem-extra1 merged commit 130f03c into main Jul 12, 2026
20 checks passed
@dem-extra1
dem-extra1 deleted the claude/gii-sparta-52amka branch July 12, 2026 03:16
d-morrison added a commit that referenced this pull request Jul 18, 2026
* Code review guidelines: add item 14, don't reinvent the wheel (closes #264)

Companion to Morrison-Lab/ai-config#603, which enshrines DRW as a dev and
review principle and starts a central big-picture-principles catalog.
Follows the hedged proposed-in-ai-config#N citation convention while
that PR is open. Per #247/#249 precedent, a CLAUDE.md-only guidelines
change takes no changelog.d fragment.

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01V5v5mUjURB2YW1nJW2Ai9S

* Item 14: specify where the checked-nothing-fit note lives (review round 1)

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01V5v5mUjURB2YW1nJW2Ai9S

* Item 14: qualify the marketplace entry as vetted, well-maintained, SHA-pinned (review round 2)

Co-Authored-By: Claude Fable 5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01V5v5mUjURB2YW1nJW2Ai9S

---------

Co-authored-by: Claude <[email protected]>
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.

2 participants