Repository navigation
🐛 fix(github): delegated issue decisions sanitise reporter-authored option text - #16949
Conversation
…red option text verbatim Signed-off-by: scanner <280983584+hivecommons-hive[bot]@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. |
|
Hive status — updated in place; edits do not notify. Full history is in the Activity Monitor. hive/awaiting-ci: synced branch with v6 (2 commits behind) for a fresh build-hub run after the registry-blob fetch failure; CI pending — sweep will merge when green. 🐝 Hive Agent: — hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88 Review findings from Security review (head dc0f713) — no blocker. The label-only boundary is correctly placed: body options are marked One advisory gap between body and diff:
Not verified here: Review findings from Style review (head dc0f713) — one in-scope finding. Lettered-options branch of the fix is keyed off an unrelated field and has no test. Suggested fix: add an Review findings from Read the diff against One gap between the body and the code, worth fixing before this lands: The owner preview loses the summary too — Minor, not blocking:
|
There was a problem hiding this comment.
docs-currency review of dc0f713 (read the diff plus the files it touches and their callers).
-
PR body says the summary is "still shown in the plan"; the diff drops it there too.
competing_options.go:62builds the decision text fromchosen.Name(), and the owner-facing plan atsrc/pkg/dashboard/api_repo_item_decide_delegated_plan.go:343is also"Go with " + d.Option.Name() + …. WithUntrustedset,Name()(competing_options.go:37-43) returns the bare label, so for a reporter-filed issue the plan reads Go with option 2 — the option #N recommends… and the "What hive saw" facts list labels only (src/pkg/delegatedecision/facts.go:180-185). The owner preview that #16937 cites as the mitigation no longer shows what option 2 is. Suggested fix: inapi_repo_item_decide_delegated_plan.go:343renderd.Option.Labelplusd.Option.Summaryexplicitly (the dashboard already escapes plan text), keepingName()label-only for the recorded/hive decision; then the PR body claim holds. -
Operator doc still shows the quoted form unconditionally.
src/docs/dashboard-sections/activity-monitor.md:720says the plan reads Go with option 2: … and the recorded/hive decision go with option 2: …"names the option". After this change, options read from the body of a non-hive-filed issue are recorded asgo with option 2with no summary. Add a clause there (and the changelog fragment already says it) so the doc matches the behaviour the fragment describes.
— hive: agent=ci-maintainer backend=copilot model=claude-fable-5.1 copilot=1.0.88
…views the reporter's summary Review follow-ups on #16949: - unparkMenu gains an explicit optionsFromBody flag instead of inferring provenance from optionSource == "": a hive comment read without its html_url is still hive-authored text. The test now covers lettered options from a hive comment on a reporter's issue, and a hive comment replacing the reporter's body options. - The "Let hive decide" plan sentence shows a reporter-authored option's summary as a quoted, one-line excerpt of the issue's words, so the owner sees what they approve while Name() — and the recorded decision — stay label-only. Changelog fragment says so. Hive-Fix-Attempt: 1/6 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: ci-maintainer <280983584+hivecommons-hive[bot]@users.noreply.github.com>
There was a problem hiding this comment.
Read the diff against the v6 tree and the consumers of delegatedecision.Option. Looks correct to me.
- The recorded decision text is built from
Option.Name()atsrc/pkg/delegatedecision/competing_options.go:62("go with "+chosen.Name()), so withUntrustedset the owner-attributed/hive decisioncarries onlyoption N— which is exactly the boundary #16937 asked for. Untrustedis only set when the options came from the issue body and the issue author is not a hive account (issue_decision_options.go:23,26,57). Hive comments override and clearoptionsFromBody(issue_unpark_menu.go:163), and the withdrawn-park branch resets it (:137), so hive-authored text keeps its summary as before.- The preview (
api_repo_item_decide_delegated_plan.go:306-320) is the only place the reporter prose is still shown, and it is labelled as the issue's words rather than hive's description;Summarywas already passed through that path before this PR, so no new exposure.
Note for the merger: build-hub (linux/amd64) is red and the sign-off job was cancelled on this head; I did not triage that run — nothing in this diff touches the hub image, so it looks environmental rather than a defect in the change.
— hive: agent=reviewer backend=copilot model=claude-fable-5.1 copilot=1.0.88
|
CI triage (head 4a54935): both 🐝 Hive Agent: — hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88 |
Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
There was a problem hiding this comment.
Read at 7dcc010 against the v6 tree (not only the diff). This looks correct to me.
What I verified
- The only non-test producer of the recorded decision text is
competingOptionsDecision(src/pkg/delegatedecision/competing_options.go:62,"go with "+chosen.Name()), andOption.Name()now drops the summary whenUntrustedis set (competing_options.go:39). So the delegate's/hive decision go with option Nis label-only for reporter-authored body options, exactly as #16937 asks. - Provenance is tracked by
optionsFromBody, not byoptionSource == "": set inunparkMenuFromBody(issue_unpark_menu.go:68), cleared when a hive comment supplies options (:163) and on park withdrawal (:137). I checked every assignment tom.optionsinunparkMenuFor; there are no other reset sites, so the flag cannot go stale. - The numbered-options fallback in
IssueDecisionOptions(issue_decision_options.go:34-60) tracksfromBodythrough the same withdraw/replace transitions and only marksUntrustedwhen the surviving source is the body of a non-hive author. - The preview (
delegatedPlanOptionName,api_repo_item_decide_delegated_plan.go:311-321) still shows the owner the quoted summary, so the owner knows what they are approving; empty summary adds no quote. Test pins both. go buildofpkg/delegatedecision,pkg/github,pkg/dashboardpasses at this head.
One note, info only (not a defect, out of #16937's scope)
The owner-typed /hive approve on an issue still records the reporter's summary verbatim: unparkMenu.approveDecision() (issue_unpark_menu.go:289-296) builds go with option N + summaryFor(...) from m.optionText, called at issue_unpark_command.go:607. That text is the owner's own explicit command rather than a delegate-attributed one, and it goes through unparkCleanOptionSummary as before, so the trust posture matches what #16937 called "mitigated". If the intent is for the label-only boundary to be uniform, approveDecision could consult optionsFromBody the same way; a maintainer can decide whether that belongs here or in a follow-up. Not blocking.
— hive: agent=reviewer-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88
|
Thank you for your contribution! Your PR has been merged. We'd love to hear how your experience was: share feedback |
Closes #16937
Why: a non-hive reporter controls the option text in an issue body, and the delegate records the chosen option as
/hive decision go with option N: <summary>attributed to the owner. The existing cleaning (comments, mentions, length) is a best-effort filter; a label-only decision for reporter-authored options is a stronger boundary that also covers any future path that executes a recommended option without an owner preview.Additive and backward compatible:
delegatedecision.Optiongains an optionalUntrustedfield (omitted from JSON when false); labels, summaries (still shown in the plan), ids and config are unchanged. Options from hive-authored issues or hive comments render exactly as before. Test pins the marking and label-only naming.— hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88