Cover the uncovered daemon LSP session mutants with a recorded ruby-lsp fixture #1693

Closed
opened 2026-11-11 16:24:16 +00:00 by jared · 2 comments
Owner

Problem

The second mutation pass (2026-11-09) left 97 uncovered mutants in 11 files under lib/os_sdlc/daemon/ (lsp_session/, transport/, and the LSP request files). No test runs the code at these mutants. An uncovered mutant is code that the suite never executes, so a change there goes unseen. Ruling 100 puts a unit test for lib/os_sdlc/<path>.rb at test/os_sdlc/<path>_test.rb.

Observed

The second mutation pass ran bin/os-sdlc-mutation-pass run . on 2026-11-09. .mutineer/pass.json lists 97 mutants in this ticket under no_coverage. A no_coverage mutant is a changed behavior that no test runs. The survivor tickets #1656 to #1664 took only the survived mutants, so no ticket covers these. Each line below gives the file, its uncovered count, and the mutation kinds.

  • lib/os_sdlc/daemon/lsp_session.rb (24): statement_removal 12, return_nil 8, boolean_literal 4
  • lib/os_sdlc/daemon/lsp_session/transport/framing.rb (20): statement_removal 8, return_nil 6, boolean_literal 2, condition_false 2, condition_true 2
  • lib/os_sdlc/daemon/navigation.rb (16): return_nil 10, statement_removal 3, boolean_literal 1, condition_false 1, condition_true 1
  • lib/os_sdlc/daemon/lsp_session/transport.rb (11): return_nil 4, boolean_literal 3, statement_removal 2, condition_false 1, condition_true 1
  • lib/os_sdlc/daemon/lsp_session/readiness.rb (7): return_nil 2, statement_removal 2, boolean_literal 1, condition_false 1, condition_true 1
  • lib/os_sdlc/daemon/lsp_session/outline_request.rb (6): return_nil 4, statement_removal 2
  • lib/os_sdlc/daemon/lsp_session/location_request.rb (5): boolean_literal 1, condition_false 1, condition_true 1, return_nil 1, statement_removal 1
  • lib/os_sdlc/daemon/lsp_session/handshake.rb (4): boolean_literal 2, return_nil 1, statement_removal 1
  • lib/os_sdlc/daemon/lsp_session/opener.rb (2): return_nil 2
  • lib/os_sdlc/daemon/lsp_session/definition_request.rb (1): return_nil 1
  • lib/os_sdlc/daemon/lsp_session/target.rb (1): return_nil 1

Reproduce

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

Approach

For each listed file, write the paired unit test at test/os_sdlc/<lib path>_test.rb (ruling 100). The test must run the uncovered code and kill its mutants. Check the older test locations first (test/cops/, test/daemon/, test/lint/, test/system_model_*). A test there may already cover the file and only need a move or an extension. Where the code calls a process, use an adapter and a recorded fixture (ruling 88). Reuse test/support/process_recording.rb and the recorded_* doubles. No test starts a real process. No recorded ruby-lsp fixture exists in test/fixtures/process_recordings/. Add one through the process_recording pattern. Refresh it only through a deliberate record command (ruling 88). The framing code is pure logic, so test it directly with no process.

When a mutant shows dead code (code no caller reaches), delete the code and write no test for it (ruling 107). When a mutant is equivalent (the mutant has the same behavior), rule it equivalent in a comment on this ticket with the reason. Follow plugins/os-sdlc/references/survivor-loop.md. 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 it reports no uncovered mutant and no survivor, except ones that this ticket deletes or rules equivalent with a reason.
  2. Given a file with deleted unreachable code, when the suite runs, then it is green and no caller of the deleted code remains.

Origin

  • Trigger: #1683 split, 2026-11-11
  • Improvised this session: none
  • Chain: uncovered mutants ← survivor tickets #1656-#1664 took only survived mutants ← the second pass split only survivors into tickets ← DESIGN (docs/research/mutation-testing/2026-11-09-second-pass/)
  • Root candidate: none found; searched uncovered, no_coverage, mutant, daemon, LSP, ruby-lsp, transport, framing
  • Where: lib/os_sdlc/daemon/ (lsp_session/, transport/, and the LSP request files)
  • Parent: #1683
  • Session: 974224e0-190b-4ca9-814e-eb971a24f35a
  • Transcript: /home/jared/.claude/projects/-home-jared-dev-cc-os-plugins-os-sdlc/974224e0-190b-4ca9-814e-eb971a24f35a.jsonl

