CRC wave 5: split RollbackPerTest #1139

Closed
opened 2026-10-18 21:07:45 +00:00 by jared · 2 comments
Owner

Problem

plugins/os-sdlc/tests/test_helper.rb (RollbackPerTest) has the job sentence "This object owns the test process setup and the cop helper and fake runner and fake git that test files share.", which holds two jobs. Extract it into separate files.

Reproduce

n/a: structure-only refactor, no behavior change.

Approach

  1. Required work:
    • split plugins/os-sdlc/tests/test_helper.rb (RollbackPerTest)
    • public methods: run
    • test: no test file
    • Part names: read the governing rulings below. Where they name no part, choose the names at extraction.
    • Before you finish, grep the repository for the old file path, not only the constant.
  2. Governing rulings:
    • R59
    • R119

Acceptance criteria

  • Every named ledger row is applied, or logged in deviations.md, or reported blocked.
  • cd plugins/os-sdlc && ruby tests/all.rb 0 failures.
  • ruby -e 'require "./plugins/os-sdlc/lib/os_sdlc"; OsSdlc::Db.connect!(":memory:"); OsSdlc.loader.eager_load' silent.
  • plugins/os-sdlc/bin/lint-sweep shows no unexplained new line.

Owner sketch

Each part owns one job; the old file is removed.

Non-goals

  • No behavior change.
  • No new tests.
  • No deletion of code that has callers.

Origin

  • Session: ca7a7686-22a8-4463-86d5-c542e7d9f215
  • Transcript: /home/jared/.claude/projects/-home-jared-dev-cc-os/ca7a7686-22a8-4463-86d5-c542e7d9f215.jsonl
  • Where: plugins/os-sdlc/tests/test_helper.rb
  • CRC refactor run: docs/crc/os-sdlc.
  • Ledger: docs/crc/os-sdlc/ledger.tsv
  • Wave: 5.
## Problem `plugins/os-sdlc/tests/test_helper.rb` (`RollbackPerTest`) has the job sentence "This object owns the test process setup and the cop helper and fake runner and fake git that test files share.", which holds two jobs. Extract it into separate files. ## Reproduce n/a: structure-only refactor, no behavior change. ## Approach 1. Required work: - split `plugins/os-sdlc/tests/test_helper.rb` (`RollbackPerTest`) - public methods: run - test: no test file - Part names: read the governing rulings below. Where they name no part, choose the names at extraction. - Before you finish, grep the repository for the old file path, not only the constant. 2. Governing rulings: - R59 - R119 ## Acceptance criteria - Every named ledger row is applied, or logged in deviations.md, or reported blocked. - `cd plugins/os-sdlc && ruby tests/all.rb` 0 failures. - `ruby -e 'require "./plugins/os-sdlc/lib/os_sdlc"; OsSdlc::Db.connect!(":memory:"); OsSdlc.loader.eager_load'` silent. - `plugins/os-sdlc/bin/lint-sweep` shows no unexplained new line. ## Owner sketch Each part owns one job; the old file is removed. ## Non-goals - No behavior change. - No new tests. - No deletion of code that has callers. ## Origin - Session: ca7a7686-22a8-4463-86d5-c542e7d9f215 - Transcript: /home/jared/.claude/projects/-home-jared-dev-cc-os/ca7a7686-22a8-4463-86d5-c542e7d9f215.jsonl - Where: plugins/os-sdlc/tests/test_helper.rb - CRC refactor run: docs/crc/os-sdlc. - Ledger: docs/crc/os-sdlc/ledger.tsv - Wave: 5.
Author
Owner

07c9deff; rows applied 1/1; parts: CopHelpers, FakeRunner, FakeGit; rows deviated 0; rows blocked 0

07c9deff; rows applied 1/1; parts: CopHelpers, FakeRunner, FakeGit; rows deviated 0; rows blocked 0
Author
Owner

Resolution

Done: split test_helper.rb: CopHelpers (was CopTestHelper), FakeRunner, FakeGit moved to tests/support; 36 cop tests include renamed

Evidence: 07c9deff; suite: 2129 runs, 4792 assertions, 0 failures, 0 errors, 0 skips; eager load silent; rubocop .rubocop.yml lib tests 34 offenses in 19 files (baseline, none in changed files); inward sweep from plugins/os-sdlc/: 0 baseline lines gone, 0 unmapped, 15 unmasked pre-existing edges recorded in docs/crc/os-sdlc/deviations.md; ledger docs/crc/os-sdlc/ledger.tsv commit column stamped

Follow-ups: #1141 dead-code ticket covers fake_git.rb's only users (Git::Branch, Git::Worktree); FakeRunner vs FakeTwoCallRunner/FakeSplitCaptureRunner near-duplicates listed in the HANDOFF Review (both fakes are in #1141's deletion list)

## Resolution **Done:** split test_helper.rb: CopHelpers (was CopTestHelper), FakeRunner, FakeGit moved to tests/support; 36 cop tests include renamed **Evidence:** 07c9deff; suite: 2129 runs, 4792 assertions, 0 failures, 0 errors, 0 skips; eager load silent; rubocop .rubocop.yml lib tests 34 offenses in 19 files (baseline, none in changed files); inward sweep from plugins/os-sdlc/: 0 baseline lines gone, 0 unmapped, 15 unmasked pre-existing edges recorded in docs/crc/os-sdlc/deviations.md; ledger docs/crc/os-sdlc/ledger.tsv commit column stamped **Follow-ups:** #1141 dead-code ticket covers fake_git.rb's only users (Git::Branch, Git::Worktree); FakeRunner vs FakeTwoCallRunner/FakeSplitCaptureRunner near-duplicates listed in the HANDOFF Review (both fakes are in #1141's deletion list)
jared closed this issue 2026-10-18 23:33:46 +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#1139
No description provided.