Write the missing tests for 90 os-sdlc survivors in cops (dry and other) #1655

Closed
opened 2026-11-09 22:13:08 +00:00 by jared · 1 comment
Owner

Problem

The second mutation pass (2026-11-09) left 90 survivors in 20 files under lib/os_sdlc/cops/ (outside structural/). No test kills them. A survivor means a changed behavior that the suite does not see. Ruling 100 puts a unit test for lib/os_sdlc/<path>.rb at test/os_sdlc/<path>_test.rb.

Observed

The pass ran bin/os-sdlc-mutation-pass run . on main at 38b3284d0. docs/research/mutation-testing/2026-11-09-second-pass/survivors.md lists each survivor with its original and mutated text. This ticket takes the groups that survivors.md classes as missing test. Each line below gives the file, its survivor count, and the mutation kinds.

  • lib/os_sdlc/cops/dry/repeated_path_literal/path_value.rb (14): return_nil 4, boolean_connector 3, condition_false 2, condition_true 2, boolean_literal 1, negation_removal 1, statement_removal 1
  • lib/os_sdlc/cops/require_inside_code.rb (11): condition_false 3, return_nil 3, statement_removal 3, boolean_connector 2
  • lib/os_sdlc/cops/dry/repeated_rescue_clause/member.rb (8): return_nil 3, condition_true 2, boolean_literal 1, condition_false 1, statement_removal 1
  • lib/os_sdlc/cops/dry/repeated_rescue_clause/group.rb (7): condition_false 2, condition_true 2, comparison 1, return_nil 1, statement_removal 1
  • lib/os_sdlc/cops/require_inside_code/call.rb (7): boolean_connector 4, condition_false 1, condition_true 1, return_nil 1
  • lib/os_sdlc/cops/minitest/tautological_assertion/same_subject_calls.rb (6): return_nil 2, boolean_connector 1, boolean_literal 1, condition_true 1, statement_removal 1
  • lib/os_sdlc/cops/dry/owned_message/send_match.rb (5): boolean_connector 1, boolean_literal 1, condition_true 1, return_nil 1, statement_removal 1
  • lib/os_sdlc/cops/dry/repeated_rescue_clause/handler.rb (5): condition_true 2, comparison 1, condition_false 1, return_nil 1
  • lib/os_sdlc/cops/dry/repeated_rescue_clause.rb (4): statement_removal 2, condition_false 1, condition_true 1
  • lib/os_sdlc/cops/sequel/ruby_filter_after_all.rb (4): condition_false 1, negation_removal 1, return_nil 1, statement_removal 1
  • lib/os_sdlc/cops/dry/repeated_collaborator_construction/group.rb (3): boolean_connector 1, condition_false 1, statement_removal 1
  • lib/os_sdlc/cops/minitest/require_in_test_method.rb (3): condition_true 1, return_nil 1, statement_removal 1
  • lib/os_sdlc/cops/require_inside_code/load_time_state.rb (3): boolean_connector 2, return_nil 1
  • lib/os_sdlc/cops/dry/hand_rolled_fetch.rb (2): condition_true 1, statement_removal 1
  • lib/os_sdlc/cops/dry/repeated_path_literal.rb (2): condition_true 1, statement_removal 1
  • lib/os_sdlc/cops/minitest/assertion_inside_loop.rb (2): condition_true 1, statement_removal 1
  • lib/os_sdlc/cops/dry/owned_message/spec.rb (1): boolean_literal 1
  • lib/os_sdlc/cops/dry/repeated_collaborator_construction/body.rb (1): boolean_connector 1
  • lib/os_sdlc/cops/dry/repeated_collaborator_construction/wiring.rb (1): return_nil 1
  • lib/os_sdlc/cops/require_inside_code/top_run.rb (1): boolean_literal 1

Reproduce

n/a: the survivors come from a whole pass. Verify with a targeted run: bin/os-sdlc-mutation-pass run <files> --no-matrix.

Approach

For each file listed, write the missing paired test at test/os_sdlc/<lib path>_test.rb (ruling 100). The test must kill each survivor of that file. When a survivor shows dead code (a branch no caller reaches), delete the code if no caller needs it, and write no test for it. When a survivor is equivalent (the mutant has the same behavior), rule it equivalent in a comment on this ticket with the reason. Then verify with a targeted --no-matrix run over the files of this ticket. Do not run a whole pass.

Required work: none beyond the acceptance criteria.

