rift · design

a local audio daemon

rift is one process, kept running by launchd, that will turn the sound its devices hear into an append-only log of which words were said when, and play back what it is given. Today: one instance, its socket, the event log, and the stream, every connected device's sound on one clock, kept on disk for a window, then archived. A device plays a file or, on macOS, hears a microphone or plays what it is given; on a Mac one ear and one mouth stand beside the daemon, each a launchd job of its own, the ear idle until the ears are on and the mouth until it is given a play, run from one path and signed by an identity of rift's own, so the microphone is asked for once and the grant holds across upgrades.

Today

The stream

Mechanical: it carries sound onto one timeline and keeps it a while, and decides nothing about what the sound is. The wire is the protocol's.

window's trailing edge now ear-desk mouth-desk ear-hall <n>.pcm 10 s open hole −60 s −40 s −20 s the daemon's clock: every frame placed on it archive past the window, indexed readers read a range · listen live each on its own clock, offset measured by ping
Sample: three devices become three tracks on the daemon's one clock, each cut into 10 s segments as frames arrive; the hall's device dropped for a few seconds, a hole that holds no file and reads as silence. Segments behind the window's trailing edge (dashed) leave audio/ for the archive, or are deleted when none is set.

The microphone

rift device ear <name> --mic [<microphone>], macOS only (CoreAudio through cpal, capture alone: no echo cancelling, no voice processing). On Linux it exits 2 saying so.

Identity

macOS grants the microphone to a program outside an app bundle by its path, and checks the program's code signature against the grant: a new path is asked again, and so is a new signature at the same path. The microphone's grant belongs to the standing ear's program, ~/.local/libexec/rift/rift, one path every release shares, signed by a certificate of rift's own, so it is asked for once. A rift device ear --mic run by hand from a terminal is the terminal's to grant, not rift's.

The mouth

rift device mouth <name> --speaker, macOS only (CoreAudio through cpal; on Linux it exits 2 saying so): it plays what rift is given for its track, and its track holds only what its output took, when it took it. The wire is the protocol's plays.

latencybounded byexpectedmeasured by
given → soundingthe hop to the daemon and on to the mouth (under a millisecond each), the wait for the output's next callback (one I/O period, 10.7 ms at 512 frames and 48 kHz), then the output's latency; on an output not yet open, its open; and, when the first give holds less than $RIFT_LEAD_MS past the interpolator's 32 samples and no end follows, up to that lead (100 ms) of the output's own samples after its openfor a first give holding the lead (2432 samples at 24 kHz, 100 ms and the reach), about 45 ms on the built-in speakers with the output open, about 90 ms when it must reopen (observed 2026-11-26, silent run); the first play after the mouth starts waited 2.1 s, inside the first open, past the listing (unverified 2026-11-26 · cpal's first stream or its first reported latency, the device's to tell); Bluetooth adds its own, 100 to 300 ms (unverified 2026-11-26 · not yet measured)the play event's t against its first sound's start; on a Mac, the ear's track hearing the speakers
hush → silencethe hop to the mouth (the pipe to it holds at most what it queues, read as it arrives), the drop, one I/O period, then what the output already holds, its latency; never $RIFT_AHEAD_MS, since the queue is dropped, not drainedunder 25 ms on built-in speakers; on Bluetooth, its latency, which nothing above the output can recallthe hush reply's time against the last sound's end (start + samples / rate); on a Mac, where sound stops in the ear's track
failure mid-playwhat happenson disk after
the mouth diesits queue goes with it; the play ends mouth at its last report, launchd respawns it, nothing resumesevery run up to the last report, short by at most 20 ms plus the output's latency
the daemon drainseach play hushed in turn inside $RIFT_DRAIN_MS, one not answered by then ended at its last report, each logged stop before stop; the mouth drops its queue as the connection goesall of it
the daemon is killedthe mouth drops its queue as the connection goes; each giver's ends with an unknown outcomethe play and its closed runs; the next boot logs played lost, the run under way not derivable but from the mouth's frames, when the ears were open
the output vanishesits queue kept; the next default opened, playing on with a new run, begun on its lead as any, a hole and the new speaker in the track; no output, a wait and a paced giver, ended mouth by the stall rule past $RIFT_STALL_MSall of it; samples the old output took and had not sounded count as played
the output fails, still listedits open ended, said, opened again a poll on, playing on with a new run; stuck past $RIFT_STALL_MS, the play ended mouthall of it, as above
the giver disconnectsbefore end, hushed, left; after it, played outall of it

