Sdlc/Structural/StaticFactAssertion: stop flagging assert_path_exists and refute_path_exists #1356
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#1356
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/StaticFactAssertionflagsassert_path_existsandrefute_path_existswith a literal path. These two assertions check filesystem state at run time. They do not assert a definition. The fix the cop prescribes ("Delete it") deletes a real check.Observed
Shape: a canonical Minitest assertion (
static_fact_call.rb:9-16) that is not a block send, with every argument a literal or constant (static_node.rb:9-17). The cop is registered at.rubocop.yml:330with no Exclude.Counterexample:
plugins/os/tests/worktree/finish_command_resolves_by_branch_test.rb:22. Sample code that also flags:Reproduce
Approach
Fix by shape, in the cop matcher: remove
assert_path_existsandrefute_path_existsfrom the canonical assertion list (static_fact_call.rb:12,15). Do not add a config Exclude list or a test-path exclusion.Required work:
assert_path_existsinplugins/os-sdlc/lib/os_sdlc/cops/structural/static_fact_assertion/static_fact_call.rbAcceptance criteria
assert_path_exists "out.txt"orrefute_path_exists "tmp.lock", when the cop runs, then it reports no offense.assert_equal 1, 1, when the cop runs, then it still reports an offense.Owner sketch
Found by the #1325 zero-false-positive audit (docs/plans/class-length-family/sdlc-cop-audit.md).
VERDICT: CREATE
Origin
assert_path_exists← canonical assertion list includes the path assertions (static_fact_call.rb:12,15) ← DESIGN (plugins/os-sdlc/lib/os_sdlc/cops/structural/static_fact_assertion/static_fact_call.rb)Work started on branch ticket-1356 via /os-sdlc:implement.
Resolution
Done: StaticFactAssertion no longer flags assert_path_exists / refute_path_exists; both removed from the static-fact call list in static_fact_call.rb.
Evidence: Commit
8afb0dbeon ticket-1356 (implementation 209): new tests in plugins/os-sdlc/tests/cops/static_fact_assertion_test.rb; full suite green; contract-auditor pass.Follow-ups: none