Skip to content

resolver

diapason.mesh.resolver

Turning « sur mon PC » into a device id — or refusing to guess.

Spec §22. The assistant hears a phrase, not an identifier. This module is the only place allowed to bridge the two, and its governing rule is that a wrong guess is worse than a question: opening a screen on the wrong machine is confusing, and sending a notification to the wrong one is a small betrayal of trust. So when two devices match equally well, this returns an AMBIGUOUS answer with the candidates rather than picking the first.

The one place it does decide on its own: a single obvious match, or a tie broken by reachability — because "the phone that is on" is what a person means by "my phone" when only one is awake.

describe_devices(devices)

The fleet as the assistant should see it: names, kinds, and whether they are awake. No keys, no addresses — nothing the model needs.

resolve_device(phrase, devices, *, local_device_id='')

Read phrase against the fleet and say who is meant — or that it is unclear.

Returns one of four outcomes, each with a French sentence the assistant can say verbatim:

LOCAL the user means this machine; do not route anything. RESOLVED one device, with device. AMBIGUOUS several plausible, with candidates — ask, do not pick. UNKNOWN nothing matched, with candidates listing what exists.