Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,6 @@
# deepevents.ai
deepevents.ai main codebase

## Enterprise tooling slices

- [`enterprise-sla-uptime-monitor`](enterprise-sla-uptime-monitor/) — deterministic SLA, uptime, webhook reliability, and export-evidence guardrail for SCIBASE Enterprise Tooling issue #19.
46 changes: 46 additions & 0 deletions enterprise-sla-uptime-monitor/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Enterprise SLA Uptime Monitor

A self-contained Enterprise Tooling slice for SCIBASE issue #19. It converts synthetic uptime checks, incident records, webhook delivery outcomes, and export jobs into a deterministic admin review packet for institutional reliability governance.

This module is intentionally narrow: it does **not** replace the existing admin-dashboard, export, trust-center, data-residency, identity-drift, legal-hold, webhook-replay, or grant-compliance submissions. It focuses only on service-level commitments, error-budget posture, webhook reliability notices, and whether SLA evidence can be exported safely.

## What it does

- Computes per-service uptime against tenant SLA targets.
- Tracks unplanned downtime, planned maintenance, MTTR, incident counts, and error-budget remaining minutes.
- Flags `breach`, `watch`, and `within_sla` service states.
- Reviews webhook destinations with elevated failure rates or dependencies on breached services.
- Blocks evidence exports that would report on a breached service before an admin review.
- Produces a SHA-256 evidence digest over the deterministic packet for audit trails.

## Files

- `src/sla-uptime-monitor.js` — local evaluator and helper functions.
- `data/sample-sla-input.json` — synthetic tenant/service/incidents/webhook/export data.
- `scripts/demo.js` — terminal demo that prints the admin metrics and action queue.
- `test/sla-uptime-monitor.test.js` — Node test suite covering breach/watch/ready decisions and deterministic digests.
- `docs/requirement-map.md` — mapping back to issue #19 Enterprise Tooling requirements.
- `docs/demo.svg` — static dashboard-style preview.

## Run locally

```bash
npm run check
npm test
npm run demo
```

Expected demo summary:

```text
SCIBASE Enterprise SLA Uptime Monitor
Services: 3
Breaches: 1
Watch: 1
Blocked exports: 1
Queued actions: 4
```

## Safety and privacy

The module uses only synthetic data and Node built-ins. It performs no network calls, requires no account credentials, and stores no secrets. It is suitable for offline review and CI.
126 changes: 126 additions & 0 deletions enterprise-sla-uptime-monitor/data/sample-sla-input.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,126 @@
{
"generatedAt": "2026-05-16T12:00:00Z",
"windowMinutes": 43200,
"tenants": [
{
"id": "northbridge-university",
"name": "Northbridge University Research Office",
"contractTier": "enterprise",
"defaultSlaTarget": 0.995
},
{
"id": "helios-rd",
"name": "Helios R&D Lab",
"contractTier": "enterprise-plus",
"defaultSlaTarget": 0.999
}
],
"services": [
{
"id": "api-core",
"name": "SCIBASE API Core",
"tenantId": "northbridge-university",
"slaTarget": 0.995,
"observedChecks": 8640,
"failedChecks": 31,
"plannedMaintenanceMinutes": 20,
"unplannedDowntimeMinutes": 265,
"owner": "platform-ops"
},
{
"id": "webhook-dispatcher",
"name": "Webhook Dispatcher",
"tenantId": "northbridge-university",
"slaTarget": 0.995,
"observedChecks": 8640,
"failedChecks": 12,
"plannedMaintenanceMinutes": 30,
"unplannedDowntimeMinutes": 180,
"owner": "integrations"
},
{
"id": "export-pipeline",
"name": "Enterprise Export Pipeline",
"tenantId": "helios-rd",
"slaTarget": 0.999,
"observedChecks": 8640,
"failedChecks": 7,
"plannedMaintenanceMinutes": 15,
"unplannedDowntimeMinutes": 23,
"owner": "data-platform"
}
],
"incidents": [
{
"id": "INC-1042",
"serviceId": "api-core",
"tenantId": "northbridge-university",
"severity": "sev2",
"startedAt": "2026-05-08T11:10:00Z",
"resolvedAt": "2026-05-08T13:55:00Z",
"customerVisible": true,
"rootCause": "database connection pool exhaustion",
"followUp": "increase pool alert lead time"
},
{
"id": "INC-1047",
"serviceId": "webhook-dispatcher",
"tenantId": "northbridge-university",
"severity": "sev3",
"startedAt": "2026-05-12T09:00:00Z",
"resolvedAt": "2026-05-12T10:26:00Z",
"customerVisible": true,
"rootCause": "downstream retry queue backpressure",
"followUp": "add tenant-specific delivery throttle"
},
{
"id": "INC-1051",
"serviceId": "export-pipeline",
"tenantId": "helios-rd",
"severity": "sev4",
"startedAt": "2026-05-13T20:00:00Z",
"resolvedAt": "2026-05-13T20:23:00Z",
"customerVisible": false,
"rootCause": "scheduled worker recycle",
"followUp": "none"
}
],
"webhookDeliveries": [
{
"destinationId": "dspace-sync",
"tenantId": "northbridge-university",
"serviceId": "webhook-dispatcher",
"attempts": 1250,
"failures": 38,
"lastFailureAt": "2026-05-15T18:42:00Z",
"requiresNotice": true
},
{
"destinationId": "orcid-sync",
"tenantId": "helios-rd",
"serviceId": "export-pipeline",
"attempts": 2200,
"failures": 3,
"lastFailureAt": "2026-05-10T07:15:00Z",
"requiresNotice": false
}
],
"exportJobs": [
{
"id": "EXP-991",
"tenantId": "northbridge-university",
"serviceId": "api-core",
"target": "institutional-admin-dashboard",
"containsSlaEvidence": true,
"requestedBy": "research-office-admin"
},
{
"id": "EXP-992",
"tenantId": "helios-rd",
"serviceId": "export-pipeline",
"target": "funder-quarterly-pack",
"containsSlaEvidence": true,
"requestedBy": "compliance-ops"
}
]
}
30 changes: 30 additions & 0 deletions enterprise-sla-uptime-monitor/docs/demo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
19 changes: 19 additions & 0 deletions enterprise-sla-uptime-monitor/docs/requirement-map.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Requirement map — Enterprise SLA uptime monitor

