Skip to content

fix(review): gate APPROVE on author-stated merge readiness, not just the draft flag - #1087

Merged
max-sixty merged 2 commits into
mainfrom
fix/issue-1086
Aug 30, 2026
Merged

max-sixty merged 2 commits into
mainfrom
fix/issue-1086

Conversation

@tend-agent

@tend-agent tend-agent commented Aug 30, 2026 •

Copy link
Copy Markdown
Collaborator

Problem

The review skill decides whether to withhold an APPROVE from the isDraft flag alone. A non-draft PR whose body says, in prose, that it must not merge yet gets read as ready, and both approving paths — step 5's "no issues, approve with an empty body" and the incremental path's "your earlier findings are now addressed" — reach APPROVE without consulting the body. The incremental path is the sharper one: its notion of "resolved" is scoped to the bot's own findings, so a PR can be simultaneously "everything the reviewer raised is fixed" and "the author says this must not merge", and the rule as written only sees the first half.

Reported in #1086 with a verified case: numbagg/numbagg#769 (draft: false) opened with This should not merge until two design choices are resolved, drew three bot COMMENT reviews on code-level findings, and got an empty-body APPROVED at 17:50 once the maintainer's commits closed those findings out. It was closed unmerged six hours later on the first of the two design choices the body had already named. The approval was the only verdict standing on the PR at close time.

Solution

Generalize the draft carve-out's reasoning — "the author hasn't asked for a verdict yet" — from the flag to the statement. Edits to plugins/tend-ci-runner/skills/review/SKILL.md, the rule stated once and pointed at from every approving path:

  • Step 5 (Submit) carries the rule, directly above the POST recipe every approving path is sent to: a PR body or later author/maintainer comment withholding merge readiness draws a COMMENT naming the blocker, not an APPROVE. It says explicitly that the bot's own findings closing out doesn't clear it — the two conditions are independent — and bounds itself to one statement: the surrounding silence rules are keyed on threads, so a body-only COMMENT would otherwise restate the same blocker on every push.
  • Step 1's two approving sentences each get a pointer, since that path jumps straight to the recipe without reading step 5's prose: the trivial-skip sentence (the path that fired) and the dedup rule's resolves the last open one (then approve with an empty body), which reaches the same trigger from the substantive-incremental path.
  • The pre-APPROVE peek in Posting mechanics re-checks the gate alongside the existing red-check gate, because a blocker can land in a comment after the review began.

The asymmetry is the argument for spending a condition here: withholding a warranted approval costs one re-review on the next push, while an APPROVE standing on a PR its author gated is a wrong outward signal that persists until someone notices.

Testing

generator/tests/test_cross_file_contracts.py gains test_review_approval_gates_on_author_stated_readiness, which pins the rule, all three pointers, and the once-only bound — the split is exactly the drift this file exists to catch, since a later edit to either approval path can silently lose its route to the gate. Confirmed failing before the skill edit and passing after; full uv run pytest is green (761 passed), as is pre-commit on both changed files.


Closes #1086 — automated triage

@tend-agent tend-agent left a comment

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The rule itself is the right shape — a stated blocker withholds the verdict the way the flag does, and putting it directly above the POST recipe is the correct place for it. Two things on the routing.

The pointer went to one of step 1's two approval sentences. The trivial-skip sentence got it; the dedup rule's (then approve with an empty body) a few paragraphs down did not, and it is the same shape — an approve fired by the bot's own last finding closing out. The new test pins the asymmetry in place, so a later reader has a contract telling them one path is routed and no signal that the other isn't.

The gate also has no "once" on it, and the surrounding silence rules are all keyed on a thread rather than a review body, so a body-only COMMENT naming a blocker isn't covered by them.

… blocker once

The gate added in this PR was reachable from step 5 and the trivial-incremental approve, but not from the dedup rule's "resolves the last open one (then approve with an empty body)" — the same trigger from the substantive-incremental path. Points that sentence at the gate too, and extends the contract test to pin it.

