Queue behind stronger lockers; bump gatelock to v0.7.1

Diet_guard was one of the two lockers missing gatelock's
wait_for_turn fix -- confirmed live on 2026-08-21, it held the global
grab for ~3 minutes against a newly-arriving, higher-ranked
screen_locker, which just retried and logged instead of making
progress. Now queues behind any stronger claim before arming.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018M5gKyYzxWG6QkCaj1wWfk
This commit is contained in:
Krzysztof Rudnicki 2026-08-21 13:06:19 +02:00
parent b53ac92c59
commit 0173f4c56c
5 changed files with 8 additions and 4 deletions

View File

@ -102,7 +102,7 @@ repos:
additional_dependencies: additional_dependencies:
- pytest - pytest
- requests - requests
- gatelock @ git+https://github.com/kuhyx/utils@gatelock-v0.5.0#subdirectory=gatelock - gatelock @ git+https://github.com/kuhyx/utils@gatelock-v0.7.1#subdirectory=gatelock
- crdt-sync @ git+https://github.com/kuhyx/utils@crdt-sync-v0.6.0#subdirectory=crdt-sync - crdt-sync @ git+https://github.com/kuhyx/utils@crdt-sync-v0.6.0#subdirectory=crdt-sync
- mcp>=2,<3 - mcp>=2,<3
- pydantic - pydantic

View File

@ -2,7 +2,7 @@ name: diet_guard_app
description: "Companion phone app for diet_guard: log meals on the go." description: "Companion phone app for diet_guard: log meals on the go."
publish_to: 'none' publish_to: 'none'
version: 1.0.40+1 version: 1.0.41+1
environment: environment:
sdk: ^3.12.2 sdk: ^3.12.2

View File

@ -52,6 +52,7 @@ from gatelock import (
LockConfig, LockConfig,
LockWindow, LockWindow,
SurfaceInfo, SurfaceInfo,
wait_for_turn,
) )
from diet_guard._gate import due_slots from diet_guard._gate import due_slots
@ -151,6 +152,9 @@ class MealGate(_GateCalendar):
disable_vt=config.resolved_disable_vt(), disable_vt=config.resolved_disable_vt(),
) )
arbiter.publish() arbiter.publish()
# Wait with nothing on screen for any stronger claim; never exits
# here, so a higher-ranked locker means "later", never "skip".
wait_for_turn(arbiter)
arbiter.acquire_holder() arbiter.acquire_holder()
self._lock = LockWindow(self.root, config, hooks=self, arbiter=arbiter) self._lock = LockWindow(self.root, config, hooks=self, arbiter=arbiter)
self._vars = make_vars(self.root) self._vars = make_vars(self.root)

View File

@ -4,7 +4,7 @@ version = "1.0.0"
description = "Tkinter/systemd log-to-unlock meal gate with calorie/macro budget tracking" description = "Tkinter/systemd log-to-unlock meal gate with calorie/macro budget tracking"
requires-python = ">=3.10" requires-python = ">=3.10"
dependencies = [ dependencies = [
"gatelock @ git+https://github.com/kuhyx/utils@gatelock-v0.5.0#subdirectory=gatelock", "gatelock @ git+https://github.com/kuhyx/utils@gatelock-v0.7.1#subdirectory=gatelock",
"crdt-sync @ git+https://github.com/kuhyx/utils@crdt-sync-v0.6.0#subdirectory=crdt-sync", "crdt-sync @ git+https://github.com/kuhyx/utils@crdt-sync-v0.6.0#subdirectory=crdt-sync",
"requests>=2.31.0", "requests>=2.31.0",
] ]

View File

@ -4,7 +4,7 @@ bandit>=1.7.0
codespell>=2.2.0 codespell>=2.2.0
coverage>=7.4.0 coverage>=7.4.0
crdt-sync @ git+https://github.com/kuhyx/utils@crdt-sync-v0.6.0#subdirectory=crdt-sync crdt-sync @ git+https://github.com/kuhyx/utils@crdt-sync-v0.6.0#subdirectory=crdt-sync
gatelock @ git+https://github.com/kuhyx/utils@gatelock-v0.5.0#subdirectory=gatelock gatelock @ git+https://github.com/kuhyx/utils@gatelock-v0.7.1#subdirectory=gatelock
mcp>=2,<3 mcp>=2,<3
mypy>=1.8.0 mypy>=1.8.0
pre-commit>=3.6.0 pre-commit>=3.6.0