Repository navigation
feat: support SLA alerting, referral fraud review, treasury sweep preview, risk metadata staleness paging - #632
Merged
Abidoyesimze merged 1 commit intoOct 20, 2026
Conversation
…ep preview, risk metadata staleness paging - support tickets: firstResponseAt, SLA breach/stale job, metrics and alert rules, 409 on invalid transitions (Neurowealth#618) - referral fraud: admin review queue, bulk approve/reject with audit log, calibration report, config-driven thresholds (Neurowealth#619) - treasury: sweep preview endpoint, typed SWEEP confirmation to enable policies, failure alerts (Neurowealth#620) - risk metadata: admin upsert with audit, staleness paging via alerting service, riskMetadataStale in API (Neurowealth#621)
|
@dslegacy Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
3 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #618
Closes #619
Closes #620
Closes #621
Summary
firstResponseAtset on the first public admin reply; breach judged against it. Invalid status transitions return 409. A scheduled job flags SLA breaches and tickets untouched forSUPPORT_STALE_HOURS, publishessupport_tickets_sla_breached{priority}/support_tickets_stale, and alerts via the alerting service. Prometheus rules added.docs/SUPPORT_TICKETS.mdupdated./api/v1/admin/referrals/fraud: paginatedqueue(score band, flag, date filters),bulk-review(per-itemAdminAuditLogrow),calibration.scripts/referral-calibration.tsproduces the monthly report. Fraud thresholds and weights are now env-driven; defaults match the old hard-coded values. Documented indocs/REFERRAL_PROGRAM.md.POST /treasury/sweep/previewis read-only (tests assert no sweep, envelope or outbox writes).POST /treasury/policies/:id/enablerequires the exact textSWEEP. Failed sweeps raise a critical alert. Runbook indocs/TREASURY.md.risk-metadata:*scopes now enforced). Staleness job pages throughalertingServiceand is now scheduled./api/protocols/riskreturnsriskMetadataStale, a penalisedscoreandrawScore; the rebalancing router uses the penalised score. Documented indocs/PROTOCOL_RISK_SCORING.md.Behaviour changes to note
sweepsEnabled = false, including existing ones after migration20261020090000_ticket_sla_treasury_enable. Each must be previewed and enabled before the cadence job sweeps.dedup_keyinalerting.tswas DLQ-specific; it now uses the alert's owndedupKeywhen provided.rollback.sql.Testing
tsc --noEmit,eslint,prettier --checkpass; OpenAPI drift check passes;docs/API_KEYS.mdregenerated.fraudDetection,admin-route-boundaries,refresh-token.servicefail onmainas well (confirmed by stash comparison);referral/service,config/secretsand somemigrationProcesstests also fail and were assumed pre-existing, not compared.