Skip to content

fix(audit): make detector-ID collisions visible (display + load-time warning)#50

Merged
ProtocolWarden merged 1 commit into
mainfrom
fix/detector-id-collision-visibility
Jun 22, 2026
Merged

fix(audit): make detector-ID collisions visible (display + load-time warning)#50
ProtocolWarden merged 1 commit into
mainfrom
fix/detector-id-collision-visibility

Conversation

@ProtocolWarden

Copy link
Copy Markdown
Owner

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.md violation surfaced as:

[R2] README first H1 does not match repo name

…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 .console detector directly.)

Fix — make the collision visible at both points (non-breaking)

  • audit_kit/result.pycollision_note(pattern): a marker rendered for any merged (collided) pattern, naming the colliding collision_sources and warning that the title may not match the finding — read the samples. Used by both finding renderers (cli/audit.py, cli/multi.py).
    [MED] [R2] README first H1 does not match repo name — 1 finding(s)  [⚠ DETECTOR-ID COLLISION across: builtin, custom — the title above is only the first-registered detector's; the real finding may be a different one, see samples]
          .console/task.md missing ## Objective
    
  • 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 discovered the hard way.

No detector ids are renamed — the builtin readme R1/R2 vs reconcile R1/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 + ty clean.

Companion: ProtocolWarden/OperationsCenter#384 renames that repo's colliding .console detectors to OC1/OC2. This upstream fix ensures any repo's future collision is loud, not silent.

🤖 Generated with Claude Code

…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>
@ProtocolWarden ProtocolWarden merged commit d3de6ee into main Jun 22, 2026
7 checks passed
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.

1 participant