feat: implement algorithmic risk assessment engine with ML scoring and real-time monitoring#93
Merged
gabito1451 merged 4 commits intoGalactiGuild:mainfrom Feb 25, 2026
Merged
Conversation
…d real-time monitoring
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.
Summary
Boosting + Random Forest) to predict project success probability and generate
a 0–100 risk score across six domains: Funding, Team, Technical, Community,
Market, and Legal
risk factor with human-readable descriptions and actionable investor recommendations
and a privacy-preserving mode that anonymizes individual contribution data
scored snapshots, trend analysis, and typed alerts (whale concentration,
sentiment drops, score changes, etc.)
Changes
Core Engine (
src/lib/risk-engine/)types.ts— Full type system: feature vectors, risk scores, alerts, monitoringsessions, pipeline config
features.ts— 22-dimensional feature extraction with log-normalisation,sigmoid scaling, and Herfindahl concentration index
model.ts— Pre-calibrated ensemble with 6-tree GBDT, 5-tree Random Forest,and logistic regression; computes 95% confidence intervals from model disagreement
explainability.ts— SHAP marginal attribution, top risk factors, top strengths,explanation summary, and investor insight generation
data-pipeline.ts— Parallel on-chain/off-chain fetching, retry-with-backoff,500-entry LRU cache with per-project invalidation
monitor.ts— SSE-based polling engine with alert threshold detection, trenddirection analysis, and pub/sub callbacks
index.ts—RiskEngineclass withassess(),assessFromRawData(), andassessBatch()methodsAPI Routes (
src/app/api/risk/)assess/route.ts—GET+POSTrisk assessment with optional privacy modemonitor/route.ts— SSE stream for live updates +POSTstart/stop controlhistory/[projectId]/route.ts— Paginated snapshot historyUI Components (
src/components/risk/)RiskScoreCard— Circular overall score, success probability, confidence badge,and animated sub-domain progress bars
RiskFactorChart— SHAP factor bars with current vs. benchmark comparison;hover reveals recommendations
RealTimeMonitor— SSE-connected live feed with sparkline chart, trend arrow,and categorised alert feed
RiskDashboard— Full composable dashboard with loading skeleton, error/retrystate, and refresh control
closes Algorithmic Risk Assessment Engine #76