Skip to content

docs(skills): say when the queued check of an edit runs relative to the flush - #565

Merged
ThomasK33 merged 1 commit into
mainfrom
docs/selection-skill-check-order
Nov 12, 2026
Merged

ThomasK33 merged 1 commit into
mainfrom
docs/selection-skill-check-order

Conversation

@ThomasK33

@ThomasK33 ThomasK33 commented Nov 12, 2026 •

Copy link
Copy Markdown
Member

What changes

One sentence of .agents/skills/verify-selection-tracking/SKILL.md (the bullet about edits in visual mode that the model leaves out). It said that when the key comes first, the schedule that checks the edit "runs later, after the flush". That is the usual order, but not the only one.

A ModeChanged handler that runs before the plugin's and turns the main loop (vim.wait(0), for example) runs the queued check earlier: after Neovim ended visual mode and before the flush. The key listener has already checked the edit at the key, so check_visual_edits finds nothing to judge. That is the unchecked_edits == 0 guard, which #540 pins with a unit test and an integration case. The second check finds nothing to do in both orders.

The sentence now says both orders and why the result is the same.

Evidence

The independent verifier of #540 found the gap (round c, evidence trail/evidence/540c). Its probe k_probe.lua runs a handler that calls vim.wait in ModeChanged (*:n, and v:*): with the guard (the head and mutant K), Claude holds alpha in 28 of 28 runs; without it (mutant H) in 10 of 14, and with main's code in 8 of 14.8.0 and 0.12.3. Without the guard it holds the cursor.

I read the other places that describe the order (the replay headers, lua/claudecode/README.md, the comment in note_visual_edit). The comment in note_visual_edit (selection.lua:215) says the mapping "reaches the flush before the schedule", which is the same claim; the guard keeps the result right, and a later PR corrects that comment.

Gates

  • Docs only: no lua/ file and no covered block changes, so no lock needs a re-record. --hash-only matches for all four verify-* skills.
  • treefmt --ci: 427 files, 0 changes.

Generated with xum • Model: anthropic:claude-sonnet-5-5 • Thinking: xhigh

…he flush

SKILL.md said that when the key comes first the schedule runs later, after the flush.
A ModeChanged handler that turns the main loop runs it earlier, after visual mode ended
and before the flush. The key listener has already checked the edit, so the second check
finds nothing to do in both orders (the unchecked_edits == 0 guard).
@ThomasK33

Copy link
Copy Markdown
Member Author

@codex review

@ThomasK33

Copy link
Copy Markdown
Member Author

@codex security review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 12, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-12T15:50:42.606833Z df1619c Manual request
🔒 Security Review ✅ Completed 2026-11-12T15:51:54.770427Z df1619c Manual request
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Breezy!

Reviewed commit: df1619c641

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review

Security review completed. No security issues were found in this pull request.

Reviewed commit: df1619c641

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

@ThomasK33
ThomasK33 added this pull request to the merge queue Nov 12, 2026
Merged via the queue into main with commit db0dbb1 Nov 12, 2026
7 checks passed
@ThomasK33
ThomasK33 deleted the docs/selection-skill-check-order branch November 12, 2026 18:30
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.

1 participant