Audit: Add text/plain Content Negotiation
Parent: #424 (Audit System)
Related: #427 (Routes - JSON only)
Overview
Add text/plain response format support to all audit GET endpoints for CLI-friendly output. Currently only application/json is supported.
Tasks
1. Content Negotiation Helper
2. Text Response Formatters
GET /traces - Compact trace list:
trace abc123 142.5ms OK client:timetable-app user:js
trace def456 15.8ms FAIL client:— user:—
--- more: cursor=2026-03-27T09:58:12.000Z ---
GET /traces/ - Waterfall format:
trace abc123 142.5ms OK client:timetable-app user:js
+0.0ms 142.5ms GET /api/v1/students 200
+0.1ms 15.2ms POST /auth/token/validate 200
+18.0ms 98.3ms GET /api/v1/db/query 200
GET /traces/search - Same as GET /traces
GET /health - Simple:
Acceptance Criteria
Implementation Notes
- Text formatters should accept model objects (not resource dicts)
- Reuse
TraceSummary, TraceTree, TraceSpan models
- Format strings using f-strings for maintainability
- Status: "OK" (200-299), "FAIL" (500+), "ERR" (400-499)
References
- PRD §5.3: Content Negotiation
- PRD §6: Trace Reconstruction (waterfall format)
Audit: Add text/plain Content Negotiation
Parent: #424 (Audit System)
Related: #427 (Routes - JSON only)
Overview
Add
text/plainresponse format support to all audit GET endpoints for CLI-friendly output. Currently onlyapplication/jsonis supported.Tasks
1. Content Negotiation Helper
application/json,text/plain,*/*2. Text Response Formatters
GET /traces - Compact trace list:
GET /traces/ - Waterfall format:
GET /traces/search - Same as GET /traces
GET /health - Simple:
Acceptance Criteria
application/jsonreturns JSON (current behavior)text/plainreturns formatted textImplementation Notes
TraceSummary,TraceTree,TraceSpanmodelsReferences