Repository navigation
skills(review-reviewers): scan PR/issue bodies and reviews for corruption - #405
Merged
Merged
Conversation
…tion The recipe only covered issue_comments. Bot-authored issue and PR bodies are composed via the same `gh issue create --body` / `gh pr create --body` paths that the Bash-tool preprocessor mangles — when a body quotes code references, backslash-bang corruption ships to GitHub and prior runs missed it because the scan didn't look there. Reviews and inline review comments are also distinct endpoints. Cover all four surfaces.
tend-agent
commented
May 10, 2026
tend-agent
left a comment
Collaborator
Author
There was a problem hiding this comment.
One coverage gap in the new recipe: the reviews + inline-review-comments scans iterate <bot-opened-prs>, but tend-review's output ships in reviews/inline comments on human-authored PRs — those PRs won't be in <bot-opened-prs>, so the new scan still misses the most common bot-review surface. Splitting the loop catches that case.
Comment on lines
250
to
261
| > # PR bodies (when bot opened the PR this window) + reviews + inline review comments | ||
| > for n in <bot-opened-prs>; do | ||
| > gh api "repos/$ARGUMENTS/pulls/$n" \ | ||
| > --jq "select(.user.login == \"$BOT_LOGIN\" and .created_at > \"<window-start>\") | \"=== PR #$n body ===\n\(.body)\n\"" \ | ||
| > >> /tmp/bot-output/all.txt | ||
| > gh api "repos/$ARGUMENTS/pulls/$n/reviews" \ | ||
| > --jq ".[] | select(.user.login == \"$BOT_LOGIN\" and .submitted_at > \"<window-start>\") | \"=== PR #$n review \(.id) state=\(.state) ===\n\(.body)\n\"" \ | ||
| > >> /tmp/bot-output/all.txt | ||
| > gh api "repos/$ARGUMENTS/pulls/$n/comments?per_page=100" \ | ||
| > --jq ".[] | select(.user.login == \"$BOT_LOGIN\" and .created_at > \"<window-start>\") | \"=== PR #$n inline-comment \(.id) ===\n\(.body)\n\"" \ | ||
| > >> /tmp/bot-output/all.txt | ||
| > done |
Collaborator
Author
There was a problem hiding this comment.
Suggested change
| > # PR bodies (when bot opened the PR this window) + reviews + inline review comments | |
| > for n in <bot-opened-prs>; do | |
| > gh api "repos/$ARGUMENTS/pulls/$n" \ | |
| > --jq "select(.user.login == \"$BOT_LOGIN\" and .created_at > \"<window-start>\") | \"=== PR #$n body ===\n\(.body)\n\"" \ | |
| > >> /tmp/bot-output/all.txt | |
| > gh api "repos/$ARGUMENTS/pulls/$n/reviews" \ | |
| > --jq ".[] | select(.user.login == \"$BOT_LOGIN\" and .submitted_at > \"<window-start>\") | \"=== PR #$n review \(.id) state=\(.state) ===\n\(.body)\n\"" \ | |
| > >> /tmp/bot-output/all.txt | |
| > gh api "repos/$ARGUMENTS/pulls/$n/comments?per_page=100" \ | |
| > --jq ".[] | select(.user.login == \"$BOT_LOGIN\" and .created_at > \"<window-start>\") | \"=== PR #$n inline-comment \(.id) ===\n\(.body)\n\"" \ | |
| > >> /tmp/bot-output/all.txt | |
| > done | |
| > # PR bodies (when bot opened the PR this window) | |
| > for n in <bot-opened-prs>; do | |
| > gh api "repos/$ARGUMENTS/pulls/$n" \ | |
| > --jq "select(.user.login == \"$BOT_LOGIN\" and .created_at > \"<window-start>\") | \"=== PR #$n body ===\n\(.body)\n\"" \ | |
| > >> /tmp/bot-output/all.txt | |
| > done | |
| > # PR reviews + inline review comments (any PR the bot reviewed/commented on, not just bot-opened) | |
| > for n in <pr-numbers-bot-reviewed>; do | |
| > gh api "repos/$ARGUMENTS/pulls/$n/reviews" \ | |
| > --jq ".[] | select(.user.login == \"$BOT_LOGIN\" and .submitted_at > \"<window-start>\") | \"=== PR #$n review \(.id) state=\(.state) ===\n\(.body)\n\"" \ | |
| > >> /tmp/bot-output/all.txt | |
| > gh api "repos/$ARGUMENTS/pulls/$n/comments?per_page=100" \ | |
| > --jq ".[] | select(.user.login == \"$BOT_LOGIN\" and .created_at > \"<window-start>\") | \"=== PR #$n inline-comment \(.id) ===\n\(.body)\n\"" \ | |
| > >> /tmp/bot-output/all.txt | |
| > done``` |
Collaborator
Author
The loop iterating <bot-opened-prs> covered PR bodies, reviews, and inline review comments together, but tend-review writes reviews and inline comments on human-authored PRs that never appear in <bot-opened-prs>. Split the loop: PR bodies still use <bot-opened-prs>, reviews and inline review comments use <pr-numbers> (all PRs touched in the window). Co-Authored-By: Claude Opus 4.7 <[email protected]>
Replace <pr-numbers> with the more precise <pr-numbers-bot-reviewed> suggested in review — signals that the loop wants the set of PRs the bot reviewed or commented on this window, not every PR touched. Co-Authored-By: Claude Opus 4.7 <[email protected]>
max-sixty
added a commit
that referenced
this pull request
Aug 13, 2026
…eck (#966) Drops the `47 * * * *` cron from `review-reviewers`, leaving `workflow_dispatch`. Its recent output had converged on maintaining its own evidence machinery, at the fleet's highest per-run cost and a seven-day quota ceiling that twice took the user-facing workflows down with it; each adopter's daily `tend-review-runs` already reviews that repo's runs from the inside and routes bundled-skill defects upstream, so this removes the direct loop rather than the only one. The skill is scoped to match: it described itself as hourly and told the session to analyze "the past hour". It now states the window `list-recent-runs.sh` actually hands it — floor at the previous successful run of the workflow, clamped 6h back — which with no cron makes the clamp the normal case rather than an outage signal, and scopes its claims to that window. (An earlier revision of this PR described a cron-payload branch; #965 replaced that logic while this branch was open, and the text was rebased onto what merges.) <details><summary>What the sweep caught, and when</summary> Its unique catches — the ones no inside-out session would have found — cluster in April–June: rubber-stamped APPROVEs over visibly failing checks (#667), backslash-backtick corruption in already-published comment bodies across repos (#359, #405, #424, #562), stale PRs silently dropping mentions (#391), and the stale/re-anchored approval family (#798, #821, #884). The last two weeks are dominated by fixes to its own machinery — evidence-gist plumbing, survey-window arithmetic, matrix branch naming, run→output attribution — while per-run cost climbed from $5.31 to $10.49. That is the shape the cost gate in #960 was written for. </details> Re-enable by dispatching it after a change that could move bot behavior fleet-wide: a release, a harness switch, a model bump — within the hour of that change, per the window note in the overlay. > _This was written by Claude Code on behalf of max-sixty_ --------- Co-authored-by: Claude Fable 5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The corruption-scan recipe in
review-reviewersonly fetches issue comments (/issues/$n/comments). Bot-authored issue bodies, PR bodies, review bodies, and inline review comments live on different endpoints and are not scanned. A survey-issue body composed bygh issue create --body "$(cat <<EOF ... EOF)"containing code references with!ships visibly corrupted backslash-bang to GitHub, and priorreview-reviewersruns miss it.Evidence
This run found 5 backslash-bang corruption sites in the body of worktrunk issue #2663 ("Nightly drift cleanup", opened by
worktrunk-bot). Examples (shown raw fromgh issue view 2663 --json body --jq .body):<\!-- ⚠️ AUTO-GENERATED ... -->eprintln\!("---")assert\!(\!repo.root_path().join("marker.txt").exists())anyhow::ensure\!(...),\!= ErrorKind::NotFound\!self.dirty_files()The existing recipe didn't catch any of these because it doesn't fetch
/issues/$n(body) or/pulls/$n(body) at all. The maintainer engaged with the issue and merged five resulting fix PRs, so this didn't block the workflow — but every code reference in the issue rendered with literal backslashes.The watch item "review-reviewers corruption-scan recipe doesn't cover PR/issue bodies" carried in evidence for prior months awaiting concrete recurrence; this run provides it.
Fix
Extend the recipe to fetch four endpoints, not one:
/issues/$n/comments— existing; covers issue and PR comments via the issue_comment surface./issues/$n(body) — for bot-opened issues this window./pulls/$n(body) — for bot-opened PRs this window./pulls/$n/reviewsand/pulls/$n/comments— review bodies and inline review comments.The four greps (
${, backslash-bang,blob/main/...#L,anthropics/) stay the same. The change is purely about what is scanned, not how.Companion to #404
PR #404 extends the
running-in-cibang-escape rule to enumerate issue/PR bodies (preventative). This PR extends the scan recipe to detect them (detective). Either lands independently — they are reverted independently and address different concerns.