Repository navigation
🐛 Keep human-only follow-ups out of the owner-delegate's default approve #19290
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
3a4a8f3
🐛 Keep human-only follow-ups out of the owner-delegate's default approve
clubanderson 9ac4c5b
📝 Cite the tracking issue in the human-only changelog entry
clubanderson 193cdd6
🐛 Name the human-only delegate rule person-only
clubanderson 383f75e
🧪 Mirror the person-only rule into the SPA decision glossary
clubanderson File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| - Asks only a person can answer no longer pass through the owner-delegate's `default-approve` / `default-release`. A governor follow-up quoting the security review's `security requires human: …` hand-off (#19229, #19289) was approved as "an agent may claim it" and landed at `stage/010-actionable`, where agents claimed and dropped it. The decider now has a `person-only` rule ahead of the defaults: an issue with the `<!-- hive:human-only -->` marker, a `human-only` label or that governor follow-up shape, and a PR whose security perspective itself returned `requires_human` (new structured aggregate field `security_routed_to_person`), keep their 045 / 085 park, get `needs-owner` and one owner-action comment. The tracker shows them as *Needs the owner* with **Let hive decide** greyed out, and the contributor relay does not offer them. The reviewer-question auto-decide now treats a security hand-off as a policy sign-off, so the PR is not merged as-is and no claimable follow-up is filed. Separately, `owner-only` on a PR now reads the question and park reasons, or a grant-verb title, not just a title that names credentials: #19226, a credential-stripping code change, had been answered with "set or rotate the secret named in the title". |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,65 @@ | ||
| package dashboard | ||
|
|
||
| import ( | ||
| "testing" | ||
| "time" | ||
|
|
||
| "github.com/hivecommons/hive/pkg/delegatedecision" | ||
| "github.com/hivecommons/hive/pkg/gfi" | ||
| "github.com/hivecommons/hive/pkg/stagelabels" | ||
| ) | ||
|
|
||
| const followUp19229Body = "A review perspective on #19227 ended with a question rather than a finding.\n\n" + | ||
| "> A reviewer handed this to a person: security requires human: Not deeply reviewed: the diff touches Hive proxy policy / egress trust surfaces.\n\n" + | ||
| "Source: hivecommons/hive#19227 (head `0c1450c`).\n" | ||
|
|
||
| func governorFollowUpLabels() []string { | ||
| return []string{"origin/governor", reviewQuestionFollowUpLabel, "help wanted"} | ||
| } | ||
|
|
||
| func TestGovernorSecurityFollowUp(t *testing.T) { | ||
| if !governorSecurityFollowUp(governorFollowUpLabels(), followUp19229Body) { | ||
| t.Fatal("#19229's shape must read as a governor security follow-up") | ||
| } | ||
| if governorSecurityFollowUp([]string{reviewQuestionFollowUpLabel}, followUp19229Body) { | ||
| t.Fatal("without origin/governor the issue is not the governor's follow-up") | ||
| } | ||
| if governorSecurityFollowUp(governorFollowUpLabels(), "> correctness requires human: unclear intent") { | ||
| t.Fatal("another perspective's hand-off is not a security one") | ||
| } | ||
| } | ||
|
|
||
| func TestIssueHumanOnlyAsk(t *testing.T) { | ||
| if got := issueHumanOnlyAsk(nil, "hivecommons/hive", governorFollowUpLabels(), followUp19229Body); got != delegatedecision.HumanOnlySecurityReview { | ||
| t.Fatalf("governor security follow-up = %q, want %q", got, delegatedecision.HumanOnlySecurityReview) | ||
| } | ||
| if got := issueHumanOnlyAsk(nil, "hivecommons/hive", nil, "please do this\n"+gfi.HumanOnlyMarker); got == "" { | ||
| t.Fatal("the human-only marker must count") | ||
| } | ||
| if got := issueHumanOnlyAsk(nil, "hivecommons/hive", []string{"human-only"}, ""); got == "" { | ||
| t.Fatal("the human-only label must count") | ||
| } | ||
| if got := issueHumanOnlyAsk(nil, "hivecommons/hive", []string{"needs-human"}, "agent stood down"); got != "" { | ||
| t.Fatalf("needs-human alone is the ordinary park a decision lifts, got %q", got) | ||
| } | ||
| } | ||
|
|
||
| func TestOwnerOnlyIssueDecisionDisablesDelegate(t *testing.T) { | ||
| it := StageTrackerItem{Kind: "issue", Number: 19229, Stage: stagelabels.IssueNeedsDecision.Number(), OwnerOnly: humanOnlyWhySecurityFollowUp} | ||
| d := stageTrackerDecisionNeededWith(it, nil, "", time.Date(2026, 11, 19, 12, 0, 0, 0, time.UTC), blockerOptionsContext{}) | ||
| if d == nil || d.BlockerReason != "owner-only:"+humanOnlyWhySecurityFollowUp { | ||
| t.Fatalf("decision = %+v, want the owner-only issue decision", d) | ||
| } | ||
| if o := decisionOptionByAction(t, d, decisionActionDelegate); o.Enabled || o.ReasonIfDisabled == "" { | ||
| t.Fatalf("Let hive decide must be off with a reason: %+v", o) | ||
| } | ||
| if o := decisionOptionByAction(t, d, decisionActionApprove); !o.Enabled { | ||
| t.Fatalf("the person's own approve stays on: %+v", o) | ||
| } | ||
|
|
||
| it.OwnerOnly = "label:needs-human" | ||
| d = stageTrackerDecisionNeededWith(it, nil, "", time.Date(2026, 11, 19, 12, 0, 0, 0, time.UTC), blockerOptionsContext{}) | ||
| if o := decisionOptionByAction(t, d, decisionActionDelegate); !o.Enabled { | ||
| t.Fatalf("control: a needs-human park keeps Let hive decide: %+v", o) | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This negates the
if issue.IsPullRequest() || itemType == "pr"directly below; anelseon that block avoids restating the condition.