Skip to content

mention: drop a review bot's approval, and read tend's output where nobody else does - #1292

Merged
max-sixty merged 5 commits into
mainfrom
faber-tend-issues
Sep 17, 2026
Merged

max-sixty merged 5 commits into
mainfrom
faber-tend-issues

Conversation

@max-sixty

@max-sixty max-sixty commented Sep 17, 2026 •

Copy link
Copy Markdown
Owner

Two changes, both from reading what tend did in a consumer repo we don't maintain.

tend-mention wakes on a third-party review bot's approval

mention_verify's review gate skips an approval only when its body is empty. A code-health badge and a "looks safe to merge" template are bodies, so a review bot's approval falls through to the participation heuristic and boots a session that can only exit silently — once per review bot per push, on a PR the bot has already reviewed.

Author type is what separates the two cases: a person's prose alongside an approval is addressed to someone, and a review bot's is generated status. So an approval with no inline comments is terminal when the author is a Bot, whatever its body says.

A COMMENTED review from the same bot still runs. Sometimes it carries a real finding and sometimes a fixed template, and no state or author field tells them apart — that needs a reader, which is what the session is.

review-reviewers comes off pause, over the consumers we don't maintain

The outside-in sweep has been dispatch-only since its hourly fleet-wide version twice hit a quota ceiling that took the user-facing workflows down with it. It now runs daily over diffplug/dormouse and jakobtfaber/Faber2026, and nothing else: those are the repos whose tend runs nobody here reads, while on our own repos tend's work arrives in PRs and issues we read anyway. Two legs a day is a fraction of what got it paused.

The skill had a matching hole. It read an empty run list as all-clear, which is exactly backwards when a repo has switched tend off — the state that produces no runs at all. Step 1 now reads the target's workflow states first, and reporting that state is the whole job: there are no runs for Steps 2 and 3 to key on, while Step 4's dedup check is what keeps a repo that stays switched off from opening the same issue every day.

test_review_reviewers_matrix_covers_consumers asserted the matrix covered data/consumers.json, which is now deliberately false. The invariant that replaces it is weaker (matrix entries must still be consumers) plus one line in running-tend's weekly refresh step, since a new adopter shows up there first.

One window for both daily profiles

Putting review-reviewers on a cron exposed a constant sized for its old cadence. list_recent_runs.py capped its window at 6h, which was right when dispatches sat days apart; on a daily cron the anchor is always ~24h back, so every tick would clamp to 6h and record an ~18h coverage gap. The night is covered by that 6h either way — it is the event-driven part of the day, which is what this sweep exists to judge, that would fall outside.

Both profiles are now daily crons resuming from their own previous run, so they share one 49h cap, one 25h no-anchor default and one 24h creation cushion — the values review-runs already used. profile no longer selects window constants at all. review-runs' behaviour is unchanged.

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

max-sixty and others added 3 commits September 17, 2026 15:50
…obody else does

A third-party review bot's APPROVED review reached the participation
heuristic and booted a session that could only exit silently. The existing
skip is keyed on an empty body, and a code-health badge or a "looks safe"
template is a body. Author type is what separates them: a person's prose
alongside an approval is addressed to someone, a review bot's is generated
status. A COMMENTED review from the same bot still runs — sometimes it
carries a finding, and no field tells the two apart.

review-reviewers comes back on a daily cron over the two consumers nobody
here maintains, which is all it now sweeps: our own repos' tend runs arrive
in PRs and issues we read anyway. The weekly consumers.json refresh adds a
new one when the adopter is someone else. And the skill reads the target's
workflow states first, so an empty run list is all-clear only where tend is
still enabled; where it isn't, the run reviews tend's output from before it
stopped.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>

@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.

Moving review-reviewers to a daily cron leaves list_recent_runs.py's window cap where the hourly cadence put it, so each scheduled tick surveys 6h and records the other 18h as a coverage gap.

In plugins/tend-ci-runner/scripts/list_recent_runs.py the review-reviewers profile takes WINDOW_CAP = timedelta(hours=6). When the anchor — the previous successful run of this workflow — is older than that, the floor clamps to now - 6h and the script warns more than 6h back ... Record a coverage gap, not an all-clear. At a daily cadence the anchor is always ~24h back, so that branch fires on every cron run, not on the outage it was written for. Step 1 then has the session record a gap, and per its own text the next run's floor advances past that span regardless — so 09:41Z–03:41Z is read by nothing, every day.

The cron time does put the consumers' default tend-nightly (06:17Z) and tend-review-runs (07:47Z) inside the 6h window, so the night is genuinely covered. What falls outside is the event-driven day — tend-review, tend-triage, tend-mention, tend-ci-fix — which is where the accepted-or-rejected outcomes this sweep judges actually land.

