Skip to content

Pipeline health API endpoint #68

@matt-bedda

Description

@matt-bedda

Overview

Add GET /api/pipeline-health endpoint that runs pipeline-doctor.js and returns structured health data for the dashboard Pipeline Health tab.

Implementation

The dashboard already has a Pipeline Health tab that expects this endpoint. Currently it 404s gracefully.

Option A: Shell out to pipeline-doctor.js

import { execSync } from "child_process";

// In router handler:
const output = execSync("node /home/mwhit/clawd/job-hunt/pipeline-doctor.js --json", {
  timeout: 30000,
  encoding: "utf-8"
});
const data = JSON.parse(output);

Option B: Read last-run JSON files directly

Read state/*-last-run.json files from the job-hunt directory.

Response Format

The dashboard expects:

{
  "pipelines": [
    {
      "id": "greenhouse",
      "name": "Greenhouse",
      "status": "healthy|degraded|down",
      "inventory": 24391,
      "applied24h": 222,
      "failed24h": 3,
      "successRate": 98.7,
      "blockers": ["41 permanent failures"]
    }
  ]
}

Config

The pipeline-doctor.js path should be configurable (or auto-detected from claude.workingDirectory).

Priority: P1

This is the only dashboard tab that doesn't work yet.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions