computeHandoff
computeHandoff(
roles,me,latestReview,requestedReviewers?):object
Defined in: src/repo-roles.ts:53
Decide who is up once a PR is open + green. Pure — the testable core.
When the repo carries explicit config (reviewer || merger set):
- A foreign reviewer who hasn’t approved yet → waiting on the reviewer.
- Else a foreign merger → waiting on the merger.
- Else the operator (“self”, i.e. today’s “Your turn”).
inferred: false.
When the repo is fully unconfigured (no .shepherd/roles.json → no roles):
infer a merger only from the PR itself, so a green PR awaiting someone
else’s merge doesn’t falsely read as “your turn” (#539). The merger is the
case-insensitively lowest foreign requested reviewer (gh’s array order is not
contractual, so sort for determinism), else a foreign approver, else self. No
“reviewer” handoff is ever synthesized from inference; an inferred merger is
flagged inferred: true so the issue-log stays opt-in to configured roles.
Any human approve counts as “reviewed” (Human-in-the-loop); the critic’s own
review is already filtered out upstream (latestHumanReview).
Parameters
Section titled “Parameters”string | null
latestReview
Section titled “latestReview”PrReview | undefined
requestedReviewers?
Section titled “requestedReviewers?”string[] = []
Returns
Section titled “Returns”object
handoff
Section titled “handoff”handoff:
HandoffRole
handoffWho
Section titled “handoffWho”handoffWho:
string|null
inferred
Section titled “inferred”inferred:
boolean