Close the A18 gaps in the EffectInModel cop #1507
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#1507
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
Sdlc/Structural/EffectInModelcop finds a value only through the CRC ledger role, not by syntax. The cop is disabled. Its effect list omits most of the outside world that principle 9 names. A18 says that parsing from a string andto_<format>stay in the value.Reproduce
n/a: design ticket. The probe in Approach shows the gap.
Approach
Gap 1, role lookup. The cop reads the role from the ledger in
roleatplugins/os-sdlc/lib/os_sdlc/cops/structural/effect_in_model.rb:33-38. AData.defineorStruct.newvalue that the ledger does not list as value or model is silent. A probe withData.defineandFile.readunderrole=adapterdid not fire.Gap 2, disabled.
plugins/os-sdlc/.rubocop.yml:366-367setsSdlc/Structural/EffectInModel:toEnabled: false. The cop needsLedgerPath.Gap 3, effect list.
plugins/os-sdlc/lib/os_sdlc/cops/structural/effect_in_model/effect_call.rb:11isDEFAULT_CONSTANTS = %w[File Dir IO YAML JSON Open3 Process Kernel].freeze. The list omits ENV,Net::HTTP,$stdoutandputs,Time.now, andsleep. Principle 9 atplugins/os-sdlc/skills/lens-principles/SKILL.md:63names files, directories, git, subprocesses, ENV, the network, the terminal, and the clock as the outside world.Related: #1351 edits the same effect list (
effect_in_model/effect_call.rb) for a different fault; sequence the two to avoid a merge conflict.Gap 4, tests.
plugins/os-sdlc/tests/cops/effect_in_model_test.rbcovers only plain classes.A18 NOT: parsing from a string and
to_<format>stay in the value. The cop must not flag them.Cop criteria. All criteria are required.
Required work:
Data.defineorStruct.newvalue by syntax — check: presentDatainplugins/os-sdlc/lib/os_sdlc/cops/structural/effect_in_model.rbNetinplugins/os-sdlc/lib/os_sdlc/cops/structural/effect_in_model/effect_call.rbData.defineinplugins/os-sdlc/tests/cops/effect_in_model_test.rbOrchestrator work: Rule on whether to enable the cop in
plugins/os-sdlc/.rubocop.yml.Acceptance criteria
Data.definevalue that callsFile.readand has role adapter in the ledger, when the cop runs, then it reports an offense.Struct.newvalue that callsFile.read, when the cop runs, then it reports an offense.ENV.fetch,Net::HTTP,puts,Time.now, orsleep, when the cop runs, then it reports an offense for each call.to_<format>, when the cop runs, then it reports no offense.Owner sketch
Origin
VERDICT: CREATE