Rowan omi.projectz.xyz
Nearby

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.

BuiltNeeds the native appOpen decisionNot doing this

The three modes

Alonedefault
Voice or button finishes a step. The microphone opens after each prompt. This is the normal state.
Rowan says
"It is just us again. You can talk to me."
Others nearbyOthers nearby · taps only
Only a tap finishes a step. Voice still works for "more time" and "say it again". Companions take turns speaking. A badge stays on the screen, and Rowan says a fixed line on the way in and out.
Rowan says
"Others are nearby. I will use taps now."
Quiet placeQuiet place · screen and buzz
A venue beacon asked for it. Each step is shown on screen with a buzz; nothing is spoken or heard. Only a tap finishes a step. Same fixed announcement.
Rowan says
"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.

Alone, nothing changesBuilt
Solo is the default and the whole product. The button finishes a step, "Rowan, done" finishes a step, a bare "yes" does not. None of the nearby code is involved until another companion is actually heard.
Under the hood
Presence::shape() returns mode solo when there are no sightings. Runs::heard() checks the mode before classifying anything.
Turns, not volumeBuilt
When two companions share a room they take turns. Each one is given a slot and waits its turn (6 seconds per slot) before speaking. Nobody gets louder.
Under the hood
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.

In a shared room, a tap confirmsBuilt
When others are nearby, a spoken "done" does not finish the step. Rowan answers with the same words every time ("I heard you. Others are nearby, so please tap to finish.") and the step stays open until a tap on the phone or a press on the pendant. "Rowan, I need more time" and "say it again" still work by voice, because they change the prompt rather than finishing anything. This is also what makes Rowan safe in a room full of people who do not have Rowan at all, which is most rooms.
Under the hood
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.
A microphone close to the mouth does most of the workNeeds the native app
An earbud or a wrist microphone hears its owner from inches away and everyone else from across the room. The web phone cannot choose its microphone. A native app on a wearable can, and the server needs nothing new for it.
Under the hood
Purely a client concern. The server treats every heard text the same way.
Recognising who is speaking by their voiceNot doing this
Voice matching is unreliable, and it is weakest on siblings, children whose voices are changing, and atypical speech, which is exactly this population. A voiceprint is also a biometric identifier, the most tightly regulated kind of data there is. Listed here so the trap is visible.
Under the hood
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.

Rotating tokens, scrambled on the way inBuilt
The phone asks for a token to broadcast and gets a new one every 10 minutes. What it hears is reported raw and scrambled with a server secret as it arrives. When the token rotates, the old scrambled version is forgotten.
Under the hood
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.
A coordinator that cannot leak what it never hadBuilt
The coordinator reads and writes its own tables only. Those tables have no links into the rest of the database, the code takes no patient id, and it refuses anything that is not a scrambled id. The automated tests check this every run. Names, diagnoses and routine content never reach it. The priority score is worked out on the app side, from things the coordinator must not see: the caregiver's chosen band, whether the open step is about to run over, whether a caregiver is on duty beside the patient.
Under the hood
Coordinator.php touches coord_* tables only, no foreign keys. The smoke test greps the file and information_schema.
Quiet zonesBuilt
A clinic, a school or a church can create a beacon id and broadcast it from a cheap fixed beacon. Companions that see it go quiet: the screen and a buzz carry each step, and the voice and microphone stay off. The venue never learns who was there. The coordinator holds the beacon's scrambled id and its policy, nothing about who saw it.
Under the hood
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.
Bluetooth on the phoneNeeds the native app
A web browser cannot broadcast or scan for Bluetooth. So the web phone keeps its own token alive but always reports that it heard nothing, and the walkthrough stages the sightings against the real coordinator. A native app would fill in what it actually hears.
Under the hood
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.

