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 additions

- `enterprise-lab-inventory-sync`: institutional lab-inventory and instrument-readiness monitor for ELN/LIMS integration, calibration drift, reagent expiry, webhook events, and export gating.
24 changes: 24 additions & 0 deletions enterprise-lab-inventory-sync/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Enterprise Lab Inventory Sync

Enterprise research offices need to know whether experiments, data exports, and publication packages depend on lab assets that are stale, offline, expired, or out of sync with institutional systems. This module adds a deterministic monitor for lab-inventory and instrument-readiness governance.

The monitor is intentionally self-contained and credential-free. It consumes synthetic inventory, ELN/LIMS integration, instrument, reagent, and project dependency records, then emits:

- dashboard metrics for institutional admins and lab operations teams
- project export gates when blocked instruments or expired reagents affect evidence packages
- webhook events for calibration drift, maintenance risk, integration lag, reservation conflicts, and inventory expiry
- prioritized admin actions with deterministic evidence digests for audit trails

## Run

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

The demo reads `data/sample-lab-input.json` and prints the current governance status. The visual preview is available at `docs/demo.svg`; `docs/demo.gif` is a short generated walkthrough artifact for the bounty review.

## Fit For Issue #19

This targets the "API & Webhooks" and "Admin Dashboards" enterprise-tooling requirements for integrations with electronic lab notebooks and lab inventory systems. It is distinct from prior slices around broad dashboards, export packages, trust centers, webhook replay, identity drift, retention/legal hold, data residency, grant compliance, and SLA monitoring.
146 changes: 146 additions & 0 deletions enterprise-lab-inventory-sync/data/sample-lab-input.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,146 @@
{
"generatedAt": "2026-05-16T14:00:00Z",
"institution": "Northbridge Translational Research",
"labs": [
{
"id": "lab-genomics",
"name": "Genomics Core",
"department": "Molecular Biology"
},
{
"id": "lab-imaging",
"name": "Imaging Core",
"department": "Bioengineering"
}
],
"integrations": [
{
"system": "Benchling ELN",
"kind": "eln",
"status": "healthy",
"lastSyncAt": "2026-05-16T13:45:00Z",
"queueDepth": 2
},
{
"system": "Quartzy Inventory",
"kind": "inventory",
"status": "degraded",
"lastSyncAt": "2026-05-15T10:30:00Z",
"queueDepth": 97
},
{
"system": "Agilent OpenLab",
"kind": "instrument",
"status": "failed",
"lastSyncAt": "2026-05-14T08:00:00Z",
"queueDepth": 211
}
],
"instruments": [
{
"id": "inst-hplc-01",
"name": "HPLC 01",
"labId": "lab-genomics",
"status": "online",
"calibrationDue": "2026-05-10",
"maintenanceDue": "2026-06-02",
"linkedEln": true,
"reservations": [
{
"projectId": "proj-metabolomics",
"startsAt": "2026-05-17T09:00:00Z",
"endsAt": "2026-05-17T11:00:00Z"
}
]
},
{
"id": "inst-confocal-02",
"name": "Confocal Microscope 02",
"labId": "lab-imaging",
"status": "offline",
"calibrationDue": "2026-06-30",
"maintenanceDue": "2026-05-18",
"linkedEln": false,
"reservations": [
{
"projectId": "proj-organoid-map",
"startsAt": "2026-05-17T10:00:00Z",
"endsAt": "2026-05-17T12:00:00Z"
},
{
"projectId": "proj-neurochip",
"startsAt": "2026-05-17T11:30:00Z",
"endsAt": "2026-05-17T13:00:00Z"
}
]
},
{
"id": "inst-sequencer-03",
"name": "Bench Sequencer 03",
"labId": "lab-genomics",
"status": "online",
"calibrationDue": "2026-06-08",
"maintenanceDue": "2026-08-01",
"linkedEln": true,
"reservations": []
}
],
"reagents": [
{
"id": "rgnt-antibody-a",
"name": "Anti-CD31 antibody",
"lot": "A-114",
"labId": "lab-imaging",
"expiresAt": "2026-05-12",
"quantity": 3,
"unit": "vial",
"projectIds": ["proj-organoid-map"]
},
{
"id": "rgnt-buffer-b",
"name": "LC-MS Buffer B",
"lot": "B-331",
"labId": "lab-genomics",
"expiresAt": "2026-05-23",
"quantity": 12,
"unit": "bottle",
"projectIds": ["proj-metabolomics"]
},
{
"id": "rgnt-enzyme-c",
"name": "Library prep enzyme mix",
"lot": "C-515",
"labId": "lab-genomics",
"expiresAt": "2026-07-01",
"quantity": 1,
"unit": "kit",
"projectIds": ["proj-neurochip"]
}
],
"projects": [
{
"id": "proj-metabolomics",
"title": "Metabolomics biomarker screen",
"owner": "Dr. Imani Patel",
"exportDue": "2026-05-25",
"requiredInstrumentIds": ["inst-hplc-01"],
"requiredReagentIds": ["rgnt-buffer-b"]
},
{
"id": "proj-organoid-map",
"title": "Organoid vascular imaging map",
"owner": "Dr. Theo Bennett",
"exportDue": "2026-05-19",
"requiredInstrumentIds": ["inst-confocal-02"],
"requiredReagentIds": ["rgnt-antibody-a"]
},
{
"id": "proj-neurochip",
"title": "Neurochip electrophysiology pilot",
"owner": "Dr. Hana Okafor",
"exportDue": "2026-06-04",
"requiredInstrumentIds": ["inst-confocal-02", "inst-sequencer-03"],
"requiredReagentIds": ["rgnt-enzyme-c"]
}
]
}
Binary file added enterprise-lab-inventory-sync/docs/demo.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added enterprise-lab-inventory-sync/docs/demo.mp4
Binary file not shown.
34 changes: 34 additions & 0 deletions enterprise-lab-inventory-sync/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.
15 changes: 15 additions & 0 deletions enterprise-lab-inventory-sync/docs/requirement-map.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Requirement Map

