Motivation
Discovery mode shells out to zig test per file, while programmatic mode uses the internal registry, runner, hooks, and reporters. This creates two execution paths with different capabilities and makes CLI features difficult to implement consistently.
Proposed architecture
Introduce a common pipeline:
- Discovery or registration produces a test plan.
- Sequential or parallel executors consume the plan.
- Execution emits a shared lifecycle event stream.
- Console, JSON, TAP, JUnit, UI, and history reporters consume those events.
External zig test processes may remain an executor implementation, but their output and status should enter the same result model.
Acceptance criteria
- Both modes use a shared result and event model.
- Reporter selection works consistently in both modes.
- Filtering, bail, timeout, and summary behavior are defined once.
- Existing public programmatic APIs remain compatible or have a migration guide.
- Architecture and extension points are documented.