UnusedPrivateMethod flags base-class private helpers that subclasses call #990
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#990
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
The cop
UnusedPrivateMethodreports a private helper as unused when only subclasses call it. The rule is mechanically a false positive here. The signal behind it is real, so the cop must not just go silent.lib/os_sdlc/cops/unused_private_method.rb(plugin rootplugins/os-sdlc). It collects private defs and call sites and symbols from the same file only.CALLBACK_ALLOWLISTis fixed. The cop has no cross-file or inheritance awareness.lib/n8n_api/resources/base.rb:14 build_pageis private inResources::Base. 9 subclass files call it. The cop reports "no call sites in this file".Jared's ruling: a private inherited helper is a hidden parent/subclass contract. It can point to inverted responsibility. In n8n-api, the builder belonged on the built object.
Approach
Keep the signal. Do not exempt silently.
Required work: none beyond the acceptance criteria.
Acceptance criteria
Origin
Discoverer: /home/jared/dev/ruby-gems/n8n-api, session 44cf3646-a8fe-4f26-8550-e92296c57f86, 2026-10-11. The cop flags
Resources::Base#build_page, which 9 subclasses call.Resolution
Done: Closed as covered (option B). The signal Jared asked to keep reaches the reader: the cop still flags subclass-only private helpers, and the lesson added by #991 names both causes (dead helper, or subclasses in other files call it) and the inverted-responsibility check. AC2 holds today; AC3 is done by #991. AC1 (distinct message) and AC4 are dropped: AC1 needs a cross-file search inside a cop that reads one file at a time.
Evidence: Lesson plugins/os-sdlc/lint-lessons/sdlc-structural-unused-private-method.yml (commit
6f63a09d, #991): sign_of names 'subclasses that call a private helper of their parent'; decision asks 'does this helper do work that belongs to the object it builds or acts on? If yes, move the work there'. The n8n-api case is fixed: commit 39b81c0 removed Resources::Base#build_page and lets each record class build itself.Follow-ups: none