fix(issueReporter): stabilize auto-issue dedup and cooldown logic#405
Open
shaun0927 wants to merge 1 commit intoEvoMap:mainfrom
Open
fix(issueReporter): stabilize auto-issue dedup and cooldown logic#405shaun0927 wants to merge 1 commit intoEvoMap:mainfrom
shaun0927 wants to merge 1 commit intoEvoMap:mainfrom
Conversation
…cooldown on skip, tighten existing-issue match Four interacting bugs in the auto-issue reporter combined to defeat its own purpose. Symptoms are already visible on this tracker: issues EvoMap#395, EvoMap#396, EvoMap#397, and EvoMap#404 carry identical auto-titles because the reporter cannot detect that it just filed the same thing. 1. computeErrorKey hashed the occurrence count. recurring_errsig(3x):… and recurring_errsig(4x):… produced different SHA-256 keys, so recentIssueKeys.includes() never matched and dedup was effectively off. The key is now normalized via the same regex already used in extractErrorSignature. 2. shouldReport bypassed the minStreak gate when the streak signal was absent. extractStreakCount returns 0 when no consecutive_failure_streak_N is present, and the old 'streakCount > 0 && streakCount < minStreak' guard did not fire. Callers who raised EVOLVER_ISSUE_MIN_STREAK still got early reports. The '> 0' precondition is removed. 3. maybeReportIssue rewrote lastReportedAt on the 'skip duplicate' branch even though no new issue was filed. This kept resetting the cooldown clock every cycle, so while the existing open issue stayed open, no re-report was ever possible. The skip branch now preserves the prior lastReportedAt and only updates lastSkippedAt. 4. findExistingIssue matched unrelated titles via a loose substring fallback (it.title.indexOf(titleSig) !== -1). It now requires the candidate title to begin with the known auto-issue prefix and start with the same signature. computeErrorKey, extractStreakCount, and extractErrorSignature are exported so the regressions can be covered by unit tests. Three new cases in test/issueReporter.test.js exercise the three behaviours. Verification: node test/issueReporter.test.js # before: TypeError: computeErrorKey is not a function # after: issueReporter.test.js: OK
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.
Problem
Four interacting bugs in
src/gep/issueReporter.jscombine to defeat themodule's own purpose. The symptoms are already visible on this tracker:
issues #395, #396, #397, and #404 are identical auto-filed duplicates
that the reporter was supposed to suppress.
computeErrorKeyhashes the occurrence count. It feeds signalslike
recurring_errsig(3x):timeout in API callandrecurring_errsig(4x):timeout in API callverbatim into SHA-256, sothe same underlying error produces a different key every emission.
recentIssueKeys.includes(errorKey)can never match.shouldReportbypasses theminStreakgate when the streaksignal is absent.
extractStreakCountreturns0when noconsecutive_failure_streak_Nsignal is present, and thestreakCount > 0 && streakCount < minStreakguard short-circuits.Users who raise
EVOLVER_ISSUE_MIN_STREAKstill get early reports.maybeReportIssueresetslastReportedAton the skip branch.When
findExistingIssuereturns an existing open issue, the codelogs "skipping duplicate" but still writes
lastReportedAt: new Date().toISOString(). The cooldown check thensees a freshly-bumped timestamp, so as long as the existing open
issue stays open, no re-report is ever possible.
findExistingIssuesubstring fallback matches unrelatedtitles. The fallback
it.title.indexOf(titleSig) !== -1matchesany title that merely contains the signature as a substring.
computeErrorKey,extractStreakCount, andextractErrorSignaturewere not exported, which is how all three bugs in category (1)–(3)
shipped without test coverage.
Fix
recurring_errsig(Nx):prefix insidecomputeErrorKey(uses the same regex that
extractErrorSignaturealready uses).> 0precondition from theminStreakgate.lastReportedAton the skip branch; onlylastSkippedAtandrecentIssueKeysare updated.both the auto-issue prefix and the same signature.
Testing
Against
mainwith the new test cases (added in this PR):With this PR applied:
The three new test cases cover:
computeErrorKeyis stable across(3x),(4x),(5x)prefixes.shouldReport(minStreak=5)returnsfalsewhen the streak signal ismissing, and
truewhen the streak meets the minimum.findExistingIssuedoes not match a title that contains the searchsignature as an unrelated substring.
Scope
src/gep/issueReporter.js— 4 focused edits, no behaviour changeoutside the bug paths; module exports gain three helpers (additive).
test/issueReporter.test.js— three new cases.No changes to obfuscated modules. No config changes. No new
dependencies.
Follow-ups (not in this PR)
DEFAULT_REPO = 'autogame-17/capability-evolver'legacy handle —separate issue.
sanitize.jspattern gaps (Slack, JWT, Azure, Discord) — separateissue.