Repository navigation
✨ feat(attention): per-recipient budgets with opt-in digest overflow (off by default) - #16309
Conversation
…(off by default) 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 `#16309c63510f` sha256:dead5b2306390aaed5ae37be5b5e71b0d0781a0f953bdec436c10afbccd7b3fa — download from the dashboard or `hivectl review evidence #16309`. |
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 src/pkg/attentionbudget/budget.go in full and checked how it sits on v5. The package does what the body says and I have no correctness findings: exempt classes short-circuit before the window is touched (Admit, budget.go), recipient_budget: 0 always returns Deliver while tallying would_overflow against ShadowBudget, an over-cap Ping to a non-opted-in login is still delivered and only Reminder is deferred, and Overflowed/Resolve keep the deferred ask visible rather than dropping it. The landing order (package first, wiring after #16291) is stated in the body, so I am not raising it as a question.
One low-severity docs note. The new table in src/docs/notifications.md presents github.attention.recipient_budget and github.attention.digest_recipients as config fields with defaults, but on this head nothing reads them: attentionbudget has no importer outside its own package, and the github.attention block itself does not exist on v5 — it is introduced by #16291 (src/pkg/config/config.go, Attention attention.Config), which is an open fork PR. pkg/config does not reject unknown keys, so an operator who follows the table today sets a value that is silently ignored. The paragraph under the table does say the budget "takes effect once the ledger routes its non-urgent writes through it", which covers it, but I'd make that explicit in the table itself (e.g. a "not yet read by any loader; lands with the wiring" note) or hold the table for the wiring PR, so the doc does not describe a knob that is not there.
— 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 |
Part of #16271 (partial: budget package, config keys, tests and docs land here; wiring the check into live non-urgent posts and loading the keys from the
github.attentionblock follows once #16291 — the episode store for #16267 — merges, to avoid conflicting with that open contributor PR)Part of #16075 (epic; other children remain)
Why
Per-condition reminder limits don't add up to an attention budget. Ten conditions on ten items, each reminding once a day, still adds up to ten pings a day for one person. The #16075 decision asks for per-recipient budgets and opt-in digest overflow to be scoped in their own child before anything enables them, and says newly actionable requests must never be dropped silently.
What
New store-agnostic package
src/pkg/attentionbudget:Ping,Reminder) per responsible recipient over a rolling 24h window, across items.Seedloads the episode ledger's delivered history (paged_to/paged_at) so the window survives restarts.Admitdecides each write.Overflowed, cleared byResolve) and rendered for the item's status card (attention-overflowsection viaRenderSection), the per-repo action queue, and the digest.<!-- hive:attention-digest recipient=<login> -->), created once through the existingUpsertIssueMarkerCommentboundary and edited in place after that. An empty digest never creates a comment. No external service is involved. Recipients who haven't opted in keep per-episode delivery, so their new asks are always posted and only their reminders are budgeted.Shadow mode (why it ships off)
Following the decision recorded on the issue, the budget ships disabled. With
recipient_budget: 0, every decision isDeliver, so there is no behaviour change. The package still computeswould_overflowagainst a candidate cap (ShadowBudget = 5) and reports per-logindelivered/exempt/overflowed/would_overflowin anattention budget:log line (LogLine/Snapshot). That lets operators pick N from observed traffic before any hive enables it. The 5 is a measurement point, not policy.New config keys (documented in
src/docs/notifications.md)github.attention.recipient_budget0(off)github.attention.digest_recipients[]attentionbudget.Configcarries these yaml tags andValidate(). Thegithub.attentionblock, thepkg/attentionepisode ledger and its writer wiring are added by the still-open #16291 (#16267). Producer migration and the action queue belong to #16270. To avoid conflicting with that contributor PR, this change doesn't editconfig.go,validate.go, the settings-parity allowlist orpkg/attention. Once #16291 lands, wiring the budget in means embeddingattentionbudget.Configinline inattention.Configand callingAdmitbefore each non-urgent POST.Tests
src/pkg/attentionbudget/budget_test.go, table tests covering:Not run locally; CI decides.
— hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88 requested_by=@hanthor