Skip to content

Top-bottom code writing flag - #17

Open
jrj221 wants to merge 4 commits into
mainfrom
top-bottom
Open

jrj221 wants to merge 4 commits into
mainfrom
top-bottom

Conversation

@jrj221

@jrj221 jrj221 commented Dec 1, 2026

Copy link
Copy Markdown
Contributor

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).

jrj221 and others added 3 commits December 1, 2026 11:25
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>
@byubean

byubean commented Dec 1, 2026

Copy link
Copy Markdown
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants