Skip to content

tech-debt(unic-pr-review): regression fixture for dedupe-ordering catch (PR #5612)#221

Merged
orioltf merged 6 commits into
developfrom
archon/task-feature-unic-pr-review-218-dedupe-ordering-regress
Jun 8, 2026
Merged

tech-debt(unic-pr-review): regression fixture for dedupe-ordering catch (PR #5612)#221
orioltf merged 6 commits into
developfrom
archon/task-feature-unic-pr-review-218-dedupe-ordering-regress

Conversation

@orioltf

@orioltf orioltf commented Jun 5, 2026

Copy link
Copy Markdown
Member

Summary

  • Adds tests/dedupe-ordering-regression.test.mjs as a parity/quality-regression guard for the dedupe-ordering catch first identified in PR #5612
  • The fixture encodes the pattern: unconditional lastFiredPathRef.current = null placed before the cancelled early-return guard, where a same-key SSP-redirect re-fires a duplicate page_view
  • Five deterministic assertions: fixture ordering invariant, confidence-to-Minor bucket, parseFinding acceptance at severity: 'minor', title regex, body regex

Why

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 fail
  • pnpm --filter unic-pr-review typecheck — exits 0, no errors
  • No version bump, no plugin.json / CHANGELOG.md changes (test-only per issue acceptance criteria)
  • Clean-slate doctrine honored — no code from apps/claude-code/pr-review/

Closes #218

🤖 Generated with Claude Code

orioltf and others added 2 commits June 5, 2026 17:23
…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>
@orioltf

orioltf commented Jun 5, 2026

Copy link
Copy Markdown
Member Author

🔍 Comprehensive PR Review

PR: #221
Reviewed by: 2/5 specialized agents (code-review, comment-quality)
Date: 2026-06-05


Summary

PR #221 adds dedupe-ordering-regression.test.mjs — a parity guard for the false-negative caught in PR #5612. The code is clean, CI-ready, and follows all project conventions. Both completed reviewers return APPROVE with zero CRITICAL/HIGH/MEDIUM findings.

Verdict: ✅ APPROVE

Severity Count
🔴 CRITICAL 0
🟠 HIGH 0
🟡 MEDIUM 0
🟢 LOW 4

🟢 Low Issues (For Consideration)

All carry a keep as-is recommendation.

View 4 low-priority observations
Issue Location Agent Recommendation
Test 2 duplicates bucketBySeverity(70) coverage from severity-bucketer.test.mjs test.mjs:84 code-review Keep as-is — harmless, adds fixture self-documentation
DEDUPE_ORDERING_DIFF and REFERENCE_FINDING are structurally disconnected (no runtime path cross-validates them) test.mjs:44–72 code-review Optional: add clarifying comment; or keep as-is
Title-regex /dedupe|duplicate|reset|guard/i is permissive (hardcoded constant makes it trivially pass) test.mjs:103 code-review Keep as-is — constant-scope makes it adequate
"ADR-0002" reference correct but unqualified in two-tier ADR system test.mjs:66 comment-quality Keep as-is — consistent with plugin-wide convention

✅ What's Good

  • Five focused assertions, each testing one distinct property — ordering invariant, bucket, validator acceptance, title constraint, body constraint.
  • Well-documented module header: fixture origin, false-negative context (pr-review v1.4.0), and exact code pattern all documented in-file.
  • CI-ready: 522/522 tests pass, typecheck clean, Biome clean, no guarded paths touched so verify:changelog passes without a version bump.
  • Clean-slate doctrine respected: zero imports from the deprecated pr-review v1 plugin.
  • Inline code diagram in DEDUPE_ORDERING_DIFF makes the bug ordering immediately graspable.
  • Load-bearing invariant surfaced in JSDoc: "If the thresholds or validator shape change in a way that breaks this finding, the regression fixture will fail."

⚠️ Partial Coverage Note

3 of 5 review agents did not produce artifacts for this run (error-handling, test-coverage, docs-impact). Given the PR scope (single test-only file, no production code changes), this is unlikely to surface additional findings — but full coverage was not achieved.


Reviewed by Archon comprehensive-pr-review workflow — 2/5 agents completed
Artifacts: /Users/oriol.torrent/.archon/workspaces/unic/unic-agents-plugins/artifacts/runs/65f708ccf46baa91eb0697ce06e42332/review/

…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.
@orioltf

orioltf commented Jun 5, 2026

Copy link
Copy Markdown
Member Author

⚡ Self-Fix Report (Aggressive)

Status: COMPLETE
Pushed: ✅ Changes pushed to archon/task-feature-unic-pr-review-218-dedupe-ordering-regress
Commit: cf0a311
Philosophy: Fix everything unless clearly a new concern


Fixes Applied (1 total)

Severity Count
🔴 CRITICAL 0
🟠 HIGH 0
🟡 MEDIUM 0
🟢 LOW 1
View all fixes
  • REFERENCE_FINDING/DEDUPE_ORDERING_DIFF disconnection (test.mjs:63) — Added JSDoc note stating REFERENCE_FINDING is the expected output shape and is not runtime-derived from DEDUPE_ORDERING_DIFF; clarifies that the fixture validates the validator, not the detector.

Tests Added

(none) — 522/522 existing tests pass


Skipped (3)

Finding Reason
Test 2 duplicates bucketBySeverity(70) coverage Reviewer explicitly recommended keep as-is; harmless, adds fixture self-documentation
Title-regex /dedupe|duplicate|reset|guard/i is permissive Reviewer explicitly recommended keep as-is; hardcoded constant makes assertion adequate
"ADR-0002" reference is unqualified Reviewer explicitly recommended keep as-is; consistent with plugin-wide convention

Suggested Follow-up Issues

(none)


Validation

✅ Type check | ✅ Lint | ✅ Tests (522 passed)


Self-fix by Archon · aggressive mode · fixes pushed to archon/task-feature-unic-pr-review-218-dedupe-ordering-regress

…n-null assertion

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.mjs to 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) parseFinding accepts the reference finding and derives severity: 'minor'.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread apps/claude-code/unic-pr-review/tests/dedupe-ordering-regression.test.mjs Outdated
orioltf and others added 2 commits June 8, 2026 13:28
Address Copilot review on the dedupe-ordering regression fixture:

- Make the JSDoc explicit that the reset lives in the effect-setup body
  (not inside the routeChangeComplete callback), and that the fix is to
  move it to cleanup teardown — not to relocate it into the callback.
  This preempts the reviewer's suggested code move, which would
  misrepresent the real PR #5612 defect and contradict the
  REFERENCE_FINDING.suggestion.
- Tighten the suggestion wording: the reset fires on every effect run
  (gated by [router]), not "every render cycle".
- Drop em dashes from authored prose per the org typography rule.

No assertion or fixture-data change; 522/522 tests still pass.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…ry in fixture

From the toolkit comment-analyzer pass on PR #221:

- Anchor the "38/46" line numbers as references to the original PR #5612
  source, not this fixture's own lines, so a maintainer won't try to map
  them onto this file.
- Show the routeChangeComplete callback wrapper in the depiction and
  indent the guard lines inside it, so "the reset (setup) runs before the
  guard (callback)" is legible from the depiction alone, not just the
  diff string below it.

Documentation only; assertions and fixture data unchanged. 522/522 pass.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@orioltf orioltf merged commit 934efab into develop Jun 8, 2026
9 checks passed
@orioltf orioltf deleted the archon/task-feature-unic-pr-review-218-dedupe-ordering-regress branch June 8, 2026 11:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

tech-debt(unic-pr-review): regression fixture for dedupe-ordering catch (PR #5612)

2 participants