A quality gate defines what “correct” means before work begins. A specification makes intent observable: when code diverges from it, resolve the mismatch early rather than treating the spec as an approval checkpoint. section 4.1.4
Listing 4.4 Spec file
Accept: GET /api/orders/export (authenticated user) Return: CSV file with columns: order_id, date, total, status Filter: Only orders belonging to the requesting user Format: Standard CSV, UTF-8 encoding Never: Include other users' data, build the CSV in the browser, load all orders into memory, allow unauthenticated access Prefer: Stream CSV rows from the server using bounded database reads
A CSV export specification turns privacy, format, and streaming requirements into explicit conditions for judging the implementation. section 4.1.4








