1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
//! Voice schema: a text-to-speech faculty — speech out, on two channels, with a
//! pile-backed routing policy that decides which audio device each channel
//! plays through.
//!
//! Extracted from `body` (2026-06-30): speaking is its own organ, not a limb of
//! the Reachy body. The body stays the physical Reachy loop (pose/look/feel/act);
//! the voice owns synthesis (F5/mary) and output
//! routing. New utterances and routing config live in one fixed native
//! collection. The historical `voice` Repository branch is migration input
//! only and is never consulted by the live faculty.
//!
//! Two channels, each a hard contract — NOT a soft preference:
//! - `say` — the PRIVATE channel: in-ear/headphone only. If no private device
//! is connected it falls back to printing text. There is no code path that
//! lets a `say` utterance play through a room speaker (the invariant is
//! enforced in `voice.rs`, not here).
//! - `shout` — the PUBLIC channel: broadcast freely (Reachy speaker → room →
//! laptop), audible by design.
//!
//! Routing is an ORDERED list of device preferences per channel: a `KIND_ROUTE`
//! entity per (channel, device, priority). At speak-time the faculty reads the
//! preferences, intersects with the actually-connected devices, and (for `say`)
//! re-checks each candidate is a private device before it plays. The list is
//! advisory ordering; the privacy guarantee is code, so no misconfiguration can
//! leak a private utterance into a room.
use id_hex;
use ;
use ;
use *;
/// Stable extrinsic scope of the one canonical Voice collection.
///
/// Minted with `trible genid` on 2026-08-07 while the first collection-backed
/// Voice implementation was developed:
/// `D51A6FB28036D12290404277F273E909`.
pub const COLLECTION_SCOPE_ID: Id = id_hex!;
/// Marks records admitted to live Voice semantics.
///
/// Both the native writer and the stopped-world canonical rewrite emit this
/// tag. Marker-free rows from the historical identity epoch remain inert if
/// they coexist in a collection. Minted with `trible genid` on 2026-08-11:
/// `6EDFB5684161B58337A0EBB9B10836DC`.
pub const KIND_LIVE_RECORD: Id = id_hex!;
/// Canonical channel names — also the `route::channel` discriminator.
pub const CHANNEL_SAY: &str = "say";
pub const CHANNEL_SHOUT: &str = "shout";
/// Tag for an utterance — the voice speaking. Carries the words, the channel it
/// went out on, and the content-addressed audio (so the moment is replayable).
pub const KIND_UTTERANCE: Id = id_hex!;
/// Tag for a ROUTE preference — one (channel, device, priority) entry. A
/// channel's policy is the set of its entries read in ascending priority. The
/// route-set operation publishes a complete timestamped generation, and
/// readers choose the latest generation by `metadata::updated_at`; exact-time
/// ties are unioned. Reconfiguring is a monotonic append, never a mutation.
pub const KIND_ROUTE: Id = id_hex!;