lint-worklist raises UnmappedCop on the os-sdlc target for Layout, Style, and Sdlc/Sequel cops #1020

Open
opened 2026-10-16 15:39:30 +00:00 by jared · 2 comments
Owner

Problem

bin/lint-worklist --target os-sdlc cannot produce a worklist. Worklist#raise_if_unmapped raises for every offending cop that CopPhase#phase returns nil for.
The gate config enables the whole Layout department (Layout: Enabled: true), Style/FrozenStringLiteralComment, and Sdlc/Sequel/*.
CopPhase maps only the listed cops and the Sdlc/Dry/ and Sdlc/Structural/ departments.
Any enabled cop outside those lists that fires in the target crashes the worklist instead of being placed in a phase.
The 2026-10-16 ruling on Layout/LineLength (docs/research/lint-lessons/layout-line-length.md section 10) says it is polish and autocorrect-only. This suggests Layout/ belongs in the autocorrect phase. The Style and Sdlc/Sequel cops need their own placement.

Observed

plugins/os-sdlc/bin/lint-worklist --target os-sdlc
.../plugins/os-sdlc/lib/os_sdlc/model/worklist.rb:67:in 'OsSdlc::Worklist#raise_if_unmapped': no fix-lints phase mapped for cop(s): Layout/EmptyLinesAroundClassBody, Layout/FirstArgumentIndentation, Layout/LineLength, Sdlc/Sequel/InlineDatasetQuery, Style/FrozenStringLiteralComment (OsSdlc::Worklist::UnmappedCop)
	from .../plugins/os-sdlc/lib/os_sdlc/model/worklist.rb:15:in 'OsSdlc::Worklist#initialize'
	from .../plugins/os-sdlc/lib/os_sdlc/controller/lint_worklist.rb:37:in 'OsSdlc::LintWorklist.rubocop_run'
	from .../plugins/os-sdlc/lib/os_sdlc/controller/lint_worklist.rb:15:in 'OsSdlc::LintWorklist.run'
	from plugins/os-sdlc/bin/lint-worklist:10:in '<main>'

Offenses named, from bundle exec rubocop in plugins/os-sdlc (first examples):

  • Layout/LineLength: lib/os_sdlc/command/lsp_session/handshake.rb:26, tests/evidence_bin_test.rb:13
  • Layout/FirstArgumentIndentation: eval/ticket-takedown/test/controller/implement_body_cli_test.rb:17
  • Layout/EmptyLinesAroundClassBody: eval/ticket-takedown/test/presenter/run_summary_test.rb:15
  • Sdlc/Sequel/InlineDatasetQuery: tests/model/dispatch_test.rb:211
  • Style/FrozenStringLiteralComment: eval/ticket-takedown/results/prism-architect/scripts/bundle.rb:1

None of these files is in git status --short, so uncommitted #1014 work does not cause the crash.
CopPhase#phase today:

def phase
  return :autocorrect if AUTOCORRECT_COPS.include?(@cop)
  return :batch if batch?
  return :iterative if iterative?

  nil
end

Department lists: BATCH_DEPARTMENTS = %w[Sdlc/Dry/] and ITERATIVE_DEPARTMENTS = %w[Sdlc/Structural/]. AUTOCORRECT_COPS holds only Minitest/Assert* and Minitest/Refute* cops.

Reproduce

plugins/os-sdlc/bin/lint-worklist --target os-sdlc

Approach

Map departments, not single cops: Layout/ to :autocorrect; Style/FrozenStringLiteralComment to :autocorrect; Sdlc/Sequel/ to :batch.
Add a test that enumerates the enabled cops from the merged rubocop config and asserts each has a phase. Then the config and the phase map cannot drift again.

Required work:

  1. Map Layout/ and Sdlc/Sequel/ departments and Style/FrozenStringLiteralComment in CopPhase — check: present Sdlc/Sequel/ in plugins/os-sdlc/lib/os_sdlc/model/worklist/cop_phase.rb
  2. Add a test that fails and names any enabled cop with no phase — check: present CopPhase in plugins/os-sdlc/tests/**/*cop_phase*_test.rb

Acceptance criteria

  1. Given the os-sdlc target at the current tree, when bin/lint-worklist --target os-sdlc runs, then it prints a worklist or "Worklist clear" and does not raise.
  2. Given an enabled cop with no phase mapping, when the cop-phase test runs, then it fails and names the cop.

