Repository navigation
TD-5302: the computer is told when a timed phone permission runs out - #128
Merged
Merged
Conversation
"Turn on for 1 hour" and a daemon-enforced expiry were already there (TD-5279): the policy reads the clock on every message. The computer was never told when a grant ran out; its Settings row just read "Off" again. The expiry timer now snapshots the grants when armed and, when it fires, sends phone_permission_lapsed (loopback windows only) for each timed grant that was on and is not live now. The window shows a banner naming the permission and where to turn it on again. A grant switched off by hand re-arms the timer first, so it is never reported. Co-Authored-By: Claude Opus 5.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.
Owner decision #6: a time-limited phone grant whose expiry the daemon enforces, and the computer sees it lapse.
What was already on main (TD-5279), checked: Settings already offers "Turn on for 1 hour", and the protocol accepts
expires_in_secondsup to seven days. The expiry is saved inphone-permissions.yaml, and the policy reads the clock on every message, so a grant stops working at its expiry even with no window open.What was missing: the computer was never told when a grant ran out. The Settings row just read "Off" again.
Change
phone_permission_lapsed(capability,label,expired_at) for each timed grant that was on and is no longer live.Tests
test_phone_grant_lapse.pyruns a 3-second grant over the wire: allowed, then the lapse event, thenphone_permission_off, and the phone is not sent the event. Turning a grant off by hand sends no event.🤖 Generated with Claude Code