docHub

Mavis coordination protocols

Audience: Any Mavis (Helper or doer) that needs to communicate with another Mavis or with the operator.


TL;DR

  1. Helper coordinates. Doers execute. Don't blur the line.
  2. Lanes are role-gated Mavis sessions, not separate agent identities. Top-level agents are General, Coder, Verifier. Lane sessions (cards, chrome, fvre, helper) inherit from one of these with a lane-scoped system prompt.
  3. Cross-session communication uses the communicate tool. To reach a lane, send to the lane's session ID. To spin up a one-shot, use spawn.
  4. The operator is the cross-Mavis bus. When in doubt, surface to the operator.
  5. Prompts and replies are archived in prompts/. Every cross-session message gets a record.
  6. ??? is the check-in code. Type ??? in any Mavis session to trigger the wake-up / check-in protocol. See below.

The roster model

ConceptWhat it isExample
Top-level agentThe identity registered in agent listGeneral, Coder, Verifier
Mavis sessionA long-lived thread with a system promptsession 412100071272671 (Helper)
LaneA Mavis session with a lane-scoped system promptcards, chrome, fvre, helper
RoleWhat a Mavis does in a sessionmanager, doer, verifier

Three role tiers:


Communication patterns

Pattern 1: Helper → doer lane (route a plan)

When Helper has work to do and a doer lane should do it:

Helper session 412100071272671
  ↓ communicate (to_session=<doer-session-id>)
Doer session 404483248046205
  ↓ does the work
  ↓ writes a report to docHub (or reports back)
Doer session 404483248046205
  ↓ communicate (to_session=412100071272671)
Helper session 412100071272671
  ↓ updates overview + memory

The doer doesn't push the report via chat — they write it to docshub/dev/reports/<date>-<slug>.md and reply with a one-line ack. The full record is on disk.

Pattern 2: Helper → operator (status check-in)

When the operator pings Helper for status:

Operator → Helper (chat)
Helper reads bootstrap.json + recent reports
Helper replies with TLDR + next-step verb

No spawn, no relay. Just the operator + Helper in a 1:1 thread.

Pattern 3: Doer → doer (cross-lane work)

When one doer needs another doer (e.g., chrome drafts wording, cards applies it):

Default: direct. If it fails, escalate to operator-relayed.

Pattern 4: Verifier (one-shot)

When a doer's work needs adversarial review:

Helper or doer
  ↓ communicate (spawn={agent_name: "Verifier", ...})
Verifier session (one-shot)
  ↓ does the review
  ↓ reports back to spawner
Verifier session exits

The verifier does NOT continue working after reporting. They audit and exit.


What Helper does NOT do

Helper's job: hold the big picture, surface state, route work, archive records. The doers do the work.

Exception: Helper may write small scripts or fixtures that are docHub-internal (e.g., the build script that regenerates manifest.json from frontmatter). That's maintenance, not feature work.


What doers do NOT do

Exception: a doer CAN update decisions/ if a decision is theirs (e.g., a D-XXX that they wrote and own). The cross-lane decisions/D-056+ are constitutional and need a Helper ack.


The prompt archive

Every cross-session message gets filed at docshub/dev/prompts/<date>-<from>-to-<to>-<slug>.md. The file has:

The prompt archive is the long-term record of how the Mavis team has coordinated. New Mavis sessions can read it to see "what did Helper ask cards to do last week, and what came back?"


The dangerous protocol

If a Mavis is about to do something destructive (delete, force-push, mass-edit, token rotation, repo cleanup):

  1. Read dangerous/ first. Always.
  2. State the plan to Helper or operator. No silent destructive actions.
  3. Verify the target is what you think it is. For GitHub: GET the repo first, inspect contents.
  4. Run a dry-run if available. wrangler ... --dry-run, gh ... --dry-run, git push --dry-run.
  5. Have a recovery plan. If this is irreversible, know how to recover BEFORE you do it.

The 2026-06-22 case-variant-dup cleanup is the canonical failure case. Don't repeat it.


Session lifecycle

PhaseWhat happensWhere it's recorded
SpawnNew Mavis session createdFirst prompts/ entry + bootstrap state
ActiveMavis does workReports + decisions + prompts
ParkedMavis idle, waiting on operator or another laneLast reports/ entry notes parked-on
ClosingMavis writes final report, hands offFinal report is the handoff record

When a Mavis session closes, the most recent report IS the handoff. Next session reads that report to resume.


The ??? check-in protocol

Wake-up code: three question marks. ???

The operator (or any Mavis) types ??? in any Mavis session to trigger a wake-up / check-in. The Mavis that sees ??? runs the protocol below.

Why ???

The protocol

When a Mavis sees ??? (the only text in the user message, or clearly the trigger), it executes:

1. Inbox scan

2. Memory refresh

3. State report

Reply with one of these forms:

4. Idle

What ??? does NOT do

Why this matters

Mavis sessions are not continuous processes. They're threads that get attention when something triggers a model invocation. Cross-Mavis messages sit unread in dormant sessions. The ??? code:

If a Mavis is genuinely dormant, ??? won't help. But it makes the common case (active session, just needs nudge) reliable.

When to use ???

Operator-as-bus fallback

If ??? doesn't reach a Mavis (because the thread is dormant), the operator can act as the bus:

  1. Read the Mavis's last reports/ entry to know current state
  2. Surface the question to the operator directly
  3. The operator relays the answer back to whoever needs it

The operator relay is slower than ??? but always works. Use it when ??? fails.


Cross-cutting examples

Scenario: Helper needs cards Mavis to confirm Region Schema state

Helper → cards Mavis (via communicate)
  Status: sent, no reply for 2 hours

Operator → cards Mavis thread
  Types: ???
  
Cards Mavis wakes, runs protocol:
  - Inbox scan: finds Helper's pending message
  - Processes it
  - Updates status to replied
  - Reports: "✅ checkin complete. Region Schema: confirmed committed at 081e2f3. Unblocks OQ-1."
  
Operator → Helper
  Relays: "Region Schema: committed at 081e2f3, OQ-1 unblocked."

Scenario: a new Helper session starts, needs to get up to speed

Operator → new Helper thread
  Types: ???
  
New Helper runs protocol:
  - Inbox scan: empty
  - Memory refresh: reads bootstrap.json, top 5 reports, recent decisions
  - State report: "✅ checkin complete. State: docHub Phase 5 in progress, awaiting deploy. 3 open questions (OQ-1, OQ-2, OQ-3). 1 pending cross-Mavis ping to cards."
  - Idles

Scenario: a lane Mavis is dormant, no ??? works

Operator tries ??? — Mavis doesn't wake
Operator reads the lane's last reports/ entry — knows the state from disk
Operator relays the question to the operator-channel directly
Operator relays the answer back

The third pattern is the fallback. It works because docHub state is on disk, not in the Mavis's head.


← back to Mavis workshop