feat: add time-based comment filtering to tag mode (#512)

Implement time-based filtering for GitHub comments and reviews to prevent
malicious actors from editing existing comments after Claude is triggered
to inject harmful content.

Changes:
- Add updatedAt and lastEditedAt fields to GraphQL queries
- Update GitHubComment and GitHubReview types with timestamp fields
- Implement filterCommentsToTriggerTime() and filterReviewsToTriggerTime()
- Add extractTriggerTimestamp() to extract trigger time from webhooks
- Update tag and review modes to pass trigger timestamp to data fetcher

Security benefits:
- Prevents comment injection attacks via post-trigger edits
- Maintains chronological integrity of conversation context
- Ensures only comments in their final state before trigger are processed
- Backward compatible with graceful degradation

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
Ashwin Bhat
2025-08-29 09:49:08 -07:00
committed by GitHub
parent c041f89493
commit a6888c03f2
5 changed files with 850 additions and 21 deletions

View File

@@ -46,6 +46,8 @@ export const PR_QUERY = `
login
}
createdAt
updatedAt
lastEditedAt
isMinimized
}
}
@@ -59,6 +61,8 @@ export const PR_QUERY = `
body
state
submittedAt
updatedAt
lastEditedAt
comments(first: 100) {
nodes {
id
@@ -70,6 +74,8 @@ export const PR_QUERY = `
login
}
createdAt
updatedAt
lastEditedAt
isMinimized
}
}
@@ -100,6 +106,8 @@ export const ISSUE_QUERY = `
login
}
createdAt
updatedAt
lastEditedAt
isMinimized
}
}