Skip to content

M1: Local Email Round Trip

Synced from agent-operator/docs/milestones/M1-email-round-trip/task.md. The repository is the source of truth.

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 .pi directory 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 mail skill and xin.
  • 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.
  • 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.
  • Define and reconcile Organization and Agent CRDs.
  • Create the per-agent namespace, service account, namespaced admin binding, ResourceQuota, LimitRange, durable PVC, and Deployment.
  • Wait for referenced Secrets and ConfigMaps and project them into the runtime without reading their values.
  • Provide a devenv-managed microVM with single-node k3s.
  • Run Stalwart with deterministic researcher@outfitter.test and demo-user@outfitter.test JMAP accounts.
  • Build and import the local operator and agent images.
  • Stream the host’s complete $HOME/.pi directory into the researcher PVC through a temporary pod, then delete that pod.
  • Run the researcher profile through Outfitter and resident Pi RPC mode.
  • Prebake the mail skill 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 INBOX through the mail skill, and use xin reply to create In-Reply-To and References headers.
  • Move each replied-to original from INBOX to Processed; 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.
  • Provide devenv tasks run demo:m1.
  • Send a unique probe from demo-user@outfitter.test to researcher@outfitter.test and record the Message-ID generated by Stalwart.
  • Query the sender Inbox and require exactly one reply whose JMAP From return address is researcher@outfitter.test and whose recipient is demo-user@outfitter.test.
  • Require In-Reply-To and References to contain the probe Message-ID.
  • Require the original to leave INBOX and enter Processed, restart the Deployment, and prove no duplicate reply appears.
  • Retain redacted evidence outside Git.
  • 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 .pi payload while no .pi credentials 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.