fix(audit): make detector-ID collisions visible (display + load-time warning)#50
Merged
Merged
Conversation
…warning) #48 un-masked the COUNT when two detectors share an id, but the displayed finding still showed only the first-registered detector's title — so a `.console/task.md` violation surfaced as "[R2] README first H1 does not match repo name" and silently misdirected a consumer (the reviewer escalated it as ci_misconfigured_check; the goal lane stalled for hours chasing a phantom README issue). This makes the collision visible at both points: - audit_kit/result.py: `collision_note(pattern)` — a marker rendered for any merged (collided) pattern, naming the colliding sources and warning that the title may not match the finding (read the samples). Used by both the single-repo (audit.py) and multi-repo (multi.py) finding renderers. - cli/runner.py: `_warn_detector_id_collisions(detectors)` logs a WARNING at load time for every id registered by more than one detector, listing each source's description — so the collision is fixable at the source (rename the custom detector) instead of being discovered the hard way. Non-breaking: no detector ids renamed; the builtin readme R1/R2 vs reconcile R1/R2 families and custom-plugin ids keep working, the collision is just no longer silent. 3 new tests (collision marker on/off, load-time warning fires per duplicate and not for unique ids); 1130 existing tests pass; `ruff check src` clean. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
The durable upstream half of the detector-ID collision saga (#48 was the first half).
#48 un-masked the count when two detectors share an id — but the displayed finding still showed only the first-registered detector's title. So a
.console/task.mdviolation surfaced as:…which silently misdirected a consumer: the reviewer saw a nonsensical "README H1" failure on a CLI PR, classified it
ci_misconfigured_check, escalated to a human, and the goal lane stalled for hours chasing a phantom README issue. (Diagnosing it required running the exact custodian, the real boundary artifact, and invoking the.consoledetector directly.)Fix — make the collision visible at both points (non-breaking)
audit_kit/result.py→collision_note(pattern): a marker rendered for any merged (collided) pattern, naming the collidingcollision_sourcesand warning that the title may not match the finding — read the samples. Used by both finding renderers (cli/audit.py,cli/multi.py).cli/runner.py→_warn_detector_id_collisions(detectors): logs aWARNINGat load time for every id registered by more than one detector, listing each source's description — so the collision is fixable at the source (rename the custom detector) instead of discovered the hard way.No detector ids are renamed — the builtin
readmeR1/R2 vsreconcileR1/R2 families and custom-plugin ids keep working; the collision is just no longer silent.Tests
3 new tests (collision marker on/off; load-time warning fires per duplicate and not for unique ids). 1128 existing tests pass;
ruff check src+tyclean.🤖 Generated with Claude Code