Origin

  • Trigger: plugins/os-sdlc/bin/lint-worklist --target os-sdlc
  • Improvised this session: none
  • Chain: UnmappedCop crash ← CopPhase lists omit enabled Layout, Style, Sdlc/Sequel cops ← DESIGN (plugins/os-sdlc/lib/os_sdlc/model/worklist/cop_phase.rb)
  • Root candidate: none
  • Where: plugins/os-sdlc/lib/os_sdlc/model/worklist/cop_phase.rb, plugins/os-sdlc/lib/os_sdlc/model/worklist.rb
  • Session: 983d18f5-eb86-409f-a7ca-daea277fedf5
  • Transcript: /home/jared/.claude/projects/-home-jared-dev-cc-os--claude-worktrees-lint-lessons/983d18f5-eb86-409f-a7ca-daea277fedf5.jsonl
    Found 2026-10-16 during the hand-finish of #1014 (implementation 51) in worktree lint-lessons.

VERDICT: CREATE

## Problem `bin/lint-worklist --target os-sdlc` cannot produce a worklist. `Worklist#raise_if_unmapped` raises for every offending cop that `CopPhase#phase` returns nil for. The gate config enables the whole `Layout` department (`Layout: Enabled: true`), `Style/FrozenStringLiteralComment`, and `Sdlc/Sequel/*`. `CopPhase` maps only the listed cops and the `Sdlc/Dry/` and `Sdlc/Structural/` departments. Any enabled cop outside those lists that fires in the target crashes the worklist instead of being placed in a phase. The 2026-10-16 ruling on Layout/LineLength (`docs/research/lint-lessons/layout-line-length.md` section 10) says it is polish and autocorrect-only. This suggests `Layout/` belongs in the autocorrect phase. The Style and `Sdlc/Sequel` cops need their own placement. ## Observed ``` plugins/os-sdlc/bin/lint-worklist --target os-sdlc ``` ``` .../plugins/os-sdlc/lib/os_sdlc/model/worklist.rb:67:in 'OsSdlc::Worklist#raise_if_unmapped': no fix-lints phase mapped for cop(s): Layout/EmptyLinesAroundClassBody, Layout/FirstArgumentIndentation, Layout/LineLength, Sdlc/Sequel/InlineDatasetQuery, Style/FrozenStringLiteralComment (OsSdlc::Worklist::UnmappedCop) from .../plugins/os-sdlc/lib/os_sdlc/model/worklist.rb:15:in 'OsSdlc::Worklist#initialize' from .../plugins/os-sdlc/lib/os_sdlc/controller/lint_worklist.rb:37:in 'OsSdlc::LintWorklist.rubocop_run' from .../plugins/os-sdlc/lib/os_sdlc/controller/lint_worklist.rb:15:in 'OsSdlc::LintWorklist.run' from plugins/os-sdlc/bin/lint-worklist:10:in '<main>' ``` Offenses named, from `bundle exec rubocop` in `plugins/os-sdlc` (first examples): - `Layout/LineLength`: `lib/os_sdlc/command/lsp_session/handshake.rb:26`, `tests/evidence_bin_test.rb:13` - `Layout/FirstArgumentIndentation`: `eval/ticket-takedown/test/controller/implement_body_cli_test.rb:17` - `Layout/EmptyLinesAroundClassBody`: `eval/ticket-takedown/test/presenter/run_summary_test.rb:15` - `Sdlc/Sequel/InlineDatasetQuery`: `tests/model/dispatch_test.rb:211` - `Style/FrozenStringLiteralComment`: `eval/ticket-takedown/results/prism-architect/scripts/bundle.rb:1` None of these files is in `git status --short`, so uncommitted #1014 work does not cause the crash. `CopPhase#phase` today: ```ruby def phase return :autocorrect if AUTOCORRECT_COPS.include?(@cop) return :batch if batch? return :iterative if iterative? nil end ``` Department lists: `BATCH_DEPARTMENTS = %w[Sdlc/Dry/]` and `ITERATIVE_DEPARTMENTS = %w[Sdlc/Structural/]`. `AUTOCORRECT_COPS` holds only `Minitest/Assert*` and `Minitest/Refute*` cops. ## Reproduce ``` plugins/os-sdlc/bin/lint-worklist --target os-sdlc ``` ## Approach Map departments, not single cops: `Layout/` to `:autocorrect`; `Style/FrozenStringLiteralComment` to `:autocorrect`; `Sdlc/Sequel/` to `:batch`. Add a test that enumerates the enabled cops from the merged rubocop config and asserts each has a phase. Then the config and the phase map cannot drift again. Required work: 1. Map `Layout/` and `Sdlc/Sequel/` departments and `Style/FrozenStringLiteralComment` in `CopPhase` — check: present `Sdlc/Sequel/` in `plugins/os-sdlc/lib/os_sdlc/model/worklist/cop_phase.rb` 2. Add a test that fails and names any enabled cop with no phase — check: present `CopPhase` in `plugins/os-sdlc/tests/**/*cop_phase*_test.rb` ## Acceptance criteria 1. Given the os-sdlc target at the current tree, when `bin/lint-worklist --target os-sdlc` runs, then it prints a worklist or "Worklist clear" and does not raise. 2. Given an enabled cop with no phase mapping, when the cop-phase test runs, then it fails and names the cop. ## Origin - Trigger: `plugins/os-sdlc/bin/lint-worklist --target os-sdlc` - Improvised this session: none - Chain: UnmappedCop crash ← CopPhase lists omit enabled Layout, Style, Sdlc/Sequel cops ← DESIGN (plugins/os-sdlc/lib/os_sdlc/model/worklist/cop_phase.rb) - Root candidate: none - Where: plugins/os-sdlc/lib/os_sdlc/model/worklist/cop_phase.rb, plugins/os-sdlc/lib/os_sdlc/model/worklist.rb - Session: 983d18f5-eb86-409f-a7ca-daea277fedf5 - Transcript: /home/jared/.claude/projects/-home-jared-dev-cc-os--claude-worktrees-lint-lessons/983d18f5-eb86-409f-a7ca-daea277fedf5.jsonl Found 2026-10-16 during the hand-finish of #1014 (implementation 51) in worktree lint-lessons. VERDICT: CREATE
Author
Owner

