@openmuster/muster 0.3.1-alpha.4 → 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 +10 -6
- package/dist/{args-9ZZDcPxa.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 +49 -26
- package/dist/{main-Doit2DDY.js → main-BeEB08iI.js} +158 -8
- package/dist/main-CLzQkYeG.js +6 -0
- package/dist/mcp-CAAZRJgv.js +6 -0
- package/dist/{module-DjDMSEKu.js → module-BX2IjSiv.js} +2 -2
- package/dist/{module-D8qcE3e7.js → module-D9KdbEpS.js} +1 -1
- package/dist/skills/board/SKILL.md +5 -0
- package/dist/{steps-BUPRIOe3.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 -45
- 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 +73 -42
- 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 +7 -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 +1 -0
- package/package.json +1 -1
- package/dist/main-D5aX7Jaj.js +0 -6
- package/dist/mcp-Cm96TIb3.js +0 -6
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: Running the feedback loop
|
|
3
|
-
description: For running the feedback loop once it is set up.
|
|
3
|
+
description: For running the feedback loop once it is set up. You go live, choose who is trusted, plan and approve cards, answer blocked tasks, start another round on a card, and fix one that stops.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
## Who this is for
|
|
7
7
|
|
|
8
8
|
You set up [a feedback loop](./20-a-feedback-loop.md) and now run it: cards
|
|
9
|
-
come in from Slack, Linear, GitHub, Notion or your app, agents work them, and
|
|
10
|
-
step in when a card needs you. This page
|
|
11
|
-
it comes up.
|
|
9
|
+
come in from Slack, Linear, GitHub, Notion or your app, agents work them, and
|
|
10
|
+
you step in when a card needs you. This page lists what you do then, in the
|
|
11
|
+
order it comes up.
|
|
12
12
|
|
|
13
13
|
**You need:** the loop's `board.ts` and `workflows.json` (in
|
|
14
14
|
`templates/loop`), a host the platforms and the sandboxes can reach, and the
|
|
@@ -16,72 +16,89 @@ keys the guide lists.
|
|
|
16
16
|
|
|
17
17
|
## Go live
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
19
|
+
Go live in this order:
|
|
20
|
+
|
|
21
|
+
1. **Give the board an address.** The platforms' webhooks and the sandboxes
|
|
22
|
+
reach the board over HTTPS: a named tunnel or a proxy to `mu serve`'s
|
|
23
|
+
port. Put the address in the environment as `MUSTER_SANDBOX_URL`, ending
|
|
24
|
+
in `/api/board`.
|
|
25
|
+
2. **Copy the workflows.** Put `workflows.json` in `~/.config/muster/` and
|
|
26
|
+
set `repo` in each of its 3 workflows to your repository. For several
|
|
27
|
+
repositories, write `loop-projects.json` and the projects' workflows
|
|
28
|
+
instead:
|
|
29
|
+
[Run several repositories on one board](./20-a-feedback-loop.md#run-several-repositories-on-one-board).
|
|
30
|
+
A project's `trusted`, `public` and `maxRuns` replace the settings in the
|
|
31
|
+
next steps on its cards.
|
|
32
|
+
3. **Choose who is trusted.** Set `LOOP_TRUSTED` to the actor IDs who may
|
|
33
|
+
start work without an approval and may approve: `slack:user:U0123`,
|
|
34
|
+
`lin:user:<uuid>`, an app's `<your principal>+<profile>`
|
|
35
|
+
([principals and profiles](../01-concepts/06-actors.md#principals-and-profiles)).
|
|
36
|
+
You, with no profile, are always trusted. A GitHub author never is.
|
|
37
|
+
4. **Choose where you hear.** Set `NOTIFY_CMD` to a command that takes one
|
|
38
|
+
line: a push to your phone, a message to yourself. Without it the loop
|
|
39
|
+
tells you nothing, and you read the board.
|
|
40
|
+
5. **Set a budget.** Cap what the cards may cost, every run under them
|
|
41
|
+
included:
|
|
33
42
|
|
|
34
43
|
```bash
|
|
35
44
|
mu budget cards 25
|
|
36
45
|
```
|
|
37
46
|
|
|
38
|
-
6. **Start it
|
|
47
|
+
6. **Start the board.** Give it the secrets `board.ts` names in its
|
|
48
|
+
environment:
|
|
39
49
|
|
|
40
50
|
```bash
|
|
41
51
|
mu serve --module "$PWD/templates/loop/board.ts" --allow-host board.example.com
|
|
42
52
|
```
|
|
43
53
|
|
|
44
|
-
7. **Point each platform at
|
|
45
|
-
where `<key>` is the sync's
|
|
46
|
-
`nt`. Each platform's page says
|
|
47
|
-
token needs:
|
|
48
|
-
[
|
|
49
|
-
[Notion](../02-sync/05-notion.md).
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
54
|
+
7. **Point each platform at the board.** Use
|
|
55
|
+
`https://<host>/api/board/webhooks/<key>`, where `<key>` is the sync's
|
|
56
|
+
name in `board.ts`: `slack`, `lin`, `gh`, `nt`. Each platform's page says
|
|
57
|
+
what to subscribe to and which scopes its token needs:
|
|
58
|
+
[Slack](../02-sync/04-slack.md), [Linear](../02-sync/03-linear.md),
|
|
59
|
+
[GitHub](../02-sync/02-github.md), [Notion](../02-sync/05-notion.md).
|
|
60
|
+
Notion's webhook needs a one-time verification first: start with
|
|
61
|
+
`NOTION_WEBHOOK_SECRET=pending`, and follow its page.
|
|
62
|
+
8. **Give the loop its own app on each platform.** Once a platform has one,
|
|
63
|
+
the loop posts there through that app, not as you:
|
|
53
64
|
|
|
54
65
|
| Platform | What to set up | In the environment |
|
|
55
66
|
| --- | --- | --- |
|
|
56
67
|
| GitHub | The GitHub App your workers push with, with read and write on Issues added and accepted on the organization | `GITHUB_APP_ID`, `GITHUB_APP_KEY_FILE` |
|
|
57
|
-
| Linear | An OAuth application with client credentials tokens turned on
|
|
68
|
+
| Linear | An OAuth application with client credentials tokens turned on, made for the board | `LINEAR_CLIENT_ID`, `LINEAR_CLIENT_SECRET`, and `LINEAR_APP_WEBHOOK_SECRET` with `agent: true` to show the issue being worked on |
|
|
58
69
|
| Slack | The bot you already have. To show "is working" under a thread while a card is worked on, turn on the app's agent feature, reinstall it, and add `agent: true` to `slack()` in `board.ts`. Slack doesn't let an app stop being an agent | `SLACK_BOT_TOKEN`, `SLACK_SIGNING_SECRET` |
|
|
59
70
|
| Notion | The integration's own token: it already writes as the integration | `NOTION_TOKEN`, `NOTION_WEBHOOK_SECRET` |
|
|
60
71
|
|
|
72
|
+
Use a Linear application made for the board: its client credentials token
|
|
73
|
+
replaces an installation of the same application made through the
|
|
74
|
+
authorization page.
|
|
75
|
+
|
|
61
76
|
Each sync page says more: [GitHub](../02-sync/02-github.md#who-the-comments-are-by),
|
|
62
77
|
[Linear](../02-sync/03-linear.md#who-the-comments-are-by),
|
|
63
78
|
[Slack](../02-sync/04-slack.md#show-a-thread-being-worked-on). To check,
|
|
64
79
|
reply on a card from each source and look at who wrote the comment there.
|
|
65
80
|
A reply by someone in `LOOP_TRUSTED` on a card held `working` starts
|
|
66
81
|
another round, so check on a card that isn't being worked on.
|
|
67
|
-
9. **
|
|
68
|
-
keep it on the app's server:
|
|
82
|
+
9. **Give your app's button a token.** Make it one that can only post
|
|
83
|
+
reports, and keep it on the app's server:
|
|
69
84
|
|
|
70
85
|
```bash
|
|
71
86
|
mu token create --as pino-app --can 'cards/app=post' --ttl 90d
|
|
72
87
|
```
|
|
73
88
|
|
|
74
|
-
Then file one report from each source and
|
|
75
|
-
`triage`, a spec on the card,
|
|
89
|
+
Then file one report from each source and follow it through:
|
|
90
|
+
[held](../01-concepts/08-tasks.md#states) `triage`, a spec on the card,
|
|
91
|
+
`working`, a pull request.
|
|
76
92
|
|
|
77
93
|
## What a card shows while it works
|
|
78
94
|
|
|
79
95
|
Each run on a card, triage and then the work, starts with one reply from
|
|
80
|
-
`mu serve`: `started card: 3 tasks in cards/slack/card-57`.
|
|
81
|
-
as the run goes, to say where each task is (`#58 completed, #59
|
|
82
|
-
waiting`)
|
|
83
|
-
changes. When the run ends, its summary is a new reply, with
|
|
84
|
-
result and the pull request, so everyone following the thread is
|
|
96
|
+
`mu serve`: `started card: 3 tasks in cards/slack/card-57`. `mu serve` edits
|
|
97
|
+
that reply as the run goes, to say where each task is (`#58 completed, #59
|
|
98
|
+
claimed, #60 waiting`). So the thread on Slack, GitHub or Notion shows one
|
|
99
|
+
comment that changes. When the run ends, its summary is a new reply, with
|
|
100
|
+
each task's result and the pull request, so everyone following the thread is
|
|
101
|
+
told.
|
|
85
102
|
|
|
86
103
|
On Slack, with `agent: true`, that reply isn't posted: the thread shows
|
|
87
104
|
"<app> is working" under it while a run is open, and the summary when it
|
|
@@ -92,6 +109,8 @@ don't go to Linear.
|
|
|
92
109
|
|
|
93
110
|
## What you hear about
|
|
94
111
|
|
|
112
|
+
Each line `NOTIFY_CMD` gets, and what to do about it:
|
|
113
|
+
|
|
95
114
|
| The line | What to do |
|
|
96
115
|
| --- | --- |
|
|
97
116
|
| `card #12 needs your approval` | Read the spec on the card, then approve it or leave it |
|
|
@@ -104,9 +123,10 @@ don't go to Linear.
|
|
|
104
123
|
## Start and park cards
|
|
105
124
|
|
|
106
125
|
A card from Notion or Linear follows its status: move the page to Ready or
|
|
107
|
-
the issue to Todo to start it, and to Not started or Backlog to
|
|
108
|
-
|
|
109
|
-
|
|
126
|
+
the issue to Todo to start it, and to Not started or Backlog to
|
|
127
|
+
[park](../01-concepts/08-tasks.md#parking-work-for-later) it. The loop sets
|
|
128
|
+
In progress and Done itself. A card from anywhere else is ready when it
|
|
129
|
+
comes in; park or start it with a label:
|
|
110
130
|
|
|
111
131
|
```bash
|
|
112
132
|
mu label 12 stage=backlog
|
|
@@ -131,9 +151,9 @@ mu read 12
|
|
|
131
151
|
mu label 12 approved=yes
|
|
132
152
|
```
|
|
133
153
|
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
154
|
+
A label set in the [inspector](./04-inspector.md) does the same. A label from
|
|
155
|
+
anyone not trusted does nothing. If the report changes after the spec was
|
|
156
|
+
written, the loop triages it again, and you approve the new spec.
|
|
137
157
|
|
|
138
158
|
## Answer a blocked task
|
|
139
159
|
|
|
@@ -151,22 +171,24 @@ mu tasks unblock 31
|
|
|
151
171
|
A worker takes it again: the run's own, if it is still waiting for work, or
|
|
152
172
|
one the loop starts for that run.
|
|
153
173
|
|
|
154
|
-
##
|
|
174
|
+
## Start another round from a reply
|
|
155
175
|
|
|
156
|
-
Once a card's run has ended, a reply on the card by someone trusted
|
|
157
|
-
work and its review
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
176
|
+
Once a card's run has ended, a reply on the card by someone trusted reopens
|
|
177
|
+
the work and its review with that reply. The work continues from its branch:
|
|
178
|
+
the same pull request gets another commit. Reply where the card is: in the
|
|
179
|
+
Slack thread, on the Linear issue, on the GitHub issue, on the Notion page,
|
|
180
|
+
or on the board. How rounds work:
|
|
161
181
|
|
|
162
|
-
- **One round at a time.** A reply made while a round runs waits for it
|
|
163
|
-
end, and goes into the next.
|
|
164
|
-
- **Several replies
|
|
165
|
-
- **A review comment on the pull request
|
|
166
|
-
card.
|
|
182
|
+
- **One round runs at a time.** A reply made while a round runs waits for it
|
|
183
|
+
to end, and goes into the next.
|
|
184
|
+
- **Several replies made between rounds go into one round together.**
|
|
185
|
+
- **A review comment on the pull request doesn't start a round.** Reply on
|
|
186
|
+
the card.
|
|
167
187
|
|
|
168
188
|
## When something stops
|
|
169
189
|
|
|
190
|
+
Symptoms, causes and fixes:
|
|
191
|
+
|
|
170
192
|
| What you see | Why | What to do |
|
|
171
193
|
| --- | --- | --- |
|
|
172
194
|
| A card held `declined` | The triage agent found nothing to change in this repository, or stopped; its summary on the card says which | Edit the report to say more, or move it to ready again (`mu label 12 stage=ready`, or the page's Status): it is triaged again. Or cancel it: `mu tasks cancel 12` |
|
|
@@ -180,24 +202,32 @@ page, or on the board.
|
|
|
180
202
|
| A card held `done` | The review approved it, but the card couldn't be completed (its budget is spent, say) | Nothing: a trusted reply starts another round as usual |
|
|
181
203
|
| No card for a report | The source isn't reaching the board | `mu daemon status` names the module's sync; check the platform's webhook deliveries |
|
|
182
204
|
|
|
183
|
-
## Rotate
|
|
205
|
+
## Rotate a token or stop the loop
|
|
184
206
|
|
|
185
207
|
Replace an app's token by making a new one, giving it to the app, and
|
|
186
|
-
revoking the old:
|
|
208
|
+
revoking the old one by its ID:
|
|
187
209
|
|
|
188
210
|
```bash
|
|
189
211
|
mu token list
|
|
190
212
|
mu token revoke Xk3v9QmB2a1c
|
|
191
213
|
```
|
|
192
214
|
|
|
215
|
+
`mu token list` shows each token's ID; `Xk3v9QmB2a1c` is an example.
|
|
216
|
+
|
|
193
217
|
To stop the loop, stop `mu serve`. What the platforms send while it is down
|
|
194
218
|
doesn't reach it. When it starts again the board catches up, within each
|
|
195
|
-
platform's limits
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
219
|
+
platform's limits:
|
|
220
|
+
|
|
221
|
+
- GitHub and Linear catch up only with a token or an app.
|
|
222
|
+
- Slack can miss a reply in an older thread.
|
|
223
|
+
- Notion misses a comment on a page that didn't otherwise change.
|
|
224
|
+
- On GitHub, Linear and Slack, edits and deletes made meanwhile are not read.
|
|
225
|
+
|
|
226
|
+
Each platform's page says what its catch-up misses:
|
|
227
|
+
[GitHub](../02-sync/02-github.md#catching-up),
|
|
200
228
|
[Linear](../02-sync/03-linear.md#catching-up),
|
|
201
229
|
[Slack](../02-sync/04-slack.md#after-downtime),
|
|
202
|
-
[Notion](../02-sync/05-notion.md#catching-up).
|
|
203
|
-
|
|
230
|
+
[Notion](../02-sync/05-notion.md#catching-up).
|
|
231
|
+
|
|
232
|
+
To take a source out, remove its sync from `board.ts` and its webhook from
|
|
233
|
+
the platform.
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
---
|
|
2
2
|
title: Building from Linear
|
|
3
|
-
description: For a team or a solo builder who plans in Linear and wants coding agents to build it.
|
|
3
|
+
description: For a team or a solo builder who plans in Linear and wants coding agents to build it. You keep the spec in the repository, move an issue to Todo, and get a pull request back on it, with screenshots, and another round from any comment.
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
## Who this is for
|
|
7
7
|
|
|
8
8
|
You plan in Linear: a project with goals, milestones and issues. You want
|
|
9
|
-
agents to build it while you do something else
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
agents to build it while you do something else. You want to steer them from
|
|
10
|
+
Linear, on your desktop or the Linear app on your phone, with GitHub holding
|
|
11
|
+
the change.
|
|
12
12
|
|
|
13
13
|
This guide is the Linear side of the [feedback loop](./20-a-feedback-loop.md)
|
|
14
14
|
template. That guide and [Running the feedback loop](./21-running-the-loop.md)
|
|
@@ -47,6 +47,8 @@ flowchart LR
|
|
|
47
47
|
|
|
48
48
|
## What you need
|
|
49
49
|
|
|
50
|
+
Set these up first:
|
|
51
|
+
|
|
50
52
|
- A board that Linear's webhooks can reach: [A board on a server](./18-a-board-on-a-server.md).
|
|
51
53
|
- The loop template set up from a clone of the repository:
|
|
52
54
|
[A feedback loop](./20-a-feedback-loop.md#set-it-up), then
|
|
@@ -56,7 +58,8 @@ flowchart LR
|
|
|
56
58
|
[Linear sync](../02-sync/03-linear.md#who-the-comments-are-by).
|
|
57
59
|
- A GitHub App that can push to the repository, and a cloud runner for the
|
|
58
60
|
agents: [Agents in cloud sandboxes](./06-sandboxed-agents.md).
|
|
59
|
-
- `AGENTS.md` and a spec in the repository, written for an agent
|
|
61
|
+
- `AGENTS.md` and a spec in the repository, written for an agent:
|
|
62
|
+
[Write the spec once, in the repository](#write-the-spec-once-in-the-repository).
|
|
60
63
|
|
|
61
64
|
## Set up Linear for agents
|
|
62
65
|
|
|
@@ -78,6 +81,9 @@ export const sync = {
|
|
|
78
81
|
}
|
|
79
82
|
```
|
|
80
83
|
|
|
84
|
+
For several repositories on one board, give each its own team and project:
|
|
85
|
+
[Run several repositories on one board](./20-a-feedback-loop.md#run-several-repositories-on-one-board).
|
|
86
|
+
|
|
81
87
|
**Keep the statuses the loop reads.** A card follows its issue's status:
|
|
82
88
|
|
|
83
89
|
| Linear status | The card | Who sets it |
|
|
@@ -90,8 +96,9 @@ export const sync = {
|
|
|
90
96
|
| Canceled, Duplicate | Canceled | You |
|
|
91
97
|
|
|
92
98
|
Moving an issue to In Progress or Done yourself moves nothing: those are the
|
|
93
|
-
statuses the loop writes. A status the loop doesn't know
|
|
94
|
-
|
|
99
|
+
statuses the loop writes. A status the loop doesn't know
|
|
100
|
+
[parks](../01-concepts/08-tasks.md#parking-work-for-later) the card. If your
|
|
101
|
+
team's statuses have other names, map them with `LOOP_STAGES`
|
|
95
102
|
([Stages](./20-a-feedback-loop.md#stages)).
|
|
96
103
|
|
|
97
104
|
**Trust yourself.** An issue starts work without an approval only if its
|
|
@@ -103,13 +110,16 @@ mu read cards/linear
|
|
|
103
110
|
export LOOP_TRUSTED=lin:user:3f2a9c1e-4b7d-4e0a-9a51-7c2d8e6b1f03
|
|
104
111
|
```
|
|
105
112
|
|
|
113
|
+
Replace the ID in the example with the one you read.
|
|
114
|
+
|
|
106
115
|
Everyone else's issues wait for an approval. A GitHub author is never
|
|
107
116
|
trusted.
|
|
108
117
|
|
|
109
|
-
**Show
|
|
110
|
-
app's agent session while a run works on it
|
|
111
|
-
run's last words as
|
|
112
|
-
own webhook, with only Agent session events, and its signing
|
|
118
|
+
**Show agent progress on the issue.** With `agent: true`, the issue shows the
|
|
119
|
+
app's agent session while a run works on it. The session shows where the run
|
|
120
|
+
is, and the run's last words as its response. It needs the OAuth
|
|
121
|
+
application's own webhook, with only Agent session events, and its signing
|
|
122
|
+
secret:
|
|
113
123
|
|
|
114
124
|
```ts board.ts
|
|
115
125
|
import { env, linear } from '@openmuster/muster'
|
|
@@ -126,8 +136,8 @@ export const sync = {
|
|
|
126
136
|
}
|
|
127
137
|
```
|
|
128
138
|
|
|
129
|
-
Without
|
|
130
|
-
written, and the summary when the run ends.
|
|
139
|
+
Without `agent: true`, the issue gets the run's first progress comment as it
|
|
140
|
+
was first written, and the summary when the run ends.
|
|
131
141
|
|
|
132
142
|
## Write the spec once, in the repository
|
|
133
143
|
|
|
@@ -163,10 +173,12 @@ in React and TypeScript.
|
|
|
163
173
|
Screenshot the screens your change touches, in light and dark.
|
|
164
174
|
```
|
|
165
175
|
|
|
176
|
+
What the example has:
|
|
177
|
+
|
|
166
178
|
- **Hard rules first:** what must never happen, and what every pull request
|
|
167
179
|
must have.
|
|
168
|
-
- **
|
|
169
|
-
- **A way for the agent to see its work
|
|
180
|
+
- **Numbered goals:** each points to the section that details it.
|
|
181
|
+
- **A way for the agent to see its work:** a demo mode with sample data lets
|
|
170
182
|
an agent build, test and screenshot in a sandbox with no credentials. The
|
|
171
183
|
work agent takes the screenshots the spec asks for, and no others: a spec
|
|
172
184
|
that asks for none gets none.
|
|
@@ -175,7 +187,8 @@ Screenshot the screens your change touches, in light and dark.
|
|
|
175
187
|
|
|
176
188
|
Put a new feature in **Triage**. The loop gives it a planner: an agent that
|
|
177
189
|
reads the issue and the repository, builds nothing, and answers on the issue
|
|
178
|
-
with its questions, numbered, and a draft of the change.
|
|
190
|
+
with its questions, numbered, and a draft of the change. Work with it like
|
|
191
|
+
this:
|
|
179
192
|
|
|
180
193
|
1. Answer in a comment. Each comment by someone trusted is the planner's next
|
|
181
194
|
round, from Linear on your desktop or your phone.
|
|
@@ -192,65 +205,69 @@ it suggests as the project's issues.
|
|
|
192
205
|
|
|
193
206
|
## Write issues an agent can finish
|
|
194
207
|
|
|
208
|
+
What helps an agent finish an issue:
|
|
209
|
+
|
|
195
210
|
- **Change the issue itself until the work starts.** An edited title or
|
|
196
|
-
description reaches the board, and the
|
|
197
|
-
text. A comment made before the work starts doesn't reach the
|
|
198
|
-
Triage it goes to the planner. Once the issue is In Progress,
|
|
199
|
-
a comment: that is what starts another round.
|
|
211
|
+
description reaches the board, and the loop triages the issue again from
|
|
212
|
+
its new text. A comment made before the work starts doesn't reach the
|
|
213
|
+
triage; in Triage it goes to the planner. Once the issue is In Progress,
|
|
214
|
+
say changes in a comment: that is what starts another round.
|
|
200
215
|
- **One issue, one pull request.** A card is one branch. Split anything
|
|
201
216
|
bigger.
|
|
202
217
|
- **Say how to check it.** The triage writes the spec as a title, what to
|
|
203
218
|
change and why, and how to check it works. The closer the issue is to that,
|
|
204
|
-
the less
|
|
219
|
+
the less the triage has to guess.
|
|
205
220
|
- **Order dependent issues yourself.** Every issue in Todo gets its own run,
|
|
206
221
|
at once, each starting from the default branch. Move an issue that builds
|
|
207
222
|
on another to Todo once the other's pull request is merged. Issues that
|
|
208
223
|
touch different code can go together.
|
|
209
224
|
- **Cap the spend.** `mu budget cards 50` stops new work on cards once they
|
|
210
225
|
have cost $50 in all.
|
|
211
|
-
-
|
|
212
|
-
|
|
213
|
-
doesn't route on them.
|
|
226
|
+
- **Linear's labels and fields are for your own filters.** Labels, the
|
|
227
|
+
assignee, the priority and the project arrive as labels on the card
|
|
228
|
+
(`tag.bug=bug`, `priority=high`). The loop doesn't route on them.
|
|
214
229
|
|
|
215
230
|
## Let it build
|
|
216
231
|
|
|
217
232
|
Move the issue to Todo. On the issue you see, in order:
|
|
218
233
|
|
|
219
|
-
1. **The spec
|
|
220
|
-
nothing to change in this repository, it says why, and the
|
|
221
|
-
`declined`. Edit the issue to say
|
|
222
|
-
it to Triage and work it out
|
|
223
|
-
|
|
234
|
+
1. **The spec:** a comment written by the triage. If the triage finds
|
|
235
|
+
nothing to change in this repository, it says why, and the loop
|
|
236
|
+
[holds](../01-concepts/08-tasks.md#states) the card `declined`. Edit the issue to say
|
|
237
|
+
more, and the loop triages it again. Or move it to Triage and work it out
|
|
238
|
+
with the planner first.
|
|
239
|
+
2. **Approval:** for an issue whose author isn't trusted. The card waits
|
|
224
240
|
until someone trusted runs `mu label <card> approved=yes`, or sets the
|
|
225
|
-
label in the inspector. Read the spec, not only the
|
|
226
|
-
the work does.
|
|
227
|
-
3. **In Progress
|
|
228
|
-
`agent: true
|
|
229
|
-
4. **The summary
|
|
241
|
+
label in the [inspector](./04-inspector.md). Read the spec, not only the
|
|
242
|
+
issue: the spec is what the work does.
|
|
243
|
+
3. **In Progress:** set by the loop, with the agent session working when
|
|
244
|
+
`agent: true` is set.
|
|
245
|
+
4. **The summary:** when the run ends, each step's result and the pull
|
|
230
246
|
request's address. The work pushes `mu/task-<id>` and opens the pull
|
|
231
247
|
request, titled with the card's title.
|
|
232
|
-
5. **The screenshots
|
|
248
|
+
5. **The screenshots:** the round's, uploaded to Linear and linked from the
|
|
233
249
|
comment. Experimental: files sent through an OAuth app haven't been
|
|
234
250
|
checked against a live workspace.
|
|
235
|
-
6. **Done
|
|
251
|
+
6. **Done:** set by the loop when the review approves. Merging the pull
|
|
236
252
|
request is yours.
|
|
237
253
|
|
|
238
254
|
## Iterate from Linear
|
|
239
255
|
|
|
240
|
-
|
|
256
|
+
How to steer from Linear:
|
|
257
|
+
|
|
258
|
+
- **Comment on the issue for another round on the same pull request.** The
|
|
241
259
|
comment goes to the agent, the work and its review run again, and the
|
|
242
|
-
commit
|
|
243
|
-
for it to end. A comment on an issue that is Done reopens it, and the
|
|
244
|
-
sets In Progress again.
|
|
260
|
+
commit is pushed to the same branch. A comment made while a round runs
|
|
261
|
+
waits for it to end. A comment on an issue that is Done reopens it, and the
|
|
262
|
+
loop sets In Progress again.
|
|
245
263
|
- **Comment on the issue, not on the pull request.** A comment on the pull
|
|
246
264
|
request doesn't start a round.
|
|
247
265
|
- **Keep the decision on the issue.** "The accent should be this colour" is a
|
|
248
|
-
comment on the issue. How the agent got there
|
|
249
|
-
business.
|
|
266
|
+
comment on the issue. How the agent got there belongs in the pull request.
|
|
250
267
|
|
|
251
|
-
## What
|
|
268
|
+
## What you still do on the board
|
|
252
269
|
|
|
253
|
-
|
|
270
|
+
Where each job is done:
|
|
254
271
|
|
|
255
272
|
| To do this | Do it here |
|
|
256
273
|
| --- | --- |
|
|
@@ -266,8 +283,8 @@ its question doesn't reach Linear. Set `NOTIFY_CMD` so you hear about it:
|
|
|
266
283
|
|
|
267
284
|
## Feedback from the app you are building
|
|
268
285
|
|
|
269
|
-
|
|
270
|
-
reports, and send them from the app's server:
|
|
286
|
+
Small bugs reported from the app don't need planning. Give the app a token
|
|
287
|
+
that can only post reports, and send them from the app's server:
|
|
271
288
|
|
|
272
289
|
```bash
|
|
273
290
|
mu token create --as my-app --can 'cards/app=post' --ttl 90d
|
|
@@ -286,19 +303,24 @@ and screenshots, and the pull request. The project's issue list says what is
|
|
|
286
303
|
done, what is in progress and what is next. On the board,
|
|
287
304
|
`mu tasks cards/ --state blocked` lists what waits on you.
|
|
288
305
|
|
|
289
|
-
## When not to
|
|
306
|
+
## When not to use the loop
|
|
307
|
+
|
|
308
|
+
The loop is the wrong tool in these cases:
|
|
290
309
|
|
|
291
|
-
- **
|
|
292
|
-
branch.
|
|
293
|
-
- **
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
310
|
+
- **It doesn't fit work you can't split into pull-request-sized issues.** A
|
|
311
|
+
card is one branch.
|
|
312
|
+
- **It doesn't work with the spec only in Linear.** Agents read the
|
|
313
|
+
repository.
|
|
314
|
+
- **It doesn't fit issues from people you wouldn't hand an agent.** Approval
|
|
315
|
+
is per card: read each spec before you approve it.
|
|
316
|
+
- **A single label-triggered pass with no rounds needs less.**
|
|
297
317
|
[A card queue](./19-a-card-queue.md) is smaller: label an issue `agent` and
|
|
298
318
|
get a spec, a pull request and a review back once.
|
|
299
319
|
|
|
300
320
|
## What goes wrong
|
|
301
321
|
|
|
322
|
+
Symptoms, causes and fixes:
|
|
323
|
+
|
|
302
324
|
- **Nothing happens when an issue moves to Todo.** The webhook isn't reaching
|
|
303
325
|
the board (Linear's webhook settings list each delivery; `mu daemon status`
|
|
304
326
|
names the sync), the issue is in a team that isn't mapped, or its status
|
|
@@ -309,14 +331,16 @@ done, what is in progress and what is next. On the board,
|
|
|
309
331
|
- **A card waits for approval on your own issue.** Your Linear user ID isn't
|
|
310
332
|
in `LOOP_TRUSTED`.
|
|
311
333
|
- **The status doesn't change.** The loop writes it as the OAuth app, with
|
|
312
|
-
its sync's scopes. Linear
|
|
313
|
-
with other scopes, so a sync given its own `scopes` needs the same in
|
|
314
|
-
`SOURCES` entry ([Stages](./20-a-feedback-loop.md#stages)).
|
|
334
|
+
its sync's scopes. Linear revokes an app's earlier tokens when one is asked
|
|
335
|
+
for with other scopes, so a sync given its own `scopes` needs the same in
|
|
336
|
+
its `SOURCES` entry ([Stages](./20-a-feedback-loop.md#stages)).
|
|
315
337
|
- **Two pull requests conflict.** Two issues in Todo changed the same code.
|
|
316
338
|
Merge one, resolve the other's branch, then comment on its issue if it
|
|
317
339
|
needs another round: the round starts from the branch as you left it.
|
|
318
340
|
|
|
319
|
-
##
|
|
341
|
+
## Related guides
|
|
342
|
+
|
|
343
|
+
Where to go next:
|
|
320
344
|
|
|
321
345
|
- [A feedback loop](./20-a-feedback-loop.md): every stage, planning, related
|
|
322
346
|
and duplicate cards.
|
|
@@ -63,6 +63,8 @@ tasks
|
|
|
63
63
|
tasks needs <id> <id>... | --none
|
|
64
64
|
budget [<channel> <usd> | <channel> --none]
|
|
65
65
|
what a channel's tasks may cost in all
|
|
66
|
+
report [<channel>] [--since 30d]
|
|
67
|
+
how tasks went and cost, by agent and workflow
|
|
66
68
|
workflow list what this machine's workflows.json registers
|
|
67
69
|
workflow run <name> --on <id> [--arg k=v]...
|
|
68
70
|
ask for one to be run on a thread
|
|
@@ -75,6 +77,7 @@ agents
|
|
|
75
77
|
--agent claude|codex (or a command after --) [--cwd <dir>]
|
|
76
78
|
[--worktree <repo> --branch <name>] [--model <m>] [--timeout 30m]
|
|
77
79
|
[--env K=V]... [--bypass-permissions] [--loop] [--budget <usd>]
|
|
80
|
+
[--estimate] say what the ready tasks may cost; start none
|
|
78
81
|
An agent that worked the task before resumes its session; --fresh won't.
|
|
79
82
|
To pick one up by its ID: --resume <session>.
|
|
80
83
|
Claude Code starts lean (a shell and files); --full loads your whole setup.
|
|
@@ -83,6 +86,7 @@ agents
|
|
|
83
86
|
[--safe] keep the agent's permission prompts on there
|
|
84
87
|
[--detach] return once started, not when it ends
|
|
85
88
|
[--no-install] with --repo: don't install its dependencies
|
|
89
|
+
[--template <name>] e2b: in place of MUSTER_E2B_TEMPLATE
|
|
86
90
|
[--push] push what it changed and open a pull request
|
|
87
91
|
The agent is told where its task is, not what it says.
|
|
88
92
|
It settles the task itself; one left unsettled is failed or released.
|
|
@@ -130,6 +134,9 @@ serve
|
|
|
130
134
|
token list | token revoke <id>
|
|
131
135
|
token exchange [-] a CI job's own OIDC token for a board token:
|
|
132
136
|
on stdin with -, or in MUSTER_OIDC_TOKEN
|
|
137
|
+
token rotate-key sign new tokens with a new key; tokens the
|
|
138
|
+
old one signed still work
|
|
139
|
+
token drop-old-keys stop every token an old key signed
|
|
133
140
|
join <board url> --as <name> ask a served board for a token, and wait
|
|
134
141
|
[--note <text>] [--timeout 10m]
|
|
135
142
|
join list | join deny <code>
|
|
@@ -201,7 +201,7 @@ returns the host already running. One on another handle with other watchers
|
|
|
201
201
|
for a board this process already runs fails with `watch_started`, naming
|
|
202
202
|
both: declare every watcher on one handle.
|
|
203
203
|
|
|
204
|
-
`board({ hooks })` declares [outgoing webhooks](../01-concepts/15-outgoing-webhooks.md#
|
|
204
|
+
`board({ hooks })` declares [outgoing webhooks](../01-concepts/15-outgoing-webhooks.md#what-one-is)
|
|
205
205
|
the same way, each secret named with `env('NAME')`: `start()` reads the
|
|
206
206
|
secrets and sends them, under one lease, `hooks`.
|
|
207
207
|
|
|
@@ -279,20 +279,18 @@ writes a test makes, so the watchers have their place.
|
|
|
279
279
|
|
|
280
280
|
## Mounting it in a web app
|
|
281
281
|
|
|
282
|
-
`team.fetch` takes a web `Request` and returns a
|
|
283
|
-
serves for this board, from the same code. That
|
|
284
|
-
[the HTTP reference](./03-http.md), the live feed,
|
|
285
|
-
the handle's `sync`. Every request needs a token, and the key is the one
|
|
282
|
+
`team.fetch(request)` takes a web `Request` and returns a promise of a
|
|
283
|
+
`Response`: what `mu serve` serves for this board, from the same code. That
|
|
284
|
+
covers the routes in [the HTTP reference](./03-http.md), the live feed,
|
|
285
|
+
`health`, and webhooks for the handle's `sync`. Every request needs a token, and the key is the one
|
|
286
286
|
`mu serve` uses, so a token from `mu token create` works on both and
|
|
287
287
|
`mu token revoke` stops it on both. That key is kept in muster's config
|
|
288
288
|
folder, so the app must run with the same `HOME` or `MUSTER_CONFIG` as the
|
|
289
289
|
`mu` that made the token. There is no mode without a token.
|
|
290
290
|
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
export const GET = team.fetch, POST = team.fetch
|
|
295
|
-
```
|
|
291
|
+
To mount it on a route in a Next.js app, see
|
|
292
|
+
[Serve the board from your web app](../03-guides/07-build-a-ui.md#serve-the-board-from-your-web-app).
|
|
293
|
+
It takes its options from `board({ serve })`:
|
|
296
294
|
|
|
297
295
|
| Option | Default | What it does |
|
|
298
296
|
| --- | --- | --- |
|
|
@@ -310,11 +308,7 @@ It opens nothing until its first request. It serves only a board on this
|
|
|
310
308
|
machine: on a handle for a board at a URL, every request gets 403. MCP over
|
|
311
309
|
HTTP, `tokenExchange` and requests to join are not served here: those stay
|
|
312
310
|
with `mu serve`. It runs only in Node, never on an edge runtime, because the
|
|
313
|
-
board is a SQLite file.
|
|
314
|
-
in `next.config.ts`, so the process has one copy of muster. If the app has a
|
|
315
|
-
`proxy.ts` (or `middleware.ts`), leave the board's routes out of its
|
|
316
|
-
`matcher`: Next.js reads a body that passes through it into memory and cuts
|
|
317
|
-
it at 10 MB, under the board's limit for a file.
|
|
311
|
+
board is a SQLite file.
|
|
318
312
|
|
|
319
313
|
### Running the watchers beside it
|
|
320
314
|
|
|
@@ -396,6 +390,7 @@ serves the board without it. Both say why, loudly.
|
|
|
396
390
|
| `filePut`, `fileGet` | [Files](../01-concepts/12-files-and-data.md): data as base64 |
|
|
397
391
|
| `schemaAdd`, `schemaList` | Typed blocks |
|
|
398
392
|
| `budgetSet`, `budgets` | [Budgets](../01-concepts/13-budgets.md) |
|
|
393
|
+
| `taskReport` | [How work went](../01-concepts/13-budgets.md#see-how-work-went): `{ channel?, since }`, `since` an ISO time |
|
|
399
394
|
|
|
400
395
|
## Other exports
|
|
401
396
|
|
|
@@ -35,7 +35,7 @@ The routes are the handle's methods: `post`, `reply`, `edit`, `remove`,
|
|
|
35
35
|
`label`, `react`, `createChannel`, `workflowRequest`, `readChannel`, `readThread`, `events`,
|
|
36
36
|
`channels`, `search`, `actors`, `head`, `cursorGet`, `cursorSet`, the `task*`
|
|
37
37
|
methods, the `schedule*` methods, `schemaAdd`, `schemaList`, `filePut`,
|
|
38
|
-
`fileGet`, `budgetSet`, `budgets`. See [The handle](./02-handle.md) for what
|
|
38
|
+
`fileGet`, `budgetSet`, `budgets`, `taskReport`. See [The handle](./02-handle.md) for what
|
|
39
39
|
each takes.
|
|
40
40
|
|
|
41
41
|
`GET /api/board/whoami` says who the token is: `{ principal, profile, can }`.
|