| Issue #19 capability | Lab inventory sync coverage |
| --- | --- |
| Admin dashboards | Produces lab, integration, finding, export-gate, and action metrics for research-office dashboards. |
| Contributor and usage analytics | Surfaces project owners and affected project IDs for blocked exports and reservation conflicts. |
| Compliance tracking | Blocks export evidence when calibration, maintenance, ELN linkage, or reagent expiry undermines reproducibility. |
| API and webhooks | Emits deterministic `lab_inventory.*` webhook event envelopes with evidence digests. |
| Electronic lab notebooks and lab inventory integrations | Models ELN, inventory, and instrument sync health, queue depth, and stale integration state. |
| Export pipelines | Produces per-project export gates: `ready`, `review_before_export`, or `block_export`. |
| Version and evidence history | Uses stable SHA-256 digests for findings, gates, and full reports. |

## Distinctness Check

This slice is about operational readiness of physical lab assets and inventory-system sync before research outputs are exported. It does not duplicate current #19 submissions for enterprise dashboards, export pipeline packaging, trust centers, compliance evidence packets, audit signal routing, webhook replay, identity provisioning drift, retention/legal hold, data residency, grant portfolio compliance, or SLA/uptime monitoring.
11 changes: 11 additions & 0 deletions enterprise-lab-inventory-sync/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{
"name": "enterprise-lab-inventory-sync",
"version": "1.0.0",
"private": true,
"type": "module",
"scripts": {
"check": "node --check src/lab-inventory-sync.js && node --check scripts/demo.js && node --check test/lab-inventory-sync.test.js",
"test": "node --test test/lab-inventory-sync.test.js",
"demo": "node scripts/demo.js"
}
}
17 changes: 17 additions & 0 deletions enterprise-lab-inventory-sync/scripts/demo.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { readFileSync } from "node:fs";
import { fileURLToPath } from "node:url";
import { dirname, join } from "node:path";
import { analyzeLabInventorySync } from "../src/lab-inventory-sync.js";

const root = dirname(dirname(fileURLToPath(import.meta.url)));
const input = JSON.parse(readFileSync(join(root, "data", "sample-lab-input.json"), "utf8"));
const report = analyzeLabInventorySync(input);

console.log(`${report.institution} lab inventory sync`);
console.log(`Evidence digest: ${report.evidenceDigest}`);
console.log(`Findings: ${report.summary.findings} (${report.summary.criticalFindings} critical, ${report.summary.highFindings} high)`);
console.log(`Export gates: ${report.summary.blockedExports} blocked, ${report.summary.reviewExports} review`);
console.log("Top admin actions:");
for (const action of report.adminActions.slice(0, 5)) {
console.log(`- [${action.severity}] ${action.action}: ${action.subject}`);
}
Loading