From d4c4f6a037c77c14eb4231a9e34d80cd1a0f9b86 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 30 Nov 2026 00:45:17 +0000 Subject: [PATCH 1/6] docs(adr): record why pushes to ready pull requests get reviewed Spec #1 chose never to review on push, so a busy branch would not start a review per commit. Spec #50 reverses that for ready pull requests: asking again after every round is easy to forget, and an agent pushing under the review agent's account cannot ask at all. This first ADR keeps the reason for the change next to the code, so the next reader does not restore the old rule. It names the parts of spec #1 it replaces and the trade-offs accepted: runner minutes for the settle wait, two attestations when a push lands during a review, and a duplicate when a push and a comment command arrive within the wait. Refs #51 Refs #50 Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_012Jmn7ojtaMx4z52zJA33Fo --- ...01-review-pushes-to-ready-pull-requests.md | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 docs/adr/0001-review-pushes-to-ready-pull-requests.md diff --git a/docs/adr/0001-review-pushes-to-ready-pull-requests.md b/docs/adr/0001-review-pushes-to-ready-pull-requests.md new file mode 100644 index 0000000..8fc3020 --- /dev/null +++ b/docs/adr/0001-review-pushes-to-ready-pull-requests.md @@ -0,0 +1,25 @@ +# Review the commits pushed to a ready pull request + +After the first review of a pull request, a new review starts only when someone posts a comment command or requests the review agent. That step is easy to forget after each round of changes. An agent that pushes fixes under the review agent's account cannot ask at all, because the workflow ignores the review agent's own comment commands and reviewer requests so that one review cannot start another. So we added a fourth kind of review request, **Push**, decided in [#50](https://github.com/cipherstash/workflows/issues/50): + +- Push reviews only commits pushed to a ready pull request, never to a draft. Drafts stay free for work in progress, and marking a draft ready still makes one Ready review of the whole pull request. +- Push is opt-in per caller. A repository turns it on by adding the `synchronize` event to its caller. A caller that does not change sees no change. +- A Push request waits for pushes to settle (5 minutes by default, set by the caller, 0 to fire at once). If the pull request was pushed again, closed or made a draft in that time, the request is skipped, so a burst of pushes gets one review, of the last push. +- The review covers only the pushed commits, with the whole pull request as context. After a force push or a rebase it covers the whole pull request. + +The settle wait and the opt-in answer the worry behind spec [#1](https://github.com/cipherstash/workflows/issues/1)'s choice: that a busy branch would start a review per commit. That worry still stands. It is now handled by the wait and by each repository's choice, not by never reviewing pushes. + +## Replaces + +This decision replaces two parts of spec #1: + +- Story 5: "As an engineer, I want no automatic review on every push, so that a busy branch does not start a review per commit." +- The out-of-scope line "Reviewing on every push (`synchronize`)." + +## Consequences + +We accept these trade-offs: + +- **Runner minutes for the wait.** Each push holds a runner for the settle wait. On private repositories that is about 5 billed minutes per push at the default. On public repositories runner minutes are free. +- **Two attestations when a push lands during a review.** A review session that is already running is not stopped when a new push arrives. Both reviews post an attestation, and each names the commit it reviewed. +- **A duplicate when a push and a comment command arrive within the wait.** A Push request never cancels or delays a comment command, so both can start a review of the same commits. From 7c969a39bcd1ebd5fa43b9ca885a082bf5e7ec48 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 30 Nov 2026 00:51:37 +0000 Subject: [PATCH 2/6] docs(adr): say why Push reviews of the review agent's pushes cannot loop ADR 0001 gave the rule that the review agent's own requests are ignored, so that one review cannot start another. It then had pushes under that same account reviewed, without saying why this does not bring the loop back. Spec #50 gives the reason: the review routine never pushes, so a review cannot cause a push. The ADR now says so. The cost line said every push holds a runner for the settle wait. Only a push that makes a Push request gets the settle job, so a push to a draft holds none. The line now says that, so a maintainer does not count drafts when weighing the opt-in. The long sentences that carry the reasons are split, and the other plain-language checker findings are fixed, so the checker reports no must-fix findings. Refs #50 Refs #51 Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_012Jmn7ojtaMx4z52zJA33Fo --- docs/adr/0001-review-pushes-to-ready-pull-requests.md | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/docs/adr/0001-review-pushes-to-ready-pull-requests.md b/docs/adr/0001-review-pushes-to-ready-pull-requests.md index 8fc3020..14943de 100644 --- a/docs/adr/0001-review-pushes-to-ready-pull-requests.md +++ b/docs/adr/0001-review-pushes-to-ready-pull-requests.md @@ -1,11 +1,12 @@ # Review the commits pushed to a ready pull request -After the first review of a pull request, a new review starts only when someone posts a comment command or requests the review agent. That step is easy to forget after each round of changes. An agent that pushes fixes under the review agent's account cannot ask at all, because the workflow ignores the review agent's own comment commands and reviewer requests so that one review cannot start another. So we added a fourth kind of review request, **Push**, decided in [#50](https://github.com/cipherstash/workflows/issues/50): +After the first review of a pull request, a new review starts only when someone posts a comment command or requests the review agent. That step is easy to forget after each round of changes. An agent that pushes fixes under the review agent's account cannot ask at all. The workflow ignores the review agent's own comment commands and reviewer requests, so that one review cannot start another. So we added a fourth kind of review request, **Push**, decided in [#50](https://github.com/cipherstash/workflows/issues/50): - Push reviews only commits pushed to a ready pull request, never to a draft. Drafts stay free for work in progress, and marking a draft ready still makes one Ready review of the whole pull request. -- Push is opt-in per caller. A repository turns it on by adding the `synchronize` event to its caller. A caller that does not change sees no change. -- A Push request waits for pushes to settle (5 minutes by default, set by the caller, 0 to fire at once). If the pull request was pushed again, closed or made a draft in that time, the request is skipped, so a burst of pushes gets one review, of the last push. -- The review covers only the pushed commits, with the whole pull request as context. After a force push or a rebase it covers the whole pull request. +- Push is opt-in per caller. A repository turns it on by adding the `synchronize` event to its caller. A caller that is not changed keeps today's behaviour. +- A Push request waits for pushes to settle (5 minutes by default, set by the caller, 0 to fire at once). If the pull request was pushed again, closed or made a draft in that time, the request is skipped. So a burst of pushes gets one review, of the last push. +- The review covers only the pushed commits, with the whole pull request as context. After a force push or a rebase, it covers the whole pull request. +- Pushes made under the review agent's account are reviewed like anyone else's. One review still cannot start another, because the review routine never pushes. The settle wait and the opt-in answer the worry behind spec [#1](https://github.com/cipherstash/workflows/issues/1)'s choice: that a busy branch would start a review per commit. That worry still stands. It is now handled by the wait and by each repository's choice, not by never reviewing pushes. @@ -20,6 +21,6 @@ This decision replaces two parts of spec #1: We accept these trade-offs: -- **Runner minutes for the wait.** Each push holds a runner for the settle wait. On private repositories that is about 5 billed minutes per push at the default. On public repositories runner minutes are free. +- **Runner minutes for the wait.** Only a push that makes a Push request takes a runner for the settle wait. A push to a draft takes none. On private repositories, each such push costs about 5 billed minutes at the default. Runner minutes are free on public repositories. - **Two attestations when a push lands during a review.** A review session that is already running is not stopped when a new push arrives. Both reviews post an attestation, and each names the commit it reviewed. - **A duplicate when a push and a comment command arrive within the wait.** A Push request never cancels or delays a comment command, so both can start a review of the same commits. From c26927aedd25382d3a58120370a45577711471d5 Mon Sep 17 00:00:00 2001 From: Claude Date: Mon, 30 Nov 2026 04:56:10 +0000 Subject: [PATCH 3/6] docs(adr): name reopen and draft toggle as ways to start a review The ADR's opening said that after the first review, only a comment command or a request for the review agent starts a new one. A Ready request also fires when the pull request is reopened or moved from draft back to ready, as CONTEXT.md defines Ready and the ADR's own second bullet says. A reader using the ADR as the record of which events start a review would wrongly conclude a reopen or draft toggle cannot. The sentence now lists all three routes and says that pushing new commits starts nothing, which is the gap Push fills. Refs #50 Refs #51 Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_012Jmn7ojtaMx4z52zJA33Fo --- docs/adr/0001-review-pushes-to-ready-pull-requests.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/adr/0001-review-pushes-to-ready-pull-requests.md b/docs/adr/0001-review-pushes-to-ready-pull-requests.md index 14943de..7489f89 100644 --- a/docs/adr/0001-review-pushes-to-ready-pull-requests.md +++ b/docs/adr/0001-review-pushes-to-ready-pull-requests.md @@ -1,6 +1,6 @@ # Review the commits pushed to a ready pull request -After the first review of a pull request, a new review starts only when someone posts a comment command or requests the review agent. That step is easy to forget after each round of changes. An agent that pushes fixes under the review agent's account cannot ask at all. The workflow ignores the review agent's own comment commands and reviewer requests, so that one review cannot start another. So we added a fourth kind of review request, **Push**, decided in [#50](https://github.com/cipherstash/workflows/issues/50): +After the first review of a pull request, a new review starts only when someone posts a comment command, requests the review agent, or reopens the pull request or toggles it to draft and back. Pushing new commits starts nothing. Asking for a review is easy to forget after each round of changes. An agent that pushes fixes under the review agent's account cannot ask at all. The workflow ignores the review agent's own comment commands and reviewer requests, so that one review cannot start another. So we added a fourth kind of review request, **Push**, decided in [#50](https://github.com/cipherstash/workflows/issues/50): - Push reviews only commits pushed to a ready pull request, never to a draft. Drafts stay free for work in progress, and marking a draft ready still makes one Ready review of the whole pull request. - Push is opt-in per caller. A repository turns it on by adding the `synchronize` event to its caller. A caller that is not changed keeps today's behaviour. From e9fbb8a002eff957761f7f95da77d54a540c72ce Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 1 Dec 2026 01:18:06 +0000 Subject: [PATCH 4/6] docs(adr): record skipped pushes' unreviewed commits and the Push queue The review on #54 found the ADR left out costs and limits a reader needs to judge the decision: commits in a skipped push are never reviewed, Push requests use their own send queue, a skipped push still bills the decision job, and merges of the base branch are left out of a review. Also uses the glossary's terms for Requested reviewer and Ready. Refs #51, #50 Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_012Jmn7ojtaMx4z52zJA33Fo --- .../0001-review-pushes-to-ready-pull-requests.md | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/docs/adr/0001-review-pushes-to-ready-pull-requests.md b/docs/adr/0001-review-pushes-to-ready-pull-requests.md index 7489f89..cbd133c 100644 --- a/docs/adr/0001-review-pushes-to-ready-pull-requests.md +++ b/docs/adr/0001-review-pushes-to-ready-pull-requests.md @@ -1,11 +1,11 @@ # Review the commits pushed to a ready pull request -After the first review of a pull request, a new review starts only when someone posts a comment command, requests the review agent, or reopens the pull request or toggles it to draft and back. Pushing new commits starts nothing. Asking for a review is easy to forget after each round of changes. An agent that pushes fixes under the review agent's account cannot ask at all. The workflow ignores the review agent's own comment commands and reviewer requests, so that one review cannot start another. So we added a fourth kind of review request, **Push**, decided in [#50](https://github.com/cipherstash/workflows/issues/50): +After the first review of a pull request, a new review starts only when someone posts a comment command, requests the review agent, or reopens the pull request or toggles it to draft and back. Pushing new commits starts nothing. Asking for a review is easy to forget after each round of changes. An agent that pushes fixes under the review agent's account cannot ask at all. The workflow ignores the review agent's own comment commands and Requested reviewer requests, so that one review cannot start another. So we added a fourth kind of review request, **Push**, decided in [#50](https://github.com/cipherstash/workflows/issues/50): -- Push reviews only commits pushed to a ready pull request, never to a draft. Drafts stay free for work in progress, and marking a draft ready still makes one Ready review of the whole pull request. -- Push is opt-in per caller. A repository turns it on by adding the `synchronize` event to its caller. A caller that is not changed keeps today's behaviour. +- Push reviews only commits pushed to a ready pull request, never to a draft. Drafts stay free for work in progress, and marking a draft ready still makes one review of the whole pull request, from a Ready request. +- Push is opt-in per caller. A repository turns it on by adding the `synchronize` event to its caller. A caller that is not changed behaves as before Push. - A Push request waits for pushes to settle (5 minutes by default, set by the caller, 0 to fire at once). If the pull request was pushed again, closed or made a draft in that time, the request is skipped. So a burst of pushes gets one review, of the last push. -- The review covers only the pushed commits, with the whole pull request as context. After a force push or a rebase, it covers the whole pull request. +- The review covers only the pushed commits, with the whole pull request as context. After a force push or a rebase, it covers the whole pull request. Changes that only came from merging the base branch in, such as GitHub's "Update branch" button, are left out. - Pushes made under the review agent's account are reviewed like anyone else's. One review still cannot start another, because the review routine never pushes. The settle wait and the opt-in answer the worry behind spec [#1](https://github.com/cipherstash/workflows/issues/1)'s choice: that a busy branch would start a review per commit. That worry still stands. It is now handled by the wait and by each repository's choice, not by never reviewing pushes. @@ -21,6 +21,7 @@ This decision replaces two parts of spec #1: We accept these trade-offs: -- **Runner minutes for the wait.** Only a push that makes a Push request takes a runner for the settle wait. A push to a draft takes none. On private repositories, each such push costs about 5 billed minutes at the default. Runner minutes are free on public repositories. +- **Runner minutes for the wait.** Only a push that makes a Push request holds a runner for the settle wait. Every other push, to a draft included, still runs the short decision job. GitHub bills each job rounded up to a whole minute, so on private repositories a push that is skipped costs about 1 billed minute, and a Push request about 8 at the default (1 to decide, about 6 to wait, 1 to send). Runner minutes are free on public repositories. - **Two attestations when a push lands during a review.** A review session that is already running is not stopped when a new push arrives. Both reviews post an attestation, and each names the commit it reviewed. -- **A duplicate when a push and a comment command arrive within the wait.** A Push request never cancels or delays a comment command, so both can start a review of the same commits. +- **A duplicate when a push and a comment command arrive within the wait.** A Push request never cancels or delays a comment command, so both can start a review of the same commits. Push requests are sent from a queue of their own, apart from the queue that Ready requests, comment commands and Requested reviewer requests share, so a Push request cannot replace one of those while it waits to be sent. This departs from #50, which put all requests for a pull request in one queue. +- **Skipped pushes leave their commits unreviewed.** A Push review covers only its own push. When a push is skipped (superseded by a later push, pushed by a bot, or after a failed settle check), its commits are in no later push's range, so no Push review covers them. For example, push A (c1, c2) and then push B (c3) within the wait: A is superseded and B reviews only c3. A comment command or a Requested reviewer request reviews the whole pull request when this matters. From 5a00a39ea237f8f6cf1b36a6b1b735a0334db02c Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 5 Dec 2026 00:49:24 +0000 Subject: [PATCH 5/6] docs(adr): review a skipped push's commits with the next push The maintainer decided the commits of a superseded push must be reviewed, not left as a documented gap. Records how: a Push request asks for every change since the last reviewed commit. Refs #51, #50 Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_012Jmn7ojtaMx4z52zJA33Fo --- docs/adr/0001-review-pushes-to-ready-pull-requests.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/adr/0001-review-pushes-to-ready-pull-requests.md b/docs/adr/0001-review-pushes-to-ready-pull-requests.md index cbd133c..270877e 100644 --- a/docs/adr/0001-review-pushes-to-ready-pull-requests.md +++ b/docs/adr/0001-review-pushes-to-ready-pull-requests.md @@ -5,7 +5,7 @@ After the first review of a pull request, a new review starts only when someone - Push reviews only commits pushed to a ready pull request, never to a draft. Drafts stay free for work in progress, and marking a draft ready still makes one review of the whole pull request, from a Ready request. - Push is opt-in per caller. A repository turns it on by adding the `synchronize` event to its caller. A caller that is not changed behaves as before Push. - A Push request waits for pushes to settle (5 minutes by default, set by the caller, 0 to fire at once). If the pull request was pushed again, closed or made a draft in that time, the request is skipped. So a burst of pushes gets one review, of the last push. -- The review covers only the pushed commits, with the whole pull request as context. After a force push or a rebase, it covers the whole pull request. Changes that only came from merging the base branch in, such as GitHub's "Update branch" button, are left out. +- The review covers every change not yet reviewed, with the whole pull request as context: from the last commit an earlier review covered, or the commit before the push if that is earlier. So the commits of a push that got no review of its own, such as one superseded during the wait, are reviewed with the next push. After a force push or a rebase, it covers the whole pull request. Changes that only came from merging the base branch in, such as GitHub's "Update branch" button, are left out. - Pushes made under the review agent's account are reviewed like anyone else's. One review still cannot start another, because the review routine never pushes. The settle wait and the opt-in answer the worry behind spec [#1](https://github.com/cipherstash/workflows/issues/1)'s choice: that a busy branch would start a review per commit. That worry still stands. It is now handled by the wait and by each repository's choice, not by never reviewing pushes. @@ -24,4 +24,5 @@ We accept these trade-offs: - **Runner minutes for the wait.** Only a push that makes a Push request holds a runner for the settle wait. Every other push, to a draft included, still runs the short decision job. GitHub bills each job rounded up to a whole minute, so on private repositories a push that is skipped costs about 1 billed minute, and a Push request about 8 at the default (1 to decide, about 6 to wait, 1 to send). Runner minutes are free on public repositories. - **Two attestations when a push lands during a review.** A review session that is already running is not stopped when a new push arrives. Both reviews post an attestation, and each names the commit it reviewed. - **A duplicate when a push and a comment command arrive within the wait.** A Push request never cancels or delays a comment command, so both can start a review of the same commits. Push requests are sent from a queue of their own, apart from the queue that Ready requests, comment commands and Requested reviewer requests share, so a Push request cannot replace one of those while it waits to be sent. This departs from #50, which put all requests for a pull request in one queue. -- **Skipped pushes leave their commits unreviewed.** A Push review covers only its own push. When a push is skipped (superseded by a later push, pushed by a bot, or after a failed settle check), its commits are in no later push's range, so no Push review covers them. For example, push A (c1, c2) and then push B (c3) within the wait: A is superseded and B reviews only c3. A comment command or a Requested reviewer request reviews the whole pull request when this matters. +- **The review routine finds where the last review stopped.** The workflow keeps no record of which commits were reviewed, so the request asks the review routine to find the last reviewed commit from the attestations on the pull request. If it finds none, it reviews the whole pull request. +- **A skipped push waits for the next push.** When the last push in a burst is itself skipped, such as a bot's push, no review is sent. Its commits, and the earlier ones, are reviewed with the next push that is sent, or at once with a comment command. From 67ae7d98e29220ac095cbce92897bed8404a9d59 Mon Sep 17 00:00:00 2001 From: Claude Date: Sat, 5 Dec 2026 01:16:15 +0000 Subject: [PATCH 6/6] docs(adr): only the review agent's attestations set where a Push review starts Matches #55 after its review: a commenter's attestation cannot move the start, a push with no earlier attestation reviews its own commits, and a push during a running review can repeat that review's changes. Refs #51, #50 Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_012Jmn7ojtaMx4z52zJA33Fo --- docs/adr/0001-review-pushes-to-ready-pull-requests.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/adr/0001-review-pushes-to-ready-pull-requests.md b/docs/adr/0001-review-pushes-to-ready-pull-requests.md index 270877e..57ea39a 100644 --- a/docs/adr/0001-review-pushes-to-ready-pull-requests.md +++ b/docs/adr/0001-review-pushes-to-ready-pull-requests.md @@ -5,7 +5,7 @@ After the first review of a pull request, a new review starts only when someone - Push reviews only commits pushed to a ready pull request, never to a draft. Drafts stay free for work in progress, and marking a draft ready still makes one review of the whole pull request, from a Ready request. - Push is opt-in per caller. A repository turns it on by adding the `synchronize` event to its caller. A caller that is not changed behaves as before Push. - A Push request waits for pushes to settle (5 minutes by default, set by the caller, 0 to fire at once). If the pull request was pushed again, closed or made a draft in that time, the request is skipped. So a burst of pushes gets one review, of the last push. -- The review covers every change not yet reviewed, with the whole pull request as context: from the last commit an earlier review covered, or the commit before the push if that is earlier. So the commits of a push that got no review of its own, such as one superseded during the wait, are reviewed with the next push. After a force push or a rebase, it covers the whole pull request. Changes that only came from merging the base branch in, such as GitHub's "Update branch" button, are left out. +- The review covers the pushed commits and the earlier commits not yet reviewed, with the whole pull request as context: it starts from the commit named by the review agent's last attestation when that is an ancestor of the commit before the push. So the commits of a push that got no review of its own, such as one superseded during the wait, are reviewed with the next push. After a force push or a rebase, it covers the whole pull request. Changes that only came from merging the base branch in, such as GitHub's "Update branch" button, are left out. - Pushes made under the review agent's account are reviewed like anyone else's. One review still cannot start another, because the review routine never pushes. The settle wait and the opt-in answer the worry behind spec [#1](https://github.com/cipherstash/workflows/issues/1)'s choice: that a busy branch would start a review per commit. That worry still stands. It is now handled by the wait and by each repository's choice, not by never reviewing pushes. @@ -24,5 +24,6 @@ We accept these trade-offs: - **Runner minutes for the wait.** Only a push that makes a Push request holds a runner for the settle wait. Every other push, to a draft included, still runs the short decision job. GitHub bills each job rounded up to a whole minute, so on private repositories a push that is skipped costs about 1 billed minute, and a Push request about 8 at the default (1 to decide, about 6 to wait, 1 to send). Runner minutes are free on public repositories. - **Two attestations when a push lands during a review.** A review session that is already running is not stopped when a new push arrives. Both reviews post an attestation, and each names the commit it reviewed. - **A duplicate when a push and a comment command arrive within the wait.** A Push request never cancels or delays a comment command, so both can start a review of the same commits. Push requests are sent from a queue of their own, apart from the queue that Ready requests, comment commands and Requested reviewer requests share, so a Push request cannot replace one of those while it waits to be sent. This departs from #50, which put all requests for a pull request in one queue. -- **The review routine finds where the last review stopped.** The workflow keeps no record of which commits were reviewed, so the request asks the review routine to find the last reviewed commit from the attestations on the pull request. If it finds none, it reviews the whole pull request. +- **The review routine finds where the last review stopped.** The workflow keeps no record of which commits were reviewed, so the request asks the review routine to find the last reviewed commit from the review agent's own attestations on the pull request. Only those count, so another commenter cannot move the start. If it finds none, it reviews the pushed commits. +- **A push during a running review can repeat its changes.** That review has not posted its attestation yet, so the next push's review starts from the one before it. - **A skipped push waits for the next push.** When the last push in a burst is itself skipped, such as a bot's push, no review is sent. Its commits, and the earlier ones, are reviewed with the next push that is sent, or at once with a comment command.