Skip to content

[scanner] Render RFC notices as summary-card embeds when rfc_format: card #15927

Closed

Description

@hivecommons-hive

Part of #15869

Goal

Render an RFC event as a Discord summary card (embed). It is used only when rfc_format: card is set on the designated announcer. Line mode is unchanged.

Applicable decision constraints

  • Opt-in: today's one-line behaviour is preserved unless cards are explicitly enabled.
  • Preserve authorization: body-derived text is subject to the private gate from the config child.
  • Bound retries, respect rate limits and surface failures.

Current code (v5)

  • src/pkg/rfcnotify/rfcnotify.go Format(e Event, includeRepo bool) string builds the only rendering.
  • src/pkg/rfcnotify/sweeper.go Poster func(content string) error. Sweeper.Run calls Format, then post.
  • src/pkg/discord/bot.go SendMessageTo(channelID, content) sends content + allowed_mentions: {parse: []}. It has no embed support and drops the response body, so there is no message ID.
  • src/pkg/github/issue_snapshots.go IssueSnapshot has no Body. src/cmd/hive/rfcnotify_wire.go rfcNotifyIssues does the mapping.
  • Scrubber: github.com/hivecommons/hive/crux/logscrub ScrubString. Check that the root module may import it (some pkg/* packages already do).

Changes

  1. Add Body string to github.IssueSnapshot (from issue.GetBody() in issueSnapshotFrom; no extra API call) and to rfcnotify.Issue.
  2. New src/pkg/rfcnotify/card.go:
    • ParseRFC(body string) RFCMeta: Target and Status from the RFC field table, the first paragraph under ## Summary (≤300 runes, logscrub.ScrubString), the count of open items under ## Decisions for maintainers (numbered or - [ ] items that are not struck through or checked), and related RFC links. Parsing never fails; missing fields stay empty.
    • Card(e Event, meta RFCMeta, includeRepo bool) Embed: title #N <title> linked to the URL, author, the fields above, and colour by state (held grey, needs-decision amber, ready green, closed completed blue, closed not-planned dark). All text is truncated to Discord limits.
    • When the body doesn't parse (no table and no summary), the caller falls back to Format.
  3. src/pkg/discord/bot.go: SendEmbedTo(channelID, content string, embed Embed) (messageID string, err error) always sets allowed_mentions: {parse: []}. Factor the shared HTTP path out of SendMessageTo and return the created message ID. On HTTP 429, honour retry_after with at most one bounded retry, then return an error.
  4. Sweeper: a Publisher interface (Post(content) error, PostCard(content string, Embed) (string, error)). When Options.Format == "card", the sweeper renders the card. The wire adapts the bot to it. A post failure follows the existing rollback path, so the failure is counted in Result.Errors and the event retries.

Decision taken by hive: the embed type lives in pkg/discord (or a minimal struct in rfcnotify, mapped in the wire); pick the simplest shape. Colour constants are fixed in code, not config.

Files

Acceptance

  • With rfc_format unset, output is identical to today.
  • A well-formed RFC renders as a card with target, status, a summary ≤300 chars (scrubbed) and the open-decision count. A malformed body falls back to the line.
  • A title containing @everyone pings nobody (payload test).
  • A 429 retries at most once, after retry_after. A persistent failure surfaces in Result.Errors and the audit log.
  • changelog.d/added-rfc-notify-cards.md. Add a docs row in src/docs/notifications.md for rfc_format: card.

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

Activity

  1. added
    kind/featureCategorizes issue or PR as related to a new feature.
    agent/scannerCreated or modified by the scanner agent
    on Oct 31, 2026
  2. added
    help wantedDenotes an issue that needs help from a contributor. Must meet "help wanted" guidelines.
    on Oct 31, 2026
  3. clubanderson commented on Oct 31, 2026

    @clubanderson
    Member

    @hanthor Tracking implementation of your RFC #15869 here. Implementer requirement: mention @hanthor in the associated PR description, link this issue and RFC #15869, and post a completion comment mentioning @hanthor after the PR actually merges, with the merge link and a clear distinction between source shipped and deployment/activation. This issue is still open; this comment is attribution/notification, not a completion claim.

  4. hivecommons-hive commented on Oct 31, 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.

  5. hivecommons-hive commented on Oct 31, 2026

    @hivecommons-hive
    ContributorAuthor

    🔓 Claim by @mrbobbytables released (released on disconnect).

  6. hivecommons-hive commented on Oct 31, 2026

    @hivecommons-hive
    ContributorAuthor

    Deferred this kick (not claimed): the sweeper/wire/docs files this issue changes (src/pkg/rfcnotify/sweeper.go, src/pkg/rfcnotify/rfcnotify.go, src/cmd/hive/rfcnotify_wire.go, src/docs/notifications.md) are all modified by open PR #15959, which is green and review-pending. Dispatching the card work in parallel would produce a guaranteed conflict on whichever lands second, so it starts once #15959 merges.


    🐝 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

  7. hivecommons-hive commented on Oct 31, 2026

    @hivecommons-hive
    ContributorAuthor

    🔒 Claimed by @thatguywob (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.

  8. hivecommons-hive commented on Oct 31, 2026

    @hivecommons-hive
    ContributorAuthor

    🔓 Claim by @thatguywob released (lease revoked).

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.kind/featureCategorizes issue or PR as related to a new feature.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions