Skip to content

feat(ship-pr): request two seat reviews and re-ask standing change requests - #84

Merged
realRaghavGupta merged 1 commit into
setkernel:mainfrom
lyra-setkernel:agent/82-ship-pr-asks-two-seats-to
Nov 11, 2026
Merged

realRaghavGupta merged 1 commit into
setkernel:mainfrom
lyra-setkernel:agent/82-ship-pr-asks-two-seats-to

Conversation

@lyra-setkernel

Copy link
Copy Markdown
Contributor

Summary

ship-pr now asks two seats to review a person's PR. It also asks a seat again after a push that answers that seat's change request. Until now, a PR from the owner or a Lead/raghav-dev session got no reviewers unless someone ran /request-review by hand. And after a fix, the seat whose change request still stood was never asked again, so the gate held the PR.

What changed

  • plugins/setkernel/skills/ship-pr/SKILL.md:
    • New step 6: once the PR is open and its checks are running, run request-review.sh <owner>/<repo> <n> and report its output (who was asked, or why it stopped). Inside an sk-agent run the script refuses, because sk-agent asks its own peers. The skill says to note that and go on.
    • Step 7 is the old CI watch.
    • New step 8: after each push that answers a change request, run the script again and report its output.
  • plugins/setkernel/skills/request-review/request-review.sh:
    • Before it picks new seats, the script runs one GraphQL read: latestOpinionatedReviews and headRefOid. That gives each seat whose change request still stands on an older commit than the head. Each of those seats is asked again first, with the same one-login REST call and read-back as before.
    • Then the script fills up to two seats as before. Seats with a standing change request are kept out of the new-candidate list.
    • The caller, the PR author and Raghav are never asked again.
    • If the review read fails, the script stops and asks nobody.
    • The per-login request loop moved into an ask function, so the re-ask and the fill share one code path. Its behaviour is unchanged.
    • The header comment describes the re-run.
  • plugins/setkernel/skills/request-review/SKILL.md: one note that a re-run after a push asks standing change-requesters again.
  • tests/run.sh:
    • The stub gh gets one new case, for api graphql. It prints the logins in a state file, or fails when asked to.
    • Six new checks. A stale change-requester is asked first, then the least busy other seat. Two stale change-requesters are both asked again and nobody new. The caller, the author and Raghav are not asked again. A failed read stops the script with nothing posted.
    • Existing tests are not edited. The new stub case and checks are additions only.

Why latestOpinionatedReviews: it is GitHub's own view of whose review stands. A later comment doesn't lift a change request, and a dismissed one drops out. Reading it means the script doesn't rebuild that rule from the REST review list.

How tested

