CODE-032: stage.js feed() can deadlock against a chatty git add

Now
DONE
Sev
HIGH
Rep
///bee
Ask
gritzko
Rev
///bee#184fddf

Input

Context

stage.js:73-83 writes the whole NUL-framed path list into git add's stdin (io.writeAll) and only then reads stdout (slurp). git emits per-file warnings (CRLF, ignored adds); once those fill the 64K pipe git blocks on write while bee still blocks on writeAll both sides stall forever. The comment on the drain ("never block a chatty git") claims the opposite of what the ordering delivers. Found in the 2026-08-21 review.

Goals

Repro first: stage a few thousand files whose content trips the CRLF warning; the test must hang without the fix and pass with it. Then fix the ordering: interleave write and drain, or point the child's stdout/stderr at a file and slurp after reaping.

Constraints

Keep the NUL framing and the one-child-per-batch shape (stage.js:203 notes).

WIP

TODOs

Outcome