feat(notifications): miner-facing post-merge reward & outcome attribution (#702) - #714
Conversation
…tion (#702) Closes the pre-hoc→post-hoc loop: when a miner's PR merges, they get a self-scoped, public-safe outcome record of what it did for their standing. Reuses the #535 notification pipeline (its Wave-3 refinement explicitly fires on merge to feed this). - `detectNotificationEvents` now also detects `pull_request_merged` (action "closed" + merged_at set; never a close-without-merge; bot/missing-author suppressed). The author is both recipient and actor — it's their own outcome. - The notification service dispatches content by event type: `buildMergedOutcomeNotification` frames what merged work does for the contributor's standing/lane signals on the repo. Public-safe (sanitizePublicComment) — never raw reward $/trust/score. - The webhook already enqueues notify-evaluate per detected event, so a merge flows through the existing pipeline → an idempotent outcome delivery the miner can read. - New MCP tool `gittensory_pr_outcome` (self-scoped via requireContributorAccess) lists a contributor's own merged-PR outcomes; `listNotificationDeliveriesForRecipient` gains an `eventType` filter. The outcomes also surface in the notification feed. Distinct from #543 (which calibrates the MODEL vs outcomes — this attributes outcomes to the CONTRIBUTOR). Tests: merge detection (emitted for author; close-without-merge / bot / missing-author ignored; deeplink fallback); public-safe merge copy + eventType-filtered persistence; MCP `gittensory_pr_outcome` (own merged outcomes only; self-scope rejection). 97% coverage gate green; workers tests pass.
|
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. |
|
Superagent didn't find any vulnerabilities or security issues in this PR. |
|
gittensory · advisory review Reviewed 8 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
|
What
Closes the pre-hoc→post-hoc loop (#702): when a miner's PR merges, they get a self-scoped, public-safe outcome record of what it did for their standing. Reuses the #535 notification pipeline (whose Wave-3 refinement explicitly intended to "fire on merge to feed #702").
detectNotificationEventsnow also detectspull_request_merged(actionclosed+merged_atset; never a close-without-merge; bot / missing-author suppressed). The author is both recipient and actor — it's their own outcome.buildMergedOutcomeNotificationframes what merged work does for the contributor's standing/lane signals on the repo. Public-safe (sanitizePublicComment) — never raw reward $/trust/score.notify-evaluateper detected event, so a merge flows through the existing pipeline → an idempotent outcome delivery the miner can read.gittensory_pr_outcome(self-scoped viarequireContributorAccess) lists a contributor's own merged-PR outcomes;listNotificationDeliveriesForRecipientgains aneventTypefilter. The outcomes also surface in the notification feed (gittensory_list_notifications).Distinct from #543 (which calibrates the model vs outcomes — this attributes outcomes to the contributor).
Acceptance (#702)
✅ A merged PR produces a public-safe, self-scoped outcome record the miner can retrieve (via
gittensory_pr_outcome+ the feed), computed through the same pipeline, no raw $/trust/score.Access boundary
Strictly miner-scoped: the merged-PR notification recipient is the PR author, and both
gittensory_pr_outcome+gittensory_list_notificationsenforcerequireContributorAccess(a session can only read its own login). All copy public-safe.Tests
gittensory_pr_outcome: own merged outcomes only; self-scope rejection.git diff --check+ui:openapi:checkpass.Closes #702 (sub-issue of #529).