Skip to content

test(notifications): maintainer recap end-to-end orchestration - #4457

Merged
JSONbored merged 1 commit into
JSONbored:mainfrom
claytonlin1110:test/maintainer-recap-e2e-2252
Jul 9, 2026
Merged

test(notifications): maintainer recap end-to-end orchestration#4457
JSONbored merged 1 commit into
JSONbored:mainfrom
claytonlin1110:test/maintainer-recap-e2e-2252

Conversation

@claytonlin1110

Copy link
Copy Markdown
Contributor

Summary

  • Add runMaintainerRecap — build (or accept an injected report) → formatMaintainerRecap → fan out to Discord + Slack independently, with a flag-OFF short-circuit when enabled === false.
  • Add deliverRecapToSlack(env, report, formattedBody) for the maintainer RecapReport (feat(notifications): Slack delivery for the maintainer recap digest (reuse notify-discord Slack path) #2246) and thread the formatted/redacted body through both channel deliverers.
  • Refactor runMaintainerRecapJob to delegate to runMaintainerRecap after loading aggregator inputs.
  • Integration-style unit tests in test/unit/maintainer-recap.test.ts: both channels called, single-channel outage isolation, redaction across both payloads, and the disabled flag arm.

Closes #2252

Scope

  • The PR title follows type(scope): short summary Conventional Commit format, for example fix(api): restore profile access checks.
  • This PR is focused and does not mix unrelated backend, UI, MCP, docs, dependency, and deploy changes.
  • This follows CONTRIBUTING.md and does not reintroduce GitHub Pages, VitePress, site/, or CNAME.
  • I linked a currently open issue this PR resolves (e.g. Closes #123) — a linked open issue is required for every contributor PR.

Validation

  • git diff --check
  • npm run actionlint
  • npm run typecheck (changed files only — pre-existing aws4fetch module resolution on this machine affects unrelated s3-blob-store.ts)
  • npm run test:coverage locally; codecov/patch requires ≥99% coverage of the lines AND branches you changed (aim for 100% on your diff so CI variance does not fail near the threshold). Global coverage is a non-blocking trend with a loose 90% backstop, not the gate.
  • 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
  • New or changed behavior has unit/integration tests for new branches, fallback paths, and sanitizer boundaries

If any required check was skipped, explain why:

  • Full npm run test:ci not re-run end-to-end locally — scoped to the recap orchestration surface. Locally: git diff --check clean; focused coverage on changed src/** files is 100% statements/branches/functions/lines (204/204 stmts, 121/121 branches); npx vitest run test/unit/maintainer-recap.test.ts test/unit/maintainer-recap-wire.test.ts test/unit/notify-discord.test.ts — 61 tests green; npm audit --audit-level=moderate — 0 vulnerabilities. CI covers the remaining path-filtered jobs.

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.
  • API/OpenAPI/MCP behavior is updated and tested where needed.
  • UI changes use live API data or real empty/error/loading states, not production mock/demo fallbacks.
  • Visible UI changes include a UI Evidence section below with JPG/JPEG or PNG screenshots arranged as organized, captioned, clickable thumbnails. SVG screenshots are not used as review evidence. Review-only screenshots or recordings are not committed to the repository.
  • Public docs/changelogs are updated where needed; changelogs are only edited for release-prep PRs.

UI Evidence

N/A — backend orchestration + unit tests only; no visible UI surface.

Notes

@claytonlin1110
claytonlin1110 requested a review from JSONbored as a code owner July 9, 2026 19:32
@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 (8da67d5).
⚠️ Report is 6 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4457   +/-   ##
=======================================
  Coverage   94.01%   94.01%           
=======================================
  Files         418      418           
  Lines       37417    37440   +23     
  Branches    13677    13685    +8     
=======================================
+ Hits        35178    35201   +23     
  Misses       1583     1583           
  Partials      656      656           
Files with missing lines Coverage Δ
src/review/maintainer-recap-wire.ts 100.00% <100.00%> (ø)
src/services/maintainer-recap.ts 100.00% <100.00%> (ø)
src/services/notify-discord.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:03:21 UTC

6 files · 1 AI reviewer · no blockers · readiness 100/100 · CI green · clean

⏸️ Suggested Action - Manual Review

  • Touches a guarded path — held for manual review: This PR changes guardrail-protected path(s): src/services/maintainer-recap.ts (matched src/services/**), src/services/notify-discord.ts (matched src/services/**).

Review summary
This PR wires build→format→dual-channel delivery into a single `runMaintainerRecap` orchestrator, adds a genuine `deliverRecapToSlack` sibling to the existing Discord deliverer, and threads the redacted `formatMaintainerRecap` body through both channels instead of raw summary lines. The new tests exercise real paths — both-channels success, single-channel-outage isolation in each direction, the flag-OFF short circuit, and redaction via a hand-built report that deliberately bypasses the builder's own sanitization — rather than fabricating unreachable states. The `runMaintainerRecapJob` refactor to delegate to the new orchestrator is a clean, behavior-preserving delegation, and its return-shape change is consistently reflected in every call site shown in the diff.

Nits — 6 non-blocking
  • packages/gittensory-engine/src/focus-manifest.ts's FocusManifestMaintainerRecapConfig.channel is still typed 'discord'-only with a doc comment saying Slack delivery is 'a follow-up', which is now stale since this PR ships unconditional Slack delivery whenever SLACK_WEBHOOK_URL is set — worth a follow-up doc/type update so the comment matches actual behavior.
  • src/services/notify-discord.ts: the 1800/2900-char payload caps are unexplained magic numbers duplicated across deliverRecapToDiscord and deliverRecapToSlack; consider naming constants (e.g. DISCORD_DESCRIPTION_MAX, SLACK_BLOCK_TEXT_MAX).
  • test/unit/maintainer-recap-wire.test.ts's new `ranRecap` narrowing helper is a nice pattern, but several assertions only check `delivery.slack.sent === false` without asserting the `reason` value — minor readability nit, not a real coverage gap since deliverRecapToSlack's own denial arms are covered directly in notify-discord.test.ts.
  • Gate Slack delivery in runMaintainerRecap behind a channel config option once FocusManifestMaintainerRecapConfig supports 'slack'/'both', so an operator with SLACK_WEBHOOK_URL set for unrelated notifications doesn't unexpectedly start receiving the maintainer recap there too.
  • Extract the repeated 1800/2900 slice-length literals in notify-discord.ts into shared named constants.
  • Touches a guarded path — held for manual review — A maintainer must review and merge this change.
Signal Result Evidence
Code review ✅ No blockers 1 reviewer
Linked issue ✅ Linked #2252
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 (1 linked issue).
Validation posture ✅ 25/25 PR body includes validation/test evidence.
Contributor workload ✅ 10/10 Author activity: 450 registered-repo PR(s), 312 merged, 104 issue(s).
Contributor context ✅ Confirmed Gittensor contributor claytonlin1110; Gittensor profile; 450 PR(s), 104 issue(s).
Gate result ⚠️ Not blocking Advisory; not blocking this PR.
Linked issue satisfaction

Addressed
The PR adds test/unit/maintainer-recap.test.ts with runMaintainerRecap tests covering both channels delivering, Discord failure not blocking Slack (and vice versa), redaction verified across both payloads via a leaky report, and an explicit flag-OFF short-circuit test, matching all three deliverables in the issue.

Review context
  • Author: claytonlin1110
  • 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: 450 PR(s), 104 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

@JSONbored
JSONbored merged commit a26924a into JSONbored:main Jul 9, 2026
9 checks passed
@loopover-orb loopover-orb Bot added gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. and removed 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
JSONbored pushed a commit that referenced this pull request Jul 9, 2026
…ip shape

Resolves the merge conflict with the #4457 e2e-test refactor (which
introduced the dual-channel runMaintainerRecap/RunMaintainerRecapResult
shape): ranRecap now accepts the union of that result type and the
job-level MaintainerRecapJobSkipped ("already_sent_this_period") case.
@JSONbored JSONbored 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. and removed gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. labels Jul 9, 2026
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. manual-review Gittensor contributor context

Development

Successfully merging this pull request may close these issues.

test(notifications): end-to-end recap orchestration test (build → format → both channels)

2 participants