os-sdlc test suite writes stray '(string)' artifact into plugin tree #234

Closed
opened 2026-08-02 15:02:00 +00:00 by jared · 2 comments
Owner

Running ruby tests/all.rb in plugins/os-sdlc leaves a stray '(string)' path in the plugin root. Pre-existing on main (reproduced 2026-08-02 during #229 work); likely a rubocop -a real run whose in-memory source has no path. Test-isolation defect: suite should have zero filesystem side effects outside tmpdirs.

Running ruby tests/all.rb in plugins/os-sdlc leaves a stray '(string)' path in the plugin root. Pre-existing on main (reproduced 2026-08-02 during #229 work); likely a rubocop -a real run whose in-memory source has no path. Test-isolation defect: suite should have zero filesystem side effects outside tmpdirs.
Author
Owner

Triage: confirmed bug, kept open over duplicate #237 (this one has the more specific root-cause hypothesis and acceptance bar). Agent Brief -- Category: bug/update. Summary: ruby tests/all.rb leaves a stray file named '(string)' in plugins/os-sdlc/ root. Current: test suite has filesystem side effects outside tmpdirs. Desired: zero side effects outside tmpdirs; locate the test writing to a path derived from a nil/placeholder name (likely rubocop -a on in-memory source with no path) and route it to a tmpdir. Acceptance: running the suite leaves no stray files in the plugin tree. Out of scope: unrelated rubocop/report parsing (see #236). Labels: bug, ready-for-agent, update.

Triage: confirmed bug, kept open over duplicate #237 (this one has the more specific root-cause hypothesis and acceptance bar). Agent Brief -- Category: bug/update. Summary: ruby tests/all.rb leaves a stray file named '(string)' in plugins/os-sdlc/ root. Current: test suite has filesystem side effects outside tmpdirs. Desired: zero side effects outside tmpdirs; locate the test writing to a path derived from a nil/placeholder name (likely rubocop -a on in-memory source with no path) and route it to a tmpdir. Acceptance: running the suite leaves no stray files in the plugin tree. Out of scope: unrelated rubocop/report parsing (see #236). Labels: bug, ready-for-agent, update.
Author
Owner

Fixed in 4c7e139. Root cause: tests/test_helper.rb autocorrected_source_for ran RuboCop::Cop::Team with autocorrect:true on in-memory snippets (nil path); Team#autocorrect File.writes to processed_source.file_path, which defaults to the buffer name '(string)'. Fix: team.defer_corrections = true (helper already reads via corrector.rewrite). Regression test added (red before, green after); suite 579 runs green, no stray file. Blast radius checked: production unaffected — AutocorrectPrepass shells out to the rubocop CLI with real paths, never the in-process API.

Fixed in 4c7e139. Root cause: tests/test_helper.rb autocorrected_source_for ran RuboCop::Cop::Team with autocorrect:true on in-memory snippets (nil path); Team#autocorrect File.writes to processed_source.file_path, which defaults to the buffer name '(string)'. Fix: team.defer_corrections = true (helper already reads via corrector.rewrite). Regression test added (red before, green after); suite 579 runs green, no stray file. Blast radius checked: production unaffected — AutocorrectPrepass shells out to the rubocop CLI with real paths, never the in-process API.
jared closed this issue 2026-08-02 20:04:01 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
jared/cc-os#234
No description provided.