tech-debt(unic-pr-review): regression fixture for dedupe-ordering catch (PR #5612)#221
Conversation
…ch (PR #5612) Add tests/dedupe-ordering-regression.test.mjs as a parity/quality-regression guard. The fixture encodes the unconditional ref/state reset placed before an early-return guard pattern from AnalyticsTracker.tsx in PR #5612. Assertions verify the pattern ordering and that a reference finding at confidence 70 (Minor band, 60-79 per ADR-0002) validates correctly via parseFinding. unic-pr-review correctly surfaced this at Minor severity; pr-review v1.4.0 missed it (false negative). This fixture prevents that quality win from silently regressing as the plugin evolves. Closes #218 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…format) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
🔍 Comprehensive PR ReviewPR: #221 SummaryPR #221 adds Verdict: ✅
🟢 Low Issues (For Consideration)All carry a keep as-is recommendation. View 4 low-priority observations
✅ What's Good
|
…disconnection in fixture Add a note to the REFERENCE_FINDING JSDoc making the fixture boundary explicit: the finding shape is the expected detector output, not runtime- derived from the diff constant. Prevents future maintainers from assuming cross-validation that does not exist at the unit level.
⚡ Self-Fix Report (Aggressive)Status: COMPLETE Fixes Applied (1 total)
View all fixes
Tests Added(none) — 522/522 existing tests pass Skipped (3)
Suggested Follow-up Issues(none) Validation✅ Type check | ✅ Lint | ✅ Tests (522 passed) Self-fix by Archon · aggressive mode · fixes pushed to |
…n-null assertion Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
Pull request overview
Adds a new deterministic regression/eval test fixture to lock in unic-pr-review’s expected “dedupe-ordering” finding behavior (Minor severity band, validator acceptance, and basic title/body invariants), based on the defect first adjudicated in PR #5612 and tracked in #218.
Changes:
- Introduces
dedupe-ordering-regression.test.mjsto encode the dedupe-ordering pattern as a canonical diff snippet plus a reference “ground-truth” Finding. - Adds assertions to ensure (a) reset-before-guard ordering is present in the fixture, (b) confidence 70 buckets to
minor, and (c)parseFindingaccepts the reference finding and derivesseverity: 'minor'.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| suggestion: | ||
| 'Move the reset into the cleanup function after `cancelled = true`, so it only fires on unmount—not on every render cycle.', |
| const DEDUPE_ORDERING_DIFF = `\ | ||
| + useEffect(() => { | ||
| let cancelled = false | ||
| + lastFiredPathRef.current = null | ||
|
|
||
| router.events.on('routeChangeComplete', (url) => { | ||
| if (cancelled) return | ||
| if (url === lastFiredPathRef.current) return | ||
| lastFiredPathRef.current = url | ||
| trackPageView(url) | ||
| }) |
Summary
tests/dedupe-ordering-regression.test.mjsas a parity/quality-regression guard for the dedupe-ordering catch first identified in PR #5612lastFiredPathRef.current = nullplaced before thecancelledearly-return guard, where a same-key SSP-redirect re-fires a duplicatepage_viewparseFindingacceptance atseverity: 'minor', title regex, body regexWhy
unic-pr-review correctly surfaced this at Minor severity; pr-review v1.4.0 missed it entirely (false negative). This is a quality win worth locking in so it cannot silently regress as the plugin evolves.
Test plan
pnpm --filter unic-pr-review test— 522 pass (5 new cases included), 0 failpnpm --filter unic-pr-review typecheck— exits 0, no errorsplugin.json/CHANGELOG.mdchanges (test-only per issue acceptance criteria)apps/claude-code/pr-review/Closes #218
🤖 Generated with Claude Code