One presence per person, however many devicesBuilt
A patient broadcasts one token whether they carry a phone, a pendant or both, so their own devices never compete with each other for a turn.
Under the hood
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.
The packet says how to confirmBuilt
Alone: voice or tap. Others nearby: tap only. Quiet zone: tap only, nothing spoken. That decision is made once and sent to every device, so a spoken "done" cannot finish a step on the phone while the pendant is still waiting for a press. Only ever a channel removed, never one added: a press or a tap works in every mode.
Under the hood
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.
The phone and the pendant see the same thingBuilt
The pendant picks up the current mode on its own heartbeat and gets the same mode, buzz pattern and speaking slot the phone does. A person's devices change mode together and announce it the same way.
Under the hood
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.
One active pendant, so a press is never ambiguousBuilt
A patient may own several pendants, but only one is active. A spare's button press is recorded and ignored. A phone tap and a pendant press are the same event in the engine, so pressing both just means the second press lands on a step that is already done.
Under the hood
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.
Speaking orderBuilt
Within a group, the order is priority first, then the scrambled id as a tie-break, worked out identically on every device. Each companion waits its slot (6 s each) before speaking, so two companions never start a sentence in the same second, and the one with the care band or the time-critical step goes first. When two people are in the same place, Rowan also drops to a whisper.
Under the hood
awareness.slot, awareness.speak_after_sec, presence.voice_level. Coordinator::packetFor() sorts the group; Speech::forRun() turns the slot into hold_sec.
Which of a person's devices carries the voiceOpen decision
Today the phone speaks and the pendant is the button. A speaking pendant would get the same lines and the same waiting slot. Whether the voice should follow the nearest device or stay on one is a decision for the family, and the coordinator does not need to change for either answer, because it never chose a device in the first place.
Under the hood
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.

One fixed line per modeBuilt
"Others are nearby. I will use taps now." on the way in. "It is just us again. You can talk to me." on the way out. "This is a quiet place. I will show you each step and buzz. Tap when you finish." for a quiet zone. These are fixed. No app, no caregiver and no future feature can change them.
Under the hood
Presence::LINES, sent in every state as presence.line. The phone speaks it when presence.change_seq moves, including on the way into quiet.
Tone, buzz, badgeBuilt
A two-note chime that is not the confirmation chime. A vibration pattern per mode that is not the confirmation pattern. A badge ("Others nearby · taps only") that stays on the phone until the mode changes again. The caregiver's Live page shows the same thing.
Under the hood
presence.haptic, presence.confirm_haptic, presence.badge in the state. The web phone uses WebAudio and navigator.vibrate where the device allows.
The caregiver can pin itBuilt
Settings → When others are nearby: follow the room, always solo, always taps only, or always quiet. A pinned mode never switches by itself. The room is still reported, so the caregiver can see what the pin is overriding.
Under the hood
patients.presence_mode; Presence::resolve() lets the pin win over the packet.
The routine itself never changesBuilt
A mode change alters how Rowan listens and how it takes a confirmation, never what the routine is. Steps, order, wording and voice stay identical. The transcript records the change as a note, not as a step. This is the rule the engine holds hardest.
Under the hood
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.

Designed so the door stays openBuilt
The coordinator only ever consumes a scrambled id and a number, which is exactly what a vault could emit. When the presence record moved to the patient's side, the coordinator did not change.
Under the hood
See /connected for what the rest of Rowan would gain.
The nearby settings live in the patient's own vaultBuilt
The pin, the priority band, the token the phone broadcasts and the history of every mode change are kept as encrypted rows in the patient's MeCentral vault. Rowan keeps a cache, writes through a queue that survives an outage, and reads the record back, so a pin the patient changes in their vault is the one Rowan obeys. Nothing is written until the primary agrees to one sentence in Settings, and never for the sample family.
Under the hood
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.
LiveBuilt
MeCentral added the scope and the endpoints on its side the same day, refused the first write until the scope was granted, granted it, and Rowan's first real rows landed: pin, band, broadcast token and a history entry. A pin changed on the vault side was read back and obeyed.
Under the hood
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.

Buzz and glance firstBuilt
In a shared room the tap is the confirmation, the buzz is the mode, and the badge is the state. All three leave the ears and eyes free for the people in the room. That is why the design effort went there first.
Earbuds as a fallback, not the defaultOpen decision
Nothing in Rowan assumes an earbud. If a family chooses one, the engine does not care where the microphone is. The wrist and the quiet on-screen cue are what the product recommends first.

What does not change

The button finishes a step
In every mode. A press or a tap always works (steps that need two confirmations need two). Being near others only ever takes a way to confirm away; it never adds one.
Coordination is a courtesy
If the connection drops, the only thing lost is the turn-taking. The routine already on the phone keeps going, and the tap-only rule is what keeps it safe.
The transcript records the room
"Mode: solo → co-present (1 other companion nearby). Rowan said: …" appears as a note on the run, so a report shows when the room changed and what Rowan said. It never records who else was there, because Rowan never knew. With MeCentral on, the lasting history of those changes belongs to the patient, in their vault.
Everything is an API call
The token, the report, the packet, the pin, the beacon: all under /api/v1/presence and PATCH /api/v1/patients, so the native app that will do the Bluetooth builds against a contract that already runs.