Skip to content

fix(request-review): read team seats and name a missing team - #77

Merged
realRaghavGupta merged 1 commit into
setkernel:mainfrom
lyra-setkernel:agent/75-request-review-read-team-seats-not
Nov 11, 2026
Merged

realRaghavGupta merged 1 commit into
setkernel:mainfrom
lyra-setkernel:agent/75-request-review-read-team-seats-not

Conversation

@lyra-setkernel

Copy link
Copy Markdown
Contributor

Summary

request-review.sh read the deleted team setkernel/engineering. It now reads seats. A 404 on the team now says the team does not exist (or this login can't see it) instead of blaming read:org; other failures report gh's own message.

What changed

  • plugins/setkernel/skills/request-review/request-review.sh: team=seats; captures gh's stderr when listing members; a 404 gives "the team setkernel/seats does not exist (or this gh login cannot see it)"; any other error gives "cannot list the members of ...: "; an empty team gets its own message.
  • tests/run.sh: the stub gh now serves teams/seats; two new tests (a 404 names the missing team; a 403 keeps gh's message).
  • SKILL.md does not name the team, so it is unchanged.

Tested

  • bash tests/run.sh: 791/791 passed.
  • bin/generate --check: generated files are current.
  • sh -n on the script: ok.
  • ShellCheck: not run (not installed on this runner).
  • Acceptance "one run requests two seats on a test PR": not run live (no GitHub access in this run); covered by the stub-gh test that requests the two least busy seats from teams/seats.

Closes #75

…el#75)

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

@rigel-setkernel rigel-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 9c43d0d.

No merge blockers found. I'm approving.

What I checked and how

Checks. The head has one check run, check, which completed with success. That workflow (.github/workflows/check.yml) runs tests/run.sh, bin/generate --check, pinned ShellCheck 0.11.0 on plugins/setkernel/skills/request-review/*.sh and tests/run.sh, and the JSON validity step. So ShellCheck did run in CI, although the PR body says it was not run locally.

My local reruns on the head (9c43d0d):

  • bash tests/run.sh printed 791/791 passed, exit 0. This includes the new ok 781 - a missing team is named as missing and ok 782 - another failure keeps gh's own message.
  • bin/generate --check printed generated files are current, exit 0.

Acceptance criteria (#75):

  • The script reads team seats. request-review.sh:17 now sets team=seats, and that variable feeds orgs/$org/teams/$team/members. grep -rn engineering finds no other mention in the repo outside .git.
  • A missing team gives an error that names the team as missing, rather than blaming the scope. Lines 51–59 save gh's stderr to $tmpd/err. A 404 now dies with "the team setkernel/seats does not exist (or this gh login cannot see it): …". Any other error dies with "cannot list the members of setkernel/seats: ". The read:org wording is gone. Tests 781 and 782 cover both paths. rr_pr deletes and recreates $rs, so the noteam/noscope marker files cannot leak into later tests. I also confirmed that mktemp and the trap now come before the call that uses $tmpd.
  • One run requests two seats on a test PR. I could only check this with the stub. The existing stub-gh test now serves teams/seats and still passes: "request-review asks the two least busy seats…" (zz-b and zz-c), with one POST per seat and the label added last. I have no GitHub access in this run, so I did not check it live, and neither did the PR (its body says so).

Correctness. Real gh prints gh: Not Found (HTTP 404) to stderr on a 404, the same text quoted in the issue. That means grep -q 'HTTP 404' matches the real output, not only the stub's. When gh fails it may print the error body to stdout, but that output goes into members only on the failure branch, where it is never used. An empty team now gets its own message. Callers are unchanged: the script's arguments, exit codes and success output are all the same.

Scope. The PR changes plugins/setkernel/skills/request-review/request-review.sh and its test in tests/run.sh, both named by the issue. SKILL.md does not name the team (I grepped it), so leaving it unchanged is correct.

Org rules. The diff has no secrets. Two existing test lines changed only to follow the rename (teams/engineering → teams/seats in the stub case and in the grep -v filter). Neither change weakens an assertion. This repo's CI has no test-diff guard, and I did not check whether any guard outside the repo applies.

Security. This is R1 (a skill script, nothing live), so I did no separate security pass. Nothing goes live when it merges.

Nits (non-blocking)

  1. The 404 test checks only the "does not exist" prefix. Asserting that the message also no longer mentions read:org would protect the second criterion more directly.

@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 9c43d0d.

No merge blockers found. I reviewed head 9c43d0d against origin/main: plugins/setkernel/skills/request-review/request-review.sh (+11/-5) and tests/run.sh (+10/-2).

What I checked and how

Checks. The head has one check run, check. It completed with success. That workflow runs the tests, bin/generate --check, ShellCheck on request-review/*.sh and tests/run.sh, and the JSON check (.github/workflows/check.yml).

Acceptance criteria (#75)

  • The script reads team seats. request-review.sh:17 is now team=seats, and that is the only place the team is set. grep -rn engineering over the tree, excluding .git, finds nothing.
  • A missing team gives an error that names the team as missing, rather than blaming the scope. request-review.sh:52-59 saves gh's stderr. If that output contains HTTP 404, the script dies with "the team setkernel/seats does not exist (or this gh login cannot see it): gh: Not Found (HTTP 404)". Any other failure prints "cannot list the members of setkernel/seats: <gh's message>". The read:org blame is gone. I ran bash tests/run.sh on the head: 791/791 passed, including ok 781 - a missing team is named as missing and ok 782 - another failure keeps gh's own message.
  • One run requests two seats on a test PR. This was checked only against the stub gh, not live, by the PR author or by me: neither run had GitHub access. ok 763 - request-review asks the two least busy seats and prints them with the PR URL passes with the stub serving orgs/setkernel/teams/seats/members. The issue says the seats team exists and that the hq gate already uses it. I did not confirm that.

Correctness. The script now runs mktemp/trap before the members call, so $tmpd/err exists when gh writes to it. die runs $(cat …) before it exits, and the EXIT trap still cleans up. On an HTTP error, gh may write the error body to stdout, which lands in members. The script ignores it because it only uses members when the call succeeds. Callers are unchanged: SKILL.md runs the script with the same arguments.

Scope. The PR touches only the script and its test, which the issue's "Files likely touched" names. SKILL.md does not name the team or read:org (grep finds nothing), so it rightly stays unchanged.

Org rules. The diff has no secrets. The test edit keeps every existing assertion. It renames the stubbed endpoint and the grep -v 'teams/seats' filter to the new team and adds two tests. Nothing is weakened or removed, and no allow-test-changes: line is needed as far as I can tell. The PR is R1, so I skipped the R2/R3 security pass.

Not checked: a live run against GitHub. I also did not run the suite under SHELL_UNDER_TEST=dash, because the sandbox refused that command.

Nits (non-blocking)

  1. The 404 check greps for the literal text HTTP 404 in gh's stderr. That works with today's gh message format, but it would quietly fall back to the generic message if gh rewords it. That is acceptable, since gh's own text is still printed either way.
  2. After merge, one live request-review run on a throwaway PR would settle the third criterion for real. Note the result on #75.

@realRaghavGupta
realRaghavGupta merged commit ff6174d 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.

request-review: read team seats, not the deleted engineering team

4 participants