Skip to content

Close a CI failure report once diagnosed, and reopen it on the lane's next failure - #1677

Merged
max-sixty merged 2 commits into
mainfrom
ci-report-reopen
Nov 14, 2026
Merged

max-sixty merged 2 commits into
mainfrom
ci-report-reopen

Conversation

@max-sixty

@max-sixty max-sixty commented Nov 11, 2026 •

Copy link
Copy Markdown
Owner

A CI failure report now closes once triage has diagnosed it and every failure has an owner, and the lane's next failure reopens it. Reopening starts ordinary issue triage, so each failed verdict on a branch that stays red gets a session, with no workflow dispatch.

Why

Since #1580, a report enters triage through ordinary issue events: filing it starts a session. But the report stayed open for the whole red spell, so on a branch that stays red, every later failure only added a "Failed again" comment and started nothing until the daily sweep (#1581 accepted that wait). Leaf's main has been red since 25 Oct, and its new failures waited 3.8 to 17.7 hours for the sweep to name them. On 9 Nov, sessions started by hand after each failed verdict named every new failure they judged real within 10 to 21 minutes, for $1.24 to $1.85 each.

The report stayed open because its open state meant "the lane is red". It now means what an open issue means elsewhere: work not yet handled. #1566 got a session per failure by having the reporter dispatch triage, which #1580 removed. This change keeps #1580's model and gets each session from the issue's own lifecycle.

How it works

  • Triage (triage/references/ci-failures.md, new step 6 of "A report"): the session re-reads the report and diagnoses any run that arrived meanwhile. Once the runs it owes are diagnosed and each failure has an owner, a transient resolution or work a maintainer ended, it closes the report. While a failure has no owner, for example after a refused creation, it leaves the report open for the daily sweep.
  • Reporter (ci_failure_report.py): a failed run with no open report reopens the lane's newest report, unless the lane has passed since that report was filed. It comments before reopening, because the reopen starts the session that reads the comment. After a pass, or when the lane has no report yet, it files a new one as before. The pass check reads the run listing the superseded check already fetches. While a report is open, a failure only comments, so a burst of red verdicts starts one session, which reads them all.
  • Daily sweep (review-runs): it judges a red lane's newest report, open or closed, against step 6. A closed report that step 6 would no longer close, because a failure's owner lapsed, is reopened with a comment naming that failure's run, which starts its triage. An open report that step 6 would close is finished work its session didn't close, so the sweep closes it, and the next failure reopens it. Any other open report goes to triage as before.
  • Review (review/references/approving.md): a PR failure the default branch shares is owned by that workflow's newest report, open or closed, and the owners its diagnosis links, rather than only by an open report.
  • The docstring, report body, template comment, AGENTS.md, the README, tend.example.yaml, and the notifications and triage skills describe the new lifecycle.

Two limits remain:

  • If a report session fails, or leaves a failure without an owner, the report stays open. Later failures then only comment until the daily sweep, as every failure does today. 14 of Leaf's last 200 triage runs (3 to 11 Nov) failed.
  • A closed report no longer means its lane is green. Its last comment says whether a pass or a diagnosis closed it.

Validation

  • uv run pytest: 1665 passed, and pre-commit is clean on the changed files. The only snapshot change is the generated workflow's template comment.
  • A new reporter test covers the reopen, its ordering, and an earlier spell's pass-closed report. These mutations all fail it or an existing test: reopening the oldest closed report, ignoring a pass since filing, counting any pass, reopening before commenting, and never reopening.
  • An independent review found the stale sweep and notification wording, the step 6 ambiguities, and edge cases in an earlier previous-verdict rule. All are fixed here. One edge remains: if a maintainer re-runs an older run during a red spell and it passes, the next failure files a second report. None of Leaf's last 100 runs on main was a re-run.
  • Evals (Claude, current guidance, 3 trials each): ci-report-progress (now with a creation-refused near miss, where the report must stay open), ci-report-repair-choice, ci-cause-recovery and ci-report-run-records pass 12/12. Their rubrics now expect a diagnosed and owned report to close. I didn't run the historical arm: the old guidance never closes a report, so it could only show the rubric change. One earlier trial failed because the rubric said "close" where the case asks for a proposal. The rubric now says "propose closing".

This was written by Claude Code on behalf of max-sixty

… next failure

A report stayed open for its whole red spell, so on a branch that stays red
every later failure only commented and started nothing until the daily sweep.
Triage now closes the report once the runs it owes are diagnosed and each
failure has an owner, a transient resolution or work a maintainer ended, and
leaves it open while a failure has none. With no open report, the reporter
reopens the lane's newest report unless the lane passed since it was filed,
commenting first because the reopen starts the session that reads it. Each
failed verdict on a red branch so gets a triage session through ordinary
issue events, without the dispatch #1580 removed.

The daily sweep closes an open report that step 6 would close. The
docstring, report body, template comment, AGENTS.md, README, example config,
and the notifications and triage skills describe the new lifecycle, and the
CI-report eval rubrics expect the close, with a refused-creation near miss
that keeps the report open.

