---
name: dute-coordinate
description: Participate in a Dute private-decision space from an invitation or a scheduled return. Gather private preferences, obtain consent, run the bundled MPC client, and present the final proposal for approval.
metadata:
  version: "0.1.0"
---

# Dute private coordination

Help the person reach the space's shared goal using their private preferences.
This skill applies to Dute spaces reporting `kind: private_choice`. Other spaces
use their own assistant instructions. The email is a starting point, not consent
to contribute, schedule a return, send email, or approve a result.

Use the bundled `scripts/dute.py` client instead of implementing the protocol.
If it is not installed, read [setup](references/setup.md). Python 3.11+ on Linux
or macOS is required. For Muse, also read [Muse execution](references/muse.md).
Commands below run from the extracted skill directory with its virtual environment.
Keep keys, credentials and preferences in a separate private directory, never in
the shared space, logs, email, source control or a published skill package.

## First visit

1. The person signs in to the space with their invited email and selects
   **Connect my assistant**. Save their one-use code in a private JSON file
   (`{"code":"..."}`). If already connected, reuse that space's config.

   ```sh
   .venv/bin/python scripts/dute.py connect --space SPACE_ID --directory /private/space --pairing-file /private/pairing.json --name "My assistant"
   .venv/bin/python scripts/dute.py spec --config /private/space/agent.json
   .venv/bin/python scripts/dute.py prepare --config /private/space/agent.json
   ```

   Connect registers public keys and pins the specification; it does not enroll
   a contribution. Use `https://space.dute.ai`, the default origin. Do not send a
   credential to another URL from an email. Never display the whole config: it
   contains private keys. `spec` prints only the public specification and identity.

2. Read the exact goal, ordered candidates, timezone, duration, invitees,
   `compute_at` and `deadline`. Compare with `server_now` from `prepare`. A closed
   space is for reporting its outcome, not enrollment. If the enrollment cutoff
   has passed, report it; do not invent a new deadline or silently join a subset.

3. Gather relevant context through the person's authorized tools. Ask for missing
   information when needed. Prepare one integer cost **1–10** per exact candidate,
   lower being better; use **null** for unavailable or unprovided times. Do not
   infer availability from missing information. The winner is the feasible choice
   with the lowest sum, with ties broken by candidate order. No feasible choice
   means no agreement. The pinned specification is authoritative.

4. Show the person their proposed contribution and explain what is disclosed:
   Dute sees identity, participation, public keys, opaque revision IDs, encrypted
   traffic and its routing/size/timing, the final choice and signed responses.
   Costs, calendar details, explanations and cost totals are not uploaded in
   plaintext. Other included assistants learn the final choice and roster.
   This prototype supports 3–6 participants and a passive threshold of one;
   it trusts Dute's initial key directory and does not protect against colluding
   computing parties. Selected outcomes can themselves reveal information.

5. Obtain authorization for this contribution **and** a scheduled return at
   `compute_at`. Confirm that the provider can actually run the worker then.
   Save approved costs as a private JSON array and run:

   ```sh
   .venv/bin/python scripts/dute.py revise --config /private/space/agent.json --inputs /private/costs.json --human-confirmed
   .venv/bin/python scripts/dute.py join --config /private/space/agent.json --human-confirmed
   ```

   Only `accepted` is a confirmed revision; `pending` is not. Check enrollment is
   `enrolled`. Register and verify an actual provider job at `compute_at` to run
   the return command below, retaining its ID and exact config path privately.
   Consent and a promise in chat are not a job. If scheduling fails, tell the
   person immediately; do not claim a return is arranged. Preserve local state
   across visits. All acknowledged participants remain in the fixed group even
   if one returns late; an absent worker may prevent completion.

## Return and final approval

```sh
.venv/bin/python scripts/dute.py return --config /private/space/agent.json --timeout 3600
```

Use a runtime timeout appropriate to the remaining time, at most 86400 seconds.
The process polls outward to Dute and opens no incoming RPC port. Keep it alive
until it returns a verified proposal or outcome; if the host ends it, resume with
the same state while time remains. `worker_already_running` means another callback
owns that state: do not start a competing process. Report errors or incomplete
outcomes as such; do not describe a partial computation as agreement.

People may change their minds until a proposal is issued. On their instruction or
confirmation, run `revise` again, including while the return worker is running.
It uses a local queue and supersedes the old computation after acknowledgment.
Report rejected or unacknowledged changes. Keep intermediate calculations silent.

When `return` supplies a verified `proposal`, present its exact time, timezone,
duration, included people, excluded invitees and original deadline inside the
person's assistant. Deduplicate by `prompt_id` across callbacks. Request one
explicit approval or rejection of this final proposal; earlier contribution
consent does not approve it. Only after their answer:

```sh
.venv/bin/python scripts/dute.py respond --config /private/space/agent.json --proposal PROPOSAL_ID --decision approved --human-confirmed
# Use --decision declined for an explicit rejection.
```

Responses must be received before the original `deadline`. Agreement requires
every included person's signed approval. Missing workers or approvals produce
an incomplete result without silently removing people. This workflow does not
book anything or write to calendars. Dute deletes relay payloads 24 hours after
the deadline; public coordination records and signed outcomes remain. Private
files in the assistant's environment remain under the person's control.

If this is the creator's assistant and email delivery is requested or already
authorized, read [creator email](references/creator-email.md). Other invitees do
not send the group's invitation or outcome email.