The path

The audio path, in the order sound crosses it, part built. Every stage writes its results to the same log, so a client reads the sound as events.

① devices ears · mouths ② one stream every track on one clock ③ voices split apart, given ids ④ words each with its times event log append-only, on disk feed replay, then live clients on the unix socket ⑤ playback hushed mid-play every result requests: quiet, hush, shutdown play
The accented log is the daemon's memory; solid is built, dashed is designed. Playback runs on the same clock as the tracks, so its runs say when each given sample sounded, and a hush or quiet ends it at once.
stagewhat it does
① devicesclients of the socket, each an ear or a mouth; built: a file player and, on macOS, the microphone (rift device), and, on macOS, the mouth, each standing as a launchd job of its own that every setup installs; one on another machine is a later protocol
② one streambuilt: every track on the daemon's clock, so a moment means the same instant on every track (the stream)
③ voicesbuilt: the talkers kind, its join to turns and its reference engine. Who spoke when, voices speaking at once included, each an enrolled voice's label with a score of evidence (null when not identified), the label holding across the stream, or a number for one not enrolled, by a talkers engine
④ wordsthe track's speech transcribed to words, each word with its start and end on that clock, by engines: echo, then turn and words; a client joins words to voices by time
⑤ playbackbuilt: audio a client gives played on a mouth, hushed at once, a play's runs logged in the giver's own sample count; designed: text a client gives spoken by a speech engine

Engines

Built through slice 11; the clean track (slice 12) designed. The work that reads sound (the echo stage, voice and turns, words) and the work that makes it (speech) are engines: programs on rift's socket, each of one kind on one track, swapped while the daemon runs. Models come and go; the daemon, its clock, its log and its checks stay. The wire is the protocol's engines.

