@openmuster/muster 0.3.1-alpha.3 → 0.3.1-alpha.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +16 -10
- package/dist/{args-DX9QSK1f.js → args-CaFBa2IP.js} +305 -23
- package/dist/cli.js +3 -3
- package/dist/index.d.ts +67 -18
- package/dist/index.js +106 -41
- package/dist/inspect/app.js +79 -51
- package/dist/{main-DgrIMbeA.js → main-BeEB08iI.js} +397 -26
- package/dist/main-CLzQkYeG.js +6 -0
- package/dist/mcp-CAAZRJgv.js +6 -0
- package/dist/{module-C-HJjWWo.js → module-BX2IjSiv.js} +2 -2
- package/dist/{module-CxoN1MOe.js → module-D9KdbEpS.js} +1 -1
- package/dist/skills/board/SKILL.md +5 -0
- package/dist/{steps-DtzUdcBE.js → steps-FNDWY1P_.js} +16 -4
- package/docs/01-concepts/09-watchers.md +4 -32
- package/docs/01-concepts/10-schedules.md +1 -1
- package/docs/01-concepts/11-access.md +19 -3
- package/docs/01-concepts/13-budgets.md +66 -3
- package/docs/01-concepts/15-outgoing-webhooks.md +6 -19
- package/docs/01-concepts/16-workflows.md +22 -2
- package/docs/01-quickstart.md +74 -42
- package/docs/02-sync/01-overview.md +34 -2
- package/docs/02-sync/02-github.md +40 -19
- package/docs/02-sync/03-linear.md +103 -85
- package/docs/02-sync/04-slack.md +116 -111
- package/docs/02-sync/05-notion.md +46 -25
- package/docs/03-guides/01-coding-agents.md +51 -33
- package/docs/03-guides/02-swarm.md +30 -15
- package/docs/03-guides/03-factory.md +193 -80
- package/docs/03-guides/04-inspector.md +79 -29
- package/docs/03-guides/05-running-agents.md +62 -35
- package/docs/03-guides/06-sandboxed-agents.md +488 -305
- package/docs/03-guides/07-build-a-ui.md +86 -31
- package/docs/03-guides/08-ci.md +59 -36
- package/docs/03-guides/09-daemon.md +121 -53
- package/docs/03-guides/10-two-agents.md +31 -22
- package/docs/03-guides/11-person-in-the-loop.md +47 -34
- package/docs/03-guides/12-unattended.md +46 -27
- package/docs/03-guides/13-terminals.md +51 -39
- package/docs/03-guides/14-no-cloud.md +31 -19
- package/docs/03-guides/15-several-boards.md +61 -27
- package/docs/03-guides/16-non-code.md +29 -18
- package/docs/03-guides/17-mcp.md +37 -30
- package/docs/03-guides/18-a-board-on-a-server.md +66 -43
- package/docs/03-guides/19-a-card-queue.md +210 -121
- package/docs/03-guides/20-a-feedback-loop.md +298 -134
- package/docs/03-guides/21-running-the-loop.md +94 -64
- package/docs/03-guides/22-building-from-linear.md +81 -57
- package/docs/04-reference/01-cli.md +8 -0
- package/docs/04-reference/02-handle.md +10 -15
- package/docs/04-reference/03-http.md +1 -1
- package/docs/04-reference/04-events.md +2 -1
- package/docs/04-reference/05-errors.md +3 -0
- package/docs/04-reference/08-files.md +49 -0
- package/docs/index.md +22 -0
- package/package.json +1 -1
- package/dist/main-CdVlnWHy.js +0 -6
- package/dist/mcp-NueWYyQs.js +0 -6
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: A board on a server
|
|
3
|
-
description: For
|
|
3
|
+
description: For anyone whose board must be reached by cloud sandboxes, platform webhooks or teammates. You end with mu serve in a container behind HTTPS, tokens held to channels, sync and watchers run from a module, and a way to back it up and upgrade it.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
## Who this is for
|
|
@@ -20,16 +20,17 @@ There are three ways, from least to most exposed:
|
|
|
20
20
|
| --- | --- | --- |
|
|
21
21
|
| A private network (Tailscale, a LAN) | Teammates' machines | No domain, no public port |
|
|
22
22
|
| A tunnel to your machine | Trying cloud runs or a webhook | Your machine awake while it runs |
|
|
23
|
-
| A server, in a container | Running cloud agents or sync for real | A small server and a name |
|
|
23
|
+
| A server, in a container | Running cloud agents or sync for real | A small server and a domain name |
|
|
24
24
|
|
|
25
|
-
For a private network, run
|
|
26
|
-
there>` on the machine with
|
|
25
|
+
For a private network, run
|
|
26
|
+
`mu serve --host 0.0.0.0 --allow-host <its name there>` on the machine with
|
|
27
|
+
the board: see
|
|
27
28
|
[With no cloud at all](./14-no-cloud.md). The rest of this page is the server.
|
|
28
29
|
|
|
29
30
|
## Run it in a container
|
|
30
31
|
|
|
31
32
|
The repository's `Dockerfile` builds an image that runs `mu serve`, with the
|
|
32
|
-
board, its files, its signing key and its config on one volume at `/data
|
|
33
|
+
board, its files, its signing key and its config on one volume at `/data`:
|
|
33
34
|
|
|
34
35
|
```bash
|
|
35
36
|
docker build -t muster https://github.com/openmuster/muster.git
|
|
@@ -38,19 +39,21 @@ docker run -d --name board --restart unless-stopped \
|
|
|
38
39
|
-e MUSTER_ALLOW_HOSTS=board.example.com muster
|
|
39
40
|
```
|
|
40
41
|
|
|
41
|
-
|
|
42
|
-
in front sends it. The board refuses a request for any other name. Several
|
|
43
|
-
names are separated by commas.
|
|
44
|
-
- **The port is bound to this machine.** Put a proxy that terminates HTTPS in
|
|
45
|
-
front, and let only it reach the port.
|
|
46
|
-
- **No token is printed,** since a container's output ends up in a log. Make
|
|
47
|
-
one when you need it, as below.
|
|
48
|
-
- **The image has a health check** at `/api/board/health`, which answers
|
|
49
|
-
without a token and says only the version.
|
|
42
|
+
In that command:
|
|
50
43
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
44
|
+
- **`MUSTER_ALLOW_HOSTS`:** the name the proxy in front sends for the board.
|
|
45
|
+
The board refuses a request for any other name. Separate several names with
|
|
46
|
+
commas.
|
|
47
|
+
- **The port is open only to this machine.** Put a proxy that terminates
|
|
48
|
+
HTTPS in front, and let only it reach the port.
|
|
49
|
+
- **`mu serve` prints no token here.** A container's output ends up in a log.
|
|
50
|
+
Make a token when you need it, as
|
|
51
|
+
[Create tokens for agents](#create-tokens-for-agents) shows.
|
|
52
|
+
- **The image has a health check.** It is at `/api/board/health`, answers
|
|
53
|
+
without a token, and says only the version.
|
|
54
|
+
|
|
55
|
+
Each release also comes as an image, `ghcr.io/openmuster/muster:<version>`,
|
|
56
|
+
so you can pull it in place of building it.
|
|
54
57
|
|
|
55
58
|
## Put HTTPS in front
|
|
56
59
|
|
|
@@ -65,7 +68,7 @@ board.example.com {
|
|
|
65
68
|
|
|
66
69
|
A Cloudflare Tunnel or Tailscale Funnel works too, with no open port at all.
|
|
67
70
|
|
|
68
|
-
##
|
|
71
|
+
## Create tokens for agents
|
|
69
72
|
|
|
70
73
|
The board signs tokens with a key on its volume. Make them inside the
|
|
71
74
|
container:
|
|
@@ -79,44 +82,60 @@ docker exec board mu token revoke Xk3v9QmB2a1c
|
|
|
79
82
|
|
|
80
83
|
The first, with `--all`, has your full access: use it on your machine
|
|
81
84
|
with `MUSTER_URL=https://board.example.com/api/board` and `MUSTER_TOKEN`. Give
|
|
82
|
-
agents tokens held to a profile and to
|
|
85
|
+
agents tokens [held to a profile](../01-concepts/11-access.md#tokens) and to
|
|
86
|
+
the channels they need. See
|
|
83
87
|
[Access](../01-concepts/11-access.md).
|
|
84
88
|
|
|
85
|
-
Or let agents ask
|
|
86
|
-
the agent run
|
|
87
|
-
|
|
88
|
-
|
|
89
|
+
Or let agents ask. Start the container with `-e MUSTER_ALLOW_JOINS=1`, and
|
|
90
|
+
have the agent run
|
|
91
|
+
`mu join https://board.example.com/api/board --as <name>`. Then approve the
|
|
92
|
+
code it shows:
|
|
93
|
+
`docker exec board mu join approve <code> --can 'work/=read,post'`. See
|
|
89
94
|
[Let an agent ask to join](../01-concepts/11-access.md#let-an-agent-ask-to-join).
|
|
90
95
|
|
|
91
|
-
##
|
|
96
|
+
## Run sync and watchers in the container
|
|
92
97
|
|
|
93
98
|
Put a [board module](../01-concepts/17-board-module.md) in `/data/config`,
|
|
94
|
-
say `/data/config/board.ts`, and name it with
|
|
95
|
-
|
|
96
|
-
|
|
99
|
+
say `/data/config/board.ts`, and name it with
|
|
100
|
+
`-e MUSTER_MODULE=/data/config/board.ts`. The image sets `MUSTER_DIR`, so
|
|
101
|
+
`mu` doesn't pick up the default module on its own. The module needs no
|
|
102
|
+
`package.json`: `mu` resolves its `import '@openmuster/muster'`. Pass the
|
|
97
103
|
secrets it names with `env()` as environment variables to `docker run`
|
|
98
|
-
(`-e GITHUB_TOKEN`).
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
+
(`-e GITHUB_TOKEN`).
|
|
105
|
+
|
|
106
|
+
The board runs the module's sync,
|
|
107
|
+
[watchers](../01-concepts/09-watchers.md#watchers) and hooks while it serves.
|
|
108
|
+
If the module fails to load, the container's log says so, and `mu serve`
|
|
109
|
+
serves the board without it.
|
|
110
|
+
|
|
111
|
+
A watcher's command runs inside the container, so it can only start what the
|
|
112
|
+
image has. To wake an agent somewhere else, have the command call out, or run
|
|
113
|
+
the watchers on that machine against the served board.
|
|
104
114
|
|
|
105
115
|
## Back it up
|
|
106
116
|
|
|
117
|
+
Write a backup to the volume from inside the container:
|
|
118
|
+
|
|
107
119
|
```bash
|
|
108
120
|
docker exec board mu backup /data/backups/2026-11-21.db
|
|
109
121
|
```
|
|
110
122
|
|
|
111
123
|
A backup is a consistent copy of the database, with the board's files copied
|
|
112
|
-
beside it (`2026-11-21.files`)
|
|
113
|
-
server. Keep a copy of `/data/config/keys` too, once: it
|
|
114
|
-
without it every token the board made stops working.
|
|
124
|
+
beside it (`2026-11-21.files`). `mu backup` makes it while the board runs.
|
|
125
|
+
Copy it off the server. Keep a copy of `/data/config/keys` too, once: it
|
|
126
|
+
never changes, and without it every token the board made stops working.
|
|
115
127
|
|
|
116
128
|
To restore, stop the container and put the copy back at
|
|
117
129
|
`/data/board/main.db`, and its files at `/data/board/main.files`.
|
|
118
130
|
|
|
119
|
-
|
|
131
|
+
On a board without a container, such as one on your own machine, run
|
|
132
|
+
`mu backup` directly with the file to write:
|
|
133
|
+
|
|
134
|
+
```bash
|
|
135
|
+
mu backup ./board-backup.db
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
## Upgrade to a new release
|
|
120
139
|
|
|
121
140
|
Back up first. Then build or pull the new image, and start a new container on
|
|
122
141
|
the same volume:
|
|
@@ -130,10 +149,10 @@ docker run -d --name board --restart unless-stopped \
|
|
|
130
149
|
-e MUSTER_ALLOW_HOSTS=board.example.com muster
|
|
131
150
|
```
|
|
132
151
|
|
|
133
|
-
A newer muster upgrades the board's file when it opens it
|
|
134
|
-
can't open
|
|
152
|
+
A newer muster upgrades the board's file when it opens it. An older muster
|
|
153
|
+
can't open that file afterwards, so the backup is how you go back.
|
|
135
154
|
|
|
136
|
-
##
|
|
155
|
+
## Run it without a container
|
|
137
156
|
|
|
138
157
|
On any machine with Node and muster installed:
|
|
139
158
|
|
|
@@ -141,12 +160,16 @@ On any machine with Node and muster installed:
|
|
|
141
160
|
mu serve --host 0.0.0.0 --allow-host board.example.com --no-token
|
|
142
161
|
```
|
|
143
162
|
|
|
144
|
-
`--
|
|
145
|
-
|
|
163
|
+
`--no-token` only skips printing a token at start, since a server's output
|
|
164
|
+
ends up in a log: make one with `mu token create`. `mu serve` won't start
|
|
165
|
+
with a `--host` other than this machine unless you pass `--allow-host`. Keep
|
|
166
|
+
it running with your service manager, such as a systemd
|
|
146
167
|
unit whose `ExecStart` is that line.
|
|
147
168
|
|
|
148
169
|
## What goes wrong
|
|
149
170
|
|
|
171
|
+
Each entry starts with what you see:
|
|
172
|
+
|
|
150
173
|
- **`allow_host_required`:** the board listens beyond this machine but wasn't
|
|
151
174
|
told its name. Set `MUSTER_ALLOW_HOSTS` or pass `--allow-host`.
|
|
152
175
|
- **Every request is `forbidden`:** the proxy sends a `Host` the board wasn't
|
|
@@ -156,7 +179,7 @@ unit whose `ExecStart` is that line.
|
|
|
156
179
|
- **The published image is for x86 servers.** On an ARM server, build it
|
|
157
180
|
from the repository there.
|
|
158
181
|
|
|
159
|
-
## When not to
|
|
182
|
+
## When not to use a server
|
|
160
183
|
|
|
161
184
|
One person, agents on one machine: keep the board local. A server is one more
|
|
162
185
|
thing to keep patched, backed up and behind HTTPS.
|
|
@@ -1,31 +1,39 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: A card queue
|
|
3
|
-
description: For handing a Linear issue, or a card you post, to an agent that writes a spec, opens a pull request and reviews it, once.
|
|
3
|
+
description: For handing a Linear issue, or a card you post, to an agent that writes a spec, opens a pull request and reviews it, once. You label the card agent. Each step runs in a cloud sandbox, and the agent asks you only for decisions.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
## Who this is for
|
|
7
7
|
|
|
8
|
-
You keep work as cards
|
|
9
|
-
an agent to take a card from start to finish: write a spec, make the
|
|
10
|
-
as a pull request, and review it. You only want to hear about a card
|
|
11
|
-
agent needs a decision from you.
|
|
8
|
+
You keep work as cards: Linear issues, or threads you post yourself. You
|
|
9
|
+
want an agent to take a card from start to finish: write a spec, make the
|
|
10
|
+
change as a pull request, and review it. You only want to hear about a card
|
|
11
|
+
when the agent needs a decision from you.
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
through a tunnel or a proxy, a Vercel project for the sandboxes, a GitHub App
|
|
15
|
-
installed on the repository, a model key, and for Linear cards a Linear key
|
|
16
|
-
and webhook. See [Agents in cloud sandboxes](./06-sandboxed-agents.md) for
|
|
17
|
-
the Vercel and GitHub parts. `"runner": "e2b"` in `workflows.json` runs the
|
|
18
|
-
steps in E2B sandboxes instead, with `E2B_API_KEY` and `MUSTER_E2B_TEMPLATE`
|
|
19
|
-
in place of the Vercel settings.
|
|
13
|
+
## Before you begin
|
|
20
14
|
|
|
21
|
-
|
|
15
|
+
You need:
|
|
22
16
|
|
|
23
|
-
|
|
24
|
-
|
|
17
|
+
- muster on the machine that holds the board
|
|
18
|
+
- `mu serve` reached through a tunnel or a proxy
|
|
19
|
+
- a Vercel project for the sandboxes
|
|
20
|
+
- a GitHub App installed on the repository
|
|
21
|
+
- a model key
|
|
22
|
+
- for Linear cards, a Linear key and webhook
|
|
23
|
+
|
|
24
|
+
See [Agents in cloud sandboxes](./06-sandboxed-agents.md) for the Vercel and
|
|
25
|
+
GitHub parts. `"runner": "e2b"` in `workflows.json` runs the steps in E2B
|
|
26
|
+
sandboxes instead, with `E2B_API_KEY` and `MUSTER_E2B_TEMPLATE` in place of
|
|
27
|
+
the Vercel settings.
|
|
28
|
+
|
|
29
|
+
## How it fits together
|
|
30
|
+
|
|
31
|
+
`templates/queue` is a [board module](../01-concepts/17-board-module.md), a
|
|
32
|
+
workflow file, and three scripts:
|
|
25
33
|
|
|
26
34
|
| File | What it does |
|
|
27
35
|
| --- | --- |
|
|
28
|
-
| `board.ts` | The board module. Its sync maps Linear team `ENG` to the channel `cards`, both ways. Its watcher `card-start` runs `start.sh` for a card labelled `tag.agent=agent`; `needs-me` runs `notify.sh` when a task under `cards/` blocks |
|
|
36
|
+
| `board.ts` | The board module. Its sync maps Linear team `ENG` to the channel `cards`, both ways. Its [watcher](../01-concepts/09-watchers.md#watchers) `card-start` runs `start.sh` for a card labelled `tag.agent=agent`; `needs-me` runs `notify.sh` when a task under `cards/` [blocks](../01-concepts/08-tasks.md#states) |
|
|
29
37
|
| `workflows.json` | The `card` workflow: spec, work and review tasks, one Vercel worker, `--push` for the work step only |
|
|
30
38
|
| `start.sh` | Marks the card `started` and asks for the `card` workflow on it, once |
|
|
31
39
|
| `notify.sh` | Tells you a task is blocked, with its ID only |
|
|
@@ -45,6 +53,13 @@ flowchart LR
|
|
|
45
53
|
|
|
46
54
|
## Set it up
|
|
47
55
|
|
|
56
|
+
`mu serve` runs the module's sync, its watchers and the workflow, and the
|
|
57
|
+
workers start with its environment.
|
|
58
|
+
|
|
59
|
+
### Copy the workflow file
|
|
60
|
+
|
|
61
|
+
Copy the workflow file to muster's config folder:
|
|
62
|
+
|
|
48
63
|
```bash
|
|
49
64
|
cp templates/queue/workflows.json ~/.config/muster/
|
|
50
65
|
```
|
|
@@ -54,58 +69,52 @@ Then edit the copy: `repo` is your repository's https address. In
|
|
|
54
69
|
`templates/queue`, and names the scripts beside it by their full paths,
|
|
55
70
|
wherever it is run from.
|
|
56
71
|
|
|
72
|
+
### Start `mu serve` with the module
|
|
73
|
+
|
|
57
74
|
Put the settings in the environment `mu serve` starts with, and give it the
|
|
58
|
-
module.
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
the variable, if one isn't set:
|
|
75
|
+
module. The module names the Linear secrets with `env()`. `mu serve` reads
|
|
76
|
+
them when it starts. If one isn't set, it refuses to start and names the
|
|
77
|
+
variable:
|
|
62
78
|
|
|
63
79
|
```bash
|
|
64
|
-
export LINEAR_WEBHOOK_SECRET
|
|
80
|
+
export LINEAR_WEBHOOK_SECRET=your_linear_webhook_secret LINEAR_API_KEY=your_linear_api_key
|
|
65
81
|
export MUSTER_SANDBOX_URL=https://board.example.com/api/board
|
|
66
|
-
export VERCEL_TOKEN
|
|
82
|
+
export VERCEL_TOKEN=your_vercel_token VERCEL_TEAM_ID=your_vercel_team_id VERCEL_PROJECT_ID=your_vercel_project_id
|
|
67
83
|
export GITHUB_APP_ID=123456 GITHUB_APP_KEY_FILE=~/.config/muster/app.pem
|
|
68
|
-
export ANTHROPIC_API_KEY=
|
|
84
|
+
export ANTHROPIC_API_KEY=your_anthropic_api_key
|
|
69
85
|
mu serve --module "$PWD/templates/queue/board.ts" --allow-host board.example.com
|
|
70
86
|
```
|
|
71
87
|
|
|
72
|
-
Use `MUSTER_SANDBOX_URL`, not `MUSTER_URL`. The watchers' scripts run `mu`
|
|
73
|
-
the board's file
|
|
74
|
-
instead, with no token, and be refused.
|
|
75
|
-
|
|
76
|
-
|
|
88
|
+
Use `MUSTER_SANDBOX_URL`, not `MUSTER_URL`. The watchers' scripts run `mu`
|
|
89
|
+
against the board's file on this machine; with `MUSTER_URL` set they would go
|
|
90
|
+
to the server instead, with no token, and be refused.
|
|
91
|
+
|
|
92
|
+
### Point Linear's webhook at the board
|
|
93
|
+
|
|
94
|
+
Point Linear's webhook at `https://board.example.com/api/board/webhooks/lin`,
|
|
95
|
+
as [Linear](../02-sync/03-linear.md) says.
|
|
96
|
+
|
|
97
|
+
### Cap the cost and check the workflow
|
|
98
|
+
|
|
99
|
+
Cap what the cards may cost at $10, and check that the `card` workflow is
|
|
100
|
+
listed:
|
|
77
101
|
|
|
78
102
|
```bash
|
|
79
103
|
mu budget cards 10
|
|
80
104
|
mu workflow list
|
|
81
105
|
```
|
|
82
106
|
|
|
83
|
-
##
|
|
84
|
-
|
|
85
|
-
1. An issue in the team gets the label `agent`, when it is made or later. It
|
|
86
|
-
arrives as a thread in `cards` with `tag.agent=agent`.
|
|
87
|
-
2. Within a few seconds the watcher `card-start` runs `start.sh` with the
|
|
88
|
-
thread's ID, as the profile `intake`. The script sets `started=yes` on the
|
|
89
|
-
card only if it still has `tag.agent=agent` and has no `started`, in one
|
|
90
|
-
write, and then asks for the `card` workflow on it. Any later wake, from a
|
|
91
|
-
comment or the run's own reply, finds `started` set and does nothing.
|
|
92
|
-
3. `mu serve` makes three tasks in `cards/card-<n>`: `spec`, `work`, which
|
|
93
|
-
needs the spec, and `review`, which needs the work. The spec task quotes
|
|
94
|
-
the card's text as content, not instructions; the work and review tasks
|
|
95
|
-
quote the spec's result the same way, and the review the work's summary,
|
|
96
|
-
filled in when the worker takes each. One worker takes them in turn, each
|
|
97
|
-
in its own Vercel sandbox; only the work task's change is pushed to
|
|
98
|
-
`mu/task-<id>` and opened as a pull request.
|
|
99
|
-
4. The card gets two replies, which go to Linear as comments: `started card:
|
|
100
|
-
3 tasks in cards/card-<n>`, and once the tasks have ended, a summary with
|
|
101
|
-
each task's result and the pull request. On the board the first reply also
|
|
102
|
-
says where each task is, as the run goes; Linear keeps it as it was first
|
|
103
|
-
written, since edits don't go to Linear.
|
|
107
|
+
## Hand it a card
|
|
104
108
|
|
|
105
|
-
|
|
106
|
-
|
|
109
|
+
A card starts from a Linear issue or from a thread you post in `cards`.
|
|
110
|
+
|
|
111
|
+
### Label an issue `agent`
|
|
107
112
|
|
|
108
|
-
|
|
113
|
+
Give an issue in the team the label `agent`, when you make it or later. Sync
|
|
114
|
+
brings it in as a thread in `cards` with `tag.agent=agent`, and the card
|
|
115
|
+
starts.
|
|
116
|
+
|
|
117
|
+
### Or post a card yourself
|
|
109
118
|
|
|
110
119
|
A card needs no issue. Post it with the label, and with `--no-sync`, so it
|
|
111
120
|
doesn't open an issue in Linear: that issue would have no `agent` label, and
|
|
@@ -123,13 +132,49 @@ with `label_conflict`, which is how the script knows the card has started:
|
|
|
123
132
|
mu label 1 started=yes --if tag.agent=agent --if-unset started --as intake
|
|
124
133
|
```
|
|
125
134
|
|
|
126
|
-
##
|
|
135
|
+
## What you see
|
|
136
|
+
|
|
137
|
+
Each card goes through these steps:
|
|
138
|
+
|
|
139
|
+
1. Within a few seconds the watcher `card-start` runs `start.sh` with the
|
|
140
|
+
thread's ID, as the [profile](../01-concepts/06-actors.md) `intake`. The
|
|
141
|
+
script sets `started=yes` on the card only if it still has
|
|
142
|
+
`tag.agent=agent` and has no `started`, in one write. Then it asks for the
|
|
143
|
+
`card` workflow on it. Any later wake, from a comment or the run's own
|
|
144
|
+
reply, finds `started` set and does nothing.
|
|
145
|
+
2. `mu serve` makes three tasks in `cards/card-<n>`: `spec`, `work`, which
|
|
146
|
+
needs the spec, and `review`, which needs the work. Each task quotes the
|
|
147
|
+
text it builds on as content, not instructions (see
|
|
148
|
+
[What a card can reach](#what-a-card-can-reach)). One worker takes the
|
|
149
|
+
tasks in turn, each in its own Vercel sandbox. The worker pushes only the
|
|
150
|
+
work task's change, to `mu/task-<id>`, and opens a pull request for it.
|
|
151
|
+
3. The card gets two replies, which go to Linear as comments: `started card:
|
|
152
|
+
3 tasks in cards/card-<n>`, and once the tasks have ended, a summary with
|
|
153
|
+
each task's result and the pull request. On the board the first reply also
|
|
154
|
+
says where each task is, as the run goes. Linear keeps it as it was first
|
|
155
|
+
written, since edits don't go to Linear.
|
|
156
|
+
|
|
157
|
+
Sync doesn't send the run's tasks to Linear: only `cards` is mapped, and
|
|
158
|
+
`cards/card-<n>` is another channel.
|
|
159
|
+
|
|
160
|
+
## Answer when it needs you
|
|
127
161
|
|
|
128
162
|
A worker that can't go on without a decision blocks its task with one line on
|
|
129
163
|
where things stand, then `->`, the decision it needs and what it recommends.
|
|
164
|
+
|
|
165
|
+
### Get the notification
|
|
166
|
+
|
|
130
167
|
The watcher `needs-me` runs `notify.sh` with the task's ID: a macOS
|
|
131
168
|
notification, or, with `NOTIFY_CMD` in `mu serve`'s environment, your own
|
|
132
|
-
command, given one line. Neither
|
|
169
|
+
command, given one line. Neither receives any of the task's text.
|
|
170
|
+
|
|
171
|
+
### Read the task and answer it
|
|
172
|
+
|
|
173
|
+
Run `answer.sh` as yourself, with no `--as` and no `MUSTER_PROFILE`:
|
|
174
|
+
`mu serve` makes the run's tasks as the profile `workflows`, and only the
|
|
175
|
+
board's owner with no profile may unblock them. Run it where `mu serve` runs,
|
|
176
|
+
with the same `MUSTER_SANDBOX_URL`, Vercel, GitHub App and model settings in
|
|
177
|
+
your shell:
|
|
133
178
|
|
|
134
179
|
```bash
|
|
135
180
|
mu read 14
|
|
@@ -138,115 +183,159 @@ mu read 14
|
|
|
138
183
|
|
|
139
184
|
`answer.sh` unblocks the task, then posts your answer on it. The unblock is
|
|
140
185
|
the gate: of two answers to one task, only the one whose unblock changed it
|
|
141
|
-
goes on, and an answer the board refuses posts nothing.
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
186
|
+
goes on, and an answer the board refuses posts nothing.
|
|
187
|
+
|
|
188
|
+
Then `answer.sh` starts a worker, since the run's own worker stops after 10
|
|
189
|
+
idle minutes. That worker takes the run's ready tasks one after another, the
|
|
190
|
+
answered one first. It is limited to that run's tasks, as the workers
|
|
191
|
+
`mu serve` starts are, with the same runner, agent, repository and `--push`
|
|
192
|
+
as `workflows.json`. `answer.sh` starts none while a worker of the run is
|
|
146
193
|
still going on this machine; that one takes the task.
|
|
147
194
|
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
Vercel, GitHub App and model settings in your shell: it starts the worker
|
|
152
|
-
itself, and stays until the worker ends, since a `--push` run's change is
|
|
153
|
-
pushed from here. If the worker ends badly, the script prints the `mu run`
|
|
154
|
-
line that runs what is left.
|
|
195
|
+
`answer.sh` stays until its worker ends, since that worker pushes the work
|
|
196
|
+
step's change from this machine, as the run's own worker does. If the worker
|
|
197
|
+
ends badly, the script prints the `mu run` line that runs what is left.
|
|
155
198
|
|
|
156
|
-
## When not to
|
|
199
|
+
## When not to use a card queue
|
|
200
|
+
|
|
201
|
+
These cases need something else:
|
|
157
202
|
|
|
158
203
|
- For a project you plan and iterate on in Linear, with rounds on the same
|
|
159
204
|
pull request: [Building from Linear](./22-building-from-linear.md).
|
|
160
205
|
- For work that needs a back-and-forth: the steps are fixed, spec, work and
|
|
161
206
|
review, and the review only comments. Nothing is sent back for a second
|
|
162
207
|
round.
|
|
163
|
-
- For a card whose text you wouldn't hand a stranger's agent: see
|
|
208
|
+
- For a card whose text you wouldn't hand a stranger's agent: see
|
|
209
|
+
[What a card can reach](#what-a-card-can-reach).
|
|
164
210
|
- For a board other people's agents reach with tokens: the watchers run on
|
|
165
211
|
the board's own machine, as its owner.
|
|
166
212
|
|
|
167
213
|
## What a card can reach
|
|
168
214
|
|
|
169
|
-
|
|
170
|
-
|
|
215
|
+
Whoever files a card writes its text, and agents that can push act on it.
|
|
216
|
+
Know what a run reaches before you map a team.
|
|
217
|
+
|
|
218
|
+
### What a run reaches
|
|
219
|
+
|
|
220
|
+
What a run reaches, and what it can't:
|
|
171
221
|
|
|
172
|
-
- **Who starts one
|
|
173
|
-
post or label a thread in `cards`, starts a run.
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
- **The repository
|
|
177
|
-
`mu/task-<id>` in the workflow's repository
|
|
222
|
+
- **Who starts one:** anyone who can label an issue in the mapped team, or
|
|
223
|
+
post or label a thread in `cards`, starts a run. `intake`, the watcher's
|
|
224
|
+
profile, asks for the run, so the workflow's `who` doesn't check the card's
|
|
225
|
+
author.
|
|
226
|
+
- **The repository:** the worker reads the work step's change out of its
|
|
227
|
+
sandbox, then pushes it to `mu/task-<id>` in the workflow's repository and
|
|
228
|
+
opens a pull request, from its own machine. The sandbox never holds the
|
|
229
|
+
GitHub token. The spec
|
|
178
230
|
and review steps set `push: false`, so whatever their agents change is
|
|
179
231
|
never pushed. The worker reads that from what `mu serve` made each task
|
|
180
232
|
with, never from its labels now, so an agent that relabels a task changes
|
|
181
233
|
nothing.
|
|
182
|
-
- **CI
|
|
183
|
-
secrets CI gives a branch of the same
|
|
184
|
-
pull-request jobs, or require approval
|
|
185
|
-
|
|
234
|
+
- **CI:** that pull request runs your continuous integration (CI) on the
|
|
235
|
+
agent's code, with whatever secrets CI gives a branch of the same
|
|
236
|
+
repository. Keep secrets away from pull-request jobs, or require approval
|
|
237
|
+
before they run.
|
|
238
|
+
- **Linear:** the run's summary quotes each task's result, which an agent
|
|
186
239
|
wrote from the card, as a comment on the issue, where its author reads it.
|
|
187
|
-
- **What it can't reach
|
|
240
|
+
- **What it can't reach:** the sandbox holds no board credential of yours, no
|
|
188
241
|
GitHub token and no model key; its token reaches the run's channel only.
|
|
189
242
|
|
|
243
|
+
### How each step quotes the one before
|
|
244
|
+
|
|
190
245
|
The spec task quotes the card as content, defused. The spec's result was
|
|
191
|
-
written by an agent that read the card
|
|
246
|
+
written by an agent that read the card. So the work and review tasks quote it
|
|
192
247
|
the same way, with `{steps.spec.result}`: under a line that says whose it is,
|
|
193
248
|
in a fence nothing in it can close, with `@`, `<`, `>` and Markdown links
|
|
194
|
-
defused. The review quotes the work's summary too.
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
249
|
+
defused. The review quotes the work's summary too. The worker fills each
|
|
250
|
+
quote in when it takes the task.
|
|
251
|
+
|
|
252
|
+
A task quotes a step's result only when the run's own worker completed that
|
|
253
|
+
step. An agent that claimed and completed another step itself, with its
|
|
254
|
+
sandbox's token, gets a `no result` note in the next task instead. A task
|
|
255
|
+
quotes a result once, when it is first taken: a task reopened after a step
|
|
256
|
+
it quotes was done again keeps the old quote.
|
|
257
|
+
|
|
258
|
+
### What still reaches a step unfenced
|
|
259
|
+
|
|
260
|
+
A fence marks what is content; it can't stop an agent from following
|
|
261
|
+
instructions in it anyway. Three things still reach a later step unfenced:
|
|
262
|
+
|
|
263
|
+
- the work's diff, which the review downloads and reads
|
|
264
|
+
- anything an agent chooses to read itself with `mu read`
|
|
265
|
+
- a later task's own text, which an earlier step's agent may edit, since its
|
|
266
|
+
token may post in the run's channel
|
|
267
|
+
|
|
268
|
+
When an agent edits a later task, the board
|
|
269
|
+
[holds](../01-concepts/08-tasks.md#who-may-change-a-task) that task as
|
|
270
|
+
`edited`, and `needs-me` pings you. `answer.sh` won't answer it: read what
|
|
271
|
+
changed, and unblock it yourself only if it is safe. Even then its worker
|
|
272
|
+
doesn't fill results into text it didn't write, and holds it again as
|
|
273
|
+
`workflow.edited`.
|
|
208
274
|
|
|
209
275
|
## What goes wrong
|
|
210
276
|
|
|
277
|
+
The failures you may hit, grouped by when they happen.
|
|
278
|
+
|
|
279
|
+
### A card doesn't start
|
|
280
|
+
|
|
281
|
+
These stop a card before its run begins:
|
|
282
|
+
|
|
211
283
|
- **The request fails.** `start.sh` leaves `started` set, so a request that
|
|
212
284
|
went through before the error doesn't start a second run, and replies on
|
|
213
285
|
the card, on the board only, with the retry: `mu label <id> --unset started`.
|
|
214
286
|
If `mu serve` refuses the request, it says why on the card itself.
|
|
215
|
-
- **
|
|
216
|
-
run started, it goes on: cancel its tasks with `mu tasks cancel`.
|
|
287
|
+
- **Someone takes the label off.** Before the watcher looked, nothing starts.
|
|
288
|
+
After a run started, it goes on: cancel its tasks with `mu tasks cancel`.
|
|
217
289
|
- **A script keeps failing.** The watcher tries the same event again, with a
|
|
218
|
-
growing wait, and after
|
|
290
|
+
growing wait, and after 5 tries says so on the card or task, once.
|
|
291
|
+
- **A label write's answer is lost.** Over HTTP, `start.sh`'s label is keyed
|
|
292
|
+
by the event that woke it, so the watcher's retry gets the same answer and
|
|
293
|
+
the card still starts. If new activity arrives on the card before that
|
|
294
|
+
retry, the retry has another key and finds `started` set: start it with
|
|
295
|
+
`mu label <id> --unset started`.
|
|
296
|
+
|
|
297
|
+
### Linear and the board disagree
|
|
298
|
+
|
|
299
|
+
These come from what sync brings in:
|
|
300
|
+
|
|
219
301
|
- **The board was down.** With `LINEAR_API_KEY` set, `mu serve` catches up
|
|
220
|
-
when it starts again
|
|
221
|
-
|
|
222
|
-
starts the card, whatever state the issue is in, closed
|
|
223
|
-
budget on `cards` is the cap. Without a key there is no
|
|
224
|
-
made while the board was down never arrives, and a label
|
|
225
|
-
to a card
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
the
|
|
302
|
+
when it starts again. An issue made meanwhile arrives with its labels. An
|
|
303
|
+
`agent` label added meanwhile to a card the board already has is brought
|
|
304
|
+
in. Either one starts the card, whatever state the issue is in, closed
|
|
305
|
+
included: the budget on `cards` is the cap. Without a key there is no
|
|
306
|
+
catch-up. An issue made while the board was down never arrives, and a label
|
|
307
|
+
added meanwhile to a card the board has arrives with the issue's next
|
|
308
|
+
update.
|
|
309
|
+
- **An issue was made before sync was set up.** Labelling it `agent` starts
|
|
310
|
+
the card: Linear's update includes the whole issue, so its thread starts
|
|
311
|
+
with the title, description and labels, as a new issue's would. If someone
|
|
229
312
|
commented on it first, after sync was set up, the thread started from that
|
|
230
|
-
comment, which
|
|
313
|
+
comment, which includes only the title: the card then runs on the title
|
|
231
314
|
alone. See [Linear](../02-sync/03-linear.md#an-issue-from-before-sync).
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
315
|
+
|
|
316
|
+
### A step goes wrong
|
|
317
|
+
|
|
318
|
+
These happen inside a run:
|
|
319
|
+
|
|
320
|
+
- **A card is long.** The spec task quotes the first 2,000 characters.
|
|
321
|
+
- **A step completes with no result.** The next task says so where the result
|
|
322
|
+
would be: `(No result from step "spec", #12: it completed without one.)`.
|
|
323
|
+
- **The worker can't fill a task.** If the quoted results make its text
|
|
236
324
|
longer than the board takes, the worker fails the task with `couldn't
|
|
237
325
|
quote the earlier steps' results into it`, and runs no agent on it.
|
|
238
|
-
- **Files on a card
|
|
326
|
+
- **Files on a card don't reach the sandbox.** The worker's token reaches
|
|
239
327
|
the run's channel only.
|
|
240
328
|
- **The review sees no checkout of the change.** Its sandbox clones the
|
|
241
329
|
default branch, and the pushed branch isn't there. The work step attaches
|
|
242
330
|
its diff to a reply on its task, and the review reads that; if the work
|
|
243
331
|
step didn't, the review says so and reviews nothing.
|
|
244
|
-
- **
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
332
|
+
- **The agent reaches a usage limit.** The worker stops and the task fails;
|
|
333
|
+
the summary says so.
|
|
334
|
+
|
|
335
|
+
### Setup and answers
|
|
336
|
+
|
|
337
|
+
These come from how you run `mu serve` or `answer.sh`:
|
|
338
|
+
|
|
250
339
|
- **`answer.sh` says `isn't yours to change`.** It ran with a profile: unset
|
|
251
340
|
`MUSTER_PROFILE`.
|
|
252
341
|
- **`mu serve` refuses to start with `config_retired`.** `~/.config/muster/`
|
|
@@ -255,7 +344,7 @@ was done again keeps the old quote.
|
|
|
255
344
|
into a board module and delete them
|
|
256
345
|
([Porting](../04-reference/07-porting.md)).
|
|
257
346
|
|
|
258
|
-
##
|
|
347
|
+
## What has been tested
|
|
259
348
|
|
|
260
349
|
Experimental: not yet run end to end against Linear, Vercel and GitHub
|
|
261
350
|
together.
|