feat: implement full-platform STT API (v2.3 consensus plan)

Batch+realtime transcription API: faster-whisper engine w/ EngineOwner
(single GPU owner, OOM downgrade chain, persisted attempted_profiles),
hardware-adaptive device manager (T0-T3 VRAM tiers), Redis/in-proc job
queue w/ leases + crash recovery, postprocess (glossary/rules/LLM w/
egress guard), privacy-first result store (UUID keys, source deleted
after transcribe), retention sweeper, API-key auth (HMAC digests,
scopes, job ownership), WebSocket realtime lane (LocalAgreement),
CLI (detect/transcribe/bench/serve/key), Docker, benchmark runner.

127 mock-based tests pass; ruff clean. Includes verification checklist
and autoplan review notes.
This commit is contained in:
2026-08-12 16:01:21 +09:00
parent b7c30f8b71
commit 7327145d7a
82 changed files with 7351 additions and 0 deletions
@@ -0,0 +1,83 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://git.lukehemmin.com/lukehemmin/luke_scribe/docs/schemas/transcript-result-v1.schema.json",
"title": "TranscriptResult v1",
"type": "object",
"required": ["schema_version", "status"],
"properties": {
"schema_version": { "const": "1.0" },
"status": { "enum": ["completed", "failed", "cancelled"] },
"source": {
"type": "object",
"properties": {
"name": { "type": "string" },
"codec": { "type": ["string", "null"] },
"size_bytes": { "type": ["integer", "null"] }
}
},
"normalized_audio": {
"type": "object",
"properties": {
"duration_sec": { "type": "number", "exclusiveMinimum": 0 },
"audio_format": { "type": "string" },
"sample_rate": { "type": "integer" },
"channels": { "type": "integer" }
}
},
"execution": {
"type": "object",
"properties": {
"model": { "type": "string" },
"device": { "type": "string" },
"compute_type": { "type": "string" },
"language_requested": { "type": ["string", "null"] },
"language_detected": { "type": ["string", "null"] },
"language_detection_confidence": { "type": ["number", "null"] },
"model_used": { "type": ["string", "null"] },
"compute_type_used": { "type": ["string", "null"] },
"downgrade_attempts": { "type": "integer" },
"capability_tier": { "type": ["string", "null"] }
}
},
"timings": {
"type": "object",
"properties": {
"model_load_sec": { "type": ["number", "null"] },
"transcription_sec": { "type": ["number", "null"] },
"ingest_sec": { "type": ["number", "null"] },
"postprocess_sec": { "type": ["number", "null"] },
"rtf": { "type": ["number", "null"] }
}
},
"text": { "type": "string" },
"segments": {
"type": "array",
"items": {
"type": "object",
"required": ["index", "start", "end", "text"],
"properties": {
"index": { "type": "integer", "minimum": 0 },
"start": { "type": "number", "minimum": 0 },
"end": { "type": "number", "minimum": 0 },
"text": { "type": "string" },
"avg_logprob": { "type": ["number", "null"] },
"no_speech_prob": { "type": ["number", "null"] },
"confidence": { "type": ["number", "null"] },
"words": { "type": ["array", "null"] },
"speaker": { "type": ["string", "null"] }
}
}
},
"warnings": { "type": "array", "items": { "type": "string" } },
"error": {
"type": "object",
"properties": {
"code": { "type": "string" },
"message": { "type": "string" },
"retryable": { "type": "boolean" }
}
},
"postprocessing": { "type": ["object", "null"] },
"entities": { "type": ["array", "null"] }
}
}