feat(#27): add bounded Windows Terminal active-tab guard - #28
Merged
Conversation
rblake2320
marked this pull request as ready for review
July 18, 2026 18:59
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.
Scope
Adds the bounded Windows Terminal active-tab guard tracked by #27.
Evidence
python -m pytest -q: 830 passed, 10 skipped.python -m build: sdist and wheel built; wheel contains the module, drill, result, and documentation.Boundary
This does not claim exclusive per-tab hardware or message routing. UIA selection and later PostMessage/SendInput calls are not atomic. RuntimeIds are desktop-session opaque and reusable; title and tab index are never identity. Exact preventive routing remains a separate birth-ID-bound named-pipe/control-plane transport.
Issue #27 remains open pending independent review and merge evidence.
Review amendment
Fails closed unless exactly one TextPattern candidate contains the focused UIA element; document-length fallback removed. Native-batch entry remains ambiguous through result validation and the post-call checkpoint; explicit returned zero acceptance remains refused. Caller-asserted birth_id is digest-bound, not live-registry-attested by this module.
Strict zero refusal amendment: only the exact typed CASCADIA postmessage result schema (ok=false, requested=1, accepted=0, target-bound, no missing/extra fields) clears native-entry ambiguity. Seven malformed/inconsistent zero-result vectors remain ambiguous.
Production-integration amendment: _production_send_body now emits the canonical typed delivery-result schema for class/override denial, deadline, PostMessage rejection, and success. A real monkeypatched _send_char_postmessage=False result passes the exact-zero classifier and the guarded-submit integration refuses; malformed zeros remain ambiguous.