Also bounds the gate to one statement: the surrounding silence rules are keyed on threads, so a body-only COMMENT naming an author's blocker would otherwise repeat on every push.
@max-sixty
max-sixty merged commit 2d7a01e into main Aug 30, 2026
13 checks passed
@max-sixty
max-sixty deleted the fix/issue-1086 branch August 30, 2026 15:20
max-sixty pushed a commit that referenced this pull request Aug 30, 2026
…the draft flag (#1087)

## Problem

The review skill decides whether to withhold an APPROVE from the
`isDraft` flag alone. A non-draft PR whose body says, in prose, that it
must not merge yet gets read as ready, and both approving paths — step
5's "no issues, approve with an empty body" and the incremental path's
"your earlier findings are now addressed" — reach APPROVE without
consulting the body. The incremental path is the sharper one: its notion
of "resolved" is scoped to the bot's own findings, so a PR can be
simultaneously "everything the reviewer raised is fixed" and "the author
says this must not merge", and the rule as written only sees the first
half.

Reported in #1086 with a verified case: numbagg/numbagg#769 (`draft:
false`) opened with `This should not merge until two design choices are
resolved`, drew three bot COMMENT reviews on code-level findings, and
got an empty-body `APPROVED` at 17:50 once the maintainer's commits
closed those findings out. It was closed unmerged six hours later on the
first of the two design choices the body had already named. The approval
was the only verdict standing on the PR at close time.

## Solution

Generalize the draft carve-out's reasoning — "the author hasn't asked
for a verdict yet" — from the flag to the statement. Edits to
`plugins/tend-ci-runner/skills/review/SKILL.md`, the rule stated once
and pointed at from every approving path:

- **Step 5 (Submit)** carries the rule, directly above the POST recipe
every approving path is sent to: a PR body or later author/maintainer
comment withholding merge readiness draws a COMMENT naming the blocker,
not an APPROVE. It says explicitly that the bot's own findings closing
out doesn't clear it — the two conditions are independent — and bounds
itself to one statement: the surrounding silence rules are keyed on
threads, so a body-only COMMENT would otherwise restate the same blocker
on every push.
- **Step 1's two approving sentences** each get a pointer, since that
path jumps straight to the recipe without reading step 5's prose: the
trivial-skip sentence (the path that fired) and the dedup rule's
`resolves the last open one (then approve with an empty body)`, which
reaches the same trigger from the substantive-incremental path.
- **The pre-APPROVE peek** in Posting mechanics re-checks the gate
alongside the existing red-check gate, because a blocker can land in a
comment after the review began.

The asymmetry is the argument for spending a condition here: withholding
a warranted approval costs one re-review on the next push, while an
APPROVE standing on a PR its author gated is a wrong outward signal that
persists until someone notices.

## Testing

`generator/tests/test_cross_file_contracts.py` gains
`test_review_approval_gates_on_author_stated_readiness`, which pins the
rule, all three pointers, and the once-only bound — the split is exactly
the drift this file exists to catch, since a later edit to either
approval path can silently lose its route to the gate. Confirmed failing
before the skill edit and passing after; full `uv run pytest` is green
(761 passed), as is `pre-commit` on both changed files.

---
Closes #1086 — automated triage

---------

Co-authored-by: tend-agent <[email protected]>
max-sixty pushed a commit to max-sixty/leaf that referenced this pull request Aug 31, 2026
Automated nightly regeneration of tend's workflow files.

**tend version:** 0.1.22 → 0.1.24

## Notable changes

- **Conflicted bot PRs are now repaired on the frequent poll**
(max-sixty/tend#1108). `tend-notifications` gains a `conflict_count`
boot gate: it runs a GraphQL scan for open bot PRs whose `mergeable` is
not `MERGEABLE`, skips ones already carrying a `tend-conflict-deferred`
marker for the current head, and boots the agent when either
notifications or conflicts are outstanding. This is the bulk of the
workflow-body diff.
- **A multi-line adopter prompt now survives generation**
(max-sixty/tend#1103). Block scalars gain explicit indentation
indicators — `prompt: |` becomes `prompt: |2`, likewise `sandbox_setup:`
— so a prompt or setup script whose first line is itself indented no
longer changes meaning. This repo's `sandbox_setup:` (the Playwright
headless-shell install) is regenerated under the new form.
- **Review gating tightened** (max-sixty/tend#1087, max-sixty/tend#1107,
max-sixty/tend#1080). `APPROVE` is gated on the author stating merge
readiness rather than on the draft flag alone; the posting preflight is
bound to the outward action; and the code-review pass becomes its own
step, gated at submit.
- **`uv` is provisioned for agent sessions** (max-sixty/tend#1109), and
pre-check setup guards are preserved through regeneration
(max-sixty/tend#1106).
- Experimental Gist-backed Claude memory (max-sixty/tend#1110) — off
unless configured.

Full upstream range:
max-sixty/tend@0.1.22...0.1.24

## Also in this PR

`tend init` now writes `.github/actionlint.yaml` — a `concurrency.queue`
ignore scoped by glob to `**/.github/workflows/tend-*.yaml`. This repo
carried the same accommodation as a blanket `-ignore` arg on the
actionlint pre-commit hook, which suppressed that schema error
everywhere, including in workflows this repo owns. The generated file
replaces it, so the false positive stays ignored on the generated
workflows and a real one in `ci.yaml` or `publish-site.yaml` now fails.

Verified by running `pre-commit run actionlint --all-files` in the
regeneration worktree with the blanket arg removed and the generated
config in place: passed.

---------

Co-authored-by: leaf-agent <[email protected]>
max-sixty pushed a commit to max-sixty/worktrunk that referenced this pull request Aug 31, 2026
Nightly regeneration of tend's workflow files, picking up two upstream
releases.

**tend version:** 0.1.22 → 0.1.24

### Notable changes

- **The frequent poll now repairs conflicted bot PRs**, not just unread
notifications — the `tend-notifications` boot gate gained a GraphQL
query that test-merges open bot PRs and looks for deferral markers in
recent comments, so a conflicted PR wakes the queue instead of waiting
for the nightly sweep
([max-sixty/tend#1108](max-sixty/tend#1108)).
- **Review gating tightened**: `APPROVE` is now conditioned on the
author stating merge readiness rather than the draft flag alone, the
posting preflight is bound to the outward action, and the code-review
pass became its own step gated at submit
([max-sixty/tend#1087](max-sixty/tend#1087),
[max-sixty/tend#1107](max-sixty/tend#1107),
[max-sixty/tend#1080](max-sixty/tend#1080)).
- **Generator fixes that change this repo's YAML**: an adopter's
`prompt:` may now span more than one line (the `|2` block-indent markers
in the diff), pre-check setup guards are preserved, and the
`concurrency.queue` actionlint ignore is written out
([max-sixty/tend#1103](max-sixty/tend#1103),
[max-sixty/tend#1106](max-sixty/tend#1106),
[max-sixty/tend#1095](max-sixty/tend#1095)).
- **`uv` is provisioned for agent sessions**, and Gist-backed Claude
memory ships as experimental
([max-sixty/tend#1109](max-sixty/tend#1109),
[max-sixty/tend#1110](max-sixty/tend#1110)).
- Pinned harness versions moved with the releases: Claude 2.1.251, Codex
0.151.0, uv 0.12.7.

### A second commit, outside the usual regen

`tend init` now also writes `.github/actionlint.yaml` (the
`concurrency.queue` ignore from max-sixty/tend#1095). The nightly recipe
stages only `.github/workflows` and `.config`, so it landed untracked
and would be re-created on every future run — the second commit tracks
it. This repo runs no actionlint job or pre-commit hook, so the file is
inert here; it only suppresses a false positive for anyone linting these
workflows locally.

Full compare: max-sixty/tend@0.1.22...0.1.24

---------

Co-authored-by: worktrunk-bot <[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.

review: empty-body APPROVE fires on a PR whose description says it should not merge

2 participants