Cop: flag tests that read skills/ or agents/ *.md and string-match their prose (PROMPT-TEXT) #1444
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#1444
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
Tests that read a
skills/oragents/*.mdfile and string-match its prose pin prompt wording.The lens
lens-taxonomy-testssorts them as PROMPT-TEXT with lifetime "never". Evals judge prompts, not string matches.Sdlc/Structural/RawFileContentAssertioncatches them only by accident, and its fix text (load the file through the owning object's public reader) is the wrong fix. The right fix is to delete the test.The redesign in #1008 drops this accidental catch, so it needs its own cop.
Observed
Deleted example,
plugins/os-backlog/tests/category_documentation_test.rb(removed infb040a58; quoted fromgit show fb040a58~1:plugins/os-backlog/tests/category_documentation_test.rb):A second shape the cop does not flag today (same file, lines 12-22):
The new cop must flag both shapes.
Reproduce
n/a: design ticket for a new cop; the deleted tests in fb040a58~1 are the positive cases.
Approach
Add a cop under
Sdlc/Structuralthat flags a test which reads a path underskills/oragents/ending in.mdand asserts on its text withassert_match,assert_includes,include?, or=~. Its message says to delete the test, not to use a reader. Scope: plugin/os-sdlc.Required work: none beyond the acceptance criteria.
Acceptance criteria
File.readonskills/*/SKILL.mdand callsassert_matchon the text, when the cop runs, then it flags the call and the message says to delete the test.skills/*/SKILL.mdand callslabels.reject { text.include?(_1) }, when the cop runs, then it flags the call.agents/*.mdfile and string-matches it, when the cop runs, then it flags the call.skills/andagents/, when the cop runs, then it does not flag the call.Origin
VERDICT: CREATE