@openmuster/muster 0.3.1-alpha.4 → 0.3.1-alpha.6

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.
Files changed (58) hide show
  1. package/README.md +11 -7
  2. package/dist/{args-9ZZDcPxa.js → args-CaFBa2IP.js} +305 -23
  3. package/dist/cli.js +3 -3
  4. package/dist/index.d.ts +98 -19
  5. package/dist/index.js +107 -42
  6. package/dist/inspect/app.js +49 -26
  7. package/dist/{main-Doit2DDY.js → main-3kE64MlN.js} +195 -12
  8. package/dist/main-o4m_lGDG.js +6 -0
  9. package/dist/mcp-D6Xt2ixk.js +6 -0
  10. package/dist/{module-DjDMSEKu.js → module-BX2IjSiv.js} +2 -2
  11. package/dist/{module-D8qcE3e7.js → module-D9KdbEpS.js} +1 -1
  12. package/dist/skills/board/SKILL.md +5 -0
  13. package/dist/skills/loop-card/SKILL.md +22 -3
  14. package/dist/{steps-BUPRIOe3.js → steps-cnWo2Wvx.js} +299 -12
  15. package/docs/01-concepts/09-watchers.md +4 -32
  16. package/docs/01-concepts/10-schedules.md +1 -1
  17. package/docs/01-concepts/11-access.md +19 -3
  18. package/docs/01-concepts/13-budgets.md +66 -3
  19. package/docs/01-concepts/15-outgoing-webhooks.md +6 -19
  20. package/docs/01-concepts/16-workflows.md +42 -2
  21. package/docs/01-quickstart.md +74 -45
  22. package/docs/02-sync/01-overview.md +34 -2
  23. package/docs/02-sync/02-github.md +40 -19
  24. package/docs/02-sync/03-linear.md +103 -85
  25. package/docs/02-sync/04-slack.md +116 -111
  26. package/docs/02-sync/05-notion.md +46 -25
  27. package/docs/03-guides/01-coding-agents.md +51 -33
  28. package/docs/03-guides/02-swarm.md +30 -15
  29. package/docs/03-guides/03-factory.md +193 -80
  30. package/docs/03-guides/04-inspector.md +73 -42
  31. package/docs/03-guides/05-running-agents.md +62 -35
  32. package/docs/03-guides/06-sandboxed-agents.md +535 -305
  33. package/docs/03-guides/07-build-a-ui.md +86 -31
  34. package/docs/03-guides/08-ci.md +59 -36
  35. package/docs/03-guides/09-daemon.md +121 -53
  36. package/docs/03-guides/10-two-agents.md +31 -22
  37. package/docs/03-guides/11-person-in-the-loop.md +47 -34
  38. package/docs/03-guides/12-unattended.md +46 -27
  39. package/docs/03-guides/13-terminals.md +51 -39
  40. package/docs/03-guides/14-no-cloud.md +31 -19
  41. package/docs/03-guides/15-several-boards.md +61 -27
  42. package/docs/03-guides/16-non-code.md +29 -18
  43. package/docs/03-guides/17-mcp.md +37 -30
  44. package/docs/03-guides/18-a-board-on-a-server.md +66 -43
  45. package/docs/03-guides/19-a-card-queue.md +210 -121
  46. package/docs/03-guides/20-a-feedback-loop.md +412 -135
  47. package/docs/03-guides/21-running-the-loop.md +94 -64
  48. package/docs/03-guides/22-building-from-linear.md +100 -63
  49. package/docs/04-reference/01-cli.md +7 -0
  50. package/docs/04-reference/02-handle.md +11 -15
  51. package/docs/04-reference/03-http.md +1 -1
  52. package/docs/04-reference/04-events.md +2 -1
  53. package/docs/04-reference/05-errors.md +6 -0
  54. package/docs/04-reference/08-files.md +49 -0
  55. package/docs/index.md +1 -0
  56. package/package.json +1 -1
  57. package/dist/main-D5aX7Jaj.js +0 -6
  58. 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. Go live, choose who is trusted, plan and approve cards, answer blocked tasks, send a card round again, and fix one that stops.
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 you
10
- step in when a card needs you. This page is what you do then, in the order
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
- 1. **The board's address.** The platforms' webhooks and the sandboxes reach
20
- the board over HTTPS: a named tunnel or a proxy to `mu serve`'s port. Put
21
- the address in the environment as `MUSTER_SANDBOX_URL`, ending in
22
- `/api/board`.
23
- 2. **The workflows.** Copy `workflows.json` to `~/.config/muster/` and set
24
- `repo` in each of its three workflows to your repository.
25
- 3. **Who is trusted.** Set `LOOP_TRUSTED` to the actor IDs who may start work
26
- without an approval and may approve: `slack:user:U0123`,
27
- `lin:user:<uuid>`, an app's `<your principal>+<profile>`. You, with no
28
- profile, always are. A GitHub author never is.
29
- 4. **Where you hear.** Set `NOTIFY_CMD` to a command that takes one line: a
30
- push to your phone, a message to yourself. Without it the loop tells you
31
- nothing, and you read the board.
32
- 5. **A budget.** Cap what the cards may cost, every run under them included:
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**, with the secrets `board.ts` names in its environment:
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 it**, at `https://<host>/api/board/webhooks/<key>`,
45
- where `<key>` is the sync's name in `board.ts`: `slack`, `lin`, `gh`,
46
- `nt`. Each platform's page says what to subscribe to and which scopes its
47
- token needs: [Slack](../02-sync/04-slack.md),
48
- [Linear](../02-sync/03-linear.md), [GitHub](../02-sync/02-github.md),
49
- [Notion](../02-sync/05-notion.md). Notion's webhook is verified once
50
- first: start with `NOTION_WEBHOOK_SECRET=pending`, and follow its page.
51
- 8. **Who the loop writes as.** What the loop says on a platform is written
52
- by an app of its own, not by you, once each platform has one:
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. One made for the board: such a token replaces an installation of the same application made through the authorization page | `LINEAR_CLIENT_ID`, `LINEAR_CLIENT_SECRET`, and `LINEAR_APP_WEBHOOK_SECRET` with `agent: true` to show the issue being worked 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. **Your app's button.** Make it a token that can only post reports, and
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 watch it go through: held
75
- `triage`, a spec on the card, `working`, a pull request.
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`. That reply is edited
81
- as the run goes, to say where each task is (`#58 completed, #59 claimed, #60
82
- waiting`), so the thread on Slack, GitHub or Notion shows one comment that
83
- changes. When the run ends, its summary is a new reply, with each task's
84
- result and the pull request, so everyone following the thread is told.
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 park it. The
108
- loop sets In progress and Done itself. A card from anywhere else is ready
109
- when it comes in; park or start it with a label:
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
- The inspector's label does the same. A label
135
- from anyone not trusted does nothing. If the report changes after the spec
136
- was written, it is triaged again, and you approve the new spec.
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
- ## Another round
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 sends the
157
- work and its review back with that reply, and the work carries on from its
158
- branch: the same pull request gets another commit. Reply where the card is:
159
- in the Slack thread, on the Linear issue, on the GitHub issue, on the Notion
160
- page, or on the board.
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 to
163
- end, and goes into the next.
164
- - **Several replies** made between rounds go into one round together.
165
- - **A review comment on the pull request** doesn't start one: reply on the
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 and stop
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. GitHub and Linear catch up only with a token or an app.
196
- Slack can miss a reply in an older thread. Notion misses a comment on a page
197
- that didn't otherwise change. On GitHub, Linear and Slack, edits and deletes
198
- made meanwhile are not read. Each
199
- platform's page says what its catch-up misses: [GitHub](../02-sync/02-github.md#catching-up),
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). To take a source out, remove its sync from `board.ts` and its
203
- webhook from the platform.
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. 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.
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, and you want to steer them
10
- from Linear, on your desktop or the Linear app on your phone, with GitHub
11
- holding the change.
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. See below.
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 parks the card. If
94
- your team's statuses have other names, map them with `LOOP_STAGES`
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 the issue as worked on.** With `agent: true`, the issue shows the
110
- app's agent session while a run works on it, with where the run is, and the
111
- run's last words as the session's response. It needs the OAuth application's
112
- own webhook, with only Agent session events, and its signing secret:
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 it, the issue gets the run's first progress comment as it was first
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,19 +173,24 @@ 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
- - **Goals, numbered,** each pointing to the section that details it.
169
- - **A way for the agent to see its work.** A demo mode with sample data lets
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
- that asks for none gets none.
184
+ that asks for none gets none. To show them in the pull request too, and
185
+ have the review check them, see
186
+ [Screenshots in pull requests](./20-a-feedback-loop.md#screenshots-in-pull-requests).
173
187
 
174
188
  ## Plan a feature with an agent
175
189
 
176
190
  Put a new feature in **Triage**. The loop gives it a planner: an agent that
177
191
  reads the issue and the repository, builds nothing, and answers on the issue
178
- with its questions, numbered, and a draft of the change.
192
+ with its questions, numbered, and a draft of the change. Work with it like
193
+ this:
179
194
 
180
195
  1. Answer in a comment. Each comment by someone trusted is the planner's next
181
196
  round, from Linear on your desktop or your phone.
@@ -192,65 +207,80 @@ it suggests as the project's issues.
192
207
 
193
208
  ## Write issues an agent can finish
194
209
 
210
+ What helps an agent finish an issue:
211
+
195
212
  - **Change the issue itself until the work starts.** An edited title or
196
- description reaches the board, and the issue is triaged again from its new
197
- text. A comment made before the work starts doesn't reach the triage; in
198
- Triage it goes to the planner. Once the issue is In Progress, say changes in
199
- a comment: that is what starts another round.
213
+ description reaches the board, and the loop triages the issue again from
214
+ its new text. A comment made before the work starts doesn't reach the
215
+ triage; in Triage it goes to the planner. Once the issue is In Progress,
216
+ say changes in a comment: that is what starts another round.
200
217
  - **One issue, one pull request.** A card is one branch. Split anything
201
218
  bigger.
202
219
  - **Say how to check it.** The triage writes the spec as a title, what to
203
220
  change and why, and how to check it works. The closer the issue is to that,
204
- the less it has to guess.
205
- - **Order dependent issues yourself.** Every issue in Todo gets its own run,
206
- at once, each starting from the default branch. Move an issue that builds
207
- on another to Todo once the other's pull request is merged. Issues that
208
- touch different code can go together.
221
+ the less the triage has to guess.
222
+ - **Mark what an issue depends on as "blocked by".** Every issue in Todo
223
+ gets its own run, each starting from the default branch, unless Linear
224
+ says another issue blocks it. Its card then waits, held `waiting-on`, and
225
+ says which issues it waits on. An issue the loop worked is done once its
226
+ pull request is merged: the newest pull request from its work's branch,
227
+ `mu/task-<id>`, merged into the repository's default branch, and none open
228
+ from that branch. The loop writes Done to Linear when the review approves,
229
+ before the merge, so it reads GitHub for these. Any other issue is done
230
+ once it is Done or Canceled in Linear
231
+ ([Wait for the issues a card depends on](./20-a-feedback-loop.md#wait-for-the-issues-a-card-depends-on)).
232
+ Issues that touch different code can go together.
209
233
  - **Cap the spend.** `mu budget cards 50` stops new work on cards once they
210
234
  have cost $50 in all.
211
- - Labels, the assignee, the priority and the project arrive as labels on the
212
- card (`tag.bug=bug`, `priority=high`), for your own filters. The loop
213
- doesn't route on them.
235
+ - **Linear's labels and fields are for your own filters.** Labels, the
236
+ assignee, the priority and the project arrive as labels on the card
237
+ (`tag.bug=bug`, `priority=high`). The loop doesn't route on them.
214
238
 
215
239
  ## Let it build
216
240
 
217
241
  Move the issue to Todo. On the issue you see, in order:
218
242
 
219
- 1. **The spec,** written by the triage, as a comment. If the triage finds
220
- nothing to change in this repository, it says why, and the card is held
221
- `declined`. Edit the issue to say more, and it is triaged again. Or move
222
- it to Triage and work it out with the planner first.
223
- 2. **Approval,** for an issue whose author isn't trusted. The card waits
243
+ 1. **The spec:** a comment written by the triage. If the triage finds
244
+ nothing to change in this repository, it says why, and the loop
245
+ [holds](../01-concepts/08-tasks.md#states) the card `declined`. Edit the issue to say
246
+ more, and the loop triages it again. Or move it to Triage and work it out
247
+ with the planner first.
248
+ 2. **Approval:** for an issue whose author isn't trusted. The card waits
224
249
  until someone trusted runs `mu label <card> approved=yes`, or sets the
225
- label in the inspector. Read the spec, not only the issue: the spec is what
226
- the work does.
227
- 3. **In Progress,** set by the loop, and the agent session working, with
228
- `agent: true`.
229
- 4. **The summary** when the run ends: each step's result, and the pull
250
+ label in the [inspector](./04-inspector.md). Read the spec, not only the
251
+ issue: the spec is what the work does.
252
+ 3. **In Progress:** set by the loop, with the agent session working when
253
+ `agent: true` is set.
254
+ 4. **The summary:** when the run ends, each step's result and the pull
230
255
  request's address. The work pushes `mu/task-<id>` and opens the pull
231
- request, titled with the card's title.
232
- 5. **The screenshots** of the round, uploaded to Linear and linked from the
256
+ request, titled with the card's title. Its body ends with `Refs ENG-123`,
257
+ the issue's key, so Linear's GitHub integration shows the pull request on
258
+ the issue. It says `Refs`, never `Fixes`: the loop sets the issue's status
259
+ itself, and a closing word would have Linear set it to Done on merge too.
260
+ An issue key the agent writes in its description links nothing.
261
+ 5. **The screenshots:** the round's, uploaded to Linear and linked from the
233
262
  comment. Experimental: files sent through an OAuth app haven't been
234
263
  checked against a live workspace.
235
- 6. **Done,** set by the loop when the review approves. Merging the pull
264
+ 6. **Done:** set by the loop when the review approves. Merging the pull
236
265
  request is yours.
237
266
 
238
267
  ## Iterate from Linear
239
268
 
240
- - **Comment on the issue** for another round on the same pull request: the
269
+ How to steer from Linear:
270
+
271
+ - **Comment on the issue for another round on the same pull request.** The
241
272
  comment goes to the agent, the work and its review run again, and the
242
- commit lands on the same branch. A comment made while a round runs waits
243
- for it to end. A comment on an issue that is Done reopens it, and the loop
244
- sets In Progress again.
273
+ commit is pushed to the same branch. A comment made while a round runs
274
+ waits for it to end. A comment on an issue that is Done reopens it, and the
275
+ loop sets In Progress again.
245
276
  - **Comment on the issue, not on the pull request.** A comment on the pull
246
277
  request doesn't start a round.
247
278
  - **Keep the decision on the issue.** "The accent should be this colour" is a
248
- comment on the issue. How the agent got there is the pull request's
249
- business.
279
+ comment on the issue. How the agent got there belongs in the pull request.
250
280
 
251
- ## What needs the board
281
+ ## What you still do on the board
252
282
 
253
- Most of the work happens in Linear. Three things don't:
283
+ Where each job is done:
254
284
 
255
285
  | To do this | Do it here |
256
286
  | --- | --- |
@@ -266,8 +296,8 @@ its question doesn't reach Linear. Set `NOTIFY_CMD` so you hear about it:
266
296
 
267
297
  ## Feedback from the app you are building
268
298
 
269
- Paper cuts don't need planning. Give the app a token that can only post
270
- reports, and send them from the app's server:
299
+ Small bugs reported from the app don't need planning. Give the app a token
300
+ that can only post reports, and send them from the app's server:
271
301
 
272
302
  ```bash
