Repository navigation
Description
Timing: Follow-up after trial/3 merges into main; defer implementation until then.
Review baseline: Local trial/3 at a094418baf6388e3eeca23821df481a7f0a8751c. This branch is not yet on the remote. Source locations below refer to that snapshot and should be rechecked after merge.
Problem
The generation formatter collects complete subprocess stdout and stderr before checking the generated-output byte ceiling. Its final artifact limit therefore does not bound captured diagnostics, peak memory, or execution time. There is no formatter deadline.
Evidence
crates/idea/idea-transformer/src/output/format.rs:42:wait_with_output()collects both streams.crates/idea/idea-transformer/src/output/format.rs:50-52: the 1 MiB output check runs after collection.- A controlled formatter probe used 975,000 input bytes and a temporary configuration with many unknown-setting warnings. It exited successfully while producing 2,058,890 stderr bytes, which the current collection pattern would retain before discarding them.
- The separate pipe-order experiment did not establish a rustfmt deadlock; this issue makes no such claim.
Acceptance criteria
- Enforce finite limits while collecting subprocess stdout and stderr, and define a formatter time policy.
- Kill and reap the child on limit, timeout, and IO-failure paths without hanging or leaking a worker/process.
- Preserve formatted artifact compatibility, generated-file ownership, and no-install-on-format-failure behavior.
- Verify oversized diagnostics/output and stalled-child behavior with watchdogs or controlled subprocess fixtures.
- State separately the final artifact budget and the subprocess acquisition/runtime limits.
Code examples and suggested direction
Example bounded stream collector, to be integrated into a supervised subprocess design:
fn read_capped(
mut input: impl std::io::Read,
limit: usize,
) -> std::io::Result<Vec<u8>> {
let mut output = Vec::new();
let mut chunk = [0_u8; 8192];
loop {
let count = input.read(&mut chunk)?;
if count == 0 {
return Ok(output);
}
if count > limit.saturating_sub(output.len()) {
return Err(std::io::Error::other("formatter stream limit exceeded"));
}
output.extend_from_slice(&chunk[..count]);
}
}The check happens before retaining each chunk. This helper alone does not provide a deadline or concurrent pipe draining; a supervisor must stop/reap the child when either collector fails.
Activity
cblanquera commentedon Oct 26, 2026
Suggested investigation and fix notes
Deferred until
trial/3is merged intomain. Recheck the merged source and tests first. The snippets are examples/proposals, not an approved patch or a change to frozen contracts.Collector component example:
Start with
cargo test -p stackpress-idea-transformer --locked, especiallysrc/output/tests.rs. Coordinate error categories and retained causes with #3, #10, and #11.Implementation workflow: After the merge, follow
.agents/workflows/rust-programming.md: prove the affected behavior, complete the three test-verified review rounds, and record relevant formatting/lints/docs, feature/platform scope, and applicable development coverage. Preserve unrelated changes.cblanquera commentedon Oct 26, 2026
Fixed on
trial/3in 407b4d6 + df443b7 (merged as ff7a251, task 00010 lane 2; not yet onmain, so leaving open).Coordinator-verified on the combined code: fmt, Clippy -D warnings, Rustdoc -D warnings,
cargo +1.96.0 check, 466 workspace tests and 857 doctests pass (467 tests on mergedtrial/3). Coverage: server 91.61%, CLI 93.15%, transformer 93.62%.Fix owner review issues #10, #3, #8, #9, #13, #12 and host parts of #4,