QA: apr serve Falsification Suite

Popperian falsification tests for apr serve HTTP endpoints (PMAT-QA-RUST-001). The most comprehensive QA example, testing OpenAI API compatibility.

IDTestPointsCriterion
P017Health endpoint2/health returns 200
P018Compute mode2Response contains cpu/gpu/cuda
P019Valid JSON2Response parses as JSON
P020OpenAI structure3choices[0].message.content exists
P021Non-empty content2Content length > 0
P022No token artifacts2No raw tokens in output
P023No BPE artifacts2No Ġ/Ċ in output
P024SSE streaming3data: { prefix present
P025Stream termination2[DONE] marker present
P026Determinism T=03Same request produces same response
P027Malformed JSON2Returns 400 on bad input
P028Coherency2Output is intelligible
P029No multi-turn loop3No fake Human:/Assistant:
P030Trace brick level1brick_trace in response
P031Trace step level1step_trace in response
P032Trace layer level1layer_trace in response
P033Default suppression2No trace fields without header

Run

cargo run --example qa_serve
cargo run --example qa_serve -- --model path/to/model.gguf

Source

// Run this example:
//   cargo run --example qa_serve
//
// See the CLI reference and source code in crates/ for implementation details.