Widen DiscardedErrorCode to a code only interpolated into the message #1451
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#1451
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
Ruling needed: does a subprocess exit status (
exit #{status.exitstatus}in a raise message) count as a discarded error code? All about 7 candidates today are this shape.The cop
Sdlc/Structural/DiscardedErrorCodecounts a code interpolated into a message as carried.A caller must then parse the message text to get the code.
Observed
Analysis:
docs/lint-lessons/analyses/sdlc-structural-discarded-error-code.md, option B.Shape:
raise Error, "bad: #{code}". The cop needs a rule for "code appears only under a dstr".Candidates (about 7):
lint/run/result.rb,report/merged_diff.rb,git/repo.rb,crc/filing/backlog_client.rb, two ineval/.../case_preparer.rb, andjudge_pairs.rb(all os-sdlc).Reproduce
n/a: this is a widening of a cop; the matcher is under
plugins/os-sdlc/lib/os_sdlc/cops/discarded_error_code/.Approach
Blocked by #1353 (false-positive carve-out on the same cop). Land #1353 first, and get the ruling above.
If the ruling says a subprocess exit status counts, flag a raise whose code appears only inside the message string.
If the ruling says no, narrow the rule so these candidates do not fire.
Rule from Jared: every new hit must be a true positive, and no Exclude lists. Carve-outs go in the matcher.
Required work:
dstrinplugins/os-sdlc/lib/os_sdlc/cops/discarded_error_code/raise_site.rbAcceptance criteria
raise Error, "bad: #{code}"wherecodeis an error code, when the cop runs, then it reports an offense.plugins/, when the cop runs, then every new hit is a true positive under the ruling.Owner sketch
Origin
.cc-os/os/handoffs/2026-10-27-1542-lint-cops-track.md).VERDICT: CREATE
Waiting on Jared's ruling (question at the top of the body) and on #1353.
Resolution
Done: Ruled 2026-10-28 (Jared): do not widen. An exit status interpolated into a raise message describes a failed subprocess for a human; no caller branches on it, so every new hit would be a false positive.
Evidence: raise_site.rb carries? counts any argument subtree naming the discriminator, so a status interpolated in the message already passes; rubocop --only Sdlc/Structural/DiscardedErrorCode reports no offenses on git/repo.rb:15, lint/run/result.rb:8, report/merged_diff.rb:13, crc/filing/backlog_client.rb:36; all rescues (lint/remediation.rb:13, lint/sweeping.rb:13, fast_gate/new_offense_report.rb:10, crc/filing.rb:44) print e.message and exit 3.
Follow-ups: none