Skip to content

[scanner] Add opt-in rich RFC notify config, designated-announcer gate and private-repo gate #15926

Closed

Description

@hivecommons-hive

Part of #15869

Goal

Add the opt-in config surface for richer RFC publishing, the explicitly designated announcer gate, and the private-repository authorization gate. No card/thread rendering yet. This child makes sure later children can't post anything new unless the operator turned it on.

Applicable decision constraints (from @clubanderson's /hive decision on #15869)

  • Opt-in upgrade: keep today's one-line behaviour unless cards/threads are explicitly enabled.
  • One explicitly designated announcer per destination; do not let every hive race to publish.
  • Do not publish private repository titles, bodies, links or discussions into a channel without an explicit authorized destination policy.
  • No live Discord configuration or channel changes: source changes only.

Current code (v5)

  • src/pkg/config/config.go DiscordConfig has RFCChannelID (rfc_channel_id) plus env override HIVE_DISCORD_RFC_CHANNEL_ID (DiscordRFCChannelIDEnvVar, applied around line 5876).
  • src/cmd/hive/rfcnotify_wire.go rfcNotifySettings / rfcNotifyState.ensure build rfcnotify.Options{StatePath, IncludeRepo, Logger}. rfcNotifyIssues maps github.IssueSnapshot → rfcnotify.Issue.
  • src/pkg/rfcnotify/sweeper.go Options / Sweeper.Run. src/pkg/rfcnotify/rfcnotify.go Issue.
  • Today every hive with rfc_channel_id + bot_token posts, and private-repo RFCs are posted as well.

Changes

  1. DiscordConfig new keys. Each uses omitempty and its zero value keeps today's behaviour:
    • rfc_format (""/line = today, card): validate. An unknown value is a config error, or a warning that falls back to line, following the convention of neighbouring keys.
    • rfc_threads (bool, default false).
    • rfc_announcer (bool, default false): this hive is the designated announcer for rfc_channel_id.
    • rfc_backlink_comment (bool, default false). Parsed only here; behaviour lands in a later child.
    • rfc_include_private (bool, default false).
  2. rfcnotify.Options gets matching fields (Format, Threads, Announcer, IncludePrivate, Backlink), and ensure plumbs them through. A config change rebuilds the sweeper options in the same way a channel change rebuilds the poster today.
  3. Announcer gate. A rich mode is rfc_format: card or rfc_threads: true. When a rich mode is configured without rfc_announcer: true, the hive keeps advancing its detector state but posts nothing, and logs one warning (rfc notify: rich mode requires rfc_announcer; not posting). Line mode with no new keys stays byte-for-byte unchanged.
  4. Private gate. Add Private bool to rfcnotify.Issue. In rfcnotify_wire.go, resolve repo visibility once per repo with github.Client.GetRepo and cache it on rfcNotifyState; refresh it at most hourly. Any failure to resolve counts as private (fail closed). The sweeper drops events for private-repo issues unless IncludePrivate is set, but the detector record still advances so nothing replays later. This applies in every mode, line mode included, because the decision makes it an authorization requirement.

Decision taken by hive: the gate lives in rich mode only, so existing line-mode users see no change. The private gate covers all modes and fails closed, as the decision requires. It ships with a security changelog fragment.

Files

  • src/pkg/config/config.go (+ a test in src/pkg/config/)
  • src/pkg/rfcnotify/sweeper.go, src/pkg/rfcnotify/rfcnotify.go
  • src/cmd/hive/rfcnotify_wire.go (+ rfcnotify_wire_test.go)
  • src/docs/notifications.md (RFC section: new keys table, announcer and private rules)

Acceptance

  • With no new keys set, the posted lines are identical to today (existing rfcnotify_test.go stays green).
  • rfc_format: card without rfc_announcer → zero posts plus one warning. The state still advances, so enabling the announcer later does not backfill.
  • An RFC in a private repo (or one whose visibility can't be resolved) is not posted unless rfc_include_private: true.
  • Tests: src/pkg/rfcnotify/rfcnotify_test.go (gates), src/cmd/hive/rfcnotify_wire_test.go (plumbing, visibility cache, fail closed), and a config parse/validation test. Coverage floors: rfcnotify uses the default THRESHOLD=90 and cmd/hive is 42 (.github/workflows/v2-tests.yml PKG_THRESHOLD).
  • changelog.d/security-rfc-notify-private-gate.md fragment.

— 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 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.

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