Motivation
Editors, CI systems, the future web UI, and external tools need structured real-time test events. The current JSON strings are assembled ad hoc and are not defined as a versioned protocol.
Proposed work
- Define typed events for run, suite, test, hook, output, retry, and coverage lifecycle data.
- Serialize events through the standard JSON facilities with correct escaping.
- Add a protocol version and compatibility policy.
- Let JSON output, UI broadcasting, and test history share the same event model.
- Document the schema with examples.
Acceptance criteria
- All event JSON is generated from typed structures rather than string interpolation.
- Arbitrary test names and error messages are escaped correctly.
- Schema fixtures or contract tests cover every event type.
- Consumers can detect the protocol version.