273
303
  mu token create --as my-app --can 'cards/app=post' --ttl 90d
@@ -286,19 +316,24 @@ and screenshots, and the pull request. The project's issue list says what is
286
316
  done, what is in progress and what is next. On the board,
287
317
  `mu tasks cards/ --state blocked` lists what waits on you.
288
318
 
289
- ## When not to
319
+ ## When not to use the loop
320
+
321
+ The loop is the wrong tool in these cases:
290
322
 
291
- - **For work you can't split into pull-request-sized issues.** A card is one
292
- branch.
293
- - **With the spec only in Linear.** Agents read the repository.
294
- - **For issues from people you wouldn't hand an agent.** Approval is per
295
- card: read each spec before you approve it.
296
- - **For a single label-triggered pass with no rounds.**
323
+ - **It doesn't fit work you can't split into pull-request-sized issues.** A
324
+ card is one branch.
325
+ - **It doesn't work with the spec only in Linear.** Agents read the
326
+ repository.
327
+ - **It doesn't fit issues from people you wouldn't hand an agent.** Approval
328
+ is per card: read each spec before you approve it.
329
+ - **A single label-triggered pass with no rounds needs less.**
297
330
  [A card queue](./19-a-card-queue.md) is smaller: label an issue `agent` and
298
331
  get a spec, a pull request and a review back once.
