arizuko

arizuko › concepts › autoviv

autoviv

Autoviv gives a new chat its own folder the first time the chat talks to you. The chat can be a Slack channel, a Discord guild or a Telegram group. Onboarding admits a new person, which is a different case. Autoviv needs no new code. A catch-all route and one MCP tool call do the work, with no daemon and no environment variable.

Three existing parts make a folder per chat

  1. Catch-all routes send a platform to a world agent. Two rows with a high seq send every message from a platform into one folder, the “world” agent, here called atlas:
    seq  match                                          target
    100  chat_jid=slack:*/channel/* verb=mention        atlas
    200  chat_jid=slack:*/channel/*                     atlas#observe
    The #observe row stores every channel message, so the agent has context. The mention row starts a turn when someone writes @atlas.
  2. The world agent sees a channel without a folder. When atlas runs a turn, it sees the chat_jid of the inbound message. Assume that no child folder has a route for that JID and that the sender holds an operator grant. Then the agent calls the MCP tool register_group with the JID and a sanitized folder name.
  3. register_group writes the group and the route. routd writes the group row, adds the route room=<jid-room> to the new folder at seq=0, and runs git init in the folder. The next message in that channel goes to atlas/eng-support instead of atlas.

One Slack channel gets its own folder

A teammate invites the bot to a new Slack channel #eng-support with the JID slack:T1234/channel/C5678 and posts “@atlas can you help here?”

  1. The route table has no row for C5678. The catch-all rule sends the message to atlas with verb=mention.
  2. atlas runs a turn, sees the JID and the operator grant of the sender, and calls register_group(jid="slack:T1234/channel/C5678", folder="atlas/eng-support").
  3. routd writes the group and adds the route room=T1234/channel/C5678 to atlas/eng-support at seq=0.
  4. The agent replies in the thread from atlas. The next message in that channel goes directly to atlas/eng-support, with its own folder, its own session and its own CLAUDE.md.

The world agent needs one paragraph of instructions

Paste a paragraph like this into the CLAUDE.md or PERSONA.md of the world agent:

When you receive a message from a Slack channel JID
(slack:*/channel/*) that does not yet have its own folder,
and the sender holds operator grant, call register_group
with folder="atlas/<short-name-derived-from-channel>" and
jid="<the channel JID>". Sanitize the channel name:
lowercase, replace spaces and punctuation with '-'.
Reply once in the new folder confirming the channel
is now registered. Do not register channels for non-operator
senders — ask the operator instead.

Autoviv has three limits

The world agent needs a delegated grant
register_group is not in the default role, so atlas needs an explicit mcp:register_group grant. The scope glob of the row is the whole containment rule. With atlas/**, the agent can register atlas/eng-support and any other folder under atlas, but not other/foo. To widen the reach, edit the glob. Do not move the folder.
A second call writes nothing new
The route key is its seq, match and target. So a second register_group call with the same JID and folder adds no second route.
The new folder gets no seed
register_group does not call container.SetupGroup. Check groups/<folder>/ if the new agent lacks its expected workspace files.

Routing and grants explain the parts

routing covers route tables, glob matching and the #observe mode. grants reference covers grants, roles and delegation. mcp reference covers register_group and the other MCP tools. web-native agents covers the web folders that a folder with the web:publish grant gets.