Repository navigation
✨ feat(attention): /hive ack and /hive snooze with the attention action contract - #16372
Conversation
…on contract Attention episodes (#16270) page one named person about one condition, but the recipient had no way to say "seen it" or "not now" short of fixing the condition, so the reminder siblings would have nothing to read. This adds the two answers through the existing /hive command sweep and pins down what every attention event must tell its recipient. - attention.ParseCommand / Store.Apply: `/hive ack [episode]` and `/hive snooze <duration> [episode]` (1m-30d) record AckedAt/AckedBy and SnoozedUntil/SnoozedBy on the episode (additive JSON fields). Only the episode's recipient or a write/maintain/admin maintainer may act; anyone else gets ErrNotPermitted and nothing is recorded. - The un-park sweep answers them on items with an open episode (local ledger check first, so other items cost no API call), only on the admitting hive, once per comment via the existing reply marker. It writes only comments: no label, hold, merge gate or review verdict is touched. - attention.Event / NewObservation: the action contract (who, why now, requested action, evidence, what Hive tried, what happens next, how to ack/snooze/resolve) with the fixed "Acknowledgement is not approval" wording; incomplete events are refused. Store locking is unchanged (Apply makes no delivery call), so this does not collide with #16365. Reminder scheduling, the opt-in flag/status card and the attention queue stay with siblings #16358 and #16361-#16363. Closes #16359 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> 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 |
|
Hive status — updated in place; edits do not notify. Full history is in the Activity Monitor. hive/awaiting-ci: CI pending — sweep will merge when green. 🐝 Hive Agent: — hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88 Evidence bundle `#16372c871480` sha256:eb4638c75d4244a722b560af53cb110ffbc3c52d9198df1b1b1916fa270cce9a — download from the dashboard or `hivectl review evidence #16372`. |
Open PR overlap checkBase branch: Conflicts are checked with every PR merged onto the current tip of
|
There was a problem hiding this comment.
Read the new attention and github code against the v5 tree, not just the diff. Looks correct to me.
What I verified:
- No collision with the un-park sweep.
/hive ack//hive snoozefall throughparseUnparkCommand(src/pkg/github/issue_unpark_command.go:988-999only matchesapprove/help/decision) andisUnparkProseAssentrejects any line starting with/(:1051), so a parked item never also gets the prose-hint or label-driven reply for the same comment. The hook runs before the park paths (:311-318) and reusespostUnparkReply's ID marker, soansweredUnparkCommentIDsdedupes across both. - Reminder state is actually honoured.
Store.ApplysetsAckedAt/SnoozedUntiland clearsWouldNotify; the existingReportrecompute atsrc/pkg/attention/episodes.go:358already gates one.AckedAt.IsZero() && !now.Before(e.SnoozedUntil), and the flap/reopen branch at:337-340preserves the ack. So no change toReportwas needed, as the body says. - Record-only.
Applytouches only episode fields andsave(); the sweep side writes a reply comment and anUpsertPRStatusSection("attention", …)— no label, state or merge endpoint.TestSweepAttentionAckSnoozeRecordOnlyAndNeverReleaseHoldspins this withhold+stage/085-needs-decision+needs-humanpresent. - Per-item cost.
Snapshotis a local map read andGate.AttentionStore()issync.Once-cached (src/pkg/writeback/gate.go:205), so items without an open episode add no API call, as claimed.
One non-blocking observation: items with an open episode now list comments twice per sweep (once in replyAttentionCommands, again in the un-park path when parked). Fine at current scale; noting it in case the attention queue (#16363) widens the set.
— 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 #16359
Part of #16270 (parent tracker; siblings #16358, #16361-#16363 own the opt-in flag, reminders and the attention queue)
Why
Attention episodes page one named person about one condition, but until now the recipient could only "answer" by fixing it. Reminders (#16361-#16363) need a recorded ack/snooze to read, and every event needs to say the same things so a recipient can act without digging — and must never be mistaken for a release mechanism.
What
src/pkg/attention/ack.go—ParseCommand(/hive ack [episode],/hive snooze <duration> [episode], durations90m/4h/2d/1w, 1m–30d),MayAct(episode recipient or maintainer),Store.Applywhich recordsAckedAt/AckedByandSnoozedUntil/SnoozedByon the episode. Non-recipient non-maintainers getErrNotPermittedand nothing is recorded.AckedBy/SnoozedByare additive JSON fields at the end ofEpisode; the existing locking pattern is reused (no delivery call under the lock), so no overlap with 🐛 fix(attention): drop the store lock across delivery calls and prune resolved items #16365.src/pkg/attention/contract.go—Event(who, what changed/why now, requested action, evidence, what Hive tried, what happens next, how to resolve),Validate,Render(also emits the ack/snooze instructions and the fixedNotApprovalwording: "Acknowledgement is not approval … release no security, merge or review hold"), andNewObservationwhich refuses incomplete events.src/pkg/github/attention_command.go+ 9-line hook inSweepIssueUnparkCommands— the existing/hivecommand sweep answers ack/snooze on items with an open episode (local ledger check first, so other items cost no API call), only on the admitting hive, once per comment via the existing reply marker, reusingcommenterMayUnparkfor the maintainer check. It writes only comments (reply + attention status section).src/docs/maintainer-commands.md; an "Attention action contract" section insrc/docs/notifications.md. Changelog fragment at rootchangelog.d/.Tests (acceptance)
TestAckAndSnoozeRecordedOnEpisodeByRecipientOrMaintainer,TestAckAndSnoozeRejectedForOtherCallers,TestParseCommand(attention); sweep test ignores a read-only non-recipient.TestSweepAttentionAckSnoozeRecordOnlyAndNeverReleaseHolds— a PR carryinghold,stage/085-needs-decision,needs-human: no label add/remove, no issue PATCH, and every non-GET request is a comment write (no merge/review endpoint).TestAckAndSnoozeChangeOnlyReminderStatepins that only reminder fields change.TestEventRenderEmitsEveryContractField— every field plus "Acknowledgement is not approval"; incomplete events refused.Deliberately not here
No reminder scheduling reading the new state, no opt-in flag / issue-side status card, no attention queue, no producer routed through
NewObservationyet (siblings own those). ExistingStore.Updateis untouched.— hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88