299
332
 
300
333
  ## What goes wrong
301
334
 
335
+ Symptoms, causes and fixes:
336
+
302
337
  - **Nothing happens when an issue moves to Todo.** The webhook isn't reaching
303
338
  the board (Linear's webhook settings list each delivery; `mu daemon status`
304
339
  names the sync), the issue is in a team that isn't mapped, or its status
@@ -309,14 +344,16 @@ done, what is in progress and what is next. On the board,
309
344
  - **A card waits for approval on your own issue.** Your Linear user ID isn't
310
345
  in `LOOP_TRUSTED`.
311
346
  - **The status doesn't change.** The loop writes it as the OAuth app, with
312
- its sync's scopes. Linear ends an app's earlier tokens when one is asked for
313
- with other scopes, so a sync given its own `scopes` needs the same in its
314
- `SOURCES` entry ([Stages](./20-a-feedback-loop.md#stages)).
347
+ its sync's scopes. Linear revokes an app's earlier tokens when one is asked
348
+ for with other scopes, so a sync given its own `scopes` needs the same in
349
+ its `SOURCES` entry ([Stages](./20-a-feedback-loop.md#stages)).
315
350
  - **Two pull requests conflict.** Two issues in Todo changed the same code.
316
351
  Merge one, resolve the other's branch, then comment on its issue if it
317
352
  needs another round: the round starts from the branch as you left it.
318
353
 
319
- ## Next
354
+ ## Related guides
355
+
356
+ Where to go next:
320
357
 
321
358
  - [A feedback loop](./20-a-feedback-loop.md): every stage, planning, related
322
359
  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>