136. Every session briefs itself on an interval, from one capability a provider mod the policy switches keeps in front of it
Context
The owner ordered on 2026-10-11 that every session working in this repository keeps itself alive and reports briefly without being asked: its own state, the peers of every board, the mesh, the integration queue and the derive queue.
Every one of those facts has an owner already. lifecycle.episodes and continuity.state hold
the episode and the task, peers.list gathers the board of every checkout, the mesh runtime
holds the links and the journal, majordomus prs brief says the queue, and the derive lock
beside the primary checkout says who derives. A session reads none of them unless it remembers
to, and none of them says anything unasked. On 2026-10-10 sessions relayed board state to each
other by hand. A superseded server's board was missing from every gather, and no answer said
so.
Two further facts shape the decision. prs brief was a private function of the command line.
And a command-line process has an empty peer board and no mesh: both live in the memory of the
server holding the checkout's lease, so peers.list run from the command line reads its own
empty board and calls it this checkout's.
Decision
One capability composes the brief. brief.session is declared once and projected to the
command line (majordomus brief), HTTP (GET /api/v1/brief), MCP (majordomus_brief) and the
Cockpit's overview. It asks each owner once and returns one line and a few, with a state for
every section (read, partial, unread, undeclared) and a summary that says what could
not be read. A section is never omitted because its owner did not answer.
The leaseholder composes it. A process that does not hold the lease, asked without an MCP
caller, asks the leaseholder over the route the registry declares, with local=true. The
server never asks back, so the hop is one deep. It composes the brief itself only when no
server answers, and says so in answered_by. A server that lost the lease answers its own MCP
sessions from its own board, adds the leaseholder's, and says that its board is unreachable by
the repository's gather.
The policy declares the interval and the switch. session.brief_interval_minutes (20 when
absent) is carried by the brief itself, so every reader takes it from one place.
session.brief_on_interval is the switch, declared in the schema, the skeleton and the
allow-list. Only true turns it on, for the reason ADR 0123 gave its own switch: what it
installs writes into the adopter's .claude/ tree.
Two carriers keep it in front of a session.
- The start event's briefing ends with what the session is told about keeping itself awake:
report every N minutes from
majordomus brief, and schedule that report where the client can. This reaches every provider whose start event Majordomus captures. - In Claude Code,
capture installwrites a second provider mod,share/mods/claude-code/majordomus-brief, to.claude/skills/majordomus-brief. It is a row ofMJ_CAPTURE_MODSbeside the handover mod and follows the same ownership rules. Only a mod can do this job: the status line and a clock are the provider's, inside the conversation, and no event fires for either. The mod shows the one line as the status line and refreshes it every minute. Once per interval it submits a prompt of its own, queued until the session is idle, that carries the brief and asks for a report of two to four lines. A prompt the person sends after the interval carries the last brief.
Consequences
- An idle Claude Code session wakes on the interval and reports, and a busy one is reminded on its next prompt. The cost is one turn per interval while the session is open, and the policy can lengthen the interval or switch it off.
- A command-line brief reports the server's board and mesh, or says it could not. "Nobody is here" is no longer printed when the truth is "I did not ask".
- The mod's behaviour is held by its own test against the engine (
claude plugin test). Case 1065 proves the half the repository owns: install, idempotence, the switch, and the command line's shapes. No case runs the mod inside a live provider session. prs briefis now read by the capability as well as by the command line. Its sentence is the integration section, and the one line keeps its open count and next merge.- The
majordomus uiproduct surface (ADR 0135) is not on master as this is written. When it lands, its dashboard readsbrief.sessionlike any other capability. Until then the Cockpit overview shows it.
Alternatives rejected
- A brief composed in each command-line process. It reads an empty board and no mesh and reports them as facts.
- A stream or follow mode. A session needs a summary at an interval, not every event. The event stream is the monitor's (ADR 0133).
- A settings hook on UserPromptSubmit that runs
majordomus brief. It costs a process on every prompt, cannot draw a status line, and cannot wake an idle session. It would also need.claude/settings.jsonedited, which is the person's own. - A cron in each session, scheduled by the worker alone. It depends on the worker remembering, which is the failure being corrected. It stays as the advice the start event gives to providers that have no mod.