fix(repo-hygiene): treat trailing blank as success in batch_read_lines_into - #3641
Conversation
…s_into batch_read_lines_into now returns 0 after ordinary EOF so a last empty line is not "file not found". Named sources still fail closed when missing, non-regular, or unopenable. Both batch CLIs trust that contract. Closes #3482 Co-authored-by: ksextonmelodic <ksextonmelodic@gmail.com>
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Claude finished @kyle-sexton's task in 1m 9s —— View job Security review complete
No security issues found. This PR changes the exit-status contract of Reviewed the file-descriptor handling specifically ( |
|
Last security-reviewed head: |
|
Claude finished @kyle-sexton's task in 3m 40s —— View job Code review complete
No blocking findings. What I checkedThe core fix in
One pre-existing (not introduced by this PR) behavioral quirk noted but not flagged as a finding: Verification noteI could not execute the test suite or |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 011bd31b00
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Claude has reviewed this PR 2 times. The lane skips further automatic reviews after 5; deleting this comment resets the count. |
Co-authored-by: ksextonmelodic <ksextonmelodic@gmail.com>
|
Claude finished @cursor[bot]'s task in 4m 45s —— View job Code review complete
What changed since the last reviewThe prior Claude/Codex/security reviews covered commit I traced the fd-3 choice for collisions with the rest of this script family: Finding (posted inline)One test-coverage gap, posted as an inline comment on Not flagged (considered, didn't meet the bar)
Verification noteI did not execute |
<!-- CURSOR_AGENT_PR_BODY_BEGIN --> No linked issue ## Summary `#3641` switched `batch_read_lines_into` from `exec {fd}<` to fixed `exec 3<` so a `ulimit -n 10` runner can still open a named source. The test matrix never exercised that limit. ## Fix Add a guarded case in `batch-common.test.sh` that lowers `ulimit -n` to 10 and reads a one-line list. Skip if the host refuses the ulimit. repo-hygiene 0.10.23 (avoids in-flight 0.10.21 / 0.10.22). ## Verification `bash plugins/repo-hygiene/skills/clean/scripts/lib/batch-common.test.sh`: cases 28-29 pass (`named source opens under ulimit -n 10`, `low-fd read yields the line`). `scripts/affected-tests.sh --run`: 1 suite passed. ## Related Refs #3641 (Codex review on the merged PR). <!-- CURSOR_AGENT_PR_BODY_END --> <div><a href="https://cursor.com/agents/bc-7ffb619a-6ebb-4d47-9c45-d68e846edf93?cursor_ref=pr_footer&cursor_cta=open_in_web"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/open-in-web-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/open-in-web-light.png"><img alt="Open in Web" width="114" height="28" src="https://cursor.com/assets/images/open-in-web-dark.png"></picture></a> <a href="https://cursor.com/background-agent?bcId=bc-7ffb619a-6ebb-4d47-9c45-d68e846edf93&cursor_ref=pr_footer&cursor_cta=open_in_cursor"><picture><source media="(prefers-color-scheme: dark)" srcset="https://cursor.com/assets/images/open-in-cursor-dark.png"><source media="(prefers-color-scheme: light)" srcset="https://cursor.com/assets/images/open-in-cursor-light.png"><img alt="Open in Cursor" width="131" height="28" src="https://cursor.com/assets/images/open-in-cursor-dark.png"></picture></a> </div> Co-authored-by: Cursor Agent <cursoragent@cursor.com> Co-authored-by: ksextonmelodic <ksextonmelodic@gmail.com>
Closes #3482
Summary
batch_read_lines_intotreated a trailing blank line as a read failure, soclean-batch.shreportedfile not foundfor a valid file ending ina\n\n.Fix
The helper's exit status is now a source-open verdict: 0 for ordinary EOF (including trailing blanks), 1 only when the named source is missing, not regular, or unopenable. Both batch CLIs trust that contract. Plugin 0.10.20.
Verification
scripts/affected-tests.sh --runpassed the three covering suites. Direct helper and both-CLI regressions cover trailing blanks, missing files, and unopenable files.Related
N/A