Summary
SuggestionStore.ComputeHash (line 68-73 in SuggestionStore.cs) derives the dedup hash from (category + language + normalized description). However, when the same description is scrubbed for GitHub submission (removing inline code at line 132 in GitHubIssueReporter.cs), the scrubbed version may have different character count than the original. If two suggestions have descriptions that normalize to the same hash but differ in inline-code density, they are treated as duplicates even though their GitHub issues would have visibly different bodies. Conversely, if title truncation at line 120-122 causes different descriptions to produce the same 60-char prefix, the hash treats them as separate even though the GitHub issues are indistinguishable.
Where
src/CodeIndex/Cli/SuggestionStore.cs:68-73
src/CodeIndex/Cli/GitHubIssueReporter.cs:119-123 (title truncation)
src/CodeIndex/Cli/GitHubIssueReporter.cs:132-133 (description scrubbing)
src/CodeIndex/Mcp/McpToolHandlers.cs:1896 (hash computed before scrubbing)
Suggested approach
- Clarify dedup semantics: are two suggestions duplicates if they have the same normalized description, or only if their GitHub issues would be identical (title + body)?
- If dedup should match GitHub behavior, compute hash on scrubbed description + truncated title to catch real duplicates
- Or: document that dedup operates on raw input (before scrubbing) and accept that scrubbed versions may appear different on GitHub
- Add integration test: create two suggestions with different inline-code density, verify they both POST to GitHub (or both get deduplicated, depending on desired behavior)
- Add a pre-submission dedup check in CreateIssueAsync that searches GitHub for similar issues before POSTing
- Update SuggestionRecord to store both raw and scrubbed versions so future dedup improvements can compare against GitHub-visible content
Summary
SuggestionStore.ComputeHash (line 68-73 in SuggestionStore.cs) derives the dedup hash from (category + language + normalized description). However, when the same description is scrubbed for GitHub submission (removing inline code at line 132 in GitHubIssueReporter.cs), the scrubbed version may have different character count than the original. If two suggestions have descriptions that normalize to the same hash but differ in inline-code density, they are treated as duplicates even though their GitHub issues would have visibly different bodies. Conversely, if title truncation at line 120-122 causes different descriptions to produce the same 60-char prefix, the hash treats them as separate even though the GitHub issues are indistinguishable.
Where
src/CodeIndex/Cli/SuggestionStore.cs:68-73src/CodeIndex/Cli/GitHubIssueReporter.cs:119-123(title truncation)src/CodeIndex/Cli/GitHubIssueReporter.cs:132-133(description scrubbing)src/CodeIndex/Mcp/McpToolHandlers.cs:1896(hash computed before scrubbing)Suggested approach