Evidence folded in from #979 (older, closed as superseded): hyperthrive-websites, session 97ec2cb5-891a-4e1e-8946-b60cf3988392, 2026-10-10, 'lint-worklist --new' failed with UnmappedCop before seeding. About 75 Layout/* cops were unmapped, and also Sdlc/RequireInMethod, which this ticket does not list. Acceptance criteria this ticket lacks: (1) 'lint-worklist --new' on a project with Layout offenses seeds a worklist and does not raise UnmappedCop; (2) Sdlc/RequireInMethod, Style/FrozenStringLiteralComment and the Layout department each map to a fix-lints phase.

Evidence folded in from #979 (older, closed as superseded): hyperthrive-websites, session 97ec2cb5-891a-4e1e-8946-b60cf3988392, 2026-10-10, 'lint-worklist --new' failed with UnmappedCop before seeding. About 75 Layout/* cops were unmapped, and also Sdlc/RequireInMethod, which this ticket does not list. Acceptance criteria this ticket lacks: (1) 'lint-worklist --new' on a project with Layout offenses seeds a worklist and does not raise UnmappedCop; (2) Sdlc/RequireInMethod, Style/FrozenStringLiteralComment and the Layout department each map to a fix-lints phase.
Author
Owner

Partial fix on main, commit f6e96599 (2026-10-27, lint-cops track): CopPhase now maps the Sdlc/Minitest/ department to batch and Sdlc/Sequel/ to iterative (not batch as this ticket proposes; Sequel cops name design fixes). New test plugins/os-sdlc/tests/lint/worklist/cop_phase_test.rb asserts that every enabled Sdlc cop in .rubocop.yml has a phase. Still open: Layout/ and Style/FrozenStringLiteralComment have no phase, and the test enumerates Sdlc cops only, not the merged config. Unsafe-autocorrect cops in AUTOCORRECT_COPS are now #1441.

Partial fix on main, commit f6e96599 (2026-10-27, lint-cops track): CopPhase now maps the Sdlc/Minitest/ department to batch and Sdlc/Sequel/ to iterative (not batch as this ticket proposes; Sequel cops name design fixes). New test plugins/os-sdlc/tests/lint/worklist/cop_phase_test.rb asserts that every enabled Sdlc cop in .rubocop.yml has a phase. Still open: Layout/ and Style/FrozenStringLiteralComment have no phase, and the test enumerates Sdlc cops only, not the merged config. Unsafe-autocorrect cops in AUTOCORRECT_COPS are now #1441.
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#1020
No description provided.