Skip to content

[scanner] Scope per-recipient attention budgets with opt-in digest overflow (off by default, never drop new asks) #16271

Closed

Description

@hivecommons-hive

Problem

Per-condition limits do not add up to an attention budget (ten conditions on ten items each reminding daily is still ten pings/day to one person). The #16075 decision says: "Scope per-recipient budgets and opt-in digest overflow explicitly in a child before enabling them; do not silently drop newly actionable requests." This is that child.

Scope

  • Per-recipient cap: at most N non-urgent attention writes (pings + reminders) per responsible recipient per rolling day, across items, computed from the episode store.
  • Overflow, never drop: an over-budget non-urgent request is still recorded as an open episode, shown in the item's status-card Attention section and the per-repo action queue, and delivered via the opt-in digest; it is never silently discarded.
  • Opt-in daily digest: one edited-in-place digest per recipient (per repo) summarising overflowed and outstanding non-urgent asks; serves as the reminder for those asks. Recipients who do not opt in keep per-episode delivery (budget applies to reminders only for them).
  • Exempt from budget: materially new security risk / imminent destructive action, mandatory/required reviews, machine-consumed protocol commands, and every security/merge hold notice.
  • Quiet hours/routing preferences, if added, never act as approval shortcuts.

Decision taken by hive: ships disabled (github.attention.recipient_budget: 0 = off; digest opt-in per recipient via config), evaluated in shadow mode first (count would-overflow) before any hive enables it. Digest delivered as a single edited GitHub comment/issue (no external service). Default N proposed in the PR is a shadow-evaluated number, not hard-coded policy.

Acceptance criteria

  • Disabled by default ⇒ no behaviour change.
  • Shadow mode reports would-overflow counts per recipient without changing writes.
  • Enabled: (N+1)th non-urgent ask in a day goes to the digest and the action queue; test asserts it is visible and not dropped.
  • Exempt classes always deliver immediately regardless of budget (tests per class).
  • Digest is created once and edited thereafter; no new comment per day.
  • Docs describe the budget, digest opt-in and exemptions.
  • No new dependency or paid service.

Likely files

src/pkg/attention (from the episode child), src/pkg/config/config.go, src/pkg/github/pr_status_comment.go, src/docs/notifications.md.

Evidence

RFC #16075 §4 (opt-in daily digest), title "maintainer attention budgets"; thread analysis point 5; maintainer decision on #16075.

Depends on #16267 (episode store) and #16270 (attention events, action queue, opt-in pilot).

Part of #16075

— hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88

Activity

  1. added
    help wantedDenotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.
    agent/scannerCreated or modified by the scanner agent
    on Nov 2, 2026
  2. hivecommons-hive commented on Nov 2, 2026

    @hivecommons-hive
    ContributorAuthor

    🔒 Claimed by @mrbobbytables (contributor on hive hosted-available-oke-11-placeholder-r05x). The claim lasts 30m0s without activity and renews while the work continues. Reply /unclaim to release, or /claim to take it over if you outrank the holder.

  3. hivecommons-hive commented on Nov 2, 2026

    @hivecommons-hive
    ContributorAuthor

    🔓 Claim by @mrbobbytables released (lease revoked).

  4. 15 remaining items

  5. hivecommons-hive commented on Nov 3, 2026

    @hivecommons-hive
    ContributorAuthor

    🔒 Claimed by agent scanner (agent on hive hosted-available-oke-11-placeholder-r05x). The claim lasts 2h0m0s without activity and renews while the work continues. Reply /unclaim to release, or /claim to take it over if you outrank the holder.

  6. added
    hive/verified-openHive verified that a likely/already-done claim did not finish this issue; keep open for more work
    stage/010-actionableTriaged; eligible for the hive to pick up
    and removed
    stage/020-claimedClaimed by the scanner or a relay contributor
    stage/010-actionableTriaged; eligible for the hive to pick up
    on Nov 3, 2026
  7. hivecommons-hive commented on Nov 3, 2026

    @hivecommons-hive
    ContributorAuthor

    Remainder implemented in #16426 (wiring the budget from #16309 into live delivery; unblocked now that the episode store landed on v5).

    Decision taken by hive: producers mark exempt asks via a new Observation.Class field (security, required_review, protocol_command, hold); an unset class is treated as an ordinary non-urgent ping and is budgeted. This is the reverse of the attentionbudget package's own unknown-class-is-exempt default, chosen because otherwise an enabled budget would never hold back any first ping from existing producers. Risk is bounded: the feature ships disabled (recipient_budget: 0) and over-budget asks are recorded and visible, never dropped. Simplest additive option; reversible by setting the class on a producer.


    🐝 Hive Agent: scanner | Instance: hosted-available-oke-11-placeholder-r05x | SHA: unknown

    — hive: agent=scanner backend=copilot model=claude-fable-5.1 copilot=1.0.88

  8. hivecommons-hive commented on Nov 3, 2026

    @hivecommons-hive
    ContributorAuthor

    🔓 Claim by agent scanner released (holding agent relaunched).

  9. murtazox04 commented on Nov 4, 2026

    @murtazox04

    Read #16426 on v5 (24c6a1c). The retry path covers my first point: an over-budget ask stays would-notify and is re-admitted every pass, so it pages once the window frees instead of living only in a silently edited digest. Persisting Overflowed on the episode also covers the restart case, because the next pass re-adds the ask to Budget.open.

    The retry does create one side effect worth a small follow-up. deliver and AdmitReminder build the ask with budgetAsk(*e, ..., now), and on Overflow, Admit stores it as b.open[openKey(...)] = ask. So every pass replaces the held entry's At with the current sweep time:

    • The digest and status-card line (ping since 2026-11-03 13:04Z) shows the last sweep, not when the ask was first held, and sortAsks (which orders by At) no longer shows the oldest first.
    • RenderDigest changes at minute precision on every pass. UpsertIssueMarkerComment only skips the edit when the body is identical, so each opted-in recipient's digest comment gets an EditComment call on every sweep while anything is held.
    • counts.Overflowed++ runs again for the same key on every pass, so the attention budget: log line counts sweeps, not held asks.

    A small fix inside Admit's overflow branch: if prev, ok := b.open[k], keep ask.At = prev.At and only increment Overflowed when !ok. Keep now for the Write that deliverLocked records, because the rolling window has to count delivery time. Using e.FirstSeen in budgetAsk instead would backdate that write, so the window would let it go too early.

    Disclosure, same as before: I maintain Cue, an open-source notification gate with per-recipient budgets. Nothing above depends on it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    agent/scannerCreated or modified by the scanner agenthelp wantedDenotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.hive/partially-addressedA merged PR addressed only part of this issue; remainder still actionablehive/verified-openHive verified that a likely/already-done claim did not finish this issue; keep open for more work

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions