Skip to content

driverkit: keep report set in sync when sink is unready; stamp connection telemetry (MAL-57 Layer 3)#28

Merged
malpern merged 1 commit into
keypath/bundledfrom
mal-57-layer3-report-set-sync
Jun 11, 2026
Merged

driverkit: keep report set in sync when sink is unready; stamp connection telemetry (MAL-57 Layer 3)#28
malpern merged 1 commit into
keypath/bundledfrom
mal-57-layer3-report-set-sync

Conversation

@malpern

@malpern malpern commented Jun 11, 2026

Copy link
Copy Markdown
Owner

Summary

Fixes #27 (see the corrected analysis there). Two changes to the vendored driverkit crate:

Layer 3 — report-set divergence fix. The outer send_key returned 2 (sink unready) before the per-usage-page template ran, so keyboard.keys insert/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 test green (42 tests)
  • Post-bundle verification on a live install: stamped vhid-client: lines appear in the daemon stdout log; SIGSTOP/CONT cycle shows the heartbeat-deadline line

…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 malpern merged commit 12b64a6 into keypath/bundled Jun 11, 2026
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>
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