Sdlc/Structural/CollaboratorConstructionInInitialize: carve out parameter-built parts and value types #1348
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#1348
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/Structural/CollaboratorConstructionInInitializeflagsdef initializebodies with 2 or moreConst.newsends. The cop cannot see whether tests have a seam, so it flags code that is correct.Counterexamples:
judge:andrepository:; plugins/os-backlog/lib/backlog/checkout.rb:9-10 is the same. The parameters are the seam.raise Error.new.Found by the #1325 zero-false-positive audit (docs/plans/class-length-family/sdlc-cop-audit.md).
Approach
Carve out by shape in the cop matcher (plugins/os-sdlc/lib/os_sdlc/cops/collaborator_construction_in_initialize.rb), never by config
Exclude. Skip.newcalls whose every argument is an initialize parameter, an ivar copy of one, or a literal. Skip value/stdlib and exception receivers. Drop the "report it to the human" text from the lint lesson.Required work:
Report it to the humaninplugins/os-sdlc/lint-lessons/sdlc-structural-collaborator-construction-in-initialize.ymlAcceptance criteria
Excludelist or test-path exclusion carries the carve-out.Owner sketch
The carve-out lives in the cop matcher.
Origin
VERDICT: CREATE
Work started on branch ticket-1348 via /os-sdlc:implement.
Resolution
Done: CollaboratorConstructionInInitialize no longer flags parts built from initialize parameters or value types (carve-out per the ticket's acceptance criteria).
Evidence: Implementation 211 commit (HEAD of ticket-1348): cop collaborator_construction_in_initialize.rb plus tests in plugins/os-sdlc/tests/cops/collaborator_construction_in_initialize_test.rb; full suite green; contract-auditor pass.
Follow-ups: none