Sdlc/RequireInMethod crashes on require CONSTANT (NoMethodError in Call#library) #1044
Labels
No labels
P0
P1
P2
P3
bug
category/code-change
category/cross-repo
category/eval-run
category/investigation
category/no-test-target
category/owner-ruling
category/prose-artifact
category/recurring-chore
category/structure
category/umbrella
crc-refactor
create
delete
enhancement
filed-by/agent
filed-by/user
frozen
lint-rule
needs-info
needs-triage
next
plugin/cc-architect
plugin/os
plugin/os-adr
plugin/os-aidd-lint
plugin/os-backlog
plugin/os-context
plugin/os-doc-hygiene
plugin/os-sdlc
plugin/os-vault
project/cc-os
ready-for-agent
ready-for-human
recurring
review
rule-proposal
update
waiting
wayfinder:grilling
wayfinder:map
wayfinder:map
wayfinder:research
wayfinder:task
wayfinder:task
wontfix
worklist/deviations
worklist/lint-rule
worklist/new-implement-build
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
jared/cc-os#1044
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
Sdlc/RequireInMethodraises while inspecting a file that callsrequirewith a constant argument. The cop assumes a string argument; a ConstNode has novalue. The error hides real offenses.Observed
Running
cd plugins/os-sdlc && bundle exec rubocop --only Sdlc/RequireInMethod eval/ticket-takedown/lib/takedown/adapter/backlog_tracker.rbprints "An error occurred while Sdlc/RequireInMethod cop was inspecting ...". With -d:lib/os_sdlc/cops/require_in_method/call.rb:31:in 'Call#library': undefined method 'value' for an instance of RuboCop::AST::ConstNode (NoMethodError). Trigger:require LIB unless defined?(Backlog::Issues)insideload_backlog. Same crash at commit3079f785. rubocop 1.90.0, ruby 4.0.2.Reproduce
Acceptance criteria
require CONSTinside a method runs without error; the cop reports an offense with a clear message or skips non-string arguments (owner decides); rubocop on backlog_tracker.rb reports no cop error.Skeptic: VERDICT: CREATE — reproducible, and the pre-change file crashes the same way, so it is a defect in the cop.
Origin
bundle exec rubocop --only Sdlc/RequireInMethod eval/ticket-takedown/lib/takedown/adapter/backlog_tracker.rbin plugins/os-sdlc, during the crc-refactor tuning run on plugins/os-backlog (branch crc-os-backlog-2026-10-16).Call#libraryassumes a string argument (plugins/os-sdlc/lib/os_sdlc/cops/require_in_method/call.rb:31) ← DESIGNMechanism: a custom Sdlc cop assumes a node shape and raises, hiding other offenses in the file. Related, not folded: #1102 (BooleanControlParameter and ParameterThreadedThroughPrivateMethods crash on destructured parameters).