Skip to content

feat(notifications): idempotent per-period recap claim + generation audit trail - #4459

Closed
oktofeesh1 wants to merge 1 commit into
JSONbored:mainfrom
oktofeesh1:feat-maintainer-recap-claim-audit-2249-2251
Closed

feat(notifications): idempotent per-period recap claim + generation audit trail#4459
oktofeesh1 wants to merge 1 commit into
JSONbored:mainfrom
oktofeesh1:feat-maintainer-recap-claim-audit-2249-2251

Conversation

@oktofeesh1

Copy link
Copy Markdown
Contributor

Summary

Scope

  • The PR title follows type(scope): short summary Conventional Commit format.
  • This PR bundles two small, closely-related deliverables (both non-conflicting edits inside the same runMaintainerRecapJob orchestrator, both "Part of Maintainer review recap digest (Discord / Slack) #1963") rather than splitting into two PRs that would each touch the exact same lines.
  • This follows CONTRIBUTING.md and does not reintroduce GitHub Pages, VitePress, site/, or CNAME.
  • I linked currently open issues this PR resolves — Closes #2249, Closes #2251.

Validation

  • git diff --check
  • npm run actionlint
  • npm run db:migrations:check — contiguous, next free 0130
  • npm run db:schema-drift:checkglobal_agent_controls stays raw-SQL-only (allowlisted), no Drizzle drift
  • npm run typecheck
  • npm run test:coverage locally — 100% branch coverage on every changed line, verified directly against lcov.info for every touched file (src/db/repositories.ts, src/review/maintainer-recap-wire.ts, src/queue/processors.ts)
  • npm run test:workers
  • npm run build:mcp
  • npm run test:mcp-pack
  • npm run ui:openapi:check
  • npm run ui:lint
  • npm run ui:typecheck
  • npm run ui:build
  • npm audit --audit-level=moderate — 0 vulnerabilities
  • Full npm run test:ci green (652 test files / 12,769 tests)
  • New or changed behavior has unit/integration tests for new branches, fallback paths, and sanitizer boundaries — see below.

Test coverage added:

Safety

  • No secrets, wallet details, hotkeys, coldkeys, user PATs, private keys, raw trust scores, private rankings, or private maintainer evidence are exposed.
  • Public GitHub text stays sanitized, low-noise, and does not imply compensation guarantees or optimization tactics.
  • Auth, cookie, CORS, GitHub App, Cloudflare, or session changes include negative-path tests. (N/A — no auth/CORS/session surface touched.)
  • API/OpenAPI/MCP behavior is updated and tested where needed. (N/A — no API/OpenAPI/MCP surface changed; internal job orchestration + a D1 column only.)
  • UI changes use live API data or real empty/error/loading states, not production mock/demo fallbacks. (N/A — no UI changes.)
  • Visible UI changes include a UI Evidence section. (N/A — no visible UI changes; backend-only.)
  • Public docs/changelogs are updated where needed; changelogs are only edited for release-prep PRs. (No changelog edit.)

UI Evidence

N/A — backend-only change (D1 migration + queue orchestrator), no UI surface touched.

Notes

  • The claim key is the UTC calendar date alone (not cadence-specific): daily fires at most once per date, and weekly fires on only ONE designated date per week, so date-only keying is correct for both cadences without needing to encode which cadence produced the tick.

…udit trail