The same file already carries the daily-cadence analogue for the other profile: REVIEW_RUNS_WINDOW_CAP = timedelta(hours=49), two days plus slack so one missed tick still gets covered. Giving review-reviewers that shape would also make both prose claims true as written, where today they read backwards:

  • .claude/skills/review-reviewers/SKILL.md: "or 6h back when that is older — normally a day, since the workflow runs daily". The floor is 6h back normally, and the cap means it never reaches further.
  • .claude/skills/running-tend/SKILL.md: "a daily tick covers the day and a dispatch soon after one covers the last 6h and warns on stderr". Inverted — the daily tick is the case that clamps and warns; a dispatch within 6h of the last run is the case that doesn't.

The cap sits outside this diff, so I haven't pushed anything. Happy to send the cap plus the two clamp tests it pins (test_no_anchor_floors_at_6h_and_warns and test_stale_anchor_clamps_to_6h_and_warns in generator/tests/test_list_recent_runs.py) if you'd like it folded in here.

The mention gate reads clean: the new condition is a strict superset of the old one, so a person's approval with prose is unaffected, and the @bot mention check and the inline-comments check both still run ahead of it.

review-reviewers' 6h cap was sized for a dispatch-only workflow. On a daily
cron the anchor is always ~24h back, so every tick clamped to 6h and recorded
an 18h coverage gap — over the event-driven part of the day the sweep exists
to judge. Both profiles now resume from their own previous run under one
49h cap, which is what review-runs already used, so the profile no longer
selects window constants at all.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>

@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.

Steps 2 to 4 do not apply drops Step 4 (Deduplicate) along with the run-keyed work, in the one mode where the window never advances. Once a consumer switches tend off, "the weeks before the last run" is a fixed span, so every daily tick re-reads the same incidents — and with Step 4 declared inapplicable, the leg opens PRs or issues against them without the check for an existing one on tend. The gates compound it: review-gates.md counts occurrences from "the current analysis and historical evidence recorded by prior runs", so a single incident re-read daily climbs one occurrence per tick and clears the Medium 5+ bar on its fifth reading rather than on five occurrences.

Step 2's repo-wide sweep is also the only recipe in the skill that enumerates bot output by window rather than by run ID, which is exactly what a run-less window needs; it's the per-run mapping under it, and Step 3's session-log work, that don't apply here. Suggestion inline.

It named a span that never moves — the weeks before the last run — so every
daily tick would re-read the same incidents, and the instruction alongside it
took Step 4 out with the run-keyed steps. The gates count occurrences from
prior runs' evidence as well as the current window, so one incident would
have reached the 5+ bar on its fifth reading rather than on five occurrences,
with no dedup check between it and a filing.

Reporting the state is the whole job. Steps 2 and 3 have no runs to key on;
Step 4 applies as written, and its dedup is what keeps a repo that stays off
from opening the same issue daily.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>

@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.

The review-reviewers section of the description still says that where tend is off, "the run reviews tend's own output from the weeks before it stopped, against the same gates as any other window" — which is what 9f1f87b dropped. Worth recomposing that paragraph around reporting the state, since the description is what a later reader takes the change to have done.

@max-sixty
max-sixty merged commit 59f60fe into main Sep 17, 2026
13 checks passed
@max-sixty
max-sixty deleted the faber-tend-issues branch September 17, 2026 23:26
max-sixty added a commit that referenced this pull request Sep 18, 2026
`gh workflow list` fetches 50 workflows without a `--limit` and says
nothing when it truncates. `list_recent_runs.py` called it with no
limit, so on a repo past that edge a `tend-*` workflow could fall
outside the listing entirely — the session would then never query its
runs, and would read the result as a quiet window rather than an
incomplete one.

It now asks for 200 and warns on hitting it, matching the `RUN_LIMIT`
warning directly below it in the same function.

The alternative was rewriting the call as `gh api --paginate
repos/<repo>/actions/workflows`, which removes the cliff rather than
moving it. That changes how the script resolves its target repo — `gh
workflow list` takes `-R` and an empty argument list means "the current
repo", while `gh api` needs the path spelled out in every case — so it
is a wider change to a script every consumer's `tend-review-runs` runs
daily. The warning is what makes truncation visible, which is the actual
defect.

Found while fixing the same class of bug one file over in #1292, where
the bot reviewer caught an unpaginated `/actions/workflows` call in the
`review-reviewers` skill.

> _This was written by Claude Code on behalf of max-sixty_

---------

Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
max-sixty added a commit that referenced this pull request Sep 18, 2026
Deploys 0.2.11 to tend itself, the last step of the release.

The pin moves from `@0.2.10` to `@0.2.11` across the nine generated
workflows, which brings in the generated changes since 0.2.10:
`tend-mention`'s review gate now treats an approval with no inline
comments as terminal when its author is a `Bot`, whatever its body says
([#1292](#1292)), and the header
comment names `.config/tend.yaml` as where to change the workflow rather
than sending every change to the skills.

`review-reviewers.yaml` is hand-maintained, so `init` doesn't touch its
ref; it's restamped onto the same version here, per **Nightly: restamp
the hand-maintained workflow refs** in the overlay. Every
`max-sixty/tend/...` ref in `.github/workflows/` now reads `0.2.11`.

> _This was written by Claude Code on behalf of max-sixty_

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 5 (1M context) <[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