fix: preserve JSON output for slow consumers at shutdown
A slow consumer can lose JSON log output when the supervised command exits: the macOS unit run received only 157 of 200 lines because the five-second drain limit also counted time blocked forwarding output.
Exclude completed and ongoing writes from the five-second active drain budget. Capture each pump's monotonic time and cumulative write duration together under a lock, so a write completing during shutdown cannot corrupt the cutoff. Keep the idle limit for silent descendants and add a shared 30-second wall deadline so a stalled consumer or lingering writer cannot prevent shutdown.
Cover slow stdout and stderr consumers with normal and shortened active budgets, snapshot accounting during and after writes, and lingering writers blocked by unread stdout or stderr pipes. The race and stalled-consumer regressions reproduced the review findings before the fixes. Add a reflex-base changelog fragment documenting the shutdown limit.
Type of change
- Bug fix (non-breaking)
Validation
- macOS, Python 3.14.8, Node 22: 11,258 unit tests passed, 159 skipped; 78.99% coverage.
- All 81 logging tests passed, including slow/stalled stdout and stderr consumers and silent/chatty lingering descendants.
- Repository Ruff lint and formatting checks passed; Pyright reported no errors or warnings.
- Commit hooks passed, including codespell, stub generation, Pyright, and ty.
- Adversarial review found no actionable issues.