# ProcessForge Yield AI

ProcessForge is the CATALYST wedge for high-cost physical operations: battery lines, semiconductor fabs, pharma fill-finish, and other production systems where a small process drift can become scrap, downtime, or a quality escape.

## Product Promise

ProcessForge detects constraint drift before defects appear.

The product does not replace metrology, quality systems, or domain-expert release decisions. It turns process windows into auditable decision-support packets: drift score, phase coherence, yield risk, ranked root causes, corrective action, pass criteria, rollback criteria, and governance boundaries.

## Endpoint

```text
POST /v1/processforge/analyze
```

## Request

```json
{
  "lineId": "battery-line-a",
  "processType": "battery-cell",
  "windowMinutes": 30,
  "targetYieldPct": 94,
  "sensors": [
    { "name": "coating temperature", "value": 88, "baseline": 70, "tolerance": 6, "unit": "C", "criticality": 0.92 },
    { "name": "slurry viscosity", "value": 1530, "baseline": 1200, "tolerance": 120, "unit": "cP", "criticality": 0.84 },
    { "name": "line speed", "value": 3.2, "baseline": 3, "tolerance": 0.35, "unit": "m/min", "criticality": 0.54 }
  ]
}
```

## Response Shape

```json
{
  "classification": "intervene",
  "manifoldDrift": 0.55,
  "phaseCoherence": 0.55,
  "yieldRisk": 0.61,
  "predictedYieldPct": 75.7,
  "earlyWarningMinutes": 12,
  "rootCauses": [
    {
      "sensor": "coating temperature",
      "driftRatio": 3,
      "direction": "high",
      "contribution": 2.76,
      "recommendedAction": "Hold the lot..."
    }
  ],
  "runbook": {
    "firstStep": "Place the current batch on engineering hold...",
    "measurements": ["Actual yield versus target yield..."],
    "passCriteria": ["External validator or domain quality review confirms..."],
    "rollbackCriteria": ["Yield risk exceeds 0.55..."],
    "governanceBoundary": "ProcessForge is an early-warning and decision-support system..."
  }
}
```

## Why This Is A Strong Wedge

- The pain is expensive and measurable: scrap, rework, downtime, escaped defects, and lost yield.
- Buyers already have data: MES, SCADA, historian, sensor, metrology, and quality-system feeds.
- CATALYST does not need to claim impossible automation. It only needs to produce earlier warnings, better root-cause ranking, and auditable corrective packets.
- The same evidence architecture already deployed for Browser Run and R2 research packets can preserve process evidence for customer review.

## Correct Use

1. Start with a validated baseline recipe or golden-run window.
2. Stream or batch the current sensor window into ProcessForge.
3. Review the root-cause ranking and corrective runbook.
4. Confirm with a second measurement channel or quality review.
5. Only then promote the corrective action into plant operating procedure.

## Memory And Agent Integration

The build uses the existing `CrewRiz/catalyst-code-agent-cache` implementation for compact repo/test context during development. Product-side persistence continues to use Cloudflare Durable Objects, R2 artifacts, D1, and Vectorize. The Python cache is a coding-agent context tool; the deployed Worker uses a TypeScript-compatible deterministic scoring engine.
