fix(tool-server): derive hidden-window failure_stage, pin keyboard guard exemption - #613
Open
filip131311 wants to merge 1 commit into
Open
fix(tool-server): derive hidden-window failure_stage, pin keyboard guard exemption#613filip131311 wants to merge 1 commit into
filip131311 wants to merge 1 commit into
Conversation
…emption Follow-up to #605, addressing the two actionable post-merge review findings: 1. assertChromiumWindowVisible took adjacent (action, failureStage) string params where the stage was always `chromium_<action>_window_hidden` — a typo or transposed argument compiled cleanly and would silently land telemetry in an unqueried bucket, breaking exactly the pre/post-migration joinability #605 froze `chromium_scroll_window_hidden` to preserve. The stage is now derived from a typed action union inside the helper; existing tests pin the exact per-tool stage strings, so the derivation is verified. 2. The keyboard/button guard exemption lived only in prose. New test pins it: an api whose visibility probe would report "hidden" must still type, and the probe must never be consulted (verified by mutation: adding the guard to the keyboard chromium impl fails the test). button has no chromium branch, so keyboard is the only tool to pin. Verified live on an Electron testbed (dev tool-server, genuinely minimized windows): keyboard types in ~37 ms and tap lands in ~55-73 ms on both an argent-booted (flagged) app and an external un-flagged app on :9222, with no guard false-positives. 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.
Follow-up to #605, addressing the two actionable findings from the post-merge review.
1. Derive
failure_stageinstead of hand-writing it per call siteassertChromiumWindowVisibletook adjacent(action, failureStage)string params where every call site passed a strictly redundant pair — the stage is alwayschromium_<action>_window_hidden. A typo or transposed argument compiled cleanly and read fine in review; the only symptom would be telemetry landing in an unqueried bucket, breaking exactly the pre/post-migration joinability #605 frozechromium_scroll_window_hiddento preserve.The helper now takes a typed
"tap" | "drag" | "scroll"action and derives the stage internally, so a drifting stage string can no longer compile. The existing guard tests assert the exact per-tool stage strings at the tool boundary, which pins the derivation (including the frozenchromium_scroll_window_hidden).2. Pin the keyboard exemption with a test
The keyboard/button exemption (key events skip compositor hit-testing and stay fast on hidden windows) was enforced only in prose — mutation testing in the review showed adding the guard to those tools would keep the suite green. New test: an api whose visibility probe would report
"hidden"must still type, and the probe must never even be consulted.buttonhas no chromium branch at all, so keyboard is the only tool to pin.Mutation-verified: temporarily adding
assertChromiumWindowVisibleto the keyboard chromium impl fails the new test; reverting restores green.Verification
typecheck:testsgreen, lint + prettier clean on changed files.:9222— no guard false-positives.🤖 Generated with Claude Code