Add lint lessons for the four Sdlc/Structural cops that n8n-api hit #991
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#991
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
plugins/os-sdlc/lint-lessons/holds lessons for 3 Sequel cops only.The gate relays no lesson for
Sdlc/Structural/UnusedPrivateMethod,Sdlc/Structural/ParameterThreadedThroughPrivateMethods,Sdlc/Structural/CollaboratorConstructionInInitialize, orSdlc/Structural/RequireRelativeDensity.In n8n-api (jaredswanson/n8n-api#2, fix-lints run), the AI treated these four offenses as obstacles.
A human review found that each offense named a real smell.
type_classwas passed down through private methods only to receivenew. The record class should ownfrom_api.instance_variable_set(:@faraday, …)in a test helper showed a missing injection seam.require_relativelines showed a hand-kept load list. The fix is Zeitwerk.The policy is that lessons are written when a real pain point appears.
This is that pain point.
Approach
The library resolves the registered name
Sdlc/Structural/<Cop>tosdlc-structural-<kebab>.yml.The drafter verified that
Lesson::Libraryloads all four files and thatLesson::Relayrenders them.Add the four drafted lesson files below verbatim.
Required work:
Sdlc/Structural/UnusedPrivateMethod. check: presentcop: Sdlc/Structural/UnusedPrivateMethodinplugins/os-sdlc/lint-lessons/sdlc-structural-unused-private-method.ymlSdlc/Structural/ParameterThreadedThroughPrivateMethods. check: presentcop: Sdlc/Structural/ParameterThreadedThroughPrivateMethodsinplugins/os-sdlc/lint-lessons/sdlc-structural-parameter-threaded-through-private-methods.ymlSdlc/Structural/CollaboratorConstructionInInitialize. check: presentcop: Sdlc/Structural/CollaboratorConstructionInInitializeinplugins/os-sdlc/lint-lessons/sdlc-structural-collaborator-construction-in-initialize.ymlSdlc/Structural/RequireRelativeDensity. check: presentcop: Sdlc/Structural/RequireRelativeDensityinplugins/os-sdlc/lint-lessons/sdlc-structural-require-relative-density.ymlDrafted content of each file follows.
plugins/os-sdlc/lint-lessons/sdlc-structural-unused-private-method.ymlplugins/os-sdlc/lint-lessons/sdlc-structural-parameter-threaded-through-private-methods.ymlplugins/os-sdlc/lint-lessons/sdlc-structural-collaborator-construction-in-initialize.ymlplugins/os-sdlc/lint-lessons/sdlc-structural-require-relative-density.ymlAcceptance criteria
Lesson::Libraryloads the lesson directory, then it returns a lesson for each of the fourSdlc/Structuralcops.Lesson::Relayrenders the lesson for that cop.Notes for review
These are format gaps found while drafting. They are open questions, not required work.
decision.UnusedPrivateMethodhas two distinct cases: a lost caller, and a helper that subclasses call (see #990).signal. Key guidance is packed into the signals for that reason.ParameterThreadedThroughPrivateMethodscop message suggests a holder object. The lesson calls the holder the weaker fix when the parameter receives only one message.afterexample forUnusedPrivateMethodand thebeforeexample forRequireRelativeDensityeach have one.Origin
plugins/os-sdlc/lint-lessons/has no lessons for theSdlc/Structuralcops.plugins/os-sdlc/lint-lessons/Related
UnusedPrivateMethodand base-class helpers.Discoverer: /home/jared/dev/ruby-gems/n8n-api, session 44cf3646-a8fe-4f26-8550-e92296c57f86, 2026-10-11. The gate relays no lesson for four Sdlc/Structural cops that n8n-api hit.
Resolution
Done: Added four lesson files under plugins/os-sdlc/lint-lessons/ for Sdlc/Structural/UnusedPrivateMethod, ParameterThreadedThroughPrivateMethods, CollaboratorConstructionInInitialize, RequireRelativeDensity, written from the n8n-api session discussion (lost test, inverted responsibility, missing seam, hand-kept load list).
Evidence: Commit
6f63a09don main. Lesson::Library returns a lesson for all four cops and the three Sequel cops; Lesson::Relay renders all four (full text when unseen, signal only when seen). tests/presenter/lesson and tests/adapter/lesson: 14 runs, 40 assertions, 0 failures.Follow-ups: Format gaps (no false-positive field, one example per cop, signal-only on repeat) stay as notes on #989/#990; none filed. A Naming/PredicateMethod lesson is not in scope here and is tracked by #989's stock-cop concern.