fix(merge-tracker): guard tier-3 fuzzy dedup with req/job numbers - #1525
Conversation
…ntifer#1524) Tier-3 duplicate detection (company + fuzzy role match) had no req/job-number awareness, so two distinct postings at the same company with similarly-worded titles could collapse into one tracker row whenever a req/job number in the Notes column was the only thing that actually distinguished them (e.g. two L&D postings at the same company, same-ish title, different req numbers). Add extractReqNumber(), which pulls a req/job/posting number out of a Notes cell using the label formats already in use in this project's own applications.md (R_, REQ/Req, Requisition, JR, Job, Job ID, Posting, Posting ID, Ref/Reference). Wire it into the tier-3 block: if both sides of a fuzzy-matched candidate have an extractable number and the numbers differ, the candidate is not treated as a duplicate. If either side has no extractable number, today's fuzzy-match-only behavior is unchanged. Adds a self-test block to test-all.mjs covering: different req numbers (not a duplicate), same req number (still a duplicate), no req number on either side (unchanged fuzzy-match behavior), and req number on only one side (falls back to fuzzy-match, since a mismatch can't be proven). Closes santifer#1524 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughmerge-tracker.mjs adds a regex-based helper to extract req/job/posting/reference identifiers from tracker Notes and uses it in tier-3 fuzzy company+role duplicate detection to prevent false duplicates when extracted numbers disagree. test-all.mjs adds a corresponding integration test. ChangesReq/job-number dedup guard
Estimated code review effort: 3 (Moderate) | ~20 minutes Possibly related issues
Possibly related PRs
Suggested labels: Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Nice guard, @Schlaflied — keying tier-3 fuzzy dedup on the req/job number stops two distinct same-company postings with near-identical titles from collapsing into one row, and it falls back to today's behavior byte-for-byte when either side lacks a number. Four targeted self-tests. Closes #1524. Merged! 🚀 |
Summary
Closes #1524.
merge-tracker.mjs's tier-3 duplicate detection (company match +roleFuzzyMatch) had no req/job-number awareness. Two distinct postings at the same company with similarly-worded titles could collapse into a single tracker row whenever a req/job number in the free-text Notes column was the only thing actually distinguishing them — e.g. two L&D-type postings at the same employer with near-identical generic titles, different req numbers (R_1494379vsR_1488728in the reported case).Fix
extractReqNumber(notes)inmerge-tracker.mjs, which pulls a req/job/posting number out of a Notes cell.Req/job-number formats found in use
Grepped this project's own
data/applications.mdNotes column (not the three examples in the issue alone) to build the extraction regex against real formats rather than guessing:R_1488728(underscore prefix)Req 1084,Req #1311,Req PRACT011038,Req SENIO001021(bare/hash/alphanumeric)REQ-056759,REQ-1000049295,REQ-2026-32061(uppercase, hyphenated)Job 202606-116491,Job #31786,Job ID 65136(bare / hash / two-word "Job ID")Posting ID 5340,Posting #114148,Posting 26-36JR00124259,JR6497(no separator)Ref R2857957,Ref 2026-45698extractReqNumber()'s regex covers all of these label prefixes (R_,Req/REQ/Requisition,JR,Job,Job ID,Posting,Posting ID,Ref/Reference) with a required trailing digit so it doesn't accidentally match unrelated words like "Required" or "Reference Program" that merely start with the same letters.Edge case: number on only one side
The issue doesn't fully spec this. I chose to fall back to existing fuzzy-match behavior (still treat as a duplicate if the fuzzy match says so) — you can't prove a mismatch without both numbers, and the issue is explicit that the fix should only prevent false positives, never introduce new false negatives on cases that already work today.
Tests
Added a self-test block to
test-all.mjs(mirroring the existing#751/#912merge-tracker regression blocks, same temp-fixture pattern) covering:All example/test data uses invented placeholder companies (Fabrikam, Northwind) — no real company names or personal job-search data.
Test plan
node test-all.mjs --quick— 1158 passed, 0 failed, 1 warning (pre-existing/expected warnings only — no rate-limit flake observed)🤖 Generated with Claude Code
Summary by CodeRabbit