Skip to content

fix(router): strip every trailing bot suffix in normalizeGitHubActor - #808

Merged
steipete merged 1 commit into
mainfrom
fix/normalize-actor-idempotent
Jul 23, 2026
Merged

steipete merged 1 commit into
mainfrom
fix/normalize-actor-idempotent

Conversation

@steipete

Copy link
Copy Markdown
Contributor

What Problem This Solves

Fixes #574. normalizeGitHubActor stripped only one trailing [bot] suffix, so evil[bot][bot] normalized to evil[bot] — one strip away from colliding with a real bot's normalized identity in the re-review requester dedupe key, the one comparison built on this normalization.

Why This Change Was Made

The strip is now anchored and greedy (/(\[bot\])+$/i), removing every contiguous trailing suffix in one pass and making the function idempotent. Embedded markers (keeps[bot]inside) are untouched. Call-site audit: the only production consumer is the requester key in supersededReReviewVersions; isAllowedMutationActor compares raw lowercase logins against the trusted list and was never affected.

User Impact

Actor normalization can no longer be spoofed by suffix stacking.

Evidence

  • node --test test/repair/comment-router-utils.test.ts: 48/48 pass, including the doubled-suffix, mixed-case, idempotency, and embedded-marker regressions.
  • Codex autoreview: clean (correct 0.98).

@clawsweeper

clawsweeper Bot commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

ClawSweeper status: review started.

I am starting a fresh review of this pull request: fix(router): strip every trailing bot suffix in normalizeGitHubActor This is item 1/1 in the current shard. Shard 0/1.

This placeholder means the worker is alive and reading the current context. I will edit this same comment with the actual review when the claws are done clicking.

Crustacean status: shell secured, claws on keyboard, evidence pebbles being sorted.

@steipete
steipete merged commit 95d3ca2 into main Jul 23, 2026
9 checks passed
@steipete
steipete deleted the fix/normalize-actor-idempotent branch July 23, 2026 13:55
azaj01 pushed a commit to azaj01/clawsweeper that referenced this pull request Sep 21, 2026
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.

normalizeGitHubActor: not idempotent — strips only one trailing [bot]

1 participant