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

- `enterprise-dashboard-attribution-anomaly-monitor/` adds a self-contained #19 slice for admin dashboard attribution quality, service-account separation, visibility-boundary checks, and collaboration-inflation review.
33 changes: 33 additions & 0 deletions enterprise-dashboard-attribution-anomaly-monitor/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# Enterprise Dashboard Attribution Anomaly Monitor

This module is a focused Enterprise Tooling slice for SCIBASE issue #19. It protects organization-wide admin dashboards from distorted productivity, collaboration, and ROI metrics before institutional leaders use those metrics for compliance or funding decisions.

## What It Adds

- Canonical researcher attribution across linked identities such as ORCID and GitHub accounts.
- Service-account activity separation so automation does not inflate researcher productivity.
- Private-project visibility boundary checks for institution-level admins.
- Usage-spike, duplicate-identity, service-credit, private-boundary, and cross-lab collaboration-inflation anomaly detection.
- Researcher and lab credit summaries for executive dashboards.
- Reviewer packets, JSON output, and SVG preview for admin review.

## Why This Is Distinct

Existing #19 submissions cover exports, webhooks, compliance evidence, identity provisioning, retention, data residency, SLA, lab inventory, secret rotation, quotas, API changes, connector certification, incident response, funder reporting, and AI model governance. This slice focuses specifically on admin dashboard attribution quality and metric integrity.

## Run

```bash
node enterprise-dashboard-attribution-anomaly-monitor/test.js
node enterprise-dashboard-attribution-anomaly-monitor/demo.js
```

The demo writes:

- `enterprise-dashboard-attribution-anomaly-monitor/dashboard-attribution-report.json`
- `enterprise-dashboard-attribution-anomaly-monitor/reviewer-packet.md`
- `enterprise-dashboard-attribution-anomaly-monitor/demo.svg`

## Decision Policy

