Repository navigation
π fix(contribute): a needs-decision park posts its question - #16837
Conversation
A hosted contributor's needs-decision verdict parks the issue at 045 through the relay's label alone; the agent is only asked to comment. projectbluefin/common#1605 and projectbluefin/utah#1036 (2026-11-01) sat at 045 with no question. When nobody commented after the task was assigned, the hub now posts the reported question once (marker `hive:contribute-park task=β¦`), with the recommendation when the reason names one and without the word otherwise, so the un-park menu offers no empty `/hive approve`. The task prompt asks for `decision: <question>; recommended: <option, because why>`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BQYnPGFJx81c8JXR3o1sg1 Signed-off-by: Danathar <Danathar@users.noreply.github.com>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Open PR overlap checkBase branch: Conflicts are checked with every PR merged onto the current tip of No conflicting open PRs or same-file overlaps were found. |
There was a problem hiding this comment.
Test review (quality lane) β read at head 317e891. The behaviour change ships failing-without-it tests: TestNeedsDecisionParkPost ("no comments" / "only the hive's own GFI notice") would post nothing on v6 today, and TestNeedsDecisionParkWireShape pins the handleTaskComplete seam. Two gaps, neither blocking:
parkCommentExplainsnever looks at the comment's author. Any β₯40-char comment created afterassignedAtsuppresses the hub's question β including a maintainer's or a bystander's unrelated remark during the task window, which is exactly the case where the question is most needed. No table row exercises a third-party comment; consider adding one (user.login != reporterβ still post) and, if you agree, restricting the "explained it" match to the reporter's login (and the hub's own marker).- The second half of
TestNeedsDecisionParkWireShapeends int.Skipfwhen the harness doesn't re-offer #77, so the "gate park is released, not posted" branch is only asserted when the harness happens to cooperate. A direct call topostNeedsDecisionParkwithgateParkReason(likeTestNeedsDecisionParkSkipsNonIssueTasksdoes forKind: "pr") would make that assertion unconditional.
β hive: agent=quality backend=copilot model=claude-fable-5.1 copilot=1.0.88
|
Hive status β updated in place; edits do not notify. Full history is in the Activity Monitor. Review findings from Docs-currency pass at 317e891 β advisory only, no blocker.
Checked and fine: the Review findings from Correctness review (head 317e891) 1. A wrong-base verdict that falls back to needs-decision now gets two hub park comments. Suggested fix in ( 2. Minor: the one-minute slack is sent to GitHub ( Review findings from Intent alignment (read at head 317e891): the diff does what the body says β Low β (and drop the Review findings from Style re-review at 687b324 (delta from 317e891 is a Prior findings from the earlier head are all still present: the PR's own files are byte-identical apart from that merge line, so the correctness notes on One new maintainability point, low severity:
@@ func TestNeedsDecisionParkWireShape(t *testing.T) {
- // A gate park is released, not posted.
- key := noPRKey("acme/widgets", 77)
- hub.completedMu.Lock()
- hub.completedTasks[key] = time.Now().Add(-(hub.completedTaskCooldown[key] + time.Minute))
- delete(hub.noWorkVerdicts, key)
- hub.completedMu.Unlock()
- conn.WriteJSON(WSMessage{Type: "ready", Seq: 3})
- again := readMsg(t, conn)
- if again.Type != "task_assign" || again.Number != 77 {
- t.Skipf("issue not re-offered in this harness (%+v); the first half is the regression", again)
- }
- conn.WriteJSON(WSMessage{
- Type: "task_complete", TaskID: again.TaskID, Result: "completed",
- CompletionSignal: completionSignalVerdict,
- Verdict: "no_work_needed", VerdictNeedsDecision: true,
- VerdictReason: gateParkReason,
- })
- select {
- case c := <-got:
- t.Fatalf("a released gate park must not get a park comment: %+v", c)
- case <-time.After(300 * time.Millisecond):
- }
}
+
+// A released gate park is not posted: same wire shape as
+// TestGateParkVerdict_WireShape, with the park poster armed.
+func TestNeedsDecisionParkWireShape_GateParkPostsNothing(t *testing.T) {
+ s, ts := setupWSTest(t)
+ defer ts.Close()
+ // β¦register/dial/auth and seed #77 exactly as aboveβ¦
+ hub := s.contributeHub
+ got := make(chan call, 1)
+ hub.needsDecisionParkPoster = func(_ context.Context, repo string, number int, since time.Time, body string) error {
+ got <- call{repo, number, since, body}
+ return nil
+ }
+ fx := newToolingReleaseFixture()
+ hub.gateParkReleaser = fx.release
+ conn.WriteJSON(WSMessage{Type: "ready", Seq: 2})
+ assign := readMsg(t, conn)
+ conn.WriteJSON(WSMessage{
+ Type: "task_complete", TaskID: assign.TaskID, Result: "completed",
+ CompletionSignal: completionSignalVerdict,
+ Verdict: "no_work_needed", VerdictNeedsDecision: true,
+ VerdictReason: gateParkReason,
+ })
+ select {
+ case <-fx.released:
+ case <-time.After(5 * time.Second):
+ t.Fatal("the hub must release the gate park through the seam")
+ }
+ select {
+ case c := <-got:
+ t.Fatalf("a released gate park must not get a park comment: %+v", c)
+ case <-time.After(300 * time.Millisecond):
+ }
+}( Otherwise the new file follows Review findings from Read the new file against the v6 tree and the
Neither blocks landing; both are a few lines. |
|
@Danathar this PR is back in your court ( Review asks:
Reply here or push a new head to this branch (same sign-off); CI and the review swarm re-run automatically and the PR returns to the normal path. Queued in your relay fix queue (9 waiting): fixes are handed out before new work as soon as you have capacity. |
There was a problem hiding this comment.
Delta re-review at 687b324 (correctness). The new head is only Merge branch 'v6'; the sole change to a PR-owned file is an upstream log string in contribute_ws.go:4505. contribute_needs_decision_park.go is byte-identical to 317e891, so the two previous correctness findings are still present:
1. Wrong-base fallback posts two hub park comments β contribute_ws.go:4488-4496 turns an unverifiable wrong_base into needs_decision and goes parkWrongBaseIssue, which posts a <!-- hive:wrong-base-park --> comment (contribute_wrong_base.go:14,117). The same completion then reaches contribute_ws.go:4542-4545 and goes postNeedsDecisionPark. Even when the wrong-base comment lands first, parkCommentExplains (contribute_needs_decision_park.go:54-56) returns false for any <!-- hive: notice, so the question is posted a second time. Suggested fix in contribute_ws.go:
wrongBaseTarget := ""
+ wrongBaseParked := false
if verdict == completionVerdictWrongBase {
resolved, target, reason, park := h.resolveWrongBaseVerdict(
completedTask, verdict, msg.VerdictTargetBranch)
verdict, wrongBaseTarget, verdictReason = resolved, target, reason
+ wrongBaseParked = park
if park && completedTask != nil {
@@
- if verdict == completionVerdictNeedsDecision && completedTask != nil {
+ if verdict == completionVerdictNeedsDecision && completedTask != nil && !wrongBaseParked {2. Slack is a no-op; zero assignedAt makes the scan unbounded β contribute_needs_decision_park.go:160-163 asks GitHub for comments since since-1m, but line 167 then drops anything Before(since), so the minute of slack never admits a comment. When since is zero (resume-adopted tasks, contribute_ws.go:157-159) no Since is sent and line 167 accepts every one of the first 100 comments, so any β₯40-char comment in the issue's history (the original report, a triage note) suppresses the question β exactly the unexplained park this PR exists to fix. Suggested fix:
opts := &gh.IssueListCommentsOptions{ListOptions: gh.ListOptions{PerPage: 100}}
- if !since.IsZero() {
- at := since.Add(-time.Minute)
- opts.Since = &at
+ if since.IsZero() {
+ return fmt.Errorf("task has no assignment time; not scanning the whole issue for an explanation")
}
+ at := since.Add(-time.Minute)
+ opts.Since = &at
@@
for _, c := range comments {
- if since.IsZero() || !c.GetCreatedAt().Time.Before(since) {
+ if !c.GetCreatedAt().Time.Before(at) {
if parkCommentExplains(c.GetBody()) {
return nil
}
}
}(Either skip-with-log as above, or post unconditionally when since is zero β but then dedupe needs the marker check to still run.)
Previous docs-currency note (contributor-relay.md:1624) is fixed at this head β the doc now describes the hub comment. The intent-alignment note on parkRecommendation (contribute_needs_decision_park.go:69-78) is unchanged and still applies.
β hive: agent=adjudicator backend=copilot model=claude-fable-5.1 copilot=1.0.88
Review on hivecommons#16837: - quality: only the reporting contributor's own comment (or the hub's marker) counts as the park's explanation; a maintainer's or bystander's remark in the task window no longer suppresses the question. The wire test's gate-park half now fails instead of skipping, and needsDecisionParkDue is tested directly. - adjudicator-3: a wrong_base verdict that falls back to needs-decision already gets parkWrongBaseIssue's note; it no longer also gets the hub's question (an explicit flag, since the target can be empty). The one-minute clock-skew slack now applies to the filter as well as the listing. - reviewer-2: contributor-relay.md's "no extra comment" sentence names the hub fallback. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BQYnPGFJx81c8JXR3o1sg1 Signed-off-by: Danathar <Danathar@users.noreply.github.com>
|
All four review findings are fixed at ad5afd1 (fix commit d34edc7, then merges of v6):
Mutants on the new logic: 7/7 caught (17/17 overall). |
Executive summary
When a hosted contributor's agent ends a task with a
needs_decisionverdict, the issue goes tostage/045-needs-decision. The contributor relay applies that label itself, and the agent is only asked, in the task prompt, to leave the question as a comment. Nothing checked that it did. projectbluefin/common#1605 (j1mc's agent, 2026-11-01 05:58Z) and projectbluefin/utah#1036 (Karibhou's agent, 15:36Z) were parked that way with no comment. Their only explanation was the dashboard's "Parked until a maintainer decides".The hub already receives the verdict's reason. With this PR, when nobody has commented on the issue since the task was assigned, the hub posts that reason as the question once, and the recommendation when the reason names one.
What
β¦; recommended: B, because β¦)/hive approveaccepts it/hive decision; never says "recommend"The task prompt now asks for
HIVE_VERDICT: no_work_needed β decision: <the question>; recommended: <the option, because why>.Why
[contribute-ws] task complete β¦ verdict=needs_decision β¦ needs_decision_label=stage/045-needs-decision. Neither issue got a comment from the agent or the hub.markIssueNeedsDecisioninbin/contributor-relay.jsapplies the label. The hub only recorded the reason in its ledger./hive approveoffer an empty choice, so that word is avoided.How
contribute_needs_decision_park.go(new):postNeedsDecisionParkruns detached after a needs-decision verdict that stands, on GitHub-backed issue tasks only.<!-- hive:contribute-park task=β¦ -->).contribute_ws.go: wires the call after the gate-park reclassification, so a released gate park is never commented on. It also adds a test seam.contribute_task_prompt.go,docs/contributor-relay.md: the decision form now asks for the question and a recommendation.notification_write_sites.go,docs/notifications.md: the new writer is inventoried asattention.Tests
TestNeedsDecisionParkCommentTestParkCommentExplainsTestNeedsDecisionParkPostsinceboundTestNeedsDecisionParkSkipsNonIssueTasksTestNeedsDecisionParkWireShapetask_completehandler posts for #1605's verdict; a released gate park posts nothingTestNeedsDecisionParkDue,TestNeedsDecisionParkNotForWrongBaseFallbackgo testdashboard, github, writebackcheck-docs-citations.py src/docsNotes
needs-human, and the stage engine derived 045 from that label. It's a person's own park, and the hive has no question to post for it.π€ Generated with Claude Code
https://claude.ai/code/session_01BQYnPGFJx81c8JXR3o1sg1