M1: Local Email Round Trip
Synced from
agent-operator/docs/milestones/M1-email-round-trip/task.md. The repository is the source of truth.
Summary
Section titled “Summary”M1 proves the smallest useful Agent Operator composition end to end. A developer
starts the local k3s environment, applies one Organization and one Agent,
sends a plain-text message through Stalwart JMAP, and receives one threaded
reply from the resident Outfitter/Pi agent.
The milestone exercises the operator’s workspace and credential primitives plus a generic resident loop and agent-owned mail skill. It deliberately does not perform paper research. The paper-ingestion composition is M2.
- Reconcile the two cluster-scoped CRDs and the workspace resources needed to run one agent.
- Expose the agent’s JMAP Secret and runtime ConfigMap without interpreting their contents.
- Copy the developer’s local
.pidirectory directly into the agent’s durable volume before starting the workload. - Receive a uniquely identified message through JMAP, let the generic loop wake
the researcher, and submit a threaded reply through the
mailskill andxin. - Verify the acknowledgement from the original sender’s mailbox, including its return address and thread headers.
- Prove the received/replied state and the single reply survive a Deployment restart.
Non-Goals
Section titled “Non-Goals”- Attachments, PDF validation, Docling, Git LFS, or wiki changes.
- A research-quality response body.
- Internet mail, SMTP administration, spam handling, DKIM, SPF, or DMARC.
- Transactionally closing the crash window between a successful reply and
moving the original to
Processed. - Projects, subagent Jobs, concurrent mailbox processing, or multi-tenant hardening.
Implementation
Section titled “Implementation”1. Operator and workspace primitives
Section titled “1. Operator and workspace primitives”- Define and reconcile
OrganizationandAgentCRDs. - Create the per-agent namespace, service account, namespaced
adminbinding, ResourceQuota, LimitRange, durable PVC, and Deployment. - Wait for referenced Secrets and ConfigMaps and project them into the runtime without reading their values.
2. Local environment
Section titled “2. Local environment”- Provide a devenv-managed microVM with single-node k3s.
- Run Stalwart with deterministic
researcher@outfitter.testanddemo-user@outfitter.testJMAP accounts. - Build and import the local operator and agent images.
- Stream the host’s complete
$HOME/.pidirectory into the researcher PVC through a temporary pod, then delete that pod.
3. Agent-owned mail composition
Section titled “3. Agent-owned mail composition”- Run the
researcherprofile through Outfitter and resident Pi RPC mode. - Prebake the
mailskill and pinned generic loop extension in the agent image, then let Outfitter project the extension to Pi offline. - Wake the resident agent on a fixed schedule, survey
INBOXthrough the mail skill, and usexin replyto createIn-Reply-ToandReferencesheaders. - Move each replied-to original from
INBOXtoProcessed; mailbox membership is the only reply-tracking state. - Avoid a second reply after restart because processed mail is no longer in
INBOX. - Keep all email behavior in the agent runtime rather than the controller.
4. Executable acceptance
Section titled “4. Executable acceptance”- Provide
devenv tasks run demo:m1. - Send a unique probe from
demo-user@outfitter.testtoresearcher@outfitter.testand record the Message-ID generated by Stalwart. - Query the sender Inbox and require exactly one reply whose JMAP
Fromreturn address isresearcher@outfitter.testand whose recipient isdemo-user@outfitter.test. - Require
In-Reply-ToandReferencesto contain the probe Message-ID. - Require the original to leave
INBOXand enterProcessed, restart the Deployment, and prove no duplicate reply appears. - Retain redacted evidence outside Git.
Graduation Criteria
Section titled “Graduation Criteria”- The agent and operator images build from a clean checkout of the landed changes.
- The executable demo passes against the local Stalwart server with the generic loop (the earlier mail-specific runtime result does not satisfy this revised acceptance contract).
- Controller tests cover ordered setup, storage-budget validation, and non-destructive image-closure upgrades on a persistent Nix store.
- The live evidence identifies the exact reply and mailbox state before and after restart.
- The agent volume contains the required local
.pipayload while no.picredentials are stored in Kubernetes or committed to Git.
The revised generic-loop demo passed locally on 2026-07-22. M1 is awaiting a clean-checkout image build before it graduates. The next milestone is M2: Email Paper Research.