When others are in the room
A kitchen with three people and three companions. A clinic waiting room with a stranger's. A classroom that has asked for quiet. Rowan keeps every step and every word the same in all of them. What changes is how it listens, how it accepts a confirmation, and who speaks first.
This page explains the design and says which parts run today. You can try it in the walkthrough: the room card stages another companion, or a quiet zone, against the real coordinator.
The three modes
"It is just us again. You can talk to me."
"Others are nearby. I will use taps now."
"This is a quiet place. I will show you each step and buzz. Tap when you finish."
Why there has to be a coordinator
If two companions take turns, something is keeping the turns. The moment one companion waits because another is speaking, the two share some state. That is fine, but it means there is a coordinator somewhere, and it is better to design it on purpose than to discover it later. On its own, each companion is fully independent. Coordination only switches on when other companions are detected nearby.
Presence::shape() returns mode solo when there are no sightings. Runs::heard() checks the mode before classifying anything.
speech.hold_sec is in every run state and the phone waits that long. Order is priority, then hash, so every device works out the same order.
Why headphones do not fix it
Headphones stop you hearing other people. They do nothing about your microphone hearing them. Three family members saying "done" in one kitchen is three microphones picking up all three voices, and no amount of politeness between apps changes that. So in a shared room, voice is used for prompts but not for confirmations.
Runs::heard(): a done intent in co_present mode is logged as voice_in_co_present with a tap_ask reply, and cleared stays false.
Purely a client concern. The server treats every heard text the same way.
Nothing in Rowan stores or compares audio features. Phrases stores only the text the recogniser returned.
How Rowan finds out who is nearby
Presence is anonymous. The coordinator only ever sees scrambled ids and a priority number. Nearby detection cannot be built on family accounts, because the patient sitting next to yours in a waiting room is not family. Instead each companion broadcasts a random token that changes every few minutes (the same privacy model as COVID exposure notifications) and reports the tokens it hears. The coordinator works out who is in the same room, applies priority, and sends back a small packet: who speaks in what order, how long to wait, and whether to go quiet. Devices apply it locally, so losing the connection costs nothing but the turn-taking.
POST /api/v1/presence?action=token. presence_tokens is app-side and knows the patient; coord_presence is coordinator-side and holds only SHA-256 hashes, a score and two booleans.
Coordinator.php touches coord_* tables only, no foreign keys. The smoke test greps the file and information_schema.
POST /api/v1/presence?action=beacon; Coordinator::registerBeacon(hash, quiet, label). The label is the venue's own words and is what the transcript shows.
POST /api/v1/presence?action=report {heard: [tokens], beacons: [ids]} every 20 s. A report older than 120 s drops out.
Phones, pendants and who speaks when
The coordinator ranks people, not gadgets, and every device one person carries behaves the same way. A room full of companions is also a room full of devices: phones, pendants, maybe a spare in a drawer. Two things could go wrong. Voices could talk over each other, and a confirmation could land on the wrong device or the wrong channel. The coordinator settles both without knowing what any of the hardware is. It decides who speaks when, and the packet it sends back says how a confirmation is taken in this room. Every device belonging to one person reads that same packet.
Presence::token() issues one token per patient; Presence::priority() scores it; Coordinator::report() takes one hash and one score. Devices are not a concept the coordinator has.
presence.confirm_by (voice_or_tap | tap), presence.mic and presence.voice_out in the run state. Runs::heard() enforces it server-side, so a client that ignores the packet still cannot clear by voice in a shared room.
GET /api/v1/devices?me=1 and GET /api/v1/patient both call Presence::refresh() and return presence beside the run state, including speech.hold_sec.
Devices::makeActive(); Devices::button() returns applied false for a spare. Runs::press() is the single path for the phone, the pendant and the caregiver's push.
awareness.slot, awareness.speak_after_sec, presence.voice_level. Coordinator::packetFor() sorts the group; Speech::forRun() turns the slot into hold_sec.
speech.text and speech.hold_sec are in every state for every client. The rule, when there is one, belongs on the app side beside Presence::resolve(), never in Coordinator.
The patient has to know the mode changed
Said out loud, the same way every time. Never left to be inferred from Rowan going quieter. For this population this matters more than the coordination itself. A short tone and one fixed spoken line, the same words every time. A badge that stays on the screen rather than a message that disappears. A buzz for the mode change that feels different from the buzz for a confirmation. The way out is announced the same way, so it is not just mysteriously quiet. And the caregiver can pin a mode so it never switches on its own.
Presence::LINES, sent in every state as presence.line. The phone speaks it when presence.change_seq moves, including on the way into quiet.
presence.haptic, presence.confirm_haptic, presence.badge in the state. The web phone uses WebAudio and navigator.vibrate where the device allows.
patients.presence_mode; Presence::resolve() lets the pin win over the packet.
The awareness packet has no field for reordering steps, on purpose.
Where identity ends up
Everything above eventually touches identity, and that gets heavy and regulated fast. Linking family members, caregiver access, sharing with a clinic, moving to a new device, deciding a patient's priority from their care context: this is the part MeCentral already does. The idea is that the patient owns their identity, their presence settings and their consents in their own vault; Rowan receives scores and yes/no answers instead of records. Most of that is not decided. One piece of it is built.
See /connected for what the rest of Rowan would gain.
core/classes/Mec.php; consent at Settings → Works with MeCentral; POST /api/v1/patients?id=N&action=mec-consent. Partner scope vault.fastdata is granted per integration by an operator; a 403 parks the vault until a human looks.
Integration "omi.projectz.xyz", sandbox key, MeCentral production. The patient can see and clear the rows at /fast-data on MeCentral.
A caution about earbuds
Everything technical above points at earbuds as the cleanest answer, and they probably are. But the more plugged in a person is, the further they drift from the people in the room. A family at breakfast, each in their own audio channel, each pulling out an earbud to answer a question and putting it back to hear the next prompt, is not a family having breakfast. Rowan's whole point is to reduce load and get out of the way. If the best technical answer makes the patient less present to the humans around them, the product is working against itself.