Skip to content

AI Classification Job Live Smoke

Purpose

make test-ai-classification-job-live is an opt-in live gateway smoke for the AI classification job surface. Today it is intentionally a read-only legacy route guard: public /api/questions/ai-classify/jobs*, /api/questions/ai-classify/suggestions, /api/questions/ai-generation*, and /api/questions/ai-solutions* must stay behind the broad legacy questions proxy until native job SSE/cancel/provider parity has explicit promotion evidence.

This smoke complements make test-ai-classification-job-route-guard, which is static. The live smoke proves the running gateway route table and response headers still match the conservative cutover state.

Command

bash
cd go-platform
AI_CLASSIFICATION_JOB_LIVE_CONFIRM=legacy-job-routes \
AI_CLASSIFICATION_JOB_AUTHORIZATION='Bearer <token>' \
make test-ai-classification-job-live

Optional route-header check for an existing job SSE endpoint:

bash
AI_CLASSIFICATION_JOB_ID=<legacy-job-id> \
AI_CLASSIFICATION_JOB_LIVE_CONFIRM=legacy-job-routes \
AI_CLASSIFICATION_JOB_AUTHORIZATION='Bearer <token>' \
make test-ai-classification-job-live

Set AI_CLASSIFICATION_JOB_ORGANIZATION_ID=<org-id> when the live legacy route requires tenant scope. Set AI_CLASSIFICATION_JOB_ARTIFACT_DIR=<dir> to keep route table, headers, and body files.

Assertions

  • GET /v1/routes includes broad questions and fallback routes as legacy_proxy.
  • No active public route targets internal AI service paths such as /v1/ai-classifier* or /v1/ai/*.
  • Job, suggestion, generation, and solution public route prefixes are not in native_read, shadow_read, native_write_shadow_validate, or native_write.
  • GET /api/questions/ai-classify/jobs?limit=1 reports:
    • X-Hoctapaz-Gateway-Route: questions
    • X-Hoctapaz-Gateway-Route-State: legacy_proxy
  • When AI_CLASSIFICATION_JOB_ID is supplied, the SSE route /api/questions/ai-classify/jobs/{id}/events reports the same legacy route headers. The script allows curl timeout after headers because SSE streams may stay open.

The smoke does not call cancel routes because cancel is a write. Cancel route promotion requires a future native target plus explicit disposable fixture and rollback evidence.

Self-Test

The hermetic self-test validates route-table and header assertions without a running gateway:

bash
AI_CLASSIFICATION_JOB_SELF_TEST=1 make test-ai-classification-job-live

Rollback

No route table changes are made by the smoke. If a non-default route table accidentally promotes AI job routes, return GATEWAY_ROUTE_TABLE to deploy/gateway/routes.json or remove the specific native entries before retrying.

Go-platform documentation is generated from repository Markdown.