---
title: "Algorithm Change Check"
method: POST
path: "/api/v1/decision/algo-check"
tags: ["Decision", "Decision Layer"]
---

# Algorithm Change Check

`POST /api/v1/decision/algo-check`

Daily ML maintenance endpoint (Phase 4 rewire).

Called daily by GCP Cloud Scheduler. Per WIRE-2 = 1'a, drift detection
is now performed in-tick via KLDivergenceDetector (which can also
automatically reset segment gates on detection). This endpoint no
longer performs the inline CUSUM+BOCPD detection that previously
duplicated and shadowed the KL path.

What it does now:
  1. Train the churn-prediction model on accumulated creator data
  2. Re-discover dynamic segments via HDP
  3. Report current drift status (read-only, from KL detector state)

Phase 4 wiring: train_churn_model and discover_segments needed periodic
triggers; this is the natural daily slot. Both methods are no-ops
until enough data accumulates (churn_min_creators / hdp_min_videos
gates).

## Query parameters

- `authorization` string, nullable

## Response `200`

Successful Response

- unknown

## Other responses

- `401` — Unauthorized - Invalid scheduler token
- `422` — Validation Error
- `500` — Internal Server Error

---

[API](https://skmtc.dev/primetime/apis/primetime-media-api.md) · [All operations](https://skmtc.dev/primetime/apis/primetime-media-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/primetime/primetime-media-api/revisions/9da9a9f64e11/schema)