VERDICT: CREATE (ticket-skeptic, 2026-11-11): child of the #1683 required split; no open ticket covers these files.

## Problem The second mutation pass (2026-11-09) left 97 uncovered mutants in 11 files under lib/os_sdlc/daemon/ (lsp_session/, transport/, and the LSP request files). No test runs the code at these mutants. An uncovered mutant is code that the suite never executes, so a change there goes unseen. Ruling 100 puts a unit test for `lib/os_sdlc/<path>.rb` at `test/os_sdlc/<path>_test.rb`. ## Observed The second mutation pass ran `bin/os-sdlc-mutation-pass run .` on 2026-11-09. `.mutineer/pass.json` lists 97 mutants in this ticket under `no_coverage`. A no_coverage mutant is a changed behavior that no test runs. The survivor tickets #1656 to #1664 took only the survived mutants, so no ticket covers these. Each line below gives the file, its uncovered count, and the mutation kinds. - `lib/os_sdlc/daemon/lsp_session.rb` (24): statement_removal 12, return_nil 8, boolean_literal 4 - `lib/os_sdlc/daemon/lsp_session/transport/framing.rb` (20): statement_removal 8, return_nil 6, boolean_literal 2, condition_false 2, condition_true 2 - `lib/os_sdlc/daemon/navigation.rb` (16): return_nil 10, statement_removal 3, boolean_literal 1, condition_false 1, condition_true 1 - `lib/os_sdlc/daemon/lsp_session/transport.rb` (11): return_nil 4, boolean_literal 3, statement_removal 2, condition_false 1, condition_true 1 - `lib/os_sdlc/daemon/lsp_session/readiness.rb` (7): return_nil 2, statement_removal 2, boolean_literal 1, condition_false 1, condition_true 1 - `lib/os_sdlc/daemon/lsp_session/outline_request.rb` (6): return_nil 4, statement_removal 2 - `lib/os_sdlc/daemon/lsp_session/location_request.rb` (5): boolean_literal 1, condition_false 1, condition_true 1, return_nil 1, statement_removal 1 - `lib/os_sdlc/daemon/lsp_session/handshake.rb` (4): boolean_literal 2, return_nil 1, statement_removal 1 - `lib/os_sdlc/daemon/lsp_session/opener.rb` (2): return_nil 2 - `lib/os_sdlc/daemon/lsp_session/definition_request.rb` (1): return_nil 1 - `lib/os_sdlc/daemon/lsp_session/target.rb` (1): return_nil 1 ## Reproduce n/a: the uncovered mutants come from a whole pass. Verify with a targeted run: `bin/os-sdlc-mutation-pass run <files> --no-matrix`. ## Approach For each listed file, write the paired unit test at `test/os_sdlc/<lib path>_test.rb` (ruling 100). The test must run the uncovered code and kill its mutants. Check the older test locations first (`test/cops/`, `test/daemon/`, `test/lint/`, `test/system_model_*`). A test there may already cover the file and only need a move or an extension. Where the code calls a process, use an adapter and a recorded fixture (ruling 88). Reuse `test/support/process_recording.rb` and the `recorded_*` doubles. No test starts a real process. No recorded ruby-lsp fixture exists in `test/fixtures/process_recordings/`. Add one through the `process_recording` pattern. Refresh it only through a deliberate record command (ruling 88). The framing code is pure logic, so test it directly with no process. When a mutant shows dead code (code no caller reaches), delete the code and write no test for it (ruling 107). When a mutant is equivalent (the mutant has the same behavior), rule it equivalent in a comment on this ticket with the reason. Follow `plugins/os-sdlc/references/survivor-loop.md`. 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 it reports no uncovered mutant and no survivor, except ones that this ticket deletes or rules equivalent with a reason. 2. Given a file with deleted unreachable code, when the suite runs, then it is green and no caller of the deleted code remains. ## Origin - Trigger: #1683 split, 2026-11-11 - Improvised this session: none - Chain: uncovered mutants ← survivor tickets #1656-#1664 took only survived mutants ← the second pass split only `survivors` into tickets ← DESIGN (`docs/research/mutation-testing/2026-11-09-second-pass/`) - Root candidate: none found; searched uncovered, no_coverage, mutant, daemon, LSP, ruby-lsp, transport, framing - Where: lib/os_sdlc/daemon/ (lsp_session/, transport/, and the LSP request files) - Parent: #1683 - Session: 974224e0-190b-4ca9-814e-eb971a24f35a - Transcript: /home/jared/.claude/projects/-home-jared-dev-cc-os-plugins-os-sdlc/974224e0-190b-4ca9-814e-eb971a24f35a.jsonl VERDICT: CREATE (ticket-skeptic, 2026-11-11): child of the #1683 required split; no open ticket covers these files.
Author
Owner

