Skip to main content

feat: add working application and synthetic sample data

GBB Demo authored on Nov 2, 2026

commit 322732c60c1d

Root commit: changes are relative to an empty tree.

4 files changed, +34 −0

  • .gitignore+3 −0
    @@ -1,0 +1,3 @@
    1+__pycache__/
    2+node_modules/
    3+.env
  • README.md+5 −0
    @@ -1,0 +1,5 @@
    1+# Pulse Status
    2+
    3+A service status board that rolls component health into a clear overall status.
    4+
    5+Synthetic evaluation project.
  • app.mjs+11 −0
    @@ -1,0 +1,11 @@
    1+const levels = {operational: 0, degraded: 1, outage: 2};
    2+export function overallStatus(components) {
    3+ if (!components.length) return "unknown";
    4+ if (components.some(component => !(component.status in levels))) throw new Error("Invalid status");
    5+ return components.reduce((worst, component) => levels[component.status] > levels[worst] ? component.status : worst, "operational");
    6+}
    7+export function uptime(successful, total) {
    8+ if (!Number.isInteger(total) || !Number.isInteger(successful) || total < 0 || successful < 0 || successful > total) throw new Error("Invalid counts");
    9+ return total === 0 ? null : Number((successful / total * 100).toFixed(2));
    10+}
    11+
  • data/sample.json+15 −0
    @@ -1,0 +1,15 @@
    1+{
    2+ "environment": "demo",
    3+ "items": [
    4+ {
    5+ "id": "sample-1",
    6+ "name": "Explore the source",
    7+ "done": true
    8+ },
    9+ {
    10+ "id": "sample-2",
    11+ "name": "Review the draft PR",
    12+ "done": false
    13+ }
    14+ ]
    15+}