-
Notifications
You must be signed in to change notification settings - Fork 1
memory(feedback): kernel-pipe vs JS-space stream ordering β TS+Bun port pattern #906
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,76 @@ | ||||||
| --- | ||||||
| name: kernel-pipe vs JS-space stream ordering β TS+Bun port pattern (2026-04-30) | ||||||
| description: When porting bash command-substitution with `2>&1` to TypeScript via `spawnSync`, must merge stdout+stderr at the kernel pipe boundary (shell-side `2>&1`), NOT in JS-space by concatenating `result.stdout + result.stderr` β JS-space concat loses chronological ordering when child interleaves stdout/stderr writes. | ||||||
|
||||||
| description: When porting bash command-substitution with `2>&1` to TypeScript via `spawnSync`, must merge stdout+stderr at the kernel pipe boundary (shell-side `2>&1`), NOT in JS-space by concatenating `result.stdout + result.stderr` β JS-space concat loses chronological ordering when child interleaves stdout/stderr writes. | |
| description: When porting bash command-substitution with `2>&1` to TypeScript via `spawnSync`, preserve child stdout/stderr interleaving by merging at the kernel pipe boundary (shell-side `2>&1`), not by reconstructing child output as `result.stdout + result.stderr` in JS-space; append `result.stderr` separately only when shell-side diagnostics such as parse errors must also be surfaced. |
Copilot
AI
Apr 30, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
P1: The example interpolates path directly into the bash -c command string. Even if callers usually pass trusted paths, this pattern is easy to cargo-cult into contexts where the value is user-influenced, creating quoting/injection risk. Consider documenting the safer pattern of passing the path as a positional parameter to bash -c (so quoting is handled without string interpolation) and note that interpolation is only acceptable when the value is fully trusted/constructed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
P1: This new MEMORY.md index entry is far longer than the repoβs documented βkeep entries terse / ~200 charsβ guidance, which makes the index harder to scan and increases the risk of truncation issues. Consider shortening this bullet to a title + very short hook and move the detailed rationale into the linked memory file body (which already contains it).