Adds a per-UTC-date claim (migration 0129, mirroring
claimRegateFanoutSlot's atomic conditional-UPDATE pattern) so a
retried cron tick or redelivered queue message never re-scans repos
or re-sends the maintainer recap digest for a period already sent.
Also records a maintainer_recap_generated audit event once the
report is built, giving operators a ledger trail independent of the
per-channel delivery-outcome event.
@oktofeesh1
oktofeesh1 requested a review from JSONbored as a code owner July 9, 2026 19:46
@superagent-security

Copy link
Copy Markdown
Contributor

Superagent didn't find any vulnerabilities or security issues in this PR.

@codecov

codecov Bot commented Jul 9, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.01%. Comparing base (861e8b7) to head (671106e).
⚠️ Report is 7 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4459   +/-   ##
=======================================
  Coverage   94.01%   94.01%           
=======================================
  Files         418      418           
  Lines       37417    37427   +10     
  Branches    13677    13678    +1     
=======================================
+ Hits        35178    35188   +10     
  Misses       1583     1583           
  Partials      656      656           
Files with missing lines Coverage Δ
src/db/repositories.ts 96.72% <100.00%> (+<0.01%) ⬆️
src/queue/processors.ts 95.39% <100.00%> (ø)
src/review/maintainer-recap-wire.ts 100.00% <100.00%> (ø)
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@loopover-orb loopover-orb Bot added gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier. gittensor:priority Maintainer-selected Gittensor priority — scores a 1.5x multiplier. labels Jul 9, 2026
@loopover-orb

loopover-orb Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Warning

🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨

⏸️ Gittensory review result - manual review recommended

Review updated: 2026-07-09 20:04:13 UTC

6 files · no blockers · readiness 100/100 · CI green · dirty

⏸️ Suggested Action - Manual Review

  • AI review already in progress for this PR head: Another Gittensory pass is already running the AI review for this exact PR head. This pass is skipping to avoid a duplicate LLM call.

Review summary
AI review is already running for this PR head in another Gittensory pass. Gittensory is holding this PR for manual review until that pass completes.

Nits — 1 non-blocking
  • AI review already in progress for this PR head — The gate is held for a human reviewer rather than passed automatically; it re-evaluates once the in-flight review completes or on the next update.
Signal Result Evidence
Code review ✅ No blockers No AI review summary
Linked issue ✅ Linked #2249, #2251
Related work ✅ No active overlap found No same-issue or scoped active PR overlap found.
Change scope ✅ 20/20 Low review scope from cached public metadata (2 linked issues).
Validation posture ✅ 25/25 PR body includes validation/test evidence.
Contributor workload ✅ 10/10 Author activity: 30 registered-repo PR(s), 24 merged, 0 issue(s).
Contributor context ✅ Confirmed Gittensor contributor oktofeesh1; Gittensor profile; 30 PR(s), 0 issue(s).
Gate result ⚠️ Not blocking Advisory; not blocking this PR.
Linked issue satisfaction

Partially addressed
The diff adds a real per-period idempotency mechanism (claimMaintainerRecapPeriod atomic UPDATE + migration + tests for same-period no-op and different-period re-send), satisfying the digest's dedup goal, but it uses a singleton-column claim mirroring claimRegateFanoutSlot rather than the notification_deliveries ON CONFLICT DO NOTHING throttle-claim idiom the issue explicitly points to, and the di

Review context
  • Author: oktofeesh1
  • Role context: outside_contributor
  • Public audience mode: oss maintainer
  • Lane context: Repository is configured for direct PR review.
  • Public profile languages: not available
  • Official Gittensor activity: 30 PR(s), 0 issue(s).
  • PR-specific overlap: none found.
Contributor next steps
  • Keep the PR focused and include validation evidence before maintainer review.
Signal definitions
  • Related work = same linked issue, overlapping active PRs, or title/path similarity.
  • Change scope = cached public metadata such as size labels, draft state, and review-burden hints.
  • Validation posture = whether the PR provides enough public validation/test evidence for maintainer review.
  • Contributor workload = public contributor activity and cleanup pressure, not a repo-wide quality failure.
  • Contributor context = public GitHub/Gittensor identity context; non-Gittensor status is not a blocker.

🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed


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

  • Re-run Gittensory review

@loopover-orb

loopover-orb Bot commented Jul 9, 2026

Copy link
Copy Markdown
Contributor

Gittensory is closing this pull request on the maintainer's behalf (conflicts with the base branch — resolve and open a fresh PR). This is an automated maintenance action — to pursue this change, please open a new pull request with the issues resolved. Closed PRs may be analyzed later to improve review accuracy, but they are not automatically reopened or re-reviewed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:feature Gittensor-scored feature linked to a feature issue — scores a 0.25x multiplier. gittensor:priority Maintainer-selected Gittensor priority — scores a 1.5x multiplier.

Projects

None yet

1 participant