Repository navigation
Conversation
Weighted multi-cursor checker for how much of a file was written in order, shown next to the edit and paste stats. Also classifies whitespace-only reformats (with a small allowance) as IDE actions instead of pastes. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Needs 200+ inserted characters before the flag applies. Moves reformat detection into recan/reformat.py (also requires whitespace to have changed), and fixes the player-bundle contract test. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Contributor
|
I want to be careful adding features around "not sure how that happened". I recommend leaving that feature out for now unless we see a recurring problem and understand what is happening. |
…; remove reformat detection Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
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.
When a recording is viewed, recan scores how much of each file was written in order, as if copied from another screen. It's shown as a "Top to bottom" percentage next to the edit and paste stats.
How it scores
It tracks cursors, each the end of a run of in-order typing. Typing at a cursor counts and moves it forward. Backspacing at it pulls it back.
Anything typed somewhere else starts a new cursor, so jumping back to fix a typo or rename a variable doesn't count as in-order writing.
Each cursor earns trust as it types. A run's n-th character counts n / 50, capped at 1. A long block counts in full, and a few characters after a jump count for almost nothing.
A cursor's trust drains by the characters typed elsewhere since it was last used. Returning to an old spot after a long stretch elsewhere has to build trust again.
Writing main at the bottom and then the rest of the file above it still scores well, because the second run ramps up to full weight.
It handles auto-closed brackets and quotes, and typing just before a trailing newline. Whitespace-only reformats are ignored, so Ctrl+Shift+L doesn't count for or against a file.
Flagging
A file scores weighted in-order characters divided by all inserted characters.
Above 80%, with at least 200 characters inserted, it's rated HIGH severity. This shows in the player, the stats CSV and the recording's overall severity.
Also changed
Whitespace-only reformats, allowing up to 5 other character changes, are now classified as IDE actions instead of unapproved pastes.
(5 other char changes are just wiggle room, a recording I tested with randomly had a character insert during a reformat, not sure how that happened).