1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
//! API Tests
//!
//! Split into parts for PMAT compliance (<2000 lines per file).
//!
//! Part organization:
//! - part_01: Unit tests, clean_chat_output, health/metrics endpoints (IMP-144-152)
//! - part_02: Generate endpoint tests, streaming tests
//! - part_03: Chat completion tests, OpenAI compatibility
//! - part_04: GPU inference tests (IMP-116+)
//! - part_05: Additional coverage tests
//! - part_06: Error response coverage (PMAT-803)
//! - part_07: Realize handlers coverage (Phase 37 - Scenario Blitz)
//! - part_08: OpenAI handlers coverage
//! - part_09: OpenAI handlers extended coverage
//! - part_10: Realize handlers extended coverage (ModelLineage, ReloadResponse, etc.)
//! - part_11: GPU handlers coverage (GpuBatchRequest, GpuBatchResponse, BatchConfig, etc.)
//! - part_12: OpenAI/Realize handlers - Request/Response type serialization
//! - part_13: OpenAI/Realize handlers - HTTP endpoint error paths and streaming
//! - part_14: Additional coverage tests
//! - part_15: T-COV-95 Directive 2: In-Process API Falsification (GPU/CUDA/quantized paths)
//! - part_16: T-COV-95 Popper Phase 2: Combinatorial API Sweep (stream/temp/max_tokens/invalid)
// T-COV-95 Coverage Bridge B2+B3 (GPU handlers, Realize/OpenAI handlers, AppState)
// T-COV-95 Deep Coverage Bridge (BatchConfig, ContinuousBatchResponse, streaming types, endpoints)
// T-COV-95 Deep Coverage Bridge (ContextWindow, format_chat, clean_chat, HTTP handlers, serde)
// T-COV-95 Extended Coverage (build_trace_data, streaming types, request/response serde)
// T-COV-95 APR handlers coverage (predict, explain, audit, serde, error paths)
// T-COV-95 gpu_handlers + realize_handlers coverage (BatchConfig, ContextWindow, format_chat)
// T-COV-95 Protocol Falsification: Potemkin Village GPU Mocks
// T-COV-95 Chaotic Citizens: GPU Batch Resilience Falsification
// T-COV-95 Interleaved Chaos: GPU Batch Processor Saturation
// T-COV-95 Generative Falsification: Proptest API Request Assault
// Coverage: realize_handlers pure functions, ContextWindow, clean_chat, build_trace_data, serde
// PMAT-187: chat-template-v1.yaml contract enforcement (FALSIFY-CT-002)
// PMAT-803: model-backed embeddings (semantic-similarity falsifier, dim==hidden_size)
// Dogfood 0.63.0: SSE deltas must reassemble with whitespace intact
// aprender#2376: native routes on a quantized server, KV-cache budget, sampling fields
// --no-cors / --no-metrics must change HTTP behaviour, not just the banner
// Dogfood 0.63.0 (#2396/#2402): /api/tags|show|version routed, stream:true is NDJSON, /realize/* stops fabricating
// aprender#2376(1 seventh route, 7, 8) + #2396(2): embeddings on a quantized server, one error envelope, / and /ready
// aprender#2375(2): /v1/explain must not fabricate SHAP values and a 0.95 prediction
// Dogfood 0.63.0 (#2375): /v1/completions streams, finish_reason is measured, `n` is honoured or refused, /v1/predict stops lying
// SURF-7/R14: a handler panic must be a JSON 500, not a dropped connection
// aprender#2376(7,8): advertised surface == mounted surface; every error body is a JSON envelope
// aprender#2375(1 regression, 4, 7) + temperature:0 — streaming chat through the real router, /v1/metrics measures
// aprender#2465(2): /v1/completions must END at a stop sequence
// aprender#2465(3): /v1/batch/completions tokenized from UTF-8 byte values, not tokens
// aprender#2375(4): POST /v1/chat/completions/stream is mounted — it must serve, and answer 503 (not 404) with no model
// aprender#2609: routed endpoints on an AprTransformer server; one condition, one status