-
Notifications
You must be signed in to change notification settings - Fork 2
Mentions
An @ in a message body is not routing on its own. It is a span of text that
resolves, against the current roster and desk set, to a typed target.
| target | what it names |
|---|---|
Agent { id } |
one agent roster member |
Person { id } |
one human participant |
Desk { id } |
the active members of one desk |
Everyone |
the addressed desk, or the full active roster in General |
Only Agent can start a turn. The grammar and its resolution live in
src/mention/.
direct_responder walks the mentions in reading order and returns the first
non-quiet mention of an active agent. A person, a desk, and an @everyone
deliberately cannot, which is where the no-fan-out rule is enforced at the
level of a name.
let mentions = resolve(body, supplied, &author, &roster, &desks);supplied as None means extract from the body. supplied as Some,
including an empty vector, is authoritative: the host has already decided, and
resolution revalidates that decision against current snapshots rather than
re-parsing. A stale reference stays visible in the text but is made quiet, so
the reader still sees what the author wrote and the router does not act on a
member who left.
Anything structurally invalid fails closed to an empty result. A malformed roster does not produce a partial routing decision.
Mentions inside code spans and fenced blocks are masked out. MENTION_CAP is
50, which bounds how many mentions in one message may remain pinging, for the
same reason the trace grammar has a cap: one message must not be able to grow
the fold without limit.
mentioned_members expands the targets into the active agent ids a turn needs
as context. It preserves mention order, then desk and roster order, keeps the
first appearance of each id, and excludes the responder itself.
This is what @everyone actually does. It produces a list that the responding
agent is told about in its context. It does not produce a turn per member, and
there is no code path in this library that would.
MentionAuthor distinguishes who wrote the mention, because normalization
differs. An agent mentioning itself, and a human mentioning an agent, are not
the same routing event, and collapsing them is how a room starts talking to
itself.
tinyhivemind is GPL-3.0-only. Built by @senamakel.
Start here
The algebra
- Shared medium
- Desks and rosters
- Mentions
- Cross-desk referral
- Transcript projection
- Threads
- Recall
- Responder ladder
Hive mechanics
Working on it
Reference