M1 Demo: Local Email Round Trip
Synced from
agent-operator/docs/milestones/M1-email-round-trip/demo.md. The repository is the source of truth.
This is the executable acceptance contract for M1. It proves transport, generic scheduled Pi execution, skill-owned mail behavior, server-side reply state, and restart durability. It does not claim that the M2 paper-research workflow runs.
Demonstrated behavior
Section titled “Demonstrated behavior”The sender demo-user@outfitter.test submits one plain-text message to
researcher@outfitter.test through Stalwart JMAP. The agent observes the message,
the generic loop wakes the resident Pi session, and the mail skill uses xin
to submit a threaded reply before moving the original from INBOX to
Processed. The verifier checks the reply and mailbox state again after
restarting the agent Deployment.
Inputs
Section titled “Inputs”- The repository’s devenv shell and local microVM support.
- A running local cluster initialized by
cluster:upandoperator:install. - The developer’s
$HOME/.pidirectory. Copying this directory into the agent PVC is a required part of the scenario. - The deterministic local-only Stalwart accounts:
researcher@outfitter.testdemo-user@outfitter.test
The demo uses local development credentials declared by the isolated cluster fixture. It does not send mail to the Internet.
From the repository root:
devenv tasks run cluster:updevenv tasks run operator:installdevenv tasks run demo:m1demo:m1 MUST perform these steps without manual kubectl intervention:
-
Apply the
mail-loop-demoorganization andresearcheragent. -
Wait for namespace
agent-researcher. -
Create the demo JMAP Secret and runtime ConfigMap in that namespace.
-
Copy the complete local
$HOME/.pidirectory directly into the durable agent volume through the temporarypi-seederpod, delete that pod, and only then unblock the agent Deployment. -
Restart the Deployment so the current locally imported image is running.
-
Wait for the initial empty work survey to settle, then submit a uniquely-subjected plain-text probe from
demo-user@outfitter.testtoresearcher@outfitter.testand record Stalwart’s generated Message-ID. -
Let a later one-minute scheduled wakeup discover the probe, then authenticate to the sender’s JMAP account and require exactly one matching reply with:
From: M1 researcher agent <researcher@outfitter.test>To: demo-user@outfitter.testSubject: Re: <probe subject>In-Reply-To: <probe Message-ID>References: <probe Message-ID>Here
Fromis the return address exposed by the delivered JMAP Email. Local JMAP delivery does not require an SMTPReturn-Pathheader. -
Require exactly one matching original in
Processedand none inINBOX. -
Confirm
/workspace/.pi/agent/auth.jsonexists and is non-empty when the source file exists locally. -
Restart the Deployment, then prove the original remains outside
INBOXand the sender mailbox still contains exactly one reply.
Evidence
Section titled “Evidence”The task MUST retain these ignored artifacts under
.devenv/state/agent-cluster/shared/evidence/m1-email-flow/:
subject.txtandprobe-message-id.txtfor the unique probe;initial-loop.jsonl, proving the startup survey settled before the probe;send.json,original-sent.json,reply-search.json, andreply.json;inbox-before.json,processed-after.json, andinbox-after.json;replies-after-restart.jsonandinbox-after-restart.json; andagent.yamlwithout Secret data.
The reply artifacts MUST include the JMAP id, Message-ID, In-Reply-To,
References, From, To, and subject. A failed assertion MUST make the task
non-zero. Secret values and the copied .pi payload MUST NOT appear in the
evidence bundle.
Expected result
Section titled “Expected result”The task prints:
M1 email reply verified with exact threading headers; original moved to Processed and was not re-replied after restart: <probe subject>The research-paper, wiki, Git LFS, Docling, model, and final response workflow is the M2 demo.