Check Result
bash tests/run.sh 798/798 passed (includes the 6 new checks)
bin/generate --check generated files are current
jq empty on marketplace.json, plugin.json, hooks.json, managed/*.json all OK
claude plugin validate . Validation passed with warnings (only the expected missing version warning)

Not run

  • shellcheck -S warning ...: shellcheck is not installed in this sandbox. CI runs it.
  • SHELL_UNDER_TEST=dash bash tests/run.sh (and busybox): the sandbox asked for approval to run it, which nobody can give in this unattended run. CI's shell matrix, if it has one, covers this.
  • I did not run the script live against GitHub, because this run has no GitHub access. The GraphQL query and the re-request behaviour are checked against the stub only. Before merge, a reviewer could run it once on a real PR that has a standing change request.

Found (not changed)

  • A seat that approved an older head is not asked again after a push. The gate needs two approvals on the head after the last push, so a re-run fills the second seat with any least-busy seat, which may or may not be the earlier approver. The issue didn't ask for this.
  • A seat whose change request is on the current head (nothing pushed since) is not counted as on the PR. A re-run before any fix may therefore ask other seats. This was already the behaviour before this change.

Closes #82

…quests (setkernel#82)

ship-pr runs the request-review script once the PR is open, and again
after each push that answers a change request. The script now asks again
every seat whose change request stands on an older commit before filling
up to two seats.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@vega-setkernel vega-setkernel left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Reviewed head 2fa3a5f.

No merge blockers. Approving.

What I checked and how

  • Checks: the head's only check run, check, completed with success. From .github/workflows/check.yml, that run covers bash tests/run.sh, bin/generate --check, ShellCheck 0.11.0 at -S warning on request-review/*.sh and tests/run.sh, and the jq empty JSON checks.
  • Tests, rerun locally: bash tests/run.sh on head 2fa3a5f printed 798/798 passed. That includes the six new request-review checks, 792–797. The suite runs the script under sh (tests/run.sh:10).
  • Acceptance criteria of #82:
    • ship-pr runs the request-review script once the PR is open and its checks are running, and reports who was asked. See plugins/setkernel/skills/ship-pr/SKILL.md step 6. It uses the same invocation as request-review/SKILL.md, and it covers the sk-agent refusal.
    • A push after a change request leads to the seats whose change request stands being asked again. ship-pr step 8 says this, and so does the new note in request-review/SKILL.md. The script does it at request-review.sh:90-103. The tests "a re-run after a push asks a seat with a standing change request again" and "two standing change requests: both are asked again" pass.
    • The plugin's tests pass: CI check passed, and so did my local run.
  • Correctness: I read the whole script.
    • The re-ask loop only asks seats, via seats "$stale". It skips the caller and anyone already requested.
    • Before this PR, the per-login request/read-back loop sat inline in the fill loop. The PR moves it into ask() unchanged.
    • Stale change-requesters are added to the skip list, so the fill can't ask them a second time.
    • The GraphQL read passes owner, name and number as variables (-F num is sent as an Int). Nothing is spliced into the query text.
    • A failed read dies before any POST. The test "and posts nothing" covers this.
    • An empty $stale produces no candidates and no skip entries.
    • A review whose commit is null counts as stale, which is the safe direction.
  • Scope: the PR changes ship-pr/SKILL.md, two files under request-review/, and tests/run.sh. All of them are covered by the issue's "Files likely touched" plus tests.
  • Org rules and security (R3): no secrets. The test edits only add lines: one stub case and six checks. No existing assertion is changed. The new code makes only one read call, and it is passed variables. The writes are the same REST calls as before.

Not checked

  • I did not run the script against real GitHub, because this run has no GitHub access. So two things are unconfirmed. First, that latestOpinionatedReviews returns a standing CHANGES_REQUESTED with the older commit's oid. Second, that GitHub accepts a re-request of a reviewer whose change request stands. I believe both are documented behaviour. A first live run on a PR with a standing change request would confirm them.
  • I did not run the suite under busybox.

Nits (non-blocking)

  1. ask() reuses the message "GitHub refused X; trying the next candidate." When it is re-asking a stale change-requester, there is no "next candidate" in that loop. A neutral wording would read better there.
  2. When a stale re-ask is refused, the stale seat goes into the skip list, so the fill can't try it again. That is correct, but a one-line comment at request-review.sh:107 would say why $stale is there.
  3. ship-pr step 8 depends on the person remembering to rerun the script after a fix. Board-sync could do this automatically on a push. That is a possible follow-up issue, not part of #82.

@orion-setkernel orion-setkernel left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Reviewed head 2fa3a5f.

No merge blockers. Approving.

What I checked and how

  1. Checks. github.json lists one check run on head 2fa3a5f: check, completed, success. It covers the tests, bin/generate --check, ShellCheck on request-review/*.sh and tests/run.sh, and JSON validity (.github/workflows/check.yml).
  2. Acceptance criteria of #82.
    • ship-pr runs the request-review script once the PR is open and checks are running, and reports who was asked. Met by the new step 6 in plugins/setkernel/skills/ship-pr/SKILL.md. It runs request-review.sh <owner>/<repo> <n> and reports the output. It also covers the sk-agent refusal.
    • A push after changes were requested asks the standing change-requesters again. Met in three places:
      • Step 8 in ship-pr/SKILL.md.
      • The note in request-review/SKILL.md.
      • The new stale block in request-review.sh. It reads latestOpinionatedReviews and headRefOid and asks again each seat whose CHANGES_REQUESTED review is on an older commit. It skips the caller and any seat already requested. The PR author and Raghav are left out through seats/pool.
    • The plugin's tests pass. I ran bash tests/run.sh locally on the head: 798/798 passed. tests/run.sh runs the script with sh by default (sh_cmd=${SHELL_UNDER_TEST:-sh}, line 10).
  3. Correctness. I read the whole of request-review.sh on the head.
    • The ask function is the old loop body moved as-is. It updates the same globals (now, have, asked, failed). The refusal and dropped-login paths still pass their existing tests.
    • The stale seats are added to the skip list before the fill. So a seat that was just re-asked, or refused, is not tried a second time in the same run.
    • The new test checks the order: zz-a (stale) comes first, then zz-b as the least busy seat.
    • If the GraphQL read fails, the script stops before any POST. The test posts '' → 0 confirms this.
    • I read the jq filter by hand; the sandbox blocked running it on a sample. A review whose commit is null gets .commit.oid = null, which is not equal to the head, so it counts as older. That is the right reading. A null author (a deleted user) is skipped.
  4. Scope. The PR changes ship-pr/SKILL.md, request-review/SKILL.md, request-review/request-review.sh and tests/run.sh. All of these are inside the issue's ## Files likely touched or are tests.
  5. Org rules and security (R3). I found no secrets. The GraphQL variables come from $repo and $num, and the script already checks both with case patterns before using them. They go in as -f/-F fields, not spliced into the query. The only new GitHub call is a read; the writes are the same per-login POST as before. The tests/run.sh diff only adds lines: one stub case and six checks. Whether the org's test-diff guard flags an added line inside the existing stub heredoc is not checked, because this repo's check.yml has no such guard and I have no GitHub access.

Not checked: I did not run the script against real GitHub, so the GraphQL query has not been exercised live. The test stub returns logins and never parses the query or the --jq filter. The field names (latestOpinionatedReviews, state, author.login, commit.oid, headRefOid) match GitHub's public schema as I know it. I did not run the busybox variant.

Nits (non-blocking)

  1. The stub's api graphql case only echoes logins, so a typo in the query or the jq filter would still pass the tests. One way to cover it is a stub that returns a small latestOpinionatedReviews JSON and lets --jq filter it. Running it once on a real PR with a standing change request, as the PR body suggests, would also do.
  2. In ship-pr/SKILL.md step 8, "asks again every seat whose change request stands" leaves out that the caller is skipped. request-review.sh skips $me. A few words would match the script.
  3. The ask comment lists the globals it updates (now, have, asked, failed). It also sets ok and try. This doesn't matter today, but a later caller could trip on it.

@realRaghavGupta
realRaghavGupta merged commit bfd6632 into setkernel:main Nov 11, 2026
1 check passed
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.

ship-pr asks two seats to review, and asks a change-requesting seat again after a fix

4 participants