Repository navigation
feat(repo): repo tasks replay builds review_replay tasks from recorded review threads - #265
Merged
Merged
Conversation
…d review threads Closes intel#260 Signed-off-by: Anton Volkov <antonwolfy@gmail.com>
antonwolfy
requested review from
jharlow-intel,
napetrov,
vchamarthi and
xaleryb
as code owners
October 28, 2026 15:38
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #265 +/- ##
==========================================
+ Coverage 92.83% 93.10% +0.27%
==========================================
Files 262 269 +7
Lines 33016 33923 +907
Branches 5510 5692 +182
==========================================
+ Hits 30649 31583 +934
+ Misses 1571 1536 -35
- Partials 796 804 +8
🚀 New features to boost your workflow:
|
CLI interface change detectedThis PR changes dokimi's user-facing CLI surface (commands and/or options): + added command `dokimi repo tasks replay`
+ argument `source`
+ option `--cache-dir`
+ option `--force`
+ option `--help/-h`
+ option `--manifest`
+ option `--manifest-file`
+ option `--out`
+ option `--prompt-file`
+ option `--threads`
+ option `--window`Updated on every push; the |
…g 100k brackets On Python 3.14 json.loads guards the C stack, so 100,000 nested brackets parse on a runner with a large stack and the case failed Tests (py3.14). Raising the error from a stubbed parser pins the same except branch on every interpreter. Signed-off-by: Alexander Rybkin <alexander.rybkin@intel.com>
…eplay When mergeCommit is headRefOid, mergeCommit^1 is the PR's own previous commit, so base became that commit and change.patch held only the last one, written as a normal task. The base branch is unknown then; skip with the reason and say so in contract 4.6. Signed-off-by: Alexander Rybkin <alexander.rybkin@intel.com>
addressed was read from the thread's own revision, so a fix committed before the reviewed revision counted, and the thread went into gold.json although the change under review already holds that fix: a miss the agent cannot avoid. Such a thread is now left out with the reason; the rename test keeps its purpose with --window 1. Signed-off-by: Alexander Rybkin <alexander.rybkin@intel.com>
…he reviewed revision Only the tie was tested, so swapping the key order of _reviewed kept every test green while base, change.patch and the carried anchors moved to another revision. Signed-off-by: Alexander Rybkin <alexander.rybkin@intel.com>
The existing case used values that start with no hex, so _SHA.match instead of fullmatch passed it and let '<sha>^2' or '<sha>..HEAD' through as revisions. Signed-off-by: Alexander Rybkin <alexander.rybkin@intel.com>
Contributor
|
5 tasks done
napetrov
pushed a commit
to napetrov/dokimi
that referenced
this pull request
Oct 29, 2026
…d review threads (intel#265) * feat(repo): repo tasks replay builds review_replay tasks from recorded review threads Closes intel#260 Signed-off-by: Anton Volkov <antonwolfy@gmail.com> * test(repo): raise the threads file's RecursionError instead of nesting 100k brackets On Python 3.14 json.loads guards the C stack, so 100,000 nested brackets parse on a runner with a large stack and the case failed Tests (py3.14). Raising the error from a stubbed parser pins the same except branch on every interpreter. Signed-off-by: Alexander Rybkin <alexander.rybkin@intel.com> * fix(repo): skip a pull request merged by fast-forward in repo tasks replay When mergeCommit is headRefOid, mergeCommit^1 is the PR's own previous commit, so base became that commit and change.patch held only the last one, written as a normal task. The base branch is unknown then; skip with the reason and say so in contract 4.6. Signed-off-by: Alexander Rybkin <alexander.rybkin@intel.com> * fix(repo): leave out a thread answered before the reviewed revision addressed was read from the thread's own revision, so a fix committed before the reviewed revision counted, and the thread went into gold.json although the change under review already holds that fix: a miss the agent cannot avoid. Such a thread is now left out with the reason; the rename test keeps its purpose with --window 1. Signed-off-by: Alexander Rybkin <alexander.rybkin@intel.com> * test(repo): pin that the most threads, not the latest comment, pick the reviewed revision Only the tie was tested, so swapping the key order of _reviewed kept every test green while base, change.patch and the carried anchors moved to another revision. Signed-off-by: Alexander Rybkin <alexander.rybkin@intel.com> * test(repo): pin that a full SHA with a suffix reaches no git command The existing case used values that start with no hex, so _SHA.match instead of fullmatch passed it and let '<sha>^2' or '<sha>..HEAD' through as revisions. Signed-off-by: Alexander Rybkin <alexander.rybkin@intel.com> --------- Signed-off-by: Anton Volkov <antonwolfy@gmail.com> Signed-off-by: Alexander Rybkin <alexander.rybkin@intel.com> Co-authored-by: Alexander Rybkin <alexander.rybkin@intel.com>
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.
Summary
How much of a repository's past review its guidance would have caught is counted by hand today, and #260 lists the ways that count went wrong.
dokimi:review_replayalready measures it, but itsgold.jsonand task directories are written by hand.dokimi repo tasks replaywrites them from a threads file thatgh api graphqlwrote: one task per merged pull request, holding the change as it was reviewed and the reviewers' line threads as gold.gh api graphql --paginate --slurp -F query=@replay-threads.graphql \ -F q='repo:IntelPython/dpnp is:pr is:merged merged:2026-10-01..2026-10-27' > threads.json python cli.py repo tasks replay https://github.com/IntelPython/dpnp@master --threads threads.json \ --out .agent-eval/tasks --manifest-file dpnp-eval.yamlCloses #260.
Changes
repo tasks replay <source> --threads FILE --out DIR [--window N] [--prompt-file F] [--force], next totasks checkincommands/repo_run.py. The code is in a new package,dokimi/repos/replay/:threads.pyreads any JSON that holds pull request objects withnumberandreviewThreads: one response, the pages--paginate --slurpwrites, or a list. A commit that is not a full 40- or 64-character hex SHA counts as missing, so no value from the file reaches git as an option or a revision expression.__typenameBot, or a login ending in[bot]), on a line of the new file (subjectTypeother thanFILE,diffSideother thanLEFT, anoriginalLine), with itsoriginalCommit. Every other thread, and every non-empty review body by a reviewer, is printed with the reason.build.pywrites one directory per PR:originalCommitmost gold threads were written on; on a tie, the one with the latest comment.baseis the merge base withmergeCommit^1.change.patchis the diff frombaseto the reviewed revision as onegit ammail, titled with the PR's title.git amstrips the CR at the end of each line of a plain mail, so a diff holding a CR (a file with CRLF line ends, such as a.bat) is written base64-encoded, which keeps it; any other patch stays readable.task.jsonsetsgrader: dokimi:review_replay,score: {metric: recall, max: 1.0},windowand the prompt, and addssource_pr,source_url,reviewed_commit,merge_commitandleft_out_files.gold.jsonholds{id, file, line, kind: unknown, comment, addressed, reply, url}per thread.change.patch,gold,source_pr,reviewed_commit, and ids such aspr3580-t1.history.pyasks git through plumbing (diff-tree), so a porcelain setting such asdiff.noprefixcannot change a patch. It also holds the-U0hunk arithmetic and the first-parent walks.eval_dir, are left out of the patch, and their threads out of the gold. A PR with no other change gets no task.addressedcomes from walking first parents from the thread'soriginalCommittoheadRefOid. A commit that changes the file withinwindowlines of the carried line addresses the thread; deleting the file is such a change. The commit must have one parent, and no bot may have written it ([bot]in the author's name or email, as in pre-commit.ci's fixes).mergeCommit^1holds are not excluded. The base branch's commits reach the PR only through merges, which the walk already treats as moves. Excluding them would also drop the author's own fix in one case: a maintainer merges the PR branch intomainpartway through review.originalCommitbelongs to each comment, not to the thread.pathis the file's latest name. The name at the thread's revision is therefore followed back through renames withgit log --follow. On dpnp PR 2841,sparse/_base.pywas edited and then renamed to_lib/_sparse.py, so one diff over the range shows a deletion and an addition. A thread from another revision is carried to the reviewed one commit by commit, for the same reason.refs/pull/*, so the commits it lacks are fetched fromoriginby SHA. A local repository is read as it is; the docs give the refspec to fetch first.task.jsonis kept, with the maintainer's edits, unless--force.✗and the reason. A git failure while one pull request is built skips only that pull request, with the reason.ghquery, the rules), a §9 example,architecture.md, and a §6 bullet inpreparing-a-repository.md. Changelog fragment (Added).The issue's open questions:
originalLineat itsoriginalCommitand carried to the reviewed revision. It is printed and left out when its line changed on the way, or when its file is in no revision.mainin after review:addressedcomes from the PR's own commits, as above, not from the merge commit.addressed.replyis in the gold for the maintainer.Risk
A new command, so no existing behaviour changes. It writes only under
--out. For a remote source it also fetches objects into dokimi's own cache clone. A local repository's git directory is never written to. A PR title that starts with a bracketed tag ([WIP] …) loses the tag in the replayed commit, sincegit amstrips bracketed prefixes from the subject.Testing
On a Linux review host at
80382d0(onmain3a1f287):make ci-local: 28 passed, 0 failed, 7 skipped (the Docker catalog smoke,test-latest, thecli-surfacepackaging step, conda-forge-deps without micromamba, docsdeploy, the pip-audit report, semgrep). 9,343 tests passed, 4 skipped; changed-line coverage 98% (455 lines).tests/test_repo_replay.py: 44 tests on a toy history built per test, with threads files in the shape--paginate --slurpwrites:mainin after review, renames a file, then addresses some threads. It covers gold vs left-out threads and every reason, the reviewed revision,base, the patch and the left-out files.addressed:mainbrought next to the line, which does not count, while the diff to the merge commit has it within the window;--window.guidance:nonewith its CRs);main, no gold thread left.baseis its first parent).--force,--prompt-file.file://remote source that has to fetch the PR's commits by SHA, and gives the same task as a local source.repo tasks check(oracle recall 1.0, null 0.0) and prepares underguidance:noneandguidance:raw.38 mutants of the new code, each failing a test.
An independent review pass before opening found:
git amrejected;-finstead of-Fin the documentedghcall;All are fixed in this commit.
Real data: IntelPython/dpnp, 47 PRs merged 2026-10-01..27, read with the §4.6 query.
repo tasks checkon all 15 tasks: 15/15 ok.guidance:noneandguidance:raw.repo runon the 15 tasks,us.anthropic.claude-sonnet-5-5, 1 rep, Claude Code 2.1.312 in apython:3.12-slimimage with git. 45 cells, none failed, $3.37 in all (3 to 13 turns per cell).Arms:
guidance:none,guidance:raw, andguidance:rev:0cf6730, the head of Add AGENTS.md guidance for coding agents IntelPython/dpnp#3099, which adds 8AGENTS.mdfiles.dpnp's
masterholds no guidance file, sononeandraware the same workspace, and the gap between them is the noise at one rep.repo compare --baseline guidance:none --metric recall_addressed(10 tasks have an addressed thread; the other 5 have none and are unpaired):recall(15)recall_addressed(10)guidance:noneguidance:raw(same workspace)guidance:rev:0cf6730This shows the measurement runs end to end. It says nothing yet about the guidance: the difference between two identical arms is as large as the difference the guidance makes, so a reading needs more reps and more PRs.
Revert
Revert the commit. Nothing else reads the files it writes.
Checklist
pytestpassesruff,mypy, and schema checks pass