executor
executor
¶
Carrying out a verified command on THIS device.
By the time anything here runs, the command has already survived every check of spec §9. What remains is the narrowest possible action — and the discipline of spec §34: a remote tool never touches storage directly, it asks the same services the local UI asks. Otherwise the mesh becomes a second source of truth, and the two drift.
Screens are opened by publishing an event the desktop shell listens to, not
by driving the window from here: the app already knows how to route
success://…, and duplicating that knowledge would guarantee the two
disagree eventually.
Classes¶
Functions:¶
push_shell_event
¶
Queue one verified event for the shell. False when the queue is full.
It used to evict the OLDEST — del _pending[:-_MAX_PENDING] — and say
nothing. Those oldest entries had already been answered SUCCESS to the
device that sent them, so dropping them turned a past promise into a lie
after the fact, and nothing anywhere recorded it.
flush_pending delivers up to twenty commands per device in one tick
(dispatch.limit_per_device) while this queue holds sixteen, so the case
is reachable the moment a peer comes back from an hour offline.
Refusing the NEWEST is the only policy under which every SUCCESS already handed out stays true. The new command gets an honest failure instead, which its sender can act on — the evicted ones could not.
Source code in src/diapason/mesh/executor.py
push_navigation
¶
pending_navigations
¶
What the shell should open, oldest first.
A draining read is the ONLY evidence this process has that a window is
attached: nothing registers, nothing announces itself, the shell simply
polls. drain=False is a diagnostic read and deliberately does not count
— looking is not collecting, and a debugging curl must not make the
machine believe someone is watching the screen.
Source code in src/diapason/mesh/executor.py
shell_is_collecting
¶
Has a window emptied the queue recently enough to still be there?
26 August 2026. Every handler below used to push an entry onto _pending
and return a sentence in the past tense — "Notification affichée.",
"L'élément est affiché." — having displayed precisely nothing. The only
code that displays anything is the React shell polling /v1/mesh/inbox.
It cost a real evening: a Windows PC ran the Python server with no window
open at all. Notifications sent from the Mac were answered SUCCESS /
"Notification affichée.", recorded as such on both machines, while the
entries sat in _pending until the seventeenth pushed the first out
silently. Nobody saw a thing, and every screen said otherwise (§100).
This does not prove the notification WILL be shown — the shell could be denied permission by the OS a second later. It proves the far more useful negative: that nobody is there to show it.