fix(listing-audit): stop crediting over-called severity as accurate#65
Conversation
) findingsAccuracy() used severityAtLeast(), which counted a student marking a "warning" issue as "critical" as a true positive. In Amazon PPC work, over-calling severity wastes client time and is a real skill deficiency, not accuracy — severityCalibration() already scores exact matches correctly, so accuracy should too. Removed severityAtLeast() (now unused) and added a regression test. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017Ck2wurvqhL2r3cCAzmuhU
📝 WalkthroughWalkthroughListing audit accuracy now requires exact severity matches instead of accepting higher-ranked severities. New tests cover exact, over-called, and under-called severity scoring. ChangesListing Audit Accuracy
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/engine/listing-audit/engine.ts`:
- Around line 90-91: Replace the em dash in the comment near the exact severity
match logic in src/engine/listing-audit/engine.ts lines 90-91 with a comma or
period. Also replace the em dash in src/engine/listing-audit/engine.test.ts line
53 with a comma or period; no other changes are needed.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro Plus
Run ID: 736171ac-e4e3-4389-a688-2227bf61ce7f
📒 Files selected for processing (2)
src/engine/listing-audit/engine.test.tssrc/engine/listing-audit/engine.ts
| // Exact severity match only — over-calling severity (e.g. warning as | ||
| // critical) is a real skill deficiency in Amazon PPC work, not accuracy. |
There was a problem hiding this comment.
📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick win
Remove em dashes from the changed comments.
src/engine/listing-audit/engine.ts#L90-L91: replace the em dash with a comma or period.src/engine/listing-audit/engine.test.ts#L53-L53: replace the em dash with a comma or period.
As per coding guidelines, TypeScript code must not use em dashes.
📍 Affects 2 files
src/engine/listing-audit/engine.ts#L90-L91(this comment)src/engine/listing-audit/engine.test.ts#L53-L53
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@src/engine/listing-audit/engine.ts` around lines 90 - 91, Replace the em dash
in the comment near the exact severity match logic in
src/engine/listing-audit/engine.ts lines 90-91 with a comma or period. Also
replace the em dash in src/engine/listing-audit/engine.test.ts line 53 with a
comma or period; no other changes are needed.
Source: Coding guidelines
Closes #51.
Summary
findingsAccuracy()usedseverityAtLeast(), which counted a student marking awarningissue ascriticalas a true positive — over-calling severity is a real skill deficiency in Amazon PPC work, not accuracy.severityCalibration()(the sibling criterion) already does exact-match scoring correctly;findingsAccuracy()now does too, so the two dimensions are properly orthogonal (per the issue's suggested fix).severityAtLeast()— dead code oncefindingsAccuracy()no longer uses it.engine.test.ts(didn't exist before) with a regression test for both over- and under-calling.Test plan
pnpm typecheckcleanpnpm lintcleanpnpm test— 286/286 passing (was 283 before the 3 new tests)Summary by CodeRabbit
Bug Fixes
Tests