kindreadsreportsfirst engine
echoan ear's frames live, every mouth's runsmasks of the ear; later, a clean tracktail, in rift: masks each run as it sounds, plus a tail
speecha mouth's says, text in piecesa play of the audio, marks of the text soundedread-aloud: Pocket TTS
talkersan ear's ruled frames, or a clean track's, and the turn engine's turnswho spoke when: settled spans, each voice an enrolled label with a score of evidence (null when not identified), or a numberdiarize: LS-EEND, then WeSpeaker against the enrolled voices
turnan ear's ruled frames, or a clean track'svoice starts and stops, turnsendpoint: Silero VAD, then Smart Turn at each close
wordsthe same frames, and the turn engine's turnspartial and final words, each timedtranscribe: Moonshine v2
rift engine add words -- uv run --project ~/src/transcribe transcribe ear-mac --terms ~/.config/transcribe/terms.txt
rift engine add echo -- ~/.local/bin/rift engine run tail ear-mac
rift engine add words -- ./my-words ear-mac   # the swap: the old job booted out, the new one loaded
rift status                                   # "engines":{"ear-mac":{"echo":"tail","words":"my-words"}}
reference enginekindwhat it doeswhere
diarizetalkersLS-EEND (DIHARD III, 100 ms steps) through FluidAudio, macOS only, fed each 20 ms frame as it comes through a 2:1 decimator of its own whose filter state carries across frames (enrolment through the same), so its steps are the same however the stream is cut, each step's slots over 0.5 smoothed by a median of five steps; a step settles once two more have come, so a span is reported 1.1 to 1.2 s after the audio it ends on (LS-EEND gives each step once, 0.9 s after it, never revising it), cut at each change of who speaks, each hole, each turn line's end and at 20 s. The profiles in --profiles, read at each connect, enrol LS-EEND afresh with each label's audio; each span naming a label is scored by WeSpeaker's embedding of its audio (at most 10 s) against the profile's, the cosine mapped linearly from 0.06 (0) to 1 (1); null, not identified, under 2 s, where other voices' windows outscored the enrolled one's (measured 2026-11-27 · Pocket TTS voices, the tables in engines/README.md). A label is LS-EEND's guess and a score evidence, not authentication: it labels the fixture's first marius phrase as the enrolled alba, and a client never acts on a label with a null score. Masked frames are nobody's. After 30 s of settled nobody, or once 60 s old at its next 3.5 settled s of nobody (past the 3 s a turn may be held across), the stream starts afresh, LS-EEND reset and the profiles enrolled again (about 0.3 s each), the audio not yet settled fed again: a stream left on a quiet room drifts, its running mean and state the room's: on the fixture after 40 s to 30 min of it a phrase took the enrolled label and part of another went unheard, and restarted the spans are a fresh stream's (measured 2026-11-28 · engines/README.md; validated privately on real speech); a voice not enrolled heard again after it takes a new integer. LS-EEND names speech from its first steps, not after a second of nobody: over twelve phrases of three Pocket TTS voices, none enrolled, it named 10 from their first step and the other two 0.28 and 0.86 s in. It did not always tell the voices apart: javert's phrases took alba's id every time, and marius's first phrase did too. Over alba's and marius's later phrases summed at 0.7 each, with alba enrolled, it named both together for 1.7 of the 2.56 s (measured 2026-11-27 · a probe over the sentences in AGENTS.md; the overlap in the model test). diarize enrol and forget keep the profiles (engines/README.md). Ready 0.35 s after start once Core ML's cache is warm (observed 2026-11-27 · mise run prove-diarize); 0.7 ms a step, 16 ms an embedding (unverified 2026-11-27 · measured 2026-11-26 before the decimator, which adds 129 multiply-adds an 8 kHz sample)engines/diarize/, Swift
endpointturnSilero VAD on 32 ms windows, a voice reported once it spans 96 ms of speech and closed after 256 ms under its offset, Smart Turn v3.2 scoring the turn so far at each close, over --bar (0.5) a turn, else held for the next voice up to --ceiling-ms (3000) of silence; a turn over the bar spanning under --short-ms (1500) of voice is held --grace-ms (512) of silence first, a voice reported inside it joining the turn (one that starts inside it but spans its 96 ms only after it is due does not), either flag at 0 turning that off, as Smart Turn scores a short opening word and its pause a finished turn (0.81 to 0.99; on recordings of one speaker, 75 sentences, turns cut mid-sentence 23 to 6 at the same 310 ms median close, observed 2026-11-26). Voice off is logged 279 ms after speech ends, and the turn with it over 1.5 s of voice, 770 ms after under it (observed 2026-11-26 · engines/prove.py, the fixture's 1.66 s, then with --short-ms 2000). A hole under 256 ms is heard as silence of its length; a longer one closes the voice at the hole's start and resets Silero, so no hole makes a voice or a turn of its own. Connecting, it hears again the audio from the oldest the window holds, any boot, so a turn held as an engine left is rebuilt whole and closed as usual, by the ceiling, or by the grace when it was waiting one out; the voices its reply's through covers stay unreported, a logged turn heard again is refused unsaid, and a turn whose voice was under way at that oldest audio is dropped, said once, rather than reported short (its edge swept meanwhile, it resumes from through and says the held turn is not rebuilt)engines/endpoint/, Rust
read-aloudspeechPocket TTS, voice --voice (alba), each say spoken as its text comes in spans of whole sentences of up to 390 bytes (a longer sentence alone), one model piece of at most 120 tokens each, so commas and the joins between sentences keep the voice's own prosody, its 24 kHz chunks given as made, a mark once each span that sounded is given, so marks rise strictly, a hush stopping it at the next chunk (play open 63 ms after the say, measured 2026-11-26 · engines/prove.py)engines/read-aloud/, Rust
scribewordsParakeet Ultra through FluidAudio, macOS only, decoding each turn once, whole, at its turn line: its frames in a 30 s buffer, a span opened at a voice's start less 250 ms and held across the voices of a turn held unfinished, decoded over its audio to the turn's end alone, at 20 s by its own rule (300 ms behind the newest frame, past a voice's close and its line, the rest carried on as the next span while the voice is on, and closed by an off or a turn line ending at or before it); no partials; none for a turn with no words. With no voice lines it decodes nothing; a turn line ending before a span a voice opened (a replay's) leaves it open. It writes no transcript anywhere but its reports: FluidAudio's own lines go to the unified log alone, from warning up. It connects from 30 s back, and loads and warms its model before it connects, saying so once. Parakeet times each word by its tokens, each mapped back to when its audio was heard, holes included; --model required, --terms rescoring the words toward the file's terms by FluidAudio's CTC spotter, each kept word keeping its times and a replaced run sharing the span it took (any newline, CRLF included); without it, no rescoring: a second fixture's invented "Phlogix", heard "Flogix" without it, is "Phlogix" with it, its final 79 to 82 ms after its turn line (2 runs). The fixture's final lands 39 to 51 ms after its turn line, the decode itself, so decoding speculatively at voice off could save at most that; ready 9.3 s after start on first use (Core ML compiling for the Neural Engine), 151 to 158 ms after; a 38 MB footprint, the weights on the Neural Engine not counted (measured 2026-11-26 · mise run prove-scribe, 5 runs; /usr/bin/time -l)engines/scribe/, Swift: an engine in any language
tailechoa mask on at a play's first run's start, off once the ear is heard past the last run's end plus --tail-ms (default 200), 200 ms more while its play is open: two events a play sounding without a longer gap; ruling up to the last frame heard while no play is open, up to the mask's planned off while one is on, and 200 ms behind what was heard while a play is open unmasked (a run is reported within 20 ms of its output taking it, before it sounds, its start an output latency on, so 200 ms covers a report held up that long). It starts from the ruling its reply gives, a play already open masked from there, and reads the reply to each report: a mask on refused was never on, and the ruling waits at an on until it is answered. Limit: a run reported later than the guard plus its output's latency lets the start of its echo through unmasked, a busier machine's leak, not one the stage can seerift engine run tail <ear>: no model, so in rift and its suite
transcribewordsMoonshine v2 Medium Streaming on speech alone: its frames in a 30 s buffer, a stream opened at each voice's start less 250 ms and fed 300 ms behind the newest frame so it stops at the voice's end, one stream across the voices of a turn held unfinished, finished at the turn line over audio to the turn's end alone (afresh from the buffer if fed past it), at 20 s by its own rule; a partial per 320 ms whose text changed; none for a turn with no words. With no voice lines (no turn engine on the track) it transcribes nothing. It connects from 30 s back, so a resume never chews through more than its buffer. Moonshine times lines, not words: a line's words share its span by length, each mapped back to when its audio was heard, holes included; --model required, --terms rewrites after decodingengines/transcribe/, Python under uv: an engine in any language

Each model engine keeps its runtime pinned (a Cargo lock, a uv lock, a Swift package's resolved pin) and its model in its own cache, never in the repo: engines/README.md names each download and licence. mise run check-engines is their gate: each engine's protocol logic at 100 % of lines against a stub model, and one test per model over the synthetic fixture (engines/fixtures/phrase.pcm, Pocket TTS saying "Please turn on the kitchen lights.", no recording of a person) where its weights are, scribe's skipped off macOS; mise run prove-engines runs three against a throwaway daemon and a fake output (PROVE_FAST=1 on a loaded machine), prove-scribe the same with scribe for words, prove-diarize endpoint and diarize over fixtures/voices.pcm. rift's release carries none of them. Smart Turn completes a falling sentence (0.988) and holds an unfinished one ("So I was thinking that we...", 0.008, the retired reference's front end agreeing at 0.008); the ceiling path is the stub suite's. A file-fed ear paced in real time on a busy machine wakes from its sleep about 200 ms late and plays on from there as a hole, keeping every sample (measured 2026-11-26 · 8 busy loops on 16 cores, 52 holes in 200 frames, replies under 50 ms), so the track it places is the fixture stretched with silence; sent fast it places none.

sliceshipsits tests decide, by values and order
1 · the connectionengine, taken, the engine events, health's enginesthe suite as an engine: the reply's fields; a second refused taken; engine on and off bracketing its reports in the feed; health listing it while connected only; an engine killed mid-stream leaving a file-fed ear's every frame answered and its segments' samples summing to what it sent
2 · wordsframes from from, words, partials, through, absenta file-fed ear (--fast) read by a suite engine from a from inside the window: every t 20 ms after the last, none twice, across the replay's join to live; its finals logged with the values sent; one overlapping, out of order or past the last frame refused and unlogged; a partial reaching a partials reader and not the log; a reconnect's through the last final's end; gone before the window
3 · turnvoice, turn, the turn line to wordsalternation and order refused when broken; each turn line reaching the words engine after the frame holding its end, by comparing ts in the order read; a turn engine leaving with voice on, its engine event after the open voice
4 · echomask, ruled, held frames, tail and rift engine run taila suite echo engine that rules to a time the test sets: the words engine holding no frame past it, then each after it once ruled; masked samples zeros and their frames marked; a replay carrying the logged masks; the echo engine gone and frames flowing unmarked; 1024 behind, dropped; tail against a play into the fake output: its masks, merged, equal each logged run's span plus the tail, merged
5 · saysay, text, mark, done, spokena suite speech engine giving a tone per piece and marking each: a say to its end, spoken its whole text; hushed once the suite's mouth reported a run, spoken the largest mark under the played it reported; busy, absent, quiet, left, engine, a kill's lost; the play event's say
6 · jobsrift engine add, remove, listagainst the launchctl stub: the plist's fields, the old job booted out before the new loads, ready only once health lists the kind, setup --remove removing them
7 · model enginesendpoint, read-aloud, transcribeeach in its own gate on a recorded fixture through a file-fed ear: the phrase's words among the finals; voice on before off and one turn over a phrase with a pause; a say's play ending end with sound in heard and spoken its text's length
8 · the loopthe jobs on a Macspeak, a final words event, a say, its spoken whole and the ear's track masked across its runs; the same with fixture and fake output as the suite's last case
9 · talkersthe kind, talkers reports and events, its through, its frames and turn lines, rift engine add talkersa suite talkers engine over a file-fed ear: its spans logged with the values sent, talkers as given; refused and unlogged: one overlapping, out of order, empty, past the last frame, a string id not of the form or not starting with a letter, an integer under 1 or with a score, a score outside 0 to 1, an id twice or out of order; a reconnect's through the last span's end; each turn line after the frame holding its end, as slice 3's; health and the engine events listing it; the plist's kind against the launchctl stub
10 · the joinnothing in the daemon: the client's rule, held by the suitea suite turn engine and talkers engine on one ear, a feed reading both: for each turn, each id's, nobody's and the unknown time over its whole length summed from the values, a gap unknown, known once a span reaches its end; a talkers engine's engine off after a turn's last span and before its event, so the tail reads unknown, not "not yet"; a reconnect mid-turn, each connection's integer ids kept apart; with none connected, health and the feed saying so
11 · diarizethe reference talkers engine, engines/diarize/, Swift, macOS only, and its enrol and forgetits protocol logic at 100 % of lines against a stub diarizer and embedder in check-engines on macOS (said skipped elsewhere): settling, cuts at turn lines, gaps and nobody, the restart after 30 settled s of nobody (a lone step over the bar smoothed away, masked steps skipped) or at 60 s of age, steps re-fed in line, masks, ids and order, resuming from through, the 16-talker cap, enrolment's files and the profiles directory's owner and mode; model tests over fixtures/voices.pcm (Pocket TTS, alba then marius, twice each): alba enrolled from 14.5 s of other sentences (fixtures/alba.pcm), both her phrases labelled hers and scored, every score of hers above every score of marius's as her, labelled so or not; the fixture fed in 20 ms, 100 ms and 333-sample pieces giving the same steps; an overlap of her and marius, their later phrases summed at 0.7, naming both together for at least 1.5 s; the fixture after 2 min of a quiet room giving a fresh stream's spans. prove-diarize runs the fixture through a throwaway daemon, the profile enrolled from the daemon's read of her first turn, her turns mostly hers and scored above any score of his.
12 · on the clean tracka talkers engine naming clean-<name> once the echo engine streams onethe clean track accepted as a talkers engine's track and its turn lines routed from that track's turn engine; a profile enrolled from the clean track scoring its own voice there as from the ruled ear; the machine's own speech, masked on the ear, nobody's on the clean track

Priority

Every launchd job rift writes (the daemon, the ear, the mouth and each engine) carries ProcessType Interactive. Unset, launchd applies "light resource limits to the job, throttling its CPU usage and I/O bandwidth"; Interactive jobs "run with the same resource limitations as apps, that is to say, none" (man launchd.plist). Adaptive moves with XPC transactions, which rift does not use. Under a load average of 43, unset, speech came out in 280 ms runs with gaps, the output glitched, and the turn and words engines answered seconds late (observed 2026-11-28).

job's ProcessTypeits threads' prioritya thread asking user-interactive QoS
unset, Standard2020: clamped
Interactive31, an app's37
Adaptive, Background4

Measured 2026-11-28 with ps -M on throwaway agents, a child of the job inheriting its class. The output's I/O thread is CoreAudio's own, real time (priority 97) whatever the job's class; cpal sets no priority of its own. The daemon's, the devices' and the engines' threads run at the job's class: no QoS or time-constraint call is made, so none is clamped.

rift setup reloads the daemon, the ear and the mouth on their new plists, and gives each engine job without the key the key, then a bootout and a bootstrap (none for a disabled one). An engine it cannot migrate is one line and its plist as it was, for the next setup to try again; setup still succeeds, so one engine never rolls back an upgrade.

Paths

pathwhat
~/.local/state/riftthe state root, mode 0700; $RIFT_ROOT overrides
<root>/audio/<boot>/<track>/<n>.pcma segment's raw frames: the closed ones still in the window and each track's open one
<root>/ear.errlaunchd's stderr for the standing ear: its waits, refusals, Bluetooth and grant lines and stop line, capped at each attempt as serve.err is
<root>/events.ndjsonthe event log, the durable state beside the audio
<root>/mouth.errlaunchd's stderr for the standing mouth: its output, refusal and stop lines, capped as ear.err is
<root>/rift.keychain-db, <root>/rift.keychain-passrift's own keychain, holding its code-signing identity, and its password (0600); setup makes both, setup --remove deletes both (identity); identity.new/ beside them lives only while a certificate is made
<root>/run/rift.sockthe socket, in run/ (0700) beside serve.lock (the flock that admits one instance), serve.pid (a hint) and serve.log (start, refused, accept, degraded, exit and panic lines)
<root>/serve.errlaunchd's stderr, for a failure before the daemon's log
<archive>/audio/…, <archive>/index.ndjsonthe archive, when one is set: every segment that left the window at its path, and its segment event, one line each (a repeated line after a kill); nothing deletes there
~/.local/libexec/rift/riftthe standing ear's program: the signed release copied to one path every release shares, the one the microphone's grant belongs to (identity)
~/.local/libexec/rift/mouththe standing mouth's program: the signed release, copied as the mouth is loaded, at a path no release older than the mouth writes; setup --remove removes it with the ear's copy and the directory
~/.local/bin/riftthe binary: hotswap's link through ~/.local/share/hotswap/rift/current, the release installed; hotswap's record is under ~/.local/state/hotswap/
~/Library/LaunchAgents/dev.gigantic.rift.upgrade.plisthotswap's upgrade agent: rift upgrade every 900 s
~/Library/LaunchAgents/dev.gigantic.rift.plistthe launchd agent: KeepAlive on an unclean exit only, RunAtLoad
~/Library/LaunchAgents/dev.gigantic.rift.ear.plistthe standing ear's agent: ~/.local/libexec/rift/rift device ear <host> --mic, KeepAlive always, RunAtLoad
~/Library/LaunchAgents/dev.gigantic.rift.<kind>.plist, <root>/engines/<kind>.erran engine's job, its command as rift engine add was given it, KeepAlive always, RunAtLoad, and its stderr
~/Library/LaunchAgents/dev.gigantic.rift.mouth.plistthe standing mouth's agent, ~/.local/libexec/rift/mouth device mouth <host> --speaker, as the ear's, written only as it is loaded

Environment

vareffect
RIFT_AHEAD_MShow much of a play its mouth may hold untaken before the daemon withholds the giver's next reply, default 200
RIFT_BOOTOUT_MSsetup's wait for launchd to let go of a job after a bootout, default 30000
RIFT_DRAIN_MSthe drain's budget for open connections before they are cut, default 1000 (launchd's ExitTimeOut is 3 s); before them, the wait for each mouth to answer its play's hush, within the same amount
RIFT_LEAD_MSthe cushion --speaker holds before a run of a play begins, and the longest it waits for it, in the output's own samples from its open, default 100; past RIFT_AHEAD_MS the giver is paced before it fills, so the wait decides
RIFT_LINGER_MShow long after the output last took a play's sample --speaker keeps it open, default 10000
RIFT_LOG_CAPthe size at which serve.log, serve.err, ear.err, mouth.err and each engines/<kind>.err are each copied to .1 and emptied (emptied, not renamed, since launchd's writer appends on), default 1 MiB
RIFT_MICthe suite's fake microphones in place of the system's: a directory, its format in src/ear.rs
RIFT_OPEN_MShow long a microphone's open may wait before --mic names the grant, waiting on, default 10000
RIFT_PING_MShow long after a device's last ping a frame's reply carries the next, default 10000
RIFT_POLL_MShow often --mic lists the inputs, how long one may fall silent before it closes, the wait after a failed open, doubled per failure in a row to 64 times, and the wait before it connects again; for --speaker the same, for outputs, default 1000
RIFT_READY_MSsetup's wait, after a reload, for the daemon to answer health ready, or the ear or the mouth to be among its devices, default 30000
RIFT_RELOAD_MSsetup's wait for health ready, or the ear or the mouth among its devices, before it loads that agent afresh, once, default 15000 (past launchd's 10 s respawn hold)
RIFT_ROOTthe state root, default ~/.local/state/rift; the socket path under it must fit 103 bytes
RIFT_SEGMENT_MSa segment's length, in whole 20 ms frames, at least one, default 10000
RIFT_SIGN_MShow long setup lets each launchctl, scutil, security, openssl and codesign call run before killing it and failing, naming the call, default 30000
RIFT_SPEAKERthe suite's fake outputs in place of the system's: a directory, its format in src/mouth.rs (the mouth)
RIFT_STALL_MShow long a play's mouth may report nothing while it owes progress before the daemon ends the play mouth (owed: the play's end after end, or given past what was taken by more than the interpolator's 64 samples), checked every second, default 15000
RIFT_ZERO_MShow long a microphone may give only exact zeros after its open before --mic closes it as a failed open, naming the grant, default 2000

Command line

Releases come from .github/workflows/release.yaml, one per merge to main, YYYY.M.N, signed by packslip.

mise use -g packslip:jgeschwendt/rift   # the latest release, verified by packslip
rift setup                              # into hotswap's layout, the ~/.local/bin/rift link, the agents
rift upgrade --check                    # what the next swap would run
mise run install                        # a checkout: a dev build as ~/.local/bin/rift-next
mise run dist                           # a checkout: this host's release archive, to dist/
commanddoes
rift servethe daemon, in the foreground; launchd runs it
rift statusprints the daemon's health, or {"code":"down","ok":false}
rift quiet on|offsets the quiet switch
rift ears on|offopens or closes the ears
rift keep <window s> [<archive>]sets the window and the archive, resolved against the working directory; none given, segments leaving the window are deleted
rift feed [--after <boot>:<seq>]prints the events, from this boot or after a position, then live
rift listen <track>prints each frame placed on the track, live
rift read <track> <from us> <to us>prints the range's frames, silence where nothing is held
rift play <track> <rate> [<file.pcm>]gives a raw PCM file (16-bit mono little-endian at <rate> Hz, 8000 to 48000; an odd last byte dropped), or stdin as it comes with none, to the mouth <track>, 16384 bytes a give, paced by the daemon's replies, then end; prints its reply, then the play's last line; exit 0 for "reason":"end", 1 for every other reason (hush, quiet, mouth, stop), for a refused play and for {"code":"unknown","ok":false} when the connection ends first; an unreadable file is rift play: <cause>, exit 1; a stop signal ends the connection, which hushes the play (left), rift play: stopped by SIG<name>, exit 1
rift hush <track>ends the mouth's open play at once and prints how much of it played and how much was dropped, or "play":null when none was open
rift device ear|mouth <name> <file.pcm> [--fast]a device, its own process: plays a raw PCM file (16 kHz, mono, 16-bit little-endian) as the track's frames, a short tail dropped, answering every ping, paced in real time and stamped from now, a pause or clock step of over 100 ms playing on from the clock as a hole, or with --fast sent as fast as each is answered and stamped as if captured ending now; prints its reply, then each notice and refusal; exit 0 once every frame is answered, {"code":"unknown","ok":false} and exit 1 if the connection ends first; an unreadable file is rift device: <cause>, exit 1
rift device ear <name> --mic [<microphone>]a device, its own process, macOS only: hears the default input (the built-in in place of a Bluetooth one, when there is one), or the one named, whatever its transport, while the ears are open (the microphone); prints its reply, then each notice and refusal; when the connection ends ({"code":"unknown","ok":false}) or the daemon is down, it waits a poll and connects again; SIGTERM, SIGINT or SIGHUP, its only exit: rift device: stopped by SIG<name>, exit 0; a withheld grant or a failed open is one stderr line, and it keeps trying; on Linux exit 2
rift device mouth <name> --speakera device, its own process, macOS only: plays what it is given for mouth-<name> on the default output, following it (the mouth), and streams what the output took as the track while the ears are open; stands, reconnects and stops as --mic does; a daemon that plays nothing is one stderr line, rift device: the daemon <version> plays nothing; fix: rift setup, waited out as a refusal; on Linux exit 2
rift engine add <kind> -- <command…> | remove <kind> | listan engine's launchd job, echo, speech, turn or words (engines): each call that changes something printed, as setup prints them; a failure is rift engine: <line>, exit 1
rift engine run tail <ear> [--tail-ms <ms>]the reference echo engine on the ear track <ear> (engines); prints its reply, then works until the connection ends, {"code":"unknown","ok":false}, exit 1
rift setup [--print | --remove]brings the release into hotswap's layout and links ~/.local/bin/rift (with none installed, the latest, through packslip), signs the release with rift's identity and copies it to the ear's fixed path unless already there, then writes the daemon's plist on the link and the ear's on that copy, boots the ear's and the mouth's out, loads the daemon's, or swaps it with one kickstart -k (a bootout then a bootstrap when it re-signed the release), and waits for the new daemon to answer health ready, then loads the ear's, waited on until that daemon lists ear-<host>; with the ear good, copies the release to the mouth's own path, writes its plist and loads it, waited on until mouth-<host> is listed, a failure there booting it out and removing both; each loaded afresh once when not ready past $RIFT_RELOAD_MS; a failure is rift setup: <line naming its label>, exit 1, the daemon left serving; one whose track another device already holds is loaded unwaited, a disabled one left unloaded, each said in a line, exit 0; --print prints the three plists (the daemon's alone off macOS), --remove has hotswap forget the layout and the upgrade agent, unloads the three agents and removes their plists, the link, both copies, the keychain and its password
rift upgrade [--check | --back | --retry]hotswap's swap onto a newer release: installed beside the running one, current moved, rift setup, then the smoke (rift version, rift status until the daemon answers with it); a failure rolls back. Exit 0 green or settled, 1 red, 2 unable to try
rift versionthe build, as the hello reports it

Gate spans

Every run of mise run check is one OpenTelemetry trace through floodgate span: a check span with each step nested under it (fmt, clippy, cover, stele.check and stele.emit), so floodgate's page shows which steps cost the time and CPU.

check only wraps check:steps in its root span; the steps live there. A step is wrapped in mise run span -- <name> [--attr k=v]… -- <cmd…> (.mise/tasks/span): it execs floodgate span when floodgate is on PATH, else the command after the second --, so a machine without floodgate, CI included, gates as before. To add a step, put it in the check:steps task's run list wrapped the same way; a step left bare is time no span explains. check-engines, a separate gate, is not spanned.