http://localhost:3000/api/feed-health
GET /providersResponse:
{
"success": true,
"count": 5,
"providers": [
{
"providerId": "HIBP",
"type": "credential_breach",
"healthScore": 92,
"status": "HEALTHY",
"metrics": {
"latency": { "avg": 150, "p95": 200, "p99": 300 },
"availability": { "uptime": 99.5 },
"errors": { "rate": 0.5 },
"accuracy": 98.5,
"freshness": 3600
}
}
]
}GET /providers/{providerId}POST /providers/{providerId}/record-request
Content-Type: application/json
{
"latency": 150,
"success": true,
"timeout": false
}GET /providers/rank/by-healthResponse:
{
"success": true,
"ranking": [
{ "rank": 1, "providerId": "HIBP", "healthScore": 95, "status": "HEALTHY" },
{ "rank": 2, "providerId": "INTERNAL", "healthScore": 88, "status": "HEALTHY" }
]
}GET /feedsGET /feeds/{feedId}Example Response:
{
"success": true,
"feedId": "credential-breach-feed",
"overallHealth": 92,
"healthStatus": "EXCELLENT",
"quality": {
"completeness": 98,
"consistency": 95,
"reliability": 92,
"timeliness": 100,
"validity": 99
},
"consensus": {
"agreementRate": 95,
"conflictCount": 12,
"lastConflict": "2024-01-15T10:30:00Z"
},
"safeMode": {
"enabled": false,
"reason": null,
"fallbackProvider": null
},
"alerts": 0
}POST /feeds/{feedId}/check-qualityResponse:
{
"success": true,
"feedId": "credential-breach-feed",
"quality": {
"completeness": 98,
"consistency": 95,
"reliability": 92,
"timeliness": 100,
"validity": 99
},
"overallHealth": 96,
"healthStatus": "EXCELLENT",
"safeModeStatus": false,
"alerts": 0
}POST /feeds/{feedId}/detect-drift
Content-Type: application/json
{
"currentDataPoints": 10500
}Response:
{
"success": true,
"driftDetected": false,
"driftPercentage": "8.5",
"currentDataPoints": 10500,
"baseline": 9650,
"threshold": 20
}POST /feeds/{feedId}/calibrate-confidence
Content-Type: application/json
{
"validationData": [
{ "correct": true },
{ "correct": true },
{ "correct": false },
{ "correct": true }
]
}Response:
{
"success": true,
"baselineAccuracy": "75.00",
"calibrationFactor": "0.83",
"sampleSize": 4
}GET /feeds/{feedId}/consensus-statsPOST /consensus/resolve
Content-Type: application/json
{
"feedId": "credential-breach-feed",
"providerResults": [
{
"providerId": "HIBP",
"result": { "breached": true, "count": 150 }
},
{
"providerId": "EXTERNAL_FEED",
"result": { "breached": true, "count": 148 }
},
{
"providerId": "INTERNAL",
"result": { "breached": false }
}
]
}Response:
{
"consensus": true,
"resolvedValue": { "breached": true, "count": 149 },
"strategy": "WEIGHTED_VOTE",
"confidence": 0.68,
"providers": [
{
"providerId": "HIBP",
"result": { "breached": true, "count": 150 },
"weight": 0.35,
"contribution": 0.35
}
],
"conflictResolved": true,
"alternatives": [false]
}POST /consensus/batch-resolve
Content-Type: application/json
{
"feedId": "credential-breach-feed",
"providerResultsBatch": [
[
{ "providerId": "HIBP", "result": "value1" },
{ "providerId": "EXTERNAL", "result": "value1" }
],
[
{ "providerId": "HIBP", "result": "value2" },
{ "providerId": "INTERNAL", "result": "value3" }
]
]
}GET /routing/{feedId}Response:
{
"success": true,
"feedId": "credential-breach-feed",
"safeModeEnabled": false,
"fallbackProvider": null,
"providers": [
{
"providerId": "HIBP",
"healthScore": 95,
"status": "HEALTHY",
"circuitState": "CLOSED"
},
{
"providerId": "EXTERNAL_FEED",
"healthScore": 88,
"status": "HEALTHY",
"circuitState": "CLOSED"
}
]
}POST /routing/{feedId}/request
Content-Type: application/json
{
"primaryProviders": ["HIBP", "EXTERNAL_FEED", "INTERNAL"],
"requestPayload": {
"query": "user@example.com"
}
}Response (Success):
{
"success": true,
"data": { "breached": true, "count": 150 },
"providerId": "HIBP",
"routingStrategy": "PRIMARY_CHAIN",
"fromSafeMode": false
}Response (Fallback):
{
"success": true,
"data": { "breached": true },
"providerId": "INTERNAL",
"safeMode": "CONSERVATIVE",
"confidenceThreshold": 0.85,
"fromSafeMode": true
}POST /routing/{feedId}/failover
Content-Type: application/json
{
"toProviderId": "INTERNAL"
}POST /feeds/{feedId}/safe-mode/activate
Content-Type: application/json
{
"reason": "Manual activation due to high error rate",
"fallbackProvider": "INTERNAL",
"mode": "CONSERVATIVE"
}Modes: CONSERVATIVE | PASSTHROUGH | MANUAL_REVIEW
POST /feeds/{feedId}/safe-mode/deactivateGET /critical-feedsResponse:
{
"success": true,
"count": 2,
"feeds": [
{
"feedId": "suspected-breach-feed",
"overallHealth": 35,
"healthStatus": "CRITICAL",
"safeMode": true,
"alerts": 5
}
]
}GET /safe-mode-feedsResponse:
{
"success": true,
"count": 1,
"feeds": [
{
"feedId": "credential-breach-feed",
"reason": "Feed health degraded to 45%",
"fallbackProvider": "INTERNAL",
"mode": "CONSERVATIVE",
"activatedAt": "2024-01-15T10:30:00Z"
}
]
}GET /drift-detected-feedsResponse:
{
"success": true,
"count": 1,
"feeds": [
{
"feedId": "phishing-feed",
"driftPercentage": 25.5,
"threshold": 20,
"lastDetected": "2024-01-15T11:00:00Z",
"safeMode": true
}
]
}| Code | Status | Description |
|---|---|---|
| 200 | OK | Successful request |
| 201 | Created | Resource created |
| 400 | Bad Request | Invalid parameters |
| 404 | Not Found | Feed or provider not found |
| 500 | Internal Server Error | Server error |
Error Response:
{
"success": false,
"error": "Feed not found"
}- Receive conflicting results from multiple providers
- Call Consensus Resolve API
POST /consensus/resolve
- Get resolved value with confidence score
- Use resolved value for decision making
- Periodically run quality check
POST /feeds/{feedId}/check-quality - Review quality scores (5 metrics)
- If quality drops, system auto-activates safe mode
- Monitor overallHealth score
- Take manual action if needed
- Feed receives new data points
- Trigger drift detection
POST /feeds/{feedId}/detect-drift { "currentDataPoints": 10500 } - If drift detected >threshold:
- Review recent changes
- Investigate data source
- Potentially activate safe mode
- Calibrate confidence after verification
POST /feeds/{feedId}/calibrate-confidence { "validationData": [...] }
- Provider health drops below threshold
- Circuit breaker opens after 5 failures
- Request routing switches to fallback
- Safe mode may activate if widespread issue
- Monitor circuit state for recovery
- Manual failover option available
// Using the dashboard
const dashboard = feedHealthDashboard;
// Refresh dashboard
await dashboard.refresh();
// Activate safe mode for feed
await dashboard.activateSafeMode('credential-feed');
// Deactivate safe mode
await dashboard.deactivateSafeMode('credential-feed');
// View feed details
dashboard.viewFeedDetails('credential-feed');
// Investigate drift
dashboard.investigateDrift('phishing-feed');- Batch Operations: Use batch-resolve for multiple conflicts
- Caching: Cache provider rankings between requests
- Monitoring Intervals: Adjust refresh intervals based on feed volatility
- Historical Data: Keep last 100 entries for space efficiency
- Circuit Breaker: Automatic protection from cascading failures
curl -s http://localhost:3000/api/feed-health/feeds/credential-feed | jq .curl -s http://localhost:3000/api/feed-health/providers/rank/by-health | jq .curl -s http://localhost:3000/api/feed-health/critical-feeds | jq .curl -s http://localhost:3000/api/feed-health/safe-mode-feeds | jq .- ISSUE_895_IMPLEMENTATION_SUMMARY.md - Full technical documentation
- feed-health-dashboard.js - Dashboard source code
- services/feedQualityControlService.js - Quality monitoring
- services/weightedConsensusEngine.js - Conflict resolution
- services/safeModeRoutingService.js - Failover logic
- models/ProviderSLA.js - Provider tracking
- models/FeedHealthScore.js - Feed metrics