Detector::CopSites runner replaces the Commissioner loop in crc/holders/site_offenses.rb #1228

Closed
opened 2026-10-22 12:28:02 +00:00 by jared · 1 comment
Owner

Problem

Step 1 of Phase 1 in docs/crc/os-sdlc/detector-plan.md moves the RuboCop Commissioner loop out of the holders detector. Today crc/holders/site_offenses.rb owns that loop. No other detector can reuse it. Each detector that wants a cop must copy the loop.

Reproduce

n/a: design ticket

Approach

Create plugins/os-sdlc/lib/os_sdlc/detector/cop_sites.rb. The contract is CopSites.new(cops, config).findings(path). It returns structs of path line cop keys. The runner reads each cop's findings list after RuboCop::Cop::Commissioner investigates the file. An os-sdlc cop records one finding struct beside each add_offense call. Crc::Holders calls the runner for site_offenses. The holders TSV output does not change.

Required work:

  1. Create the runner module in the new detector directory — check: present module Detector in plugins/os-sdlc/lib/os_sdlc/detector/*.rb
  2. Remove the Commissioner loop from the holders detector and call the runner — check: absent Commissioner in plugins/os-sdlc/lib/os_sdlc/crc/holders/**/*.rb

Acceptance criteria

  1. Given a cop that records findings, when CopSites.new(cops, config).findings(path) runs on a file, then it returns one struct with path line cop keys for each recorded finding.
  2. Given the holders detector, when it runs site_offenses, then it calls the runner and the TSV output is the same as before.
  3. Given the existing holders tests, when the suite runs, then they stay green.

Origin

  • Session: b2f2f23b-2a60-45d3-8f2c-f66275d9ab4f
  • Transcript: /home/jared/.claude/projects/-home-jared-dev-cc-os/b2f2f23b-2a60-45d3-8f2c-f66275d9ab4f.jsonl
  • Where: docs/crc/os-sdlc/detector-plan.md
  • Root candidate: none found; searched CopSites, cop_sites, Commissioner, site_offenses, detector-plan, Detector

VERDICT: CREATE

## Problem Step 1 of Phase 1 in docs/crc/os-sdlc/detector-plan.md moves the RuboCop Commissioner loop out of the holders detector. Today crc/holders/site_offenses.rb owns that loop. No other detector can reuse it. Each detector that wants a cop must copy the loop. ## Reproduce n/a: design ticket ## Approach Create `plugins/os-sdlc/lib/os_sdlc/detector/cop_sites.rb`. The contract is `CopSites.new(cops, config).findings(path)`. It returns structs of `path line cop keys`. The runner reads each cop's `findings` list after `RuboCop::Cop::Commissioner` investigates the file. An os-sdlc cop records one finding struct beside each `add_offense` call. `Crc::Holders` calls the runner for `site_offenses`. The holders TSV output does not change. Required work: 1. Create the runner module in the new detector directory — check: present `module Detector` in `plugins/os-sdlc/lib/os_sdlc/detector/*.rb` 2. Remove the Commissioner loop from the holders detector and call the runner — check: absent `Commissioner` in `plugins/os-sdlc/lib/os_sdlc/crc/holders/**/*.rb` ## Acceptance criteria 1. Given a cop that records findings, when `CopSites.new(cops, config).findings(path)` runs on a file, then it returns one struct with `path line cop keys` for each recorded finding. 2. Given the holders detector, when it runs `site_offenses`, then it calls the runner and the TSV output is the same as before. 3. Given the existing holders tests, when the suite runs, then they stay green. ## Origin - Session: b2f2f23b-2a60-45d3-8f2c-f66275d9ab4f - Transcript: /home/jared/.claude/projects/-home-jared-dev-cc-os/b2f2f23b-2a60-45d3-8f2c-f66275d9ab4f.jsonl - Where: docs/crc/os-sdlc/detector-plan.md - Root candidate: none found; searched CopSites, cop_sites, Commissioner, site_offenses, detector-plan, Detector VERDICT: CREATE
Author
Owner

Resolution

Done: Detector::CopSites (lib/os_sdlc/detector/cop_sites.rb) runs a cop list over one file through RuboCop::Cop::Commissioner and returns the Finding(path, line, cop, facts) rows each RecordingCop records through report(node, message:, **facts). Crc::Holders::SiteOffenses calls the runner; its output is byte-identical.

Evidence: fast-batch-7 merged to main ae057ddd: commits 1de2554f e1400851 2fbced02 d8af9b2d 3c1de83f; suite 2369 runs 0 failures; memo docs/crc/os-sdlc/fast-batch-7/finding-a-cop-sites-runner.md; tests tests/detector/cop_sites_test.rb tests/detector/recording_cop_test.rb

Follow-ups: none

## Resolution **Done:** Detector::CopSites (lib/os_sdlc/detector/cop_sites.rb) runs a cop list over one file through RuboCop::Cop::Commissioner and returns the Finding(path, line, cop, facts) rows each RecordingCop records through report(node, message:, **facts). Crc::Holders::SiteOffenses calls the runner; its output is byte-identical. **Evidence:** fast-batch-7 merged to main ae057ddd: commits 1de2554f e1400851 2fbced02 d8af9b2d 3c1de83f; suite 2369 runs 0 failures; memo docs/crc/os-sdlc/fast-batch-7/finding-a-cop-sites-runner.md; tests tests/detector/cop_sites_test.rb tests/detector/recording_cop_test.rb **Follow-ups:** none
jared closed this issue 2026-10-22 12:56:12 +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#1228
No description provided.