docs(#5789): add stdout contamination pattern to shell-scripting guide - #5790
Conversation
Add a fourth shell correctness pattern documenting how functions that write diagnostic output to stdout pollute variables when called inside $(...) command substitution. This pattern caused a HIGH-severity bug on PR #5357 where retry_curl() wrote ::warning:: and ::error:: annotations to stdout, contaminating the resp variable and breaking downstream jq parsing. The new section follows the existing format: problem description, anti-pattern and correct code examples, and a review guidance paragraph with severity levels. Also updates the AGENTS.md table entry to reference the new pattern. Note: pre-commit could not run (network access blocked in sandbox). The post-script runs an authoritative pre-commit check on the runner before pushing. Closes #5789
|
🤖 Finished Review · ✅ Success · Started 7:11 AM UTC · Completed 7:25 AM UTC |
Site previewPreview: https://28da04f0-site.fullsend-ai.workers.dev Commit: |
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
ReviewFindingsMedium
Low
Labels: PR adds new section to docs/contributing/shell-scripting.md and updates AGENTS.md table entry |
|
/fs-fix |
|
🤖 Finished Fix · ✅ Success · Started 7:31 AM UTC · Completed 7:36 AM UTC |
Remove duplicate -fsSL flags from the retry_curl() function body in both the WRONG and CORRECT examples. The actual codebase convention in action.yml uses `curl "$@"` in the function body and callers pass flags explicitly (e.g., `retry_curl -fsSL ...`). The examples now match. Addresses review feedback on #5790
🔧 Fix agent — iteration 1 (human-triggered)Addressed 1 of 2 review findings. Fixed the duplicated -fsSL flags in retry_curl documentation examples to match the codebase convention. The protected-path finding is informational and requires human approval, not a code fix. Fixed (1):
Disagreed (1):
Tests: passedNext steps:
|
|
🤖 Finished Retro · ✅ Success · Started 9:04 AM UTC · Completed 9:18 AM UTC |
Retro: PR #5790 — docs(#5789): add stdout contamination pattern to shell-scripting guideWorkflow overviewThis PR demonstrates the retro-to-merge feedback loop working as designed. The retro agent analyzed PR #5357 (where a human reviewer caught stdout contamination bugs that the review agent missed across 8 review runs), filed issue #5789, and the full pipeline executed cleanly: triage (4.5 min) → code (7 min) → review (15 min) → human-triggered fix (7 min) → human approval → merge. Total wall-clock ~2 hours, with ~82 minutes of human latency between fix completion and approval. What went well
Known issues observed (no new proposals needed)Missing re-review after fix push. After the fix agent pushed commit Code agent did not cross-reference actual source code when writing examples. The ConclusionClean workflow with no new proposals. All identified improvement opportunities are already tracked in existing issues. |
Summary
Add the stdout contamination in command substitution pattern to
docs/contributing/shell-scripting.md, giving the review agent explicit guidance to catch functions that write diagnostic output to stdout when called inside$(...).Related Issue
Closes #5789
Changes
docs/contributing/shell-scripting.mdwith problem description, anti-pattern/fix code examples, and review guidance paragraph following the existing formatAGENTS.mdtable entry for Shell Scripting to reference the new patternTesting
lycheemarkdown link check passes on both changed filesgitlintpasses on commit messagescan-secretspasses on all changed filesChecklist
!for breaking changes)Closes #5789
Post-script verification
agent/5789-stdout-contamination-pattern)3f36f021def4d5a92e26200d3313dd26dba22cd0..HEAD)