Commit 5b2ab04
feat(copilot-detection): implement actual file comparison in Compare-DiffContent (#543)
* feat(copilot-detection): implement actual file comparison in Compare-DiffContent
The Compare-DiffContent function now uses the OriginalCommits parameter
for actual file-path comparison instead of just a presence check:
- Extract file paths from follow-up diff sections
- Extract changedFiles from original commits
- Calculate overlap percentage between file sets
- Determine category based on overlap:
- DUPLICATE: >=80% file overlap
- LIKELY_DUPLICATE: >=50% overlap or single file with commits
- POSSIBLE_SUPPLEMENTAL: >0% overlap
- INDEPENDENT: 0% overlap (new category)
Added 'INDEPENDENT' category and recommendation mapping.
Updated tests to verify file overlap logic (Issue #244).
Closes #244
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* fix(copilot-detection): use member-access enumeration for file collection
Fixes jagged array issue where += operator was appending arrays as
single elements. Uses PowerShell's member-access enumeration pattern
($OriginalCommits.changedFiles) which automatically flattens nested
arrays into a single collection.
Addresses review comment from gemini-code-assist on PR #543.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
* fix: address Copilot PR review comments
Addresses three Copilot review comments from PR #543:
1. Early return bug (comment 2654872685): Distinguish between truly
empty diff and regex extraction failure. Now returns UNKNOWN category
with warning when diff sections exist but no files extracted.
2. Regex pattern precision (comment 2654872682): Replace `\s` (any
whitespace) with `[ \t]` (space/tab only) to avoid matching across
newlines in file path extraction.
3. Heuristic reason clarity (comment 2654872678): Use different reason
message for single-file heuristic ("Single file change with original
commits present") vs actual file overlap ("Partial file overlap").
All 38 Pester tests pass.
Comment-IDs: 2654872685, 2654872682, 2654872678
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
---------
Co-authored-by: rjmurillo[bot] <rjmurillo-bot@users.noreply.github.com>
Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
Co-authored-by: Claude <claude@anthropic.com>1 parent 0d0e8c4 commit 5b2ab04
File tree
2 files changed
+101
-158
lines changed- .claude/skills/github/scripts/pr
- tests
2 files changed
+101
-158
lines changedLines changed: 64 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
203 | 203 | | |
204 | 204 | | |
205 | 205 | | |
206 | | - | |
| 206 | + | |
207 | 207 | | |
208 | 208 | | |
209 | | - | |
210 | | - | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
211 | 224 | | |
212 | | - | |
213 | | - | |
214 | | - | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
215 | 231 | | |
216 | 232 | | |
217 | | - | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
218 | 238 | | |
219 | | - | |
220 | | - | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
221 | 273 | | |
222 | 274 | | |
223 | 275 | | |
| |||
314 | 366 | | |
315 | 367 | | |
316 | 368 | | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
317 | 372 | | |
318 | 373 | | |
319 | 374 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
244 | 244 | | |
245 | 245 | | |
246 | 246 | | |
247 | | - | |
| 247 | + | |
248 | 248 | | |
249 | | - | |
| 249 | + | |
| 250 | + | |
250 | 251 | | |
251 | 252 | | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
252 | 266 | | |
253 | 267 | | |
254 | | - | |
| 268 | + | |
255 | 269 | | |
256 | 270 | | |
257 | | - | |
| 271 | + | |
258 | 272 | | |
259 | 273 | | |
260 | 274 | | |
261 | | - | |
262 | | - | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
263 | 278 | | |
264 | 279 | | |
265 | | - | |
| 280 | + | |
266 | 281 | | |
267 | 282 | | |
268 | 283 | | |
269 | | - | |
270 | | - | |
271 | | - | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
272 | 287 | | |
273 | 288 | | |
274 | | - | |
275 | | - | |
| 289 | + | |
276 | 290 | | |
277 | | - | |
| 291 | + | |
| 292 | + | |
278 | 293 | | |
279 | 294 | | |
280 | | - | |
281 | | - | |
282 | | - | |
283 | | - | |
284 | | - | |
285 | | - | |
286 | | - | |
287 | | - | |
288 | | - | |
289 | | - | |
290 | | - | |
291 | | - | |
292 | | - | |
293 | | - | |
294 | | - | |
295 | | - | |
296 | | - | |
297 | | - | |
298 | | - | |
299 | | - | |
300 | | - | |
301 | | - | |
302 | | - | |
303 | | - | |
304 | | - | |
305 | | - | |
306 | | - | |
307 | | - | |
308 | | - | |
309 | | - | |
310 | | - | |
311 | | - | |
312 | | - | |
313 | | - | |
314 | | - | |
315 | | - | |
316 | | - | |
317 | | - | |
318 | | - | |
319 | | - | |
320 | | - | |
321 | | - | |
322 | | - | |
323 | | - | |
324 | | - | |
325 | | - | |
326 | | - | |
327 | | - | |
328 | | - | |
329 | | - | |
330 | | - | |
331 | | - | |
332 | | - | |
333 | | - | |
334 | | - | |
335 | | - | |
336 | | - | |
337 | | - | |
338 | | - | |
339 | | - | |
340 | | - | |
341 | | - | |
342 | | - | |
343 | | - | |
344 | | - | |
345 | | - | |
346 | | - | |
347 | | - | |
348 | | - | |
349 | | - | |
350 | | - | |
351 | | - | |
352 | | - | |
353 | | - | |
354 | | - | |
355 | | - | |
356 | | - | |
357 | | - | |
358 | | - | |
359 | | - | |
360 | | - | |
361 | | - | |
362 | | - | |
363 | | - | |
364 | | - | |
365 | | - | |
366 | | - | |
367 | | - | |
368 | | - | |
| 295 | + | |
| 296 | + | |
369 | 297 | | |
370 | 298 | | |
371 | | - | |
372 | | - | |
373 | | - | |
374 | | - | |
375 | | - | |
376 | | - | |
377 | | - | |
378 | | - | |
379 | | - | |
380 | | - | |
381 | | - | |
382 | | - | |
383 | | - | |
384 | | - | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
385 | 303 | | |
386 | | - | |
387 | | - | |
388 | | - | |
389 | | - | |
| 304 | + | |
390 | 305 | | |
391 | | - | |
392 | | - | |
393 | | - | |
394 | | - | |
395 | | - | |
396 | | - | |
397 | | - | |
398 | | - | |
399 | | - | |
400 | | - | |
401 | | - | |
402 | | - | |
403 | | - | |
404 | | - | |
405 | | - | |
406 | | - | |
407 | | - | |
408 | | - | |
409 | | - | |
410 | | - | |
411 | | - | |
412 | | - | |
413 | | - | |
414 | | - | |
415 | | - | |
416 | | - | |
417 | | - | |
418 | | - | |
419 | | - | |
| 306 | + | |
| 307 | + | |
420 | 308 | | |
421 | 309 | | |
422 | 310 | | |
| |||
0 commit comments