Repository navigation
fix(keys_highway_3d): keep run score across mastery changes #129
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
075c688
fix(keys_highway_3d): keep run score across mastery changes (#94)
claude 68972bc
fix(changelog): restore CRLF line endings so the diff is one entry
claude cc6ab0f
test: parse the vocal regression fixture with safe_xml (CodeFactor B314)
claude dd9f96f
fix(tests): use safe_xml for untrusted test XML (CodeFactor B314)
claude 4009d36
fix(tests): use safe_xml for untrusted test XML (CodeFactor B314)
pullfrog[bot] File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
WARNING: Retaining
_hitNoteKeysacross a mastery change turns a replayed already-hit note into a wrong-note missjudgeHit(screen.js:669) skips any note whosenoteKeyis already inhitKeysand returnsnull. With the judged sets no longer cleared by_resetScoring()here, a note that was hit, then dropped out of the playable set by a mastery change, then brought back into view and played again falls through to theelsebranch in_checkHit(screen.js:3483-3496):matchesHiddenHandNotereturns false (hand filter is not excluding it), so it books a_misses++and a_streak = 0. A correctly replayed note is penalised and breaks the run's streak — the exact class of bug #94 is about._onSeek('back')→forgetJudgmentsFromdoes clear the stale keys, so loop-wrap and Section Practice rewinds are covered, and a note already in the past cannot be replayed without a seek — so this needs a hit withinHIT_TOLERANCE_Sof the mastery change. That is narrow, which is why this is a WARNING rather than CRITICAL, but it is a real hole in the retention the new comment relies on.Cheap hardening: when a mastery change rebuilds the playable set, drop keys for notes that are no longer present (
for (const k of _hitNoteKeys) if (!newKeys.has(k)) _hitNoteKeys.delete(k)), or havejudgeHitdistinguish "already hit" from "no match" so a replay is idempotent rather than a miss.Reply with
@kilocode-bot fix itto have Kilo Code address this issue.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Checked this against
judgeHitand_checkHit; I don't think it's a regression, so I'm leaving the code as is.judgeHitonly iterates_notation.playable, so a retained key for a note that is no longer in the playable set is never consulted. A stale key can only matter for a note that is present, withinHIT_TOLERANCE_Sof the press, and already hit.mainalready books it as a miss, with no mastery change involved, becausejudgeHitskips keys inhitKeys. The doc comment onjudgeHitlists "a duplicate" among the null returns.hitKeys, so the duplicate press would score a second hit on one chart note. Retaining the keys makes the behavior consistent with the no-mastery-change case, and the totals stay correct.Pruning keys for absent notes would be harmless but wouldn't change any reachable outcome, so I'm not adding it. If you'd rather make duplicate presses neutral instead of misses, that would be a separate change to
_checkHit, since it affects non-mastery play too.Generated by Claude Code