Acceptance criteria

  1. Given a targeted --no-matrix Mutineer run on the files listed in this ticket, when the run ends, then no survivor remains except ones that this ticket rules equivalent with a reason.
  2. Given a file that has a deleted dead-code candidate, when the suite runs, then it is green and no caller of the deleted code remains.

Origin

  • Trigger: second whole-codebase mutation pass, 2026-11-09 (docs/research/mutation-testing/2026-11-09-second-pass/)
  • Improvised this session: none
  • Chain: survivors ← no paired unit test for the file ← tests were written at the pipeline level, and the unit test per file (ruling 100) was never added ← DESIGN (ruling 100)
  • Root candidate: none found; searched survivor, mutation, mutineer, cops-other, missing tests
  • Where: lib/os_sdlc/cops/ (outside structural/)
  • Session: bc5ad309-36b7-4fe5-a67f-1d90187242eb
  • Transcript: /home/jared/.claude/projects/-home-jared-dev-cc-os-plugins-os-sdlc/bc5ad309-36b7-4fe5-a67f-1d90187242eb.jsonl

VERDICT: CREATE (ticket-skeptic, 2026-11-09): no open ticket covers these survivors.

## Problem The second mutation pass (2026-11-09) left 90 survivors in 20 files under lib/os_sdlc/cops/ (outside structural/). No test kills them. A survivor means a changed behavior that the suite does not see. Ruling 100 puts a unit test for `lib/os_sdlc/<path>.rb` at `test/os_sdlc/<path>_test.rb`. ## Observed The pass ran `bin/os-sdlc-mutation-pass run .` on main at 38b3284d0. `docs/research/mutation-testing/2026-11-09-second-pass/survivors.md` lists each survivor with its original and mutated text. This ticket takes the groups that `survivors.md` classes as `missing test`. Each line below gives the file, its survivor count, and the mutation kinds. - `lib/os_sdlc/cops/dry/repeated_path_literal/path_value.rb` (14): return_nil 4, boolean_connector 3, condition_false 2, condition_true 2, boolean_literal 1, negation_removal 1, statement_removal 1 - `lib/os_sdlc/cops/require_inside_code.rb` (11): condition_false 3, return_nil 3, statement_removal 3, boolean_connector 2 - `lib/os_sdlc/cops/dry/repeated_rescue_clause/member.rb` (8): return_nil 3, condition_true 2, boolean_literal 1, condition_false 1, statement_removal 1 - `lib/os_sdlc/cops/dry/repeated_rescue_clause/group.rb` (7): condition_false 2, condition_true 2, comparison 1, return_nil 1, statement_removal 1 - `lib/os_sdlc/cops/require_inside_code/call.rb` (7): boolean_connector 4, condition_false 1, condition_true 1, return_nil 1 - `lib/os_sdlc/cops/minitest/tautological_assertion/same_subject_calls.rb` (6): return_nil 2, boolean_connector 1, boolean_literal 1, condition_true 1, statement_removal 1 - `lib/os_sdlc/cops/dry/owned_message/send_match.rb` (5): boolean_connector 1, boolean_literal 1, condition_true 1, return_nil 1, statement_removal 1 - `lib/os_sdlc/cops/dry/repeated_rescue_clause/handler.rb` (5): condition_true 2, comparison 1, condition_false 1, return_nil 1 - `lib/os_sdlc/cops/dry/repeated_rescue_clause.rb` (4): statement_removal 2, condition_false 1, condition_true 1 - `lib/os_sdlc/cops/sequel/ruby_filter_after_all.rb` (4): condition_false 1, negation_removal 1, return_nil 1, statement_removal 1 - `lib/os_sdlc/cops/dry/repeated_collaborator_construction/group.rb` (3): boolean_connector 1, condition_false 1, statement_removal 1 - `lib/os_sdlc/cops/minitest/require_in_test_method.rb` (3): condition_true 1, return_nil 1, statement_removal 1 - `lib/os_sdlc/cops/require_inside_code/load_time_state.rb` (3): boolean_connector 2, return_nil 1 - `lib/os_sdlc/cops/dry/hand_rolled_fetch.rb` (2): condition_true 1, statement_removal 1 - `lib/os_sdlc/cops/dry/repeated_path_literal.rb` (2): condition_true 1, statement_removal 1 - `lib/os_sdlc/cops/minitest/assertion_inside_loop.rb` (2): condition_true 1, statement_removal 1 - `lib/os_sdlc/cops/dry/owned_message/spec.rb` (1): boolean_literal 1 - `lib/os_sdlc/cops/dry/repeated_collaborator_construction/body.rb` (1): boolean_connector 1 - `lib/os_sdlc/cops/dry/repeated_collaborator_construction/wiring.rb` (1): return_nil 1 - `lib/os_sdlc/cops/require_inside_code/top_run.rb` (1): boolean_literal 1 ## Reproduce n/a: the survivors come from a whole pass. Verify with a targeted run: `bin/os-sdlc-mutation-pass run <files> --no-matrix`. ## Approach For each file listed, write the missing paired test at `test/os_sdlc/<lib path>_test.rb` (ruling 100). The test must kill each survivor of that file. When a survivor shows dead code (a branch no caller reaches), delete the code if no caller needs it, and write no test for it. When a survivor is equivalent (the mutant has the same behavior), rule it equivalent in a comment on this ticket with the reason. Then verify with a targeted `--no-matrix` run over the files of this ticket. Do not run a whole pass. Required work: none beyond the acceptance criteria. ## Acceptance criteria 1. Given a targeted `--no-matrix` Mutineer run on the files listed in this ticket, when the run ends, then no survivor remains except ones that this ticket rules equivalent with a reason. 2. Given a file that has a deleted dead-code candidate, when the suite runs, then it is green and no caller of the deleted code remains. ## Origin - Trigger: second whole-codebase mutation pass, 2026-11-09 (`docs/research/mutation-testing/2026-11-09-second-pass/`) - Improvised this session: none - Chain: survivors ← no paired unit test for the file ← tests were written at the pipeline level, and the unit test per file (ruling 100) was never added ← DESIGN (ruling 100) - Root candidate: none found; searched survivor, mutation, mutineer, cops-other, missing tests - Where: lib/os_sdlc/cops/ (outside structural/) - Session: bc5ad309-36b7-4fe5-a67f-1d90187242eb - Transcript: /home/jared/.claude/projects/-home-jared-dev-cc-os-plugins-os-sdlc/bc5ad309-36b7-4fe5-a67f-1d90187242eb.jsonl VERDICT: CREATE (ticket-skeptic, 2026-11-09): no open ticket covers these survivors.
Author
Owner

