Agent Mail — optional coordination adapter
Agent Mail carries messages, acknowledgements, identities, and temporary file
reservations. It is not a task tracker, queue, proof ledger, or lifecycle
controller.
Reservations are advisory: they prevent collisions only because every
cooperating writer checks them against the same absolute project path, and one
writer registered against a different path resolution makes the whole ledger
advisory fiction. Agent Mail enforces nothing on a writer that does not check.
Named failure mode — silence-as-status: reading an unanswered thread as
"work stalled" or "work done"; mail silence proves only that no mail arrived.
Anti-pattern: widening or renewing a reservation unprompted when a conflict
appears. Corrective: report the conflict to the caller as-is; scope and TTL
changes are the caller's call.
Boundary
- Skip Agent Mail for a single writer.
- The caller supplies the absolute project path, agent identities, thread id,
participants, paths, exclusivity, reason, and TTL.
- Reservations prevent accidental overlap among cooperating writers. They do not
create work ownership or affect Plan, Candidate, or verdict semantics.
- Mail silence proves nothing about work status.
- A message or acknowledgement is evidence that communication occurred, not
evidence that a change is correct or complete. The adapter cannot select
AgentOps semantics, issue a binding verdict, or turn factory completion into
delivery or validation proof.
- Release a reservation, including any
force_release, only on the caller's
explicit request for that exact reservation. Force-release has no autonomous
trigger; a conflict is reported, not force-cleared.
- Agent Mail never selects work, changes tracker state, commits code, validates,
integrates, closes, releases, or delivers work.
Modes and authority
Two disjoint surfaces; do not reach the second from the first:
- Coordination mode (default). Register identity, reserve/release the
caller's paths, send/read/acknowledge the caller's threads. This is the whole
of routine use, and all of it writes durable Agent Mail records.
- Admin / disaster-recovery mode (explicitly caller-authorized only).
Installing the git pre-commit guard,
doctor repair, backup/restore, and the
irreversible clear-and-reset-everything are a separate mode. Each requires
the caller's explicit authorization for that specific operation; none is ever
performed as a side effect of coordination. clear-and-reset-everything
deletes the database and all storage and cannot be undone — never run it, even
with --force, without an explicit destructive-reset authorization from the
caller.
Surfaces
Choose exactly one mailbox owner and access mode for each storage root. When an
HTTP/MCP daemon owns the root, use its MCP tools; do not point the direct am
CLI at the same database. Use the CLI fallback only with a root not owned by a
running Agent Mail runtime. A busy mailbox activity lock or a bounded read
timeout is a degraded adapter result, not permission to restart the service,
repair the database, or silently switch roots.
Use the MCP tools when they are present. Otherwise use the self-describing am
CLI. Pin the intended storage root explicitly, and discover current syntax with
am mail --help, am file_reservations --help, and related group help; do not
infer commands from remembered aliases. If a direct macOS read rejects a
symlinked snapshot directory such as /var, use a caller-scoped, non-symlinked
temporary directory for that isolated invocation or report the adapter
degraded; never weaken the traversal check.
One-shot use
- Confirm that multiple explicitly coordinated writers share the repository.
- Freeze one storage root and either MCP/server mode or direct-CLI mode; never
mix both against the same live database.
- Register the caller-supplied identity against the same absolute project path.
- Reserve only the supplied paths, with a bounded TTL.
- Report conflicts without waiting, narrowing scope, or changing the plan.
- Send the supplied message once and record its id.
- Read or acknowledge only the requested thread.
- Before the caller advances a declared transition, verify every
acknowledgement-required message in that transition has the intended
recipient acknowledgement. Later traffic is not an implicit acknowledgement.
- Release only reservations the caller explicitly asks to release.
Output
Return the project, identity, thread/message ids, reservation ids and paths
(with their TTLs), conflicts, and timestamps. The caller owns all subsequent
decisions.
Terminal outcomes are explicit, never silent:
- Adapter unavailable — neither the MCP tools nor the
am CLI is present:
report that Agent Mail is unavailable and stop. Do not fall back to
hand-written coordination or treat the absence as "no conflicts".
- Reservation conflict — report the conflicting reservation as-is; do not
narrow, widen, renew, or force-release it.
- Mailbox ownership conflict — a daemon and direct CLI contend for one
storage root: report the lock owner/mode and stop; do not restart, repair, or
bypass the lock as a coordination side effect.
- Required acknowledgement pending — report the exact message and intended
recipient and stop the dependent transition. Do not infer acknowledgement
from a later reply or repair it after validation.
- Timeout / degraded surface — report the operation as timed out or degraded
with what was and was not observed; a timeout is evidence, not "done".
- Cleanup — reservations released this session are listed by id; any left
in place (still holding a TTL) are named so the caller can see what remains.
References
- CLI and MCP surface notes
- Coordination patterns
- Troubleshooting
1---
2name: agent-mail
3user-invocable: false
4skill_api_version: 1
5hexagonal_role: supporting
6consumes:
7- coordination-request
8produces:
9- agent-identity
10- file-reservation
11- acknowledged-handoff
12context_rel:
13- kind: supplier-to
14 with: agent-native
15metadata:
16 capabilities: [agent_mail]
17 effects: [write_agent_mail_records, install_precommit_guard, authorized_destructive_reset]
18 canonical_status: canonical
19 disposition: keep_optional_adapter
20 tier: execution
21 dependencies: []
22description: 'Use Agent Mail as an optional messaging and file-reservation adapter for explicitly coordinated writers. Triggers: "coordinate writers", "reserve files".'
23practices:
24- pragmatic-programmer
25output_contract: factual messaging and reservation adapter results
26---
27
28# Agent Mail — optional coordination adapter
29
30Agent Mail carries messages, acknowledgements, identities, and temporary file
31reservations. It is not a task tracker, queue, proof ledger, or lifecycle
32controller.
33
34Reservations are **advisory**: they prevent collisions only because every
35cooperating writer checks them against the same absolute project path, and one
36writer registered against a different path resolution makes the whole ledger
37advisory fiction. Agent Mail enforces nothing on a writer that does not check.
38
39Named failure mode — **silence-as-status**: reading an unanswered thread as
40"work stalled" or "work done"; mail silence proves only that no mail arrived.
41
42Anti-pattern: widening or renewing a reservation unprompted when a conflict
43appears. Corrective: report the conflict to the caller as-is; scope and TTL
44changes are the caller's call.
45
46## Boundary
47
48- Skip Agent Mail for a single writer.
49- The caller supplies the absolute project path, agent identities, thread id,
50 participants, paths, exclusivity, reason, and TTL.
51- Reservations prevent accidental overlap among cooperating writers. They do not
52 create work ownership or affect Plan, Candidate, or verdict semantics.
53- Mail silence proves nothing about work status.
54- A message or acknowledgement is evidence that communication occurred, not
55 evidence that a change is correct or complete. The adapter cannot select
56 AgentOps semantics, issue a binding verdict, or turn factory completion into
57 delivery or validation proof.
58- Release a reservation, including any `force_release`, only on the caller's
59 explicit request for that exact reservation. Force-release has no autonomous
60 trigger; a conflict is reported, not force-cleared.
61- Agent Mail never selects work, changes tracker state, commits code, validates,
62 integrates, closes, releases, or delivers work.
63
64## Modes and authority
65
66Two disjoint surfaces; do not reach the second from the first:
67
68- **Coordination mode (default).** Register identity, reserve/release the
69 caller's paths, send/read/acknowledge the caller's threads. This is the whole
70 of routine use, and all of it writes durable Agent Mail records.
71- **Admin / disaster-recovery mode (explicitly caller-authorized only).**
72 Installing the git pre-commit guard, `doctor repair`, backup/restore, and the
73 irreversible `clear-and-reset-everything` are a separate mode. Each requires
74 the caller's explicit authorization for that specific operation; none is ever
75 performed as a side effect of coordination. `clear-and-reset-everything`
76 deletes the database and all storage and cannot be undone — never run it, even
77 with `--force`, without an explicit destructive-reset authorization from the
78 caller.
79
80## Surfaces
81
82Choose exactly one mailbox owner and access mode for each storage root. When an
83HTTP/MCP daemon owns the root, use its MCP tools; do not point the direct `am`
84CLI at the same database. Use the CLI fallback only with a root not owned by a
85running Agent Mail runtime. A busy mailbox activity lock or a bounded read
86timeout is a degraded adapter result, not permission to restart the service,
87repair the database, or silently switch roots.
88
89Use the MCP tools when they are present. Otherwise use the self-describing `am`
90CLI. Pin the intended storage root explicitly, and discover current syntax with
91`am mail --help`, `am file_reservations --help`, and related group help; do not
92infer commands from remembered aliases. If a direct macOS read rejects a
93symlinked snapshot directory such as `/var`, use a caller-scoped, non-symlinked
94temporary directory for that isolated invocation or report the adapter
95degraded; never weaken the traversal check.
96
97## One-shot use
98
991. Confirm that multiple explicitly coordinated writers share the repository.
1002. Freeze one storage root and either MCP/server mode or direct-CLI mode; never
101 mix both against the same live database.
1023. Register the caller-supplied identity against the same absolute project path.
1034. Reserve only the supplied paths, with a bounded TTL.
1045. Report conflicts without waiting, narrowing scope, or changing the plan.
1056. Send the supplied message once and record its id.
1067. Read or acknowledge only the requested thread.
1078. Before the caller advances a declared transition, verify every
108 acknowledgement-required message in that transition has the intended
109 recipient acknowledgement. Later traffic is not an implicit acknowledgement.
1109. Release only reservations the caller explicitly asks to release.
111
112## Output
113
114Return the project, identity, thread/message ids, reservation ids and paths
115(with their TTLs), conflicts, and timestamps. The caller owns all subsequent
116decisions.
117
118Terminal outcomes are explicit, never silent:
119
120- **Adapter unavailable** — neither the MCP tools nor the `am` CLI is present:
121 report that Agent Mail is unavailable and stop. Do not fall back to
122 hand-written coordination or treat the absence as "no conflicts".
123- **Reservation conflict** — report the conflicting reservation as-is; do not
124 narrow, widen, renew, or force-release it.
125- **Mailbox ownership conflict** — a daemon and direct CLI contend for one
126 storage root: report the lock owner/mode and stop; do not restart, repair, or
127 bypass the lock as a coordination side effect.
128- **Required acknowledgement pending** — report the exact message and intended
129 recipient and stop the dependent transition. Do not infer acknowledgement
130 from a later reply or repair it after validation.
131- **Timeout / degraded surface** — report the operation as timed out or degraded
132 with what was and was not observed; a timeout is evidence, not "done".
133- **Cleanup** — reservations released this session are listed by id; any left
134 in place (still holding a TTL) are named so the caller can see what remains.
135
136## References
137
138- [CLI and MCP surface notes](references/TOOLS.md)
139- [Coordination patterns](references/WORKFLOWS.md)
140- [Troubleshooting](references/RECOVERY.md)