refactor: inject async writer into reporters instead of hardcoding stdout#161
Merged
branchseer merged 3 commits intomainfrom Feb 15, 2026
Merged
refactor: inject async writer into reporters instead of hardcoding stdout#161branchseer merged 3 commits intomainfrom
branchseer merged 3 commits intomainfrom
Conversation
…dout - Add Box<dyn AsyncWrite + Unpin> writer parameter to PlainReporter and LabeledReporterBuilder, replacing hardcoded std::io::stdout() calls - Make LeafExecutionReporter::start/finish and GraphExecutionReporter::finish async using #[async_trait(?Send)] - Convert display helpers to sync formatters (format_command_with_cache_status, format_error_message, format_cache_hit_message) returning Str - Convert print_summary to sync format_summary returning Vec<u8> buffer - Restructure labeled reporter to batch shared state updates before async writes, avoiding RefCell borrows across await points - Pass tokio::io::sink() as writer in unit tests - Move reporter tests to their own module files (plain.rs, labeled.rs) with shared test fixtures in mod.rs
tokio::io::Stdout has its own internal ~8KB buffer. Without explicit flush(), data written to the reporter's writer may appear after process output (which is flushed by the execution engine), causing E2E snapshot test failures due to output reordering.
CI runs clippy with -D warnings, and redundant_pub_crate triggers when pub(crate) is used inside a private module (the effective visibility is already crate-scoped).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Box<dyn AsyncWrite + Unpin>writer intoPlainReporterandLabeledReporterBuilderinstead of hardcodingstd::io::stdout()LeafExecutionReporter::start/finishandGraphExecutionReporter::finishasync via#[async_trait(?Send)]Str/Vec<u8>, keeping async I/O only at the reporter method leveltokio::io::sink()as writer in unit tests; move reporter tests to their own module files (plain.rs,labeled.rs)