driverkit: keep report set in sync when sink is unready; stamp connection telemetry (MAL-57 Layer 3)#28
Merged
Conversation
…tion telemetry (MAL-57 Layer 3) Fixes #27. The outer send_key returned 2 (sink unready) before the per-usage-page template ran, so the keyboard.keys insert/erase for a dropped event never happened. A Release dropped while unready left the full-state report set holding a key the user had released; if the sink recovered via a transient ready-flap without kanata entering full recovery, the next keystroke's report re-pressed the stale key — and no release ever followed (indefinite stuck key). Move the readiness check inside the template, after the set mutation: dropped events still update intent, only the post is skipped, and the next successful report converges. Telemetry (the gap that made the 2026-06-10 incidents attributable only by elimination): timestamp every connection status line this client prints, and log the previously-silent heartbeat-deadline reconnect path in the vendored pqrs client. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
malpern
added a commit
to malpern/KeyPath
that referenced
this pull request
Jun 11, 2026
… 3); fix engine cache hash Pulls malpern/kanata#28: a Release dropped while the VHID sink is unready no longer desyncs the C++ full-state report set (which could re-press a released key indefinitely on the next report), and every client connection event is now timestamped, including the previously silent heartbeat-deadline reconnect path. Also fixes Scripts/build-kanata.sh cache invalidation: the source hash only covered *.rs/*.toml/*.lock, so a C++-only change in the vendored driverkit crate served a stale cached engine. Include *.c/*.cpp/*.h/*.hpp. Co-Authored-By: Claude Fable 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.
Summary
Fixes #27 (see the corrected analysis there). Two changes to the vendored driverkit crate:
Layer 3 — report-set divergence fix. The outer
send_keyreturned 2 (sink unready) before the per-usage-page template ran, sokeyboard.keysinsert/erase for the dropped event never happened. A Release dropped while unready left the full-state report set holding a key the user had released; if the sink recovered via a transient ready-flap without kanata entering full recovery, the next keystroke's report re-pressed the stale key indefinitely (the absolute-full-state property from #26 faithfully re-asserts a corrupted set). Fix: move the readiness check inside the template, after the set mutation — dropped events still update intent, only the post is skipped, and the next successful report converges.Telemetry. Every connection status line this client prints now carries an HH:MM:SS.mmm timestamp, and the previously-silent heartbeat-deadline reconnect path in the vendored pqrs client logs a stamped reason line. The 2026-06-10 incidents could only be attributed to that path by eliminating the others.
Test plan
cargo build+cargo testgreen (42 tests)vhid-client:lines appear in the daemon stdout log; SIGSTOP/CONT cycle shows the heartbeat-deadline line