Resolution

Done: Killed the dry, minitest, sequel, and require_inside_code cop survivors through each cop's test file (ruling 105) with the survivor loop: targeted mutineer packet per cop, haiku writes snippet tests, rerun verifies. Branch ticket-1655, commit 1b537fa37.

Evidence: Final targeted --no-matrix run over 10 cops (load 2.94): 433 mutants, 416 killed, 17 survived, 0 timeouts, 0 errors, score 96.1. 16 survivors are equivalent (truthiness-only predicates, nil vs empty string in interpolation, nil splat). Full suite 3,721 runs green on this branch; rubocop --cache false clean on the 10 changed test files; sonnet diff review found no defects. Record: docs/research/mutation-testing/2026-11-10-survivor-loop/final_summary_1655.tsv.

Follow-ups: One survivor needs a ruling, in the session handoff: require_inside_code line 27 (mutant 7309435e2179) shows that an alias of a load-path global is not a load-time change; a test would fix that behavior in place. #1668 covers the loop itself.

## Resolution **Done:** Killed the dry, minitest, sequel, and require_inside_code cop survivors through each cop's test file (ruling 105) with the survivor loop: targeted mutineer packet per cop, haiku writes snippet tests, rerun verifies. Branch ticket-1655, commit 1b537fa37. **Evidence:** Final targeted --no-matrix run over 10 cops (load 2.94): 433 mutants, 416 killed, 17 survived, 0 timeouts, 0 errors, score 96.1. 16 survivors are equivalent (truthiness-only predicates, nil vs empty string in interpolation, nil splat). Full suite 3,721 runs green on this branch; rubocop --cache false clean on the 10 changed test files; sonnet diff review found no defects. Record: docs/research/mutation-testing/2026-11-10-survivor-loop/final_summary_1655.tsv. **Follow-ups:** One survivor needs a ruling, in the session handoff: require_inside_code line 27 (mutant 7309435e2179) shows that an alias of a load-path global is not a load-time change; a test would fix that behavior in place. #1668 covers the loop itself. <!-- os-backlog kind: resolution -->
jared closed this issue 2026-11-10 13:39:39 +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#1655
No description provided.