This module targets issue #19, **Enterprise Tooling**, with a distinct service-level reliability slice that is not another admin dashboard, export package, trust center, data-residency guard, webhook replay ledger, identity drift checker, or grant compliance packet.

| Issue #19 capability | Module coverage |
| --- | --- |
| Admin dashboards | Emits tenant-level service health, breach counts, MTTR, error-budget remaining minutes, and queueable admin actions. |
| API & webhooks | Evaluates webhook delivery failure rates, notice requirements, and destination-specific reliability actions. |
| Export pipelines | Marks SLA evidence exports ready or blocked based on service reliability posture and attached evidence. |
| Compliance tracking | Produces auditable SLA summaries, SHA-256 evidence digests, incident follow-ups, and customer-notice recommendations. |
| Institutional use case | Gives research offices a deterministic readout for uptime obligations before reporting to funders or internal governance. |

## Non-overlap

Live gate search found existing #19 submissions for broad tooling, export operations, trust centers, audit routers, webhook replay, identity drift, data residency, retention/legal hold, and grant compliance. This slice is limited to SLA/uptime/error-budget governance and does not claim to manage those adjacent workflows.

## Local-first guardrail

All data is synthetic. The demo runs offline, performs no network calls, stores no credentials, and does not publish or send notifications.
13 changes: 13 additions & 0 deletions enterprise-sla-uptime-monitor/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"name": "enterprise-sla-uptime-monitor",
"version": "1.0.0",
"description": "Self-contained enterprise SLA and uptime monitoring slice for SCIBASE Enterprise Tooling.",
"type": "module",
"private": true,
"scripts": {
"check": "node --check src/sla-uptime-monitor.js && node --check scripts/demo.js && node --check test/sla-uptime-monitor.test.js",
"test": "node --test test/sla-uptime-monitor.test.js",
"demo": "node scripts/demo.js"
},
"license": "MIT"
}
23 changes: 23 additions & 0 deletions enterprise-sla-uptime-monitor/scripts/demo.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import { readFile } from 'node:fs/promises';
import { fileURLToPath } from 'node:url';
import { dirname, join } from 'node:path';

import { evaluateSlaPortfolio } from '../src/sla-uptime-monitor.js';

const here = dirname(fileURLToPath(import.meta.url));
const samplePath = join(here, '..', 'data', 'sample-sla-input.json');
const input = JSON.parse(await readFile(samplePath, 'utf8'));
const report = evaluateSlaPortfolio(input);

console.log('SCIBASE Enterprise SLA Uptime Monitor');
console.log(`Window: ${report.windowMinutes} minutes`);
console.log(`Services: ${report.adminMetrics.serviceCount}`);
console.log(`Breaches: ${report.adminMetrics.breachedServices}`);
console.log(`Watch: ${report.adminMetrics.watchServices}`);
console.log(`Blocked exports: ${report.adminMetrics.exportsBlocked}`);
console.log(`Queued actions: ${report.adminMetrics.queuedActions}`);
console.log(`Evidence digest: ${report.evidenceDigest}`);
console.log('\nAction queue:');
for (const action of report.actionQueue) {
console.log(`- [${action.priority}] ${action.type}: ${action.summary}`);
}
Loading