Sdlc/Sequel/RubyFilterAfterAll: require a Sequel dataset origin, not a _dataset suffix #1379

Open
opened 2026-10-25 21:23:30 +00:00 by jared · 0 comments
Owner

Problem

Sdlc/Sequel/RubyFilterAfterAll matches any call whose name ends _dataset. A method that is not Sequel has no model and no dataset_module, so the prescribed fix cannot apply.

Found by the #1325 zero-false-positive audit (docs/plans/class-length-family/sdlc-cop-audit.md).

Observed

class Report
  def big_ones
    fixture_dataset.to_a.select { |n| n > 3 }
  end

  def fixture_dataset = [1, 2, 5, 8]
end

fixture_dataset returns an Array. The cop flags big_ones.

Reproduce

n/a: run rubocop --only Sdlc/Sequel/RubyFilterAfterAll on the snippet above.

Approach

Fix by shape. Put the change in the cop matcher, never in a config Exclude list.

Required work:

  1. Match only *_dataset association readers on a Sequel::Model, or Model.dataset and Model.where chains. Do not match by name suffix.

Acceptance criteria

  1. Given the Report class above, when the cop runs, then it reports no offense.
  2. Given Handoff.where(x: 1).all.select { |h| h.ok }, when the cop runs, then it reports an offense.

Origin

  • Trigger: the #1325 zero-false-positive audit of the Sdlc cops (docs/plans/class-length-family/sdlc-cop-audit.md)
  • Improvised this session: none
  • Chain: false positive ← matcher keys on the _dataset name suffix ← DESIGN (plugins/os-sdlc/lib/os_sdlc/cops/ruby_filter_after_all.rb:17-28)
  • Root candidate: none found; searched RubyFilterAfterAll, ruby_filter_after_all, _dataset
  • Where: plugins/os-sdlc/lib/os_sdlc/cops/ruby_filter_after_all.rb
  • Session: eb98cdcd-6783-46a0-b7df-cf18a8fe2a56
  • Transcript: /home/jared/.claude/projects/-home-jared-dev-cc-os--claude-worktrees-ticket-1325/eb98cdcd-6783-46a0-b7df-cf18a8fe2a56.jsonl

VERDICT: CREATE

## Problem `Sdlc/Sequel/RubyFilterAfterAll` matches any call whose name ends `_dataset`. A method that is not Sequel has no model and no `dataset_module`, so the prescribed fix cannot apply. Found by the #1325 zero-false-positive audit (docs/plans/class-length-family/sdlc-cop-audit.md). ## Observed ```ruby class Report def big_ones fixture_dataset.to_a.select { |n| n > 3 } end def fixture_dataset = [1, 2, 5, 8] end ``` `fixture_dataset` returns an Array. The cop flags `big_ones`. ## Reproduce n/a: run `rubocop --only Sdlc/Sequel/RubyFilterAfterAll` on the snippet above. ## Approach Fix by shape. Put the change in the cop matcher, never in a config Exclude list. Required work: 1. Match only `*_dataset` association readers on a Sequel::Model, or `Model.dataset` and `Model.where` chains. Do not match by name suffix. ## Acceptance criteria 1. Given the `Report` class above, when the cop runs, then it reports no offense. 2. Given `Handoff.where(x: 1).all.select { |h| h.ok }`, when the cop runs, then it reports an offense. ## Origin - Trigger: the #1325 zero-false-positive audit of the Sdlc cops (docs/plans/class-length-family/sdlc-cop-audit.md) - Improvised this session: none - Chain: false positive ← matcher keys on the `_dataset` name suffix ← DESIGN (plugins/os-sdlc/lib/os_sdlc/cops/ruby_filter_after_all.rb:17-28) - Root candidate: none found; searched RubyFilterAfterAll, ruby_filter_after_all, _dataset - Where: plugins/os-sdlc/lib/os_sdlc/cops/ruby_filter_after_all.rb - Session: eb98cdcd-6783-46a0-b7df-cf18a8fe2a56 - Transcript: /home/jared/.claude/projects/-home-jared-dev-cc-os--claude-worktrees-ticket-1325/eb98cdcd-6783-46a0-b7df-cf18a8fe2a56.jsonl VERDICT: CREATE
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#1379
No description provided.