Skip to content

feat(notifications): event-to-subscription-to-delivery service #535

Description

@JSONbored

Parent roadmap: #525
Parent phase: #527

Background

When a reviewer requests changes on a miner's PR, the miner is never told by Gittensory — so fixes are slow and merge rates suffer. Closing this loop is the wave's killer use case. This issue absorbs #255 (digest notifications) but decouples the miner real-time alert from the #150 PWA research gate by shipping it on the extension badge channel first.

Goal

A new event → subscription → delivery notifications service on the existing JOBS queue.

Current Behavior

pull_request_review webhooks are received but the author is never notified; there is no notification service and no review field on the payload (see #527 review-field child).

Desired Behavior

  • Add notify-evaluate / notify-deliver job types to the JobMessage union + processJob switch (src/queue/processors.ts). Emit events from detectNotificationEvents inside processGitHubWebhook.
  • Killer event: pull_request_review state changes_requested → alert the author. Other events: PR going stale, duplicate cluster forming, new high-fit issue; maintainer-side gate failure / SLA breach (cron-driven).
  • Channels sequenced: extension badge (pull-based, ships with the rebuild) + email → PWA web push → Slack/Discord.

Implementation Requirements

Public/Private Output Boundaries

  • Templated, public-safe copy only; payloads carry { repo, pr, eventType, deeplink }. Suppress self-notifications and bot loops.

Acceptance Criteria

Testing Requirements

  • npm run test:ci, 97%+ coverage. Idempotency test (duplicate webhook/queue retry → one delivery); self-notification suppression; rate-limit window.

Sub-issues

Wave 3 refinement (#525)

This issue already owns the killer event (changes_requested → alert the author). Refinements: the alert should carry the predicted-gate delta + concrete fix list (reuse the #688 predicted-gate engine), and also fire on merge to feed #702 (miner reward attribution). #699 (issue-watch) is the new-issue half of the same miner feed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    gittensor:featureGittensor-scored feature linked to a feature issue — scores a 0.25x multiplier.

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions