aboutsummaryrefslogtreecommitdiff
path: root/tasks/20261014-190252/TASK.md
diff options
context:
space:
mode:
authorTommaso Negri <me@tommasongr.com>2026-10-14 21:58:57 +0200
committerTommaso Negri <me@tommasongr.com>2026-10-14 21:58:57 +0200
commitf802039757d5da01a2b7cb7d1b15c692f137d91f (patch)
tree86c328bda63b0d566eb56c8d0c83409fcc9b8b8c /tasks/20261014-190252/TASK.md
parente6b4d0cb69809ea3d742ba03f4a0586cbbb3d1b3 (diff)
downloadbar-f802039757d5da01a2b7cb7d1b15c692f137d91f.tar.gz
bar-f802039757d5da01a2b7cb7d1b15c692f137d91f.zip
add tasks
Diffstat (limited to 'tasks/20261014-190252/TASK.md')
-rw-r--r--tasks/20261014-190252/TASK.md15
1 files changed, 15 insertions, 0 deletions
diff --git a/tasks/20261014-190252/TASK.md b/tasks/20261014-190252/TASK.md
new file mode 100644
index 0000000..abbeb72
--- /dev/null
+++ b/tasks/20261014-190252/TASK.md
@@ -0,0 +1,15 @@
+# Drain command stdout and stderr concurrently
+
+- STATUS: OPEN
+- PRIORITY: 10
+- TAGS: review, bug, core
+
+Files: Sources/bar/Models/Runner.swift, Tests/barTests/phbarTests.swift.
+
+Problem: Runner reads stdout to EOF before draining stderr. A child that fills the stderr pipe blocks on writing; Runner waits for stdout EOF, so a valid command can stall until timeout.
+
+Approach: Drain both pipes concurrently using a small, clearly owned implementation. Avoid moving blocking reads onto the main actor or filling Swift's cooperative executor with unbounded blocking work. Preserve /bin/sh -c, inherited environment, output whitespace, newline parsing, and ERROR cells on nonzero exit. Decide whether stderr should be forwarded on successful exits too; command.md currently promises forwarding without that qualification.
+
+Completion checks: A command writes substantially more than pipe capacity to stderr and then emits stdout; it finishes promptly and stdout is correct. Check simultaneous large stdout/stderr, normal empty output, and nonzero exit diagnostics. Add focused regression tests with an outer deadline so a failure cannot hang the test suite. Coordinate timeout ownership with the separate timeout task.
+
+Design constraint: Follow README.md: keep source-based configuration, no dependencies or plugin framework, and use the smallest readable change that makes the existing behavior reliable. This is a suggestion for individual review, not a deadline. Findings were recorded on 2026-10-14; re-check the current code before implementing.