Reconsider project_index_test raw-content assertion rather than exempting RawFileContentAssertion #304

Open
opened 2026-08-06 22:26:32 +00:00 by jared · 1 comment
Owner

Context

The os-backlog fix-lints run (2026-08-06) left one offense standing: Sdlc/Structural/RawFileContentAssertion at plugins/os-backlog/tests/project_index_test.rb:28. The test asserts a corrupt index file survives byte-for-byte after a read — ProjectIndex#all swallows corrupt JSON into {} by design ('read paths never rewrite', project_index.rb:13-14), so no parsed reader can prove the bytes were untouched, and a scoped Exclude in .rubocop.yml was the proposed fix. User call: an offense with no reasonable in-code fix suggests the code/test design itself should be re-examined before an exemption is granted. Investigate whether ProjectIndex should expose a way to verify the no-rewrite-on-read invariant (or whether the cop/test shape should change), instead of excluding the file.

## Context The os-backlog fix-lints run (2026-08-06) left one offense standing: Sdlc/Structural/RawFileContentAssertion at plugins/os-backlog/tests/project_index_test.rb:28. The test asserts a corrupt index file survives byte-for-byte after a read — ProjectIndex#all swallows corrupt JSON into {} by design ('read paths never rewrite', project_index.rb:13-14), so no parsed reader can prove the bytes were untouched, and a scoped Exclude in .rubocop.yml was the proposed fix. User call: an offense with no reasonable in-code fix suggests the code/test design itself should be re-examined before an exemption is granted. Investigate whether ProjectIndex should expose a way to verify the no-rewrite-on-read invariant (or whether the cop/test shape should change), instead of excluding the file.
Author
Owner

Frozen in the 2026-08-16 backlog reset — see #419 for the expiry procedure. Do not work unless a live run rediscovers this issue.

Frozen in the 2026-08-16 backlog reset — see #419 for the expiry procedure. Do not work unless a live run rediscovers this issue.
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#304
No description provided.