Work started on branch ticket-1693 (survivor loop, recorded ruby-lsp fixture).

Work started on branch ticket-1693 (survivor loop, recorded ruby-lsp fixture).
Author
Owner

Resolution

Done: Survivor loop over the 11 daemon LSP files in 2 packets; 22 tests (lsp_session 4, new opener 1, new transport 4, new transport/framing 4, handshake 2, navigation 7). The ruby-lsp start moved to the new adapter LspSession::ServerProcess (bin/lsp-probe -> Opener -> LspSession.open(server:)). A recorded ruby-lsp transcript (test/fixtures/process_recordings/ruby_lsp/, written by test/support/lsp_server_tap.rb over a small fixed tree; refresh entry ruby_lsp) replays through test/support/recorded_lsp_server.rb; no test starts ruby-lsp. Fix found on the way: the handshake now declares window.workDoneProgress; ruby-lsp 0.26.11 sends $/progress only then, so readiness had waited out its 3-second timeout on every session start. Ruling 107 deleted io.flush in Transport::Framing (every caller's stdin is sync). Equivalent rulings: a037167e8119 (add_line false vs nil, read only by break unless), 10272ebef7d0 (drain rescue value never read), 9c2ee027e224 (close discards the request_shutdown rescue value).

Evidence: main d5ea53c8b (merged; e357262f3 refactor, 07e780513 fix). Orchestrator re-ran both packets: group A 0 survivors of 117, 3 uncovered (before 0 of 65, 56 uncovered); navigation 0 of 26, 0 uncovered (before 13 uncovered). Suite run twice: 5046 runs, 0 failures. Rubocop clean on 19 files. Orchestrator smoke test against real ruby-lsp from the branch: lsp-probe symbols Opener and outline give the same result as main.

Follow-ups: none. 3 ServerProcess#start mutants (6814b5f00d46, cfc15075e137, 79fe1bc39584) sit on the real Open3 call and stay visible per ruling 137; noted on #1683.

## Resolution **Done:** Survivor loop over the 11 daemon LSP files in 2 packets; 22 tests (lsp_session 4, new opener 1, new transport 4, new transport/framing 4, handshake 2, navigation 7). The ruby-lsp start moved to the new adapter LspSession::ServerProcess (bin/lsp-probe -> Opener -> LspSession.open(server:)). A recorded ruby-lsp transcript (test/fixtures/process_recordings/ruby_lsp/, written by test/support/lsp_server_tap.rb over a small fixed tree; refresh entry ruby_lsp) replays through test/support/recorded_lsp_server.rb; no test starts ruby-lsp. Fix found on the way: the handshake now declares window.workDoneProgress; ruby-lsp 0.26.11 sends $/progress only then, so readiness had waited out its 3-second timeout on every session start. Ruling 107 deleted io.flush in Transport::Framing (every caller's stdin is sync). Equivalent rulings: a037167e8119 (add_line false vs nil, read only by break unless), 10272ebef7d0 (drain rescue value never read), 9c2ee027e224 (close discards the request_shutdown rescue value). **Evidence:** main d5ea53c8b (merged; e357262f3 refactor, 07e780513 fix). Orchestrator re-ran both packets: group A 0 survivors of 117, 3 uncovered (before 0 of 65, 56 uncovered); navigation 0 of 26, 0 uncovered (before 13 uncovered). Suite run twice: 5046 runs, 0 failures. Rubocop clean on 19 files. Orchestrator smoke test against real ruby-lsp from the branch: lsp-probe symbols Opener and outline give the same result as main. **Follow-ups:** none. 3 ServerProcess#start mutants (6814b5f00d46, cfc15075e137, 79fe1bc39584) sit on the real Open3 call and stay visible per ruling 137; noted on #1683. <!-- os-backlog kind: resolution -->
jared closed this issue 2026-11-11 18:02:58 +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#1693
No description provided.