feat(eval): add rework rate tracking script for agent PRs (#5516)#5517
feat(eval): add rework rate tracking script for agent PRs (#5516)#5517Benkapner wants to merge 3 commits into
Conversation
…i#5516) Add scripts/rework-rate.sh that calculates how often agent-merged PRs need human follow-up commits touching the same files. Provides a baseline trust metric for autonomy decisions. Usage: ./scripts/rework-rate.sh [REPO] [DAYS] [FOLLOWUP_DAYS] Outputs total agent PRs, reworked count, rework rate percentage, and a list of reworked PRs with follow-up commit details. Signed-off-by: Benjamin Kapner <bkapner@redhat.com>
E2E tests did not runE2E tests run automatically for org/repo members and collaborators on pull requests. For other contributors, a maintainer must add the See E2E testing guide for details. |
PR Summary by QodoAdd script to measure human rework after agent-merged PRs
AI Description
Diagram
High-Level Assessment
Files changed (1)
|
Site previewPreview: https://69414218-site.fullsend-ai.workers.dev Commit: |
Code Review by Qodo
1.
|
rh-hemartin
left a comment
There was a problem hiding this comment.
Hello! You need to fix the body, your process didn't expand \n characters into newlines.
Also I'm running the script locally and it looks too static. You should include something that indicates that the script is actively working. I asked my local agent to introduce a progress system and it looks something like this:
Rework Rate Report
Repository: fullsend-ai/fullsend
Window: last 7 days (since 2026-07-16T00:00:00Z)
Follow-up window: 1 days after merge
Checking PR 7/39 (#5468)...
|
I think something is better than nothing, but I'm not sure about the metric being really a rework one. Do you have any reference to decide file changes? Maybe doing this per line would be better? Also I think we could include the coder into the rework metric, currently we are using it more and more for fixes, so it makes sense that if it passes multiple times on the same file (or line or whatever) then it is considered rework, even if it was itself. What do you think? |
- Fix bot identity: use fullsend-ai-coder[bot] with app/ fallback - Add progress indicator (Checking PR N/M) - Add --paginate to PR files API call - Surface API errors as warnings instead of silently skipping - Track and report skipped PRs count Signed-off-by: Benjamin Kapner <bkapner@redhat.com>
|
thanks for the review and for running it locally. pushed fixes addressing all points:
on the metric question you raised (file-level vs line-level, and whether to include the coder agent's own rework): those are good points. i think this first version is a starting point to get a baseline, and we can refine the metric definition based on what the data shows. happy to iterate on the detection granularity in a follow-up. |
|
You need to install pre-commit locally, the CI is failing because of that: |
- Double-quote variable expansions in date commands - Use if ! command instead of $? checks Signed-off-by: Benjamin Kapner <bkapner@redhat.com>
|
thanks @rh-hemartin , fixed the shellcheck findings (SC2086 double-quoting, SC2181 direct exit code checks). should pass now i hope |
|
Example run: |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
|
thanks for testing it, appreciate the example run output. ready for your approval when you're good. |
Summary
Adds
scripts/rework-rate.sh, a script that calculates how often agent-merged PRs need human cleanup afterward.How it works
Usage
Why this matters
Rework rate is a concrete trust metric. If 5% of agent PRs need human cleanup, you can trust the agent more. If 40% do, you should require human review on everything. The trustworthiness-evidence problem doc identifies this as a gap, and the roadmap references it under Testing (#295).
Related Issue
Closes #5516
Checklist