@tend-agent tend-agent left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This PR makes "lane still red, report closed after diagnosis" the normal state between failures. Two consumers of the report still assume a red lane has an open report.

  • review-runs, failing default-branch CI (inline). red-default-branch-runs will list every red run of such a lane as a candidate, because no later green exists. The bullet used to define when a report-tracked failure counts as a fix in progress: "a cause issue or repair PR covers the failure". This PR replaced that with a rule that only covers open reports. For a closed report the sweep has two options. It can hand the report to triage, where step 1 says "A closed report needs nothing". Or it can treat the failure as having no fix in progress and work it directly, alongside the cause owners the diagnosis already linked. Either way, the case this PR makes common no longer gets a defined outcome.
  • /tend-ci-runner:review's references/approving.md, step 3 "Route the failure to its fixer" (outside the diff). It says the default branch's repair is owned by "its open CI failure report … where one tracks that workflow, or the daily scan … where none does". Mid-spell, the review will now usually find no open report and name the daily scan as the owner, when the closed report and the cause issues it links are the actual owners.

With reports closing once diagnosed, a red lane's report is usually closed.
The daily sweep now judges the lane's newest report against step 6: a closed
report that step 6 would still close needs nothing, and one it no longer
would, because a failure's owner lapsed, is reopened with a comment naming
that run, which makes the run owed and starts its triage. Handing a closed
report to triage would do nothing, since triage skips a closed report.

The review's routing of a failure the default branch shares now names that
workflow's newest report, open or closed, and the owners its diagnosis links,
rather than only an open report.
@max-sixty
max-sixty merged commit c81fdda into main Nov 14, 2026
14 checks passed
@max-sixty
max-sixty deleted the ci-report-reopen branch November 14, 2026 17:41
@max-sixty max-sixty mentioned this pull request Nov 14, 2026
max-sixty added a commit that referenced this pull request Nov 14, 2026
Bumps the generator to 0.3.25, syncs `uv.lock`, and adds the 0.3.25
section to `CHANGELOG.md`, which the tag's release workflow publishes as
the GitHub Release notes.

The release ships the 21 commits since 0.3.24. The one it was cut for is
#1677: CI failure reports close once triage has diagnosed them and
reopen on the lane's next failure, so each failed run on a branch that
stays red starts a triage session.

> _This was written by Claude Code on behalf of max-sixty_
max-sixty added a commit to max-sixty/leaf that referenced this pull request Nov 14, 2026
Regenerates Leaf's Tend workflows with [tend
0.3.25](https://github.com/max-sixty/tend/releases/tag/0.3.25).

The change that matters here is the CI failure report's lifecycle
([max-sixty/tend#1677](max-sixty/tend#1677)).
`main` has been red since 25 Oct, and its report stayed open the whole
time, so each later failed `ci` run only added a "Failed again" comment
and new failures waited up to a day for the daily sweep. Now triage
closes the report once every failure has an owner, and the next failed
run reopens it, which starts a triage session through the ordinary
`issues: reopened` event. The workflow change itself is only
`tend-ci-failures`' comment and every action pin moving to 0.3.25; the
behavior is in the released runtime and skills.

The release also retries the uv download in `setup-runtime`
([max-sixty/tend#1666](max-sixty/tend#1666)),
where one 504 on 8 Nov left Leaf's new causes waiting 22 to 24 hours for
the next sweep, and ends a session's CI poll before the session's own
timeout
([max-sixty/tend#1683](max-sixty/tend#1683)).

> _This was written by Claude Code on behalf of max-sixty_
max-sixty pushed a commit to max-sixty/worktrunk that referenced this pull request Nov 15, 2026
Regenerates the Tend workflows for tend 0.3.24 → 0.3.25
([compare](max-sixty/tend@0.3.24...0.3.25)).
The diff only bumps the action pins and the generated-by header, plus a
reworded `tend-ci-failures` header comment. The behavior changes come
with the new action version.

What changes for this repo:

- **CI failure reports follow the lane's state.** Triage now closes a CI
failure report once it has diagnosed the failure and every failure has
an owner. The lane's next failure reopens the report, which starts a new
triage session instead of only adding a "Failed again" comment
(max-sixty/tend#1677). Before filing, triage also searches for an
existing cause by the full test name (max-sixty/tend#1673).
- **CI polling handles more cases.** A failed external check, such as
`codecov/patch`, now returns red once it fails on two reads 30 seconds
apart, without waiting for hung Actions jobs (max-sixty/tend#1584).
Cancelled matrix checks are superseded by a later run of the same
workflow (max-sixty/tend#1526). The poll now ends before the Claude
session's own timeout, so a session that approved and then polled CI can
still act on the result (max-sixty/tend#1683).
- **`tend check` can accept a reviewed failure.** A maintainer can list
a failing check under `checks.accepted` in `.config/tend.yaml` with a
reason. It then prints as `ACCEPTED`, no longer fails `tend check`, and
the nightly drift step treats it as a non-failure (max-sixty/tend#1662).
This is relevant to #4797 if the `release` environment's
`workflow_dispatch` exposure is judged acceptable rather than gated.
- **Setup is more robust.** `setup-runtime` retries the uv download
(max-sixty/tend#1666), and Claude Code moves to 2.1.322
(max-sixty/tend#1665).

Co-authored-by: worktrunk-bot <[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