The front door
Requests from the outside world arrive in ~/.mecha/requests/ as JSON, drained
from the public surface by a
process that holds the drain key and nothing else. mecha frontdoor is
everything that happens to them afterwards, and the whole of it exists to serve
one sentence:
The privileged run sees the extraction, never the prose.
mecha frontdoor # what has arrived, and each request's state
mecha frontdoor list --state extraction_failed
mecha frontdoor show 42 # the full request, including what a stranger wrote
mecha frontdoor extract # run the quarantined pass over anything new
mecha frontdoor next --limit 5 # what a triage run may be told, as JSON
mecha frontdoor triage --limit 5 # draft a reply to each extracted request
mecha frontdoor needs-info 42 --note "which week?"
mecha frontdoor close 42 --reason "answered in person"
Why a quarantine
A run holding the calendar and the mailbox is the most dangerous context in this system, and a free-text field is the one place a stranger controls the bytes.
The typed form is already doing most of the work. Nothing anyone types can change what kind of request theirs is, or its priority, or whether consent exists, because those are enums and booleans the origin validated. What remains is prose — and prose is where an instruction can hide.
So the shape is CaMeL's dual-LLM split, at a size where it is cheap:
free text ──▶ extractor (no tools, no history, JSON only)
│
▼
typed fields ──▶ triage run (calendar, mail, drafts a reply)
│
free text ────────┴──▶ shown to you, never to the privileged pass
The verbs, and the split between them
listandshoware for you.showprints the prose, because a person reading a stranger's request in a terminal is the safe context: you cannot be prompt-injected into sending your own calendar somewhere.extractis the quarantined pass. A tool-less model call per record, turning prose into typed fields. Nothing it produces has any authority; it is the only representation of the prose a privileged run will ever see.nextis what a triage trigger runs. It prints exactly what the boundary allows and nothing else, so the thing feeding a run with calendar and mail access cannot accidentally include the words a stranger typed.
Draining is deliberately not here. mecha-factory-publish drain speaks the
protocol and holds the key, and the common case — nothing new — has to cost
zero tokens and no model at all.
And a request has to be able to reach an answer
Otherwise the queue only grows, which is the failure this component exists to fix. Three verbs end one:
-
triageis the privileged half. A full agent, with mail and calendar, told only whatnextwould print, ending in outbox drafts and never in mail in flight. Each request gets its own conversation — a fresh taint — so whatever one request's run took in cannot arm the interlock for the request behind it. (The extractor'sreads_like_instructionsflag is not what does this: it is a label shown to you inshowand the TUI, and it gates nothing, because a gate built on that judgement rejects real people and still passes the attack that mattered.)It refuses to run without the outbox route, rather than running unrouted: without it a
mail_sendthe model makes actually sends, and a stranger's inbox is not where you want to discover that[outbox] toolswas unset. -
needs-infoparks a request until the requester answers something.--noterecords what is missing, and it replaces the previous note even when absent — a stale explanation attached to a new state reads as an explanation of that state. -
closeends one, and--reasonis required. Not optional: silence is precisely the failure mode this component exists to fix, and a request that went away without a recorded reason is indistinguishable from one that was dropped.
The join between a request and its drafts needed no building. A staged outbox
item already records the session that drafted it, so a triage run with its own
session is enough to say which drafts belong to which request. reconcile reads
the outbox and updates the request store, and it runs on list and next on
its own rather than on a verb you have to remember: a state that is only correct
after someone runs a command is a state nobody can trust. The outbox has still
never heard of a request, and mecha outbox send — another process, hours
later — closes the loop without knowing it is doing so.
Three decisions there:
- A rejected draft returns the request to
extracted, never toclosed. "Not this reply" is not "not this request", and a request closed because its first draft was wrong is exactly the silence this exists to fix. The rejection reason rides along, and the request becomes a triage candidate again. - A partly-resolved set is left alone. Some sent and some pending is a person mid-review, not a state to settle on their behalf. So is a request whose drafts have been swept: unknown stays unknown and waits for a person.
- Reconciliation is best-effort. No outbox is a perfectly ordinary machine,
and a
listthat refuses to print because a cross-check store is absent would be worse than one printing slightly stale states.
What crosses the boundary
There is no way to hand a privileged run the prose. The brief a triage run
gets is built by one function with no option to include it; the original is for
a human running frontdoor show. A rule that said "remember not to include the
free text" would hold until the first person in a hurry.
What does cross is narrow on purpose:
reply_to, named on its own — the address the stranger chose and proved by clicking — so a run never has to hunt for where the answer goes.- The typed fields the origin validated. Which fields count as prose comes from the request type's manifest (the field kind), never from a guess on this side.
- The extraction — topic, claimed urgency, institution, dates — but not the extractor's own free-text reading, because a paraphrase of an injection is the injection rearranged.
- Dates only as quoted text of 3 to 48 characters that literally appear in
the prose. The extractor was asked for dates "as written", and that is
checked rather than trusted. A date it invented — or a span too short or too
long to be one, since an injection copied verbatim would pass a containment
check — is held back and shown with its reason in
frontdoor showand the TUI, as a label to read rather than a block. - Attachments as measurements only: field, size, digest and the content type mecha derived — never the stranger's filename, the path, or the bytes.
An extraction failure is not a silent pass-through. The record goes to
extraction_failed and waits for you; it never falls back to handing the prose
on. And the extractor itself is issued a request with no tools and a single
message — not told to avoid tools, but given none — so there is nothing for an
injected instruction to reach.
States
drained ──▶ extracted ──▶ triaged ──▶ awaiting_me ──▶ answered
│ ▲ │
│ └───── every draft rejected ──┘
│
├──▶ extraction_failed (at any point; routes to a human)
├──▶ needs_info (parked until the requester answers)
└──▶ booked (a confirmed booking; nothing was owed)
any state ──▶ closed (always with a reason)
triage moves a request to triaged, and awaiting_me is where it sits while
its drafts wait in the outbox. Releasing one gets answered; rejecting all of
them gets extracted again, with the rejection reason attached.
booked is where a confirmed booking goes, without passing through any of the
rest. The gate only publishes slots your calendar says are free, the
verification click confirms one, and a deterministic sweep with no model in it
turns the record into a calendar event whose invite your provider sends — so the
request arrives already answered. Settling it is what keeps a finished meeting
out of the review queue, and out of the extraction and triage passes that would
otherwise spend a model call drafting a reply to it. A cancellation closes both
itself and the booking it withdraws.
A record that did not validate against the manifest at drain time is never extracted and never reaches a run.
Your booking hours, from the web
The Factory view in the web app lists the manifests in
~/.mecha/factory/types/. Open a booking page there to see what it offers
now, when the slot timer last pushed, and the meetings coming up. You can also
edit its hours: the weekly windows, dates off, meeting lengths, the gap around
other meetings, minimum notice, how far ahead, and the most per day.
The editor shows what the page would offer before you save. That preview is
factory-publish slots preview, computed over the busy time the last push
saw, so it is the page's own arithmetic. Saving writes the manifest's
[availability] section in place and keeps your comments. It then pushes, so
the page changes at once instead of at the slot timer's next run, two
minutes later at most.
Five rules hold it together:
- One file. The slot timer reads the manifest itself
(
factory-publish slots push book --manifest …/book.toml), so the hours the page promises and the hours it computes cannot disagree. - The time zone is not an hours edit. The booking page reads it to label
its times, so the editor shows it but will not change it. Change it in your
working copy of the manifest and
factory-publish type pushthat. - A
type pushreplaces the hours too. The file the editor writes is the record of what the box serves, and a push rewrites it whole. If the hours you push differ from the ones set here, the push prints a note saying so. Copy the hours into your working copy before you push it. - Only you write it. The save is a handler in
mecha serve. There is no CLI verb and no tool for it, so no model can change what strangers may book of your week, even if a stranger's message asks it to. - "How far ahead" stops at 60 days, because the timer fetches 60 days of your calendar. A longer horizon would make every push refuse.
Cancelling a booking from this page is not built yet.
Your forms, from the web
The same Factory view creates and edits the forms strangers fill in. New form starts a draft from a starter (a meeting request, a letter, a speaking invitation, a lab application, a booking page) under a link name you choose once. Open any form to edit its title, description, questions (each with a kind, a required switch, help text, and choices for the choice kinds) and the message people see after they submit, or switch to Edit as TOML for anything the fields do not show.
Edits are saved as a draft: nothing changes for strangers until you press Publish, which uploads the draft as the live form. Preview shows the page as strangers will see it. A booking page's hours are not edited here, and publishing it keeps the hours that are live. Pausing or retiring a form is not built yet.
Where to go next
- Security model — the interlock, and why a second layer was still worth building.
- Publishing — the outbound half of the same boundary.
- Triggers — what a triage run is scheduled by.