ParameterTally attributes a nested Struct or Data constructor to the file's outer constant #1087
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#1087
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
OsSdlc::CollaboratorPass::ParameterTallylabels every constructor site in a file with the file's Zeitwerk constant. A nestedResult = Struct.new(:root, :run_dir)insidelib/os_sdlc/crc_jobs.rbis therefore reported as a site ofOsSdlc::CrcJobs, and the clumproot+run_dirlistsCrcJobsas a class that takes those names when only its nested value does. Findings over-count sites and the prescriber brief shows the wrong excerpt for that constant.Observed
bin/collaborator-pass prescribe-brief --run <run> --subject root+run_dirlists siteOsSdlc::CrcJobswith excerptResult = Struct.new(...)at line 7.Reproduce
Approach
ConstructorSitestracks the lexical namespace while walking the Prism tree and names each site by its enclosing class or module plus the assigned constant forData.defineandStruct.new. The join with the ledger then falls back to the file's constant only when the nested constant has no row.Required work: none beyond the acceptance criteria.
Acceptance criteria
initializeand a nestedResult = Struct.new(:a, :b), when the tally runs, then the struct site's constant isOuter::Resultand the initialize site's constant isOuter.measure --sources paramsruns, thenOsSdlc::CrcJobsis not a site ofroot+run_dirunless its owninitializetakes those names.Origin
VERDICT: CREATE
REASON: Observed wrong output in the shipped #1083 tool, not an agent improvisation. #1085 is a different root (the rubocop cop, not ParameterTally).