High-severity attribution anomalies hold the executive dashboard until resolved. Medium anomalies remain visible only with dashboard annotations and owner confirmation requests.
Original file line number Diff line number Diff line change
@@ -0,0 +1,290 @@
{
"generatedAt": "2026-05-20T11:02:55.616Z",
"credits": [
{
"eventId": "evt:001",
"projectId": "project:neuro-alpha",
"actorId": "user:amy-orcid",
"canonicalResearcherId": "researcher:amy-chen",
"type": "dataset_upload",
"timestamp": "2026-05-20T02:00:00Z",
"rawCredit": 16.8,
"dashboardCredit": 16.8,
"serviceAccount": false,
"duplicateAlias": true,
"privateBoundary": false,
"labId": "lab:neuro",
"collaborationPair": [
"lab:neuro",
"lab:materials"
]
},
{
"eventId": "evt:002",
"projectId": "project:neuro-alpha",
"actorId": "user:amy-github",
"canonicalResearcherId": "researcher:amy-chen",
"type": "code_commit",
"timestamp": "2026-05-20T02:15:00Z",
"rawCredit": 13.2,
"dashboardCredit": 13.2,
"serviceAccount": false,
"duplicateAlias": true,
"privateBoundary": false,
"labId": "lab:neuro",
"collaborationPair": [
"lab:neuro",
"lab:materials"
]
},
{
"eventId": "evt:003",
"projectId": "project:neuro-alpha",
"actorId": "user:sync-bot",
"canonicalResearcherId": "user:sync-bot",
"type": "ai_review_generated",
"timestamp": "2026-05-20T02:30:00Z",
"rawCredit": 30,
"dashboardCredit": 0,
"serviceAccount": true,
"duplicateAlias": false,
"privateBoundary": false,
"labId": "lab:neuro",
"collaborationPair": [
"lab:neuro",
"lab:materials"
]
},
{
"eventId": "evt:004",
"projectId": "project:materials-sensor",
"actorId": "user:sync-bot",
"canonicalResearcherId": "user:sync-bot",
"type": "repository_export",
"timestamp": "2026-05-20T02:45:00Z",
"rawCredit": 36,
"dashboardCredit": 0,
"serviceAccount": true,
"duplicateAlias": false,
"privateBoundary": false,
"labId": "lab:materials",
"collaborationPair": [
"lab:neuro",
"lab:materials"
]
},
{
"eventId": "evt:005",
"projectId": "project:materials-sensor",
"actorId": "user:ben",
"canonicalResearcherId": "user:ben",
"type": "peer_review_completed",
"timestamp": "2026-05-20T03:00:00Z",
"rawCredit": 40,
"dashboardCredit": 40,
"serviceAccount": false,
"duplicateAlias": false,
"privateBoundary": false,
"labId": "lab:materials",
"collaborationPair": [
"lab:neuro",
"lab:materials"
]
},
{
"eventId": "evt:006",
"projectId": "project:neuro-alpha",
"actorId": "user:amy-orcid",
"canonicalResearcherId": "researcher:amy-chen",
"type": "manuscript_edit",
"timestamp": "2026-05-20T03:05:00Z",
"rawCredit": 32,
"dashboardCredit": 32,
"serviceAccount": false,
"duplicateAlias": true,
"privateBoundary": false,
"labId": "lab:neuro",
"collaborationPair": [
"lab:neuro",
"lab:materials"
]
},
{
"eventId": "evt:007",
"projectId": "project:neuro-alpha",
"actorId": "user:amy-github",
"canonicalResearcherId": "researcher:amy-chen",
"type": "dataset_upload",
"timestamp": "2026-05-20T03:20:00Z",
"rawCredit": 49,
"dashboardCredit": 49,
"serviceAccount": false,
"duplicateAlias": true,
"privateBoundary": false,
"labId": "lab:neuro",
"collaborationPair": [
"lab:neuro",
"lab:materials"
]
},
{
"eventId": "evt:008",
"projectId": "project:external-secret",
"actorId": "user:external",
"canonicalResearcherId": "user:external",
"type": "repository_export",
"timestamp": "2026-05-20T03:40:00Z",
"rawCredit": 18,
"dashboardCredit": 18,
"serviceAccount": false,
"duplicateAlias": false,
"privateBoundary": true,
"labId": "lab:external",
"collaborationPair": null
}
],
"metrics": {
"researcherCredits": [
{
"researcherId": "researcher:amy-chen",
"credit": 111
},
{
"researcherId": "user:ben",
"credit": 40
},
{
"researcherId": "user:sync-bot",
"credit": 0
}
],
"labCredits": [
{
"labId": "lab:neuro",
"credit": 111
},
{
"labId": "lab:materials",
"credit": 40
}
]
},
"anomalies": [
{
"kind": "usage_spike",
"key": "researcher:amy-chen:2026-05-20",
"severity": "high",
"score": 111,
"reason": "dashboard credit 111 in one day exceeds institutional review threshold"
},
{
"kind": "service_account_credit",
"severity": "high",
"score": 36,
"reason": "service account activity must not count as researcher productivity",
"eventIds": [
"evt:004"
],
"actorId": "user:sync-bot"
},
{
"kind": "service_account_credit",
"severity": "high",
"score": 30,
"reason": "service account activity must not count as researcher productivity",
"eventIds": [
"evt:003"
],
"actorId": "user:sync-bot"
},
{
"kind": "private_project_boundary",
"severity": "high",
"score": 18,
"reason": "admin dashboard row references a project outside visibility boundary",
"eventIds": [
"evt:008"
],
"projectId": "project:external-secret"
},
{
"kind": "duplicate_identity_credit",
"canonicalResearcherId": "researcher:amy-chen",
"severity": "medium",
"score": 111,
"reason": "multiple linked identities generated dashboard credit under one researcher",
"eventIds": [
"evt:001",
"evt:002",
"evt:006",
"evt:007"
]
},
{
"kind": "collaboration_inflation",
"severity": "medium",
"score": 60,
"reason": "same cross-lab collaboration pair appears repeatedly in a short window",
"pair": [
"lab:materials",
"lab:neuro"
],
"eventIds": [
"evt:001",
"evt:002",
"evt:005",
"evt:006",
"evt:007"
]
}
],
"reviewPacket": {
"holdExecutiveDashboard": true,
"ownerActions": [
{
"kind": "usage_spike",
"severity": "high",
"action": "remove_from_executive_dashboard_until_resolved",
"reason": "dashboard credit 111 in one day exceeds institutional review threshold"
},
{
"kind": "service_account_credit",
"severity": "high",
"action": "remove_from_executive_dashboard_until_resolved",
"reason": "service account activity must not count as researcher productivity"
},
{
"kind": "service_account_credit",
"severity": "high",
"action": "remove_from_executive_dashboard_until_resolved",
"reason": "service account activity must not count as researcher productivity"
},
{
"kind": "private_project_boundary",
"severity": "high",
"action": "remove_from_executive_dashboard_until_resolved",
"reason": "admin dashboard row references a project outside visibility boundary"
},
{
"kind": "duplicate_identity_credit",
"severity": "medium",
"action": "annotate_dashboard_metric_and_request_owner_confirmation",
"reason": "multiple linked identities generated dashboard credit under one researcher"
},
{
"kind": "collaboration_inflation",
"severity": "medium",
"action": "annotate_dashboard_metric_and_request_owner_confirmation",
"reason": "same cross-lab collaboration pair appears repeatedly in a short window"
}
]
},
"stats": {
"eventCount": 8,
"creditedResearcherCount": 2,
"anomalyCount": 6,
"highSeverityCount": 4,
"serviceAccountEvents": 2,
"hiddenBoundaryEvents": 1
}
}
19 changes: 19 additions & 0 deletions enterprise-dashboard-attribution-anomaly-monitor/demo.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
"use strict";

const fs = require("node:fs");
const path = require("node:path");
const {
buildDashboardAttributionMonitor,
buildReviewerMarkdown,
renderDashboardSvg
} = require("./index");
const sampleData = require("./sample-data");

const report = buildDashboardAttributionMonitor(sampleData);
const outDir = __dirname;

fs.writeFileSync(path.join(outDir, "dashboard-attribution-report.json"), `${JSON.stringify(report, null, 2)}\n`);
fs.writeFileSync(path.join(outDir, "reviewer-packet.md"), buildReviewerMarkdown(report));
fs.writeFileSync(path.join(outDir, "demo.svg"), renderDashboardSvg(report));

console.log(JSON.stringify(report, null, 2));
Binary file not shown.
1 change: 1 addition & 0 deletions enterprise-dashboard-attribution-anomaly-monitor/demo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading