…ures (#5410)
## Summary
The implementation pipeline was leaving PRs and issues stuck after a
single Claude Code Action hiccup. Three fixes restore self-healing
behavior:
- **`impl-generate.yml`**: cap raised from **2 → 3** generation
attempts, aligning with the existing `impl:{lib}:failed` label
description (*"max retries exhausted (3 attempts)"*) and the repair
phase's 3-attempt budget. Failure comments now read `Attempt N/3`.
- **`impl-repair.yml`**: previously had no failure handler — when the
Claude Code Action itself crashed, the workflow ended with `ai-rejected`
already removed and re-review never fired, leaving the PR silently
stuck. Added a `Handle repair failure` step that restores `ai-rejected`
and auto-retries the same attempt **once** via a marker comment, then
falls back to manual.
- **`impl-review.yml`**: both failure paths (Claude crash → `Handle
review failure`, and score=0 from missing `quality_score.txt` →
`Validate review output`) immediately surfaced `ai-review-failed`,
requiring manual rerun. Both now auto-retry **once** via
`repository_dispatch` with a shared marker comment before giving up.
The `>=50% after 3 attempts` merge logic in `impl-review.yml` was
already correct and is unchanged — these fixes only ensure PRs reach
that gate instead of stalling earlier.
## Concrete trigger (not added to the PR but motivated it)
Issue #5365 (`area-mountain-panorama`) had **4/9 libraries hard-failed**
without ever creating a PR (transient Claude crashes during generate,
capped at 2 attempts), **1 PR stuck** with `ai-review-failed` (plotnine
#5372), and **1 PR stuck** mid-repair (altair #5370 — repair workflow
itself crashed on attempt 1). Manual recovery was triggered earlier in
the conversation.
## Test plan
- [ ] Trigger a generate that fails twice (e.g., simulate or wait for
transient flake) — should auto-retry to attempt 3 instead of stopping at
2
- [ ] Trigger a repair where Claude Code Action crashes — should restore
`ai-rejected` and auto-retry the same attempt once via marker comment
- [ ] Trigger a review where Claude crashes — should auto-retry via
`repository_dispatch` once before adding `ai-review-failed`
- [ ] Trigger a review where Claude runs but writes no
`quality_score.txt` — same auto-retry behavior
- [ ] Verify markers prevent infinite retry loops (each marker only
allows one auto-retry)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
---------
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Implementation:
area-mountain-panorama- python/altairImplements the python/altair version of
area-mountain-panorama.File:
plots/area-mountain-panorama/implementations/python/altair.pyParent Issue: #5365
🤖 impl-generate workflow