feat(notifications): active issue-watch monitor — gittensory_watch_issues (#699 path B) - #735
Conversation
…sues (#699 path B) Miners subscribe to repos for NEW grabbable, high-multiplier issues; when one opens, the watchers are notified through the #535 pipeline. Completes the active half of #699 (path A shipped the pull surface in #706). - issue_watch_subscriptions table (migration 0036) + repositories CRUD (upsert idempotent on login+repo, list-for-login, delete, list-watchers-for-repo); labels lowercased for case-insensitive filtering. - engine: export isGrabbableHighMultiplierIssue (open + maintainer-created + not WIP) — the exact condition path A ranks up. - notifications/service: detectIssueWatchEvents fans out one event per matching watcher (label filter; skips the issue's own author), DB-backed so it sits alongside the pure detectNotificationEvents; buildIssueWatchNotification (public-safe "open to grab" copy). New eventType issue_watch_match (its pullNumber field carries the issue number). - processors: the issue-opened webhook path detects watch events and fans them into the existing notify-evaluate enqueue loop. - MCP gittensory_watch_issues (watch/unwatch/list, self-scoped) — the miner surface; matches surface through gittensory_list_notifications. Tests: grabbable-issue logic, subscription CRUD, fan-out detection (label filter / author-skip / no-author edge), public-safe copy, the dispatch, the MCP tool (incl. self-scope), and the webhook end-to-end. 97% coverage held.
|
Note Gittensory Gate skippedPR closed before full evaluation. No late first comment was created.
💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →. Checked by Gittensory, a quiet PR intelligence layer for OSS maintainers. |
|
gittensory · advisory review Reviewed 10 changed file(s) — two independent AI reviewers. Suggested action: ✅ Safe to merge — both reviewers found no blocking issues. Reviewer A · Suggestions
Worth double-checking
Reviewer B · Suggestions
Worth double-checking
|
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
What
Completes the active half of #699 (path A shipped the pull surface in #706): miners subscribe to repos for new grabbable, high-multiplier issues, and when one opens they're notified through the #535 pipeline.
How
issue_watch_subscriptionstable (migration 0036) + repositories CRUD:upsertIssueWatchSubscription(idempotent on login+repo; re-subscribe updates the label filter),listIssueWatchSubscriptionsForLogin,deleteIssueWatchSubscription,listIssueWatchersForRepo. Labels are lowercased for case-insensitive matching.engine.isGrabbableHighMultiplierIssue(exported): open + maintainer-created + not WIP — the exact condition path A ranks to the top.notifications/service.detectIssueWatchEvents: fans out one event per matching watcher (honours the optional label filter; skips the issue's own author). DB-backed (reads watchers), so it lives beside the puredetectNotificationEvents. New eventTypeissue_watch_match(itspullNumberfield carries the issue number) +buildIssueWatchNotification(public-safe "open to grab" copy — no reward/score/multiplier language).processors: the issue-opened webhook path detects watch events and merges them into the existingnotify-evaluateenqueue loop — reusing the whole feat(notifications): event-to-subscription-to-delivery service #535 delivery + rate-limit + idempotency machinery.gittensory_watch_issues(watch/unwatch/list, self-scoped): the miner control surface. Matches arrive viagittensory_list_notifications.Flow
A maintainer opens a new non-WIP issue on a watched repo → each subscribed miner (matching their label filter, excluding the issue author) gets a badge notification: "New issue to grab on owner/repo#N." Maintainer-created issues are the highest-fit targets, so miners can claim them early.
Tests
Grabbable-issue logic, subscription CRUD (idempotency + label normalization), fan-out detection (label filter / author-skip / no-author edge / no-watchers), public-safe copy, the content dispatch, the MCP tool (incl. self-scope rejection), and the webhook end-to-end (opened issue → watcher enqueued, author skipped). Typecheck + UI lint + OpenAPI clean; 97% coverage held.