Skip to content

QA pass for v1.0.0: normalize modes, observe command identities, add done-enough checklist - #15

Merged
ActualLearner merged 7 commits into
mainfrom
qa/v1.0.0
Aug 21, 2026
Merged

ActualLearner merged 7 commits into
mainfrom
qa/v1.0.0

Conversation

@ActualLearner

Copy link
Copy Markdown
Owner

What

QA pass against the product spec for the v1.0.0 tag (issue #10). Fixes two real spec bugs found during manual verification and adds the sharpened done-enough QA checklist the map asked for.

Changes

  1. engine (lua/keycoach/engine.lua): normalize canonical adapter modes ("normal"/"visual"/"select"/"operator_pending") to inventory short modes (n/v/s/o) before comparison. Previously the mismatch meant existing-mapping detection never fired and candidate conflict checks silently passed in real use.
  2. collector (lua/keycoach/nvim/collector.lua): record privacy-safe command identities on CmdlineLeave (colon cmdtype only, not aborted, non-terminal/prompt buffers, command name only — never arguments). Command identity is captured with the exact-mode context from the : keypress, because the live mode at CmdlineLeave is "c" (verified empirically), which would otherwise drop the identity. Two of the four V1 recommendation types were unreachable without it.
  3. docs (docs/qa-checklist.md + README link): sharpens the map's "QA checklist is fog" item into automated gates, a spec-derived verification matrix, release steps, and known limitations.

Tests

  • tests/engine_spec.lua: canonical-mode regression tests (Existing Mapping, Mapping Candidate conflict).
  • tests/collector_spec.lua: command-identity recording, invoking-mode preservation, ignore cases (aborted/non-colon/terminal/prompt), stop behavior.
  • tests/smoke_spec.lua (new): fully wired plugin via public keycoach API — install → onboard → real CmdlineLeave record; recommend → apply → retire a Mapping Candidate; Existing Mapping from a real inventory mapping.
  • make check: 76 passing (was 67). StyLua clean.

Review notes

  • Standards review flagged a duplicated mode-overlap helper; engine stays deliberately runtime-neutral (documented ADR), so the tiny local copy is kept rather than coupling to the Neovim inventory module.
  • Spec review caught the "c"-mode-at-CmdlineLeave bug; fixed by tracking the invoking exact-mode context.
  • Known limitations (failed commands counted, legacy :map x :X double-count) are documented in the checklist.

Closes #10

Observed mode names from the Neovim adapter ("normal", "visual",
"select", "operator_pending") never matched inventory short modes
("n", "v", "s", "o"), so existing-mapping detection never fired
and candidate conflict checks silently passed in real use. Normalize each
observation's mode once at the start of processing and keep the overlap
check conservative. Ref: #10
Key/mouse capture never observed commands, so two of the four V1
recommendation types were unreachable in live use. Record the command
name (never arguments) on CmdlineLeave for non-aborted colon commands in
non-terminal buffers, using the exact-mode context captured when the
user pressed ':' (the live mode at CmdlineLeave is "c", which would
otherwise drop the identity). Ref: #10
Sharpens the fog on the wayfinder map into a release gate: automated
gates, a spec-derived verification matrix, release steps, and known
limitations. Ref: #10
@coderabbitai

coderabbitai Bot commented Aug 19, 2026 •

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: f3d2b42d-6cb4-424e-84d2-47374f1b3499


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Covers the review notes on command name matching: Ex ranges and
substitutions starting with punctuation (:%s, :'<,'>d, :1,5d, :.d) are
ignored because they are not bindable, while :w! and :e# reduce to their
canonical command identities. Also proves that a couple of mistyped
commands below the 10-in-3-sessions evidence thresholds stay silent. Ref: #10
A consistently mistyped command (e.g. :Telescoop) could aggregate into a
bindable command identity and drive a candidate for a nonexistent command.
Skip commands that do not exist at execution time via exists(":name"), so
E492 typos never enter the evidence pool. Existing-mapping detection now
uses directional mode coverage so an "x" (visual+select) mapping is
recognized for visual and select observations, while a select-only mapping
is not reported as existing for a visual one. Ref: #10
exists(":name") returns 1 for abbreviated builtins but 2 for full
builtins and user-defined commands, so the == 1 filter dropped
:Telescope/:Example/:KeyCoach identities in real use; treat any nonzero
as existing. command_name now skips leading command modifiers (silent,
tab, vertical, keepjumps, ...) so :silent w records command:w instead of
command:silent, and ignores global/filter forms (:g/pat/d, :v/pat/d)
like the excluded range forms. Ref: #10
…-family coverage

Replace the hand-rolled name extraction with Neovim's own command parser.
nvim_parse_cmd resolves canonical full names (:w!/:write/:sil w all record
command:write), strips every modifier including abbreviations, rejects
unknown commands exactly when execution would fail with E492, and sees
through any filter delimiter, so the g//v// guard no longer misses :g?pat?d.
Ranged invocations are skipped via the parsed range.

mode_covers now matches Vim map semantics: a "v" mapping covers select
observations (vmap = Visual+Select) while an "x" mapping covers visual
only (xmap), so existing mappings are neither missed nor fabricated across
families. Ref: #10
@ActualLearner
ActualLearner merged commit 1c61b40 into main Aug 21, 2026
4 checks passed
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.

Manual QA pass and tag v1.0.0

1 participant