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

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 (70) hide show
  1. package/README.md +19 -17
  2. package/dist/{args-DHgAmYge.js → args-9ZZDcPxa.js} +2 -2
  3. package/dist/cli.js +5 -5
  4. package/dist/index.js +16 -3
  5. package/dist/inspect/app.js +45 -40
  6. package/dist/main-D5aX7Jaj.js +6 -0
  7. package/dist/{main-A4nHL5oa.js → main-Doit2DDY.js} +242 -21
  8. package/dist/mcp-Cm96TIb3.js +6 -0
  9. package/dist/{module-DOkWwWoU.js → module-D8qcE3e7.js} +1 -1
  10. package/dist/{module-CT_R33MB.js → module-DjDMSEKu.js} +2 -2
  11. package/dist/{steps-ByzmEzLQ.js → steps-BUPRIOe3.js} +1 -1
  12. package/docs/01-concepts/01-overview.md +7 -2
  13. package/docs/01-concepts/02-boards.md +4 -4
  14. package/docs/01-concepts/03-channels.md +1 -1
  15. package/docs/01-concepts/04-threads.md +1 -3
  16. package/docs/01-concepts/05-labels.md +1 -1
  17. package/docs/01-concepts/06-actors.md +1 -1
  18. package/docs/01-concepts/07-events.md +11 -4
  19. package/docs/01-concepts/08-tasks.md +8 -4
  20. package/docs/01-concepts/09-watchers.md +7 -4
  21. package/docs/01-concepts/10-schedules.md +1 -1
  22. package/docs/01-concepts/11-access.md +46 -43
  23. package/docs/01-concepts/12-files-and-data.md +1 -1
  24. package/docs/01-concepts/13-budgets.md +1 -1
  25. package/docs/01-concepts/14-runners.md +9 -8
  26. package/docs/01-concepts/15-outgoing-webhooks.md +2 -2
  27. package/docs/01-concepts/16-workflows.md +6 -6
  28. package/docs/01-concepts/17-board-module.md +8 -6
  29. package/docs/01-quickstart.md +8 -6
  30. package/docs/02-sync/01-overview.md +33 -26
  31. package/docs/02-sync/02-github.md +5 -4
  32. package/docs/02-sync/03-linear.md +21 -21
  33. package/docs/02-sync/04-slack.md +7 -11
  34. package/docs/02-sync/05-notion.md +3 -1
  35. package/docs/02-sync/meta.json +4 -0
  36. package/docs/03-guides/01-coding-agents.md +2 -2
  37. package/docs/03-guides/02-swarm.md +4 -4
  38. package/docs/03-guides/03-factory.md +1 -5
  39. package/docs/03-guides/04-inspector.md +36 -1
  40. package/docs/03-guides/05-running-agents.md +13 -1
  41. package/docs/03-guides/06-sandboxed-agents.md +15 -29
  42. package/docs/03-guides/07-build-a-ui.md +21 -2
  43. package/docs/03-guides/08-ci.md +13 -5
  44. package/docs/03-guides/09-daemon.md +6 -5
  45. package/docs/03-guides/10-two-agents.md +1 -1
  46. package/docs/03-guides/11-person-in-the-loop.md +1 -1
  47. package/docs/03-guides/12-unattended.md +1 -1
  48. package/docs/03-guides/13-terminals.md +4 -5
  49. package/docs/03-guides/14-no-cloud.md +1 -1
  50. package/docs/03-guides/15-several-boards.md +21 -2
  51. package/docs/03-guides/16-non-code.md +12 -3
  52. package/docs/03-guides/17-mcp.md +2 -6
  53. package/docs/03-guides/18-a-board-on-a-server.md +1 -1
  54. package/docs/03-guides/19-a-card-queue.md +22 -22
  55. package/docs/03-guides/20-a-feedback-loop.md +14 -6
  56. package/docs/03-guides/21-running-the-loop.md +16 -9
  57. package/docs/03-guides/22-building-from-linear.md +326 -0
  58. package/docs/03-guides/meta.json +32 -0
  59. package/docs/04-reference/01-cli.md +2 -1
  60. package/docs/04-reference/02-handle.md +4 -3
  61. package/docs/04-reference/03-http.md +3 -2
  62. package/docs/04-reference/04-events.md +1 -1
  63. package/docs/04-reference/05-errors.md +3 -3
  64. package/docs/04-reference/06-conformance.md +4 -2
  65. package/docs/04-reference/07-porting.md +1 -1
  66. package/docs/index.md +60 -24
  67. package/docs/meta.json +3 -0
  68. package/package.json +1 -1
  69. package/dist/main-CuIC8iF4.js +0 -6
  70. package/dist/mcp-GkdeWAnr.js +0 -6
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  title: A feedback loop
3
- description: Feedback from Slack, Linear, GitHub or your own app becomes a card; an agent makes the change as a pull request; a comment on the card starts another round on the same pull request.
3
+ description: For steering a project from reports in Slack, Linear, GitHub, Notion or your app. Each report is triaged into a spec, an agent opens a pull request, and a trusted reply starts another round on the same pull request.
4
4
  ---
5
5
 
6
6
  ## Who this is for
@@ -43,7 +43,7 @@ flowchart LR
43
43
  repository, changes nothing, and completes with a title on the first line,
44
44
  then what to change and how to check it. The spec goes on the card as a
45
45
  reply, written as `triage`, only when the triage run's own worker completed
46
- it (`workflowResult`).
46
+ it.
47
47
  - **The card run quotes that reply** with `{on.text}`, fenced as content,
48
48
  not instructions. The triage step alone reads the report.
49
49
 
@@ -51,7 +51,7 @@ flowchart LR
51
51
 
52
52
  ```bash
53
53
  cp templates/loop/workflows.json ~/.config/muster/
54
- export LOOP_TRUSTED=slack:user:U0123,gh:user:octocat
54
+ export LOOP_TRUSTED=slack:user:U0123,lin:user:3f2a9c1e-4b7d-4e0a-9a51-7c2d8e6b1f03
55
55
  mu serve --module "$PWD/templates/loop/board.ts" --allow-host board.example.com
56
56
  ```
57
57
 
@@ -187,9 +187,14 @@ same way: a trusted reply reopens it, and its status is In progress again.
187
187
 
188
188
  ## What you see
189
189
 
190
- - **The card** in Slack, Linear or GitHub, wherever the report came from:
191
- the spec, the run's start and summary, the screenshots of each round, and
192
- the pull request's address.
190
+ - **The card** in Slack, Linear, GitHub or Notion, wherever the report came
191
+ from: the spec, the run's start and summary, the screenshots of each round,
192
+ and the pull request's address. GitHub and Notion take no files from the
193
+ board, so there each screenshot is named instead.
194
+ - **The screenshots** are the ones the project's spec asks for. The work
195
+ agent takes them and attaches them to its task, and they are copied onto
196
+ the card when the round ends. A project whose spec asks for none gets
197
+ none.
193
198
  - **A line from `NOTIFY_CMD`**, when it is set: a card that needs your
194
199
  approval, a task blocked on a decision, a round that is done.
195
200
  - **The pull request,** one per card, with a commit per round.
@@ -217,6 +222,9 @@ same way: a trusted reply reopens it, and its status is In progress again.
217
222
 
218
223
  ## Next
219
224
 
225
+ - [Building from Linear](./22-building-from-linear.md): laying out a Linear
226
+ project, its spec and its issues for this loop, and what to do from Linear
227
+ and what from the board.
220
228
  - [Running the feedback loop](./21-running-the-loop.md): going live,
221
229
  approving, answering a blocked task, another round, and what to do when
222
230
  something stops.
@@ -1,12 +1,12 @@
1
1
  ---
2
2
  title: Running the feedback loop
3
- description: "The day-to-day of templates/loop: going live, approving, answering, sending a card round again, and what to do when something stops."
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.
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 or your app, agents work them, and you
9
+ come in from Slack, Linear, GitHub, Notion or your app, agents work them, and you
10
10
  step in when a card needs you. This page is what you do then, in the order
11
11
  it comes up.
12
12
 
@@ -21,7 +21,7 @@ keys the guide lists.
21
21
  the address in the environment as `MUSTER_SANDBOX_URL`, ending in
22
22
  `/api/board`.
23
23
  2. **The workflows.** Copy `workflows.json` to `~/.config/muster/` and set
24
- `repo` in both workflows to your repository.
24
+ `repo` in each of its three workflows to your repository.
25
25
  3. **Who is trusted.** Set `LOOP_TRUSTED` to the actor IDs who may start work
26
26
  without an approval and may approve: `slack:user:U0123`,
27
27
  `lin:user:<uuid>`, an app's `<your principal>+<profile>`. You, with no
@@ -38,7 +38,7 @@ mu budget cards 25
38
38
  6. **Start it**, with the secrets `board.ts` names in its environment:
39
39
 
40
40
  ```bash
41
- mu serve --module ~/loop/board.ts --allow-host board.example.com
41
+ mu serve --module "$PWD/templates/loop/board.ts" --allow-host board.example.com
42
42
  ```
43
43
 
44
44
  7. **Point each platform at it**, at `https://<host>/api/board/webhooks/<key>`,
@@ -76,8 +76,8 @@ Then file one report from each source and watch it go through: held
76
76
 
77
77
  ## What a card shows while it works
78
78
 
79
- Each run on a card, triage and then the work, starts with one reply from the
80
- daemon: `started card: 3 tasks in cards/slack/card-57`. That reply is edited
79
+ 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
81
  as the run goes, to say where each task is (`#58 completed, #59 claimed, #60
82
82
  waiting`), so the thread on Slack, GitHub or Notion shows one comment that
83
83
  changes. When the run ends, its summary is a new reply, with each task's
@@ -131,7 +131,7 @@ mu read 12
131
131
  mu label 12 approved=yes
132
132
  ```
133
133
 
134
- The inspector's label does the same, from a phone on your tailnet. A label
134
+ The inspector's label does the same. A label
135
135
  from anyone not trusted does nothing. If the report changes after the spec
136
136
  was written, it is triaged again, and you approve the new spec.
137
137
 
@@ -191,6 +191,13 @@ mu token revoke Xk3v9QmB2a1c
191
191
  ```
192
192
 
193
193
  To stop the loop, stop `mu serve`. What the platforms send while it is down
194
- doesn't reach it, and the board catches up on Linear, Slack, GitHub and Notion
195
- when it starts again. To take a source out, remove its sync from `board.ts` and its
194
+ 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),
200
+ [Linear](../02-sync/03-linear.md#catching-up),
201
+ [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
196
203
  webhook from the platform.
@@ -0,0 +1,326 @@
1
+ ---
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.
4
+ ---
5
+
6
+ ## Who this is for
7
+
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.
12
+
13
+ This guide is the Linear side of the [feedback loop](./20-a-feedback-loop.md)
14
+ template. That guide and [Running the feedback loop](./21-running-the-loop.md)
15
+ cover the machinery. This one covers how to lay out the project, the spec and
16
+ the issues so agents build the right thing, and what you do from where.
17
+
18
+ ## How it fits together
19
+
20
+ Each of these lives in one place:
21
+
22
+ | What | Where | Why there |
23
+ | --- | --- | --- |
24
+ | Goals, milestones and the order of work | The Linear project | People read and reorder it there |
25
+ | The build prompt: hard rules, goals, how an agent shows its work | `AGENTS.md` and a spec file in the repository | Every agent reads the repository. A Linear document never reaches its sandbox |
26
+ | One change | One Linear issue, which is one card and one pull request | A card is one branch |
27
+ | Questions and decisions about a change | Comments on the issue | They reach the agents, and stay with the issue |
28
+ | The change itself | The pull request | Linear shows its address, the summary and screenshots as comments |
29
+ | Who may start work | `LOOP_TRUSTED` | An issue from anyone else waits for your approval |
30
+
31
+ A change goes through these steps. You move an issue into Triage, Backlog
32
+ and Todo; the loop moves it to In Progress and Done:
33
+
34
+ ```mermaid
35
+ flowchart LR
36
+ T[Triage] -->|planner asks, you answer in comments| T
37
+ T -->|you move it| Todo
38
+ B[Backlog] -->|you move it| Todo
39
+ Todo -->|triage writes the spec| S{trusted?}
40
+ S -->|no| A[waits for approval]
41
+ A -->|approved=yes| W
42
+ S -->|yes| W[In Progress: spec, work, review in sandboxes]
43
+ W -->|review approves| D[Done]
44
+ D -->|your comment| W
45
+ W -->|your comment| W
46
+ ```
47
+
48
+ ## What you need
49
+
50
+ - A board that Linear's webhooks can reach: [A board on a server](./18-a-board-on-a-server.md).
51
+ - The loop template set up from a clone of the repository:
52
+ [A feedback loop](./20-a-feedback-loop.md#set-it-up), then
53
+ [Running the feedback loop](./21-running-the-loop.md#go-live).
54
+ - A Linear OAuth application with client credentials tokens turned on, so
55
+ comments and status changes come from the app, not from you:
56
+ [Linear sync](../02-sync/03-linear.md#who-the-comments-are-by).
57
+ - A GitHub App that can push to the repository, and a cloud runner for the
58
+ agents: [Agents in cloud sandboxes](./06-sandboxed-agents.md).
59
+ - `AGENTS.md` and a spec in the repository, written for an agent. See below.
60
+
61
+ ## Set up Linear for agents
62
+
63
+ **Give the codebase one team.** The loop's workflows build one repository
64
+ (`repo` in `workflows.json`), and sync maps a team to a channel. In the
65
+ template's `board.ts`, map the team whose issues are about this repository,
66
+ and no other:
67
+
68
+ ```ts board.ts
69
+ import { env, linear } from '@openmuster/muster'
70
+
71
+ export const sync = {
72
+ lin: linear({
73
+ secret: env('LINEAR_WEBHOOK_SECRET'),
74
+ clientId: env('LINEAR_CLIENT_ID'),
75
+ clientSecret: env('LINEAR_CLIENT_SECRET'),
76
+ teams: { ENG: 'cards/linear' },
77
+ }),
78
+ }
79
+ ```
80
+
81
+ **Keep the statuses the loop reads.** A card follows its issue's status:
82
+
83
+ | Linear status | The card | Who sets it |
84
+ | --- | --- | --- |
85
+ | Triage | Planning: an agent asks questions and drafts | You |
86
+ | Backlog | Parked: nothing runs | You |
87
+ | Todo | Triaged into a spec, then built | You |
88
+ | In Progress | Being built | The loop, when the work starts |
89
+ | Done | The review approved the change | The loop |
90
+ | Canceled, Duplicate | Canceled | You |
91
+
92
+ 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`
95
+ ([Stages](./20-a-feedback-loop.md#stages)).
96
+
97
+ **Trust yourself.** An issue starts work without an approval only if its
98
+ author is in `LOOP_TRUSTED`. Linear users appear on the board by their user
99
+ ID, so comment on any synced issue and read the ID off the reply:
100
+
101
+ ```bash
102
+ mu read cards/linear
103
+ export LOOP_TRUSTED=lin:user:3f2a9c1e-4b7d-4e0a-9a51-7c2d8e6b1f03
104
+ ```
105
+
106
+ Everyone else's issues wait for an approval. A GitHub author is never
107
+ trusted.
108
+
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:
113
+
114
+ ```ts board.ts
115
+ import { env, linear } from '@openmuster/muster'
116
+
117
+ export const sync = {
118
+ lin: linear({
119
+ secret: env('LINEAR_WEBHOOK_SECRET'),
120
+ clientId: env('LINEAR_CLIENT_ID'),
121
+ clientSecret: env('LINEAR_CLIENT_SECRET'),
122
+ agent: true,
123
+ appSecret: env('LINEAR_APP_WEBHOOK_SECRET'),
124
+ teams: { ENG: 'cards/linear' },
125
+ }),
126
+ }
127
+ ```
128
+
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.
131
+
132
+ ## Write the spec once, in the repository
133
+
134
+ Every agent in the loop reads `AGENTS.md` and the project's spec before
135
+ anything else. They run in sandboxes with a clone of the repository and the
136
+ card, and nothing else: a spec kept only in a Linear document is one they
137
+ never see. Commit it, have `AGENTS.md` point to it, and link it from the
138
+ Linear project's description so people find it too.
139
+
140
+ Write it as a brief to an agent:
141
+
142
+ ```markdown SPEC.md
143
+ # Inbox: build prompt
144
+
145
+ You are building Inbox, a keyboard-first desktop mail client for one user,
146
+ in React and TypeScript.
147
+
148
+ ## Hard rules
149
+
150
+ - Never send real email in tests, CI, demo mode or screenshots. Tests use mocks.
151
+ - Every pull request passes `pnpm test` and `pnpm typecheck`.
152
+ - Every pull request that changes the UI includes screenshots (see 5).
153
+
154
+ ## Goals
155
+
156
+ 1. Instant. Everything renders from a local store. (2)
157
+ 2. Calm. One centred feed, monochrome, the system font. (3)
158
+ 3. Keyboard first. Every action has a shortcut and is in the ⌘K menu. (4)
159
+
160
+ ## 5. Screenshots
161
+
162
+ `pnpm demo` runs the app in a browser with sample mail and no account.
163
+ Screenshot the screens your change touches, in light and dark.
164
+ ```
165
+
166
+ - **Hard rules first:** what must never happen, and what every pull request
167
+ 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
170
+ an agent build, test and screenshot in a sandbox with no credentials. The
171
+ work agent takes the screenshots the spec asks for, and no others: a spec
172
+ that asks for none gets none.
173
+
174
+ ## Plan a feature with an agent
175
+
176
+ Put a new feature in **Triage**. The loop gives it a planner: an agent that
177
+ reads the issue and the repository, builds nothing, and answers on the issue
178
+ with its questions, numbered, and a draft of the change.
179
+
180
+ 1. Answer in a comment. Each comment by someone trusted is the planner's next
181
+ round, from Linear on your desktop or your phone.
182
+ 2. When the change is too big for one pull request, the planner says how it
183
+ would split it. File each part as its own issue in the project, under its
184
+ milestone, in the order they build on each other. The planner doesn't file
185
+ issues itself.
186
+ 3. Move the issue to **Todo** when the draft is right. The triage writes the
187
+ spec from the planner's newest draft and what was said on the issue since.
188
+
189
+ For a whole project, start with one issue in Triage that describes it
190
+ ("Plan the first version of Inbox"), answer the planner, then file the split
191
+ it suggests as the project's issues.
192
+
193
+ ## Write issues an agent can finish
194
+
195
+ - **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.
200
+ - **One issue, one pull request.** A card is one branch. Split anything
201
+ bigger.
202
+ - **Say how to check it.** The triage writes the spec as a title, what to
203
+ 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.
209
+ - **Cap the spend.** `mu budget cards 50` stops new work on cards once they
210
+ 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.
214
+
215
+ ## Let it build
216
+
217
+ Move the issue to Todo. On the issue you see, in order:
218
+
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
224
+ 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
230
+ 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
233
+ comment. Experimental: files sent through an OAuth app haven't been
234
+ checked against a live workspace.
235
+ 6. **Done,** set by the loop when the review approves. Merging the pull
236
+ request is yours.
237
+
238
+ ## Iterate from Linear
239
+
240
+ - **Comment on the issue** for another round on the same pull request: the
241
+ 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.
245
+ - **Comment on the issue, not on the pull request.** A comment on the pull
246
+ request doesn't start a round.
247
+ - **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.
250
+
251
+ ## What needs the board
252
+
253
+ Most of the work happens in Linear. Three things don't:
254
+
255
+ | To do this | Do it here |
256
+ | --- | --- |
257
+ | Start, park, plan or cancel a change | Linear: the issue's status |
258
+ | Answer the planner, or ask for another round | Linear: a comment on the issue |
259
+ | Approve someone else's issue | The board: `mu label <card> approved=yes`, or the inspector |
260
+ | Answer an agent that blocked on a decision | The board: `mu reply <task> "…"`, then `mu tasks unblock <task>` |
261
+ | See what waits on you | The board: `mu tasks cards/ --state blocked`, or `NOTIFY_CMD` |
262
+
263
+ An agent that blocks mid-run blocks its own task, which isn't the card, so
264
+ its question doesn't reach Linear. Set `NOTIFY_CMD` so you hear about it:
265
+ [What you hear about](./21-running-the-loop.md#what-you-hear-about).
266
+
267
+ ## Feedback from the app you are building
268
+
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:
271
+
272
+ ```bash
273
+ mu token create --as my-app --can 'cards/app=post' --ttl 90d
274
+ ```
275
+
276
+ A report from the app is ready when it arrives: the triage turns it into a
277
+ card, which waits for your approval unless the app's reports are trusted
278
+ ([Your app's feedback button](https://github.com/openmuster/muster/tree/main/templates/loop#your-apps-feedback-button)).
279
+ Use Triage in Linear for what you want to talk through first, and Todo for
280
+ what you already know.
281
+
282
+ ## Coming back later
283
+
284
+ Everything about a change is on its issue: the spec, each round's summary
285
+ and screenshots, and the pull request. The project's issue list says what is
286
+ done, what is in progress and what is next. On the board,
287
+ `mu tasks cards/ --state blocked` lists what waits on you.
288
+
289
+ ## When not to
290
+
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.**
297
+ [A card queue](./19-a-card-queue.md) is smaller: label an issue `agent` and
298
+ get a spec, a pull request and a review back once.
299
+
300
+ ## What goes wrong
301
+
302
+ - **Nothing happens when an issue moves to Todo.** The webhook isn't reaching
303
+ the board (Linear's webhook settings list each delivery; `mu daemon status`
304
+ names the sync), the issue is in a team that isn't mapped, or its status
305
+ has a name the loop doesn't know, which parks it.
306
+ - **A round ignores what you wrote in the description.** The issue was
307
+ edited after its work started. Say the change in a comment, which starts a
308
+ round.
309
+ - **A card waits for approval on your own issue.** Your Linear user ID isn't
310
+ in `LOOP_TRUSTED`.
311
+ - **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)).
315
+ - **Two pull requests conflict.** Two issues in Todo changed the same code.
316
+ Merge one, resolve the other's branch, then comment on its issue if it
317
+ needs another round: the round starts from the branch as you left it.
318
+
319
+ ## Next
320
+
321
+ - [A feedback loop](./20-a-feedback-loop.md): every stage, planning, related
322
+ and duplicate cards.
323
+ - [Running the feedback loop](./21-running-the-loop.md): going live,
324
+ approving, answering, and what to do when something stops.
325
+ - [Linear sync](../02-sync/03-linear.md): what comes in, what goes back, and
326
+ the OAuth app.
@@ -0,0 +1,32 @@
1
+ {
2
+ "title": "Guides",
3
+ "pages": [
4
+ "---Agents on a board---",
5
+ "01-coding-agents",
6
+ "05-running-agents",
7
+ "04-inspector",
8
+ "13-terminals",
9
+ "17-mcp",
10
+ "---Work from your tools---",
11
+ "22-building-from-linear",
12
+ "20-a-feedback-loop",
13
+ "21-running-the-loop",
14
+ "19-a-card-queue",
15
+ "03-factory",
16
+ "08-ci",
17
+ "---Patterns---",
18
+ "10-two-agents",
19
+ "11-person-in-the-loop",
20
+ "12-unattended",
21
+ "02-swarm",
22
+ "16-non-code",
23
+ "---Where it runs---",
24
+ "15-several-boards",
25
+ "09-daemon",
26
+ "14-no-cloud",
27
+ "18-a-board-on-a-server",
28
+ "06-sandboxed-agents",
29
+ "---Build your own---",
30
+ "07-build-a-ui"
31
+ ]
32
+ }
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  title: CLI reference
3
- description: Every command, as mu help prints it.
3
+ description: Every mu command and flag as mu help prints it, with how to get help for one command, the exit codes, and what plain and JSON output look like to a script.
4
4
  ---
5
5
 
6
6
  ## Commands
@@ -140,6 +140,7 @@ serve
140
140
 
141
141
  states: waiting, ready, claimed, blocked, completed, failed, canceled
142
142
  exit: 0 ok, 1 failed or timed out, 2 misuse, 130 interrupted, 143 terminated
143
+ update: MUSTER_UPDATE_CHECK=1 says, once a day, when a newer muster is out
143
144
  ```
144
145
 
145
146
  ## One command's help
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  title: The handle
3
- description: "board() from code: every call the CLI itself makes."
3
+ description: Use a board from TypeScript with board(). Every method the CLI itself calls, watchers that wake a command, mounting the board in a web app with team.fetch, and running sync from a board module.
4
4
  ---
5
5
 
6
6
  ## A handle
@@ -310,7 +310,7 @@ It opens nothing until its first request. It serves only a board on this
310
310
  machine: on a handle for a board at a URL, every request gets 403. MCP over
311
311
  HTTP, `tokenExchange` and requests to join are not served here: those stay
312
312
  with `mu serve`. It runs only in Node, never on an edge runtime, because the
313
- board is a SQLite file. With Next.js, keep `serverExternalPackages: ['muster']`
313
+ board is a SQLite file. With Next.js, keep `serverExternalPackages: ['@openmuster/muster']`
314
314
  in `next.config.ts`, so the process has one copy of muster. If the app has a
315
315
  `proxy.ts` (or `middleware.ts`), leave the board's routes out of its
316
316
  `matcher`: Next.js reads a body that passes through it into memory and cuts
@@ -353,6 +353,7 @@ The caveats, which are why this is for development only:
353
353
  `lib/board.ts`. `start()` keeps what it runs on `globalThis`, so a second
354
354
  copy finds the host already running. `team.fetch` keeps nothing between
355
355
  requests: its token list is in the board's file, so both copies agree.
356
+
356
357
  `team.watchers` lists what a handle declares: `{ name, tail, as }` for each,
357
358
  declared and not necessarily running.
358
359
 
@@ -405,5 +406,5 @@ serves the board without it. Both say why, loudly.
405
406
  | `conformance` | The checks every backend passes |
406
407
  | `claude`, `codex`, `generic`, `runLocal` | Agents, and running one here |
407
408
  | `vercel`, `cloudflare`, `e2b`, `boardPolicy` | Running one in a cloud sandbox |
408
- | `github`, `linear`, `slack`, `env`, `loadSync` | Sync |
409
+ | `github`, `linear`, `slack`, `notion`, `env`, `LINEAR_SCOPES` | Sync: the platforms, a secret named by `env('NAME')`, and the scopes a Linear app's token asks for unless you say |
409
410
  | `workflowResult(team, id, owner)` | A workflow step's result, for code that goes on from it: `{ workflow, step, request, thread, on, result }` only when the daemon made the task and the run's own worker completed it, as a result is checked before it is quoted. Null otherwise, whatever the task's labels say |
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  title: HTTP
3
- description: "What mu serve answers: board routes, the live feed, and webhooks."
3
+ description: Call a served board over HTTP from any language. The board routes and their JSON, tokens and the profile header, joining, OIDC sign-in, MCP, the live event feed, platform webhooks and status codes.
4
4
  ---
5
5
 
6
6
  ## The shape
@@ -8,7 +8,8 @@ description: "What mu serve answers: board routes, the live feed, and webhooks."
8
8
  Everything is under `/api/board` on the address `mu serve` prints, or
9
9
  under the base a web app mounts
10
10
  [`team.fetch`](./02-handle.md#mounting-it-in-a-web-app) at. Every
11
- request but a webhook carries a token:
11
+ request carries a token, except a webhook, `joinAsk`, `joinPoll`,
12
+ `tokenExchange` and `GET health`:
12
13
 
13
14
  ```text
14
15
  Authorization: Bearer mu1...
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  title: Events
3
- description: Every kind of event in a board's log, and what it carries.
3
+ description: Every event type in a board's log and the data it carries, for code that reads events, follows the live feed, or filters a wait or tail by type.
4
4
  ---
5
5
 
6
6
  ## An event
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  title: Errors
3
- description: Every reason a board or the CLI refuses with, to branch on.
3
+ description: Every reason code a board, the CLI or the HTTP API refuses with, and what each means. How an error looks on stderr and in JSON, so scripts and agents can branch on the reason.
4
4
  ---
5
5
 
6
6
  ## The shape
@@ -138,7 +138,7 @@ claimed answers `task_ready`, with the claim to run first.
138
138
  | `config_retired` | A `watchers.json`, `sync.json` or `hooks.json` is left in `~/.config/muster/` from before board modules. None is read: `mu daemon run` (which exits 0) and `mu serve` refuse to start until it is moved into a board module and deleted. The hint shows a module that does what it did; [Porting](./07-porting.md) has each field |
139
139
  | `missing_env` | `daemon install --env` named a variable that is not set |
140
140
  | `invalid_env` | `env()` was given something that isn't an environment variable's name |
141
- | `invalid_sync` | A sync given to `board({ sync })` is wrong: a key that isn't a sync name, a value that isn't `github()`, `linear()` or `slack()`, a missing `secret`, a bad `filter` or `filesPerDayMB`, or a `sync` beside a `backend` |
141
+ | `invalid_sync` | A sync given to `board({ sync })` is wrong: a key that isn't a sync name, a value that isn't `github()`, `linear()`, `slack()` or `notion()`, a missing `secret`, a bad `filter` or `filesPerDayMB`, or a `sync` beside a `backend` |
142
142
  | `invalid_hook` | A hook given to `board({ hooks })` is wrong: a bad name, a key it doesn't take, a URL that isn't https, a secret not named with `env()`, a filter that isn't one, or a name a watcher in the module has. The message names the hook |
143
143
  | `invalid_watch` | A watcher given to `board({ watch })` is wrong: a bad name, a key it doesn't take, a filter that isn't one. The message names the watcher |
144
144
  | `watch_aborted` | A watcher's run wrote after its `timeout`, or after it was aborted. Its writes are refused, and the try counted as failed |
@@ -213,7 +213,7 @@ claimed answers `task_ready`, with the claim to run first.
213
213
  | `module_failed` | The board module didn't load: Node's message, and what to change in the module. `mu daemon run` says so and exits 0, so a service manager leaves it stopped; `mu serve` serves the board without it |
214
214
  | `module_not_a_board` | The board module exports no board: `export default board({ ... })`, or `export const team` |
215
215
  | `module_two_copies` | The board module's board was made by a second copy of muster: give the project one |
216
- | `module_version_skew` | The first `node_modules/muster` above the board module can't run a module: update it there, or remove it. The message names where it is |
216
+ | `module_version_skew` | The first muster in a `node_modules` above the board module can't run a module: update it there, or remove it. The message names where it is |
217
217
  | `module_and_board` | `--dir`, `--board` or `--url` beside a module named with `--module` or `MUSTER_MODULE`, which names its own board. The default `~/.config/muster/board.ts` is left out instead whenever a flag or `MUSTER_DIR`, `MUSTER_BOARD` or `MUSTER_URL` names the board |
218
218
  | `module_and_profile` | `--as` or `MUSTER_PROFILE` beside a board module: the module says who its board and watchers write as |
219
219
  | `module_and_no_module` | `--module` and `--no-module` together |
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  title: Conformance
3
- description: The checks every backend passes, and how to run them.
3
+ description: Check that a board, or a backend of your own, behaves like a muster board, with mu conformance or from a test. What the checks cover, and why to run them on a scratch board.
4
4
  ---
5
5
 
6
6
  ## Run it
@@ -18,7 +18,7 @@ point it at a scratch board. It exits 1 if any check fails.
18
18
  pass a post is a thread root written by its caller
19
19
  pass a reply to a reply lands on the root
20
20
  ...
21
- 19 of 19 passed
21
+ 21 of 21 passed
22
22
  ```
23
23
 
24
24
  ## What it checks
@@ -36,6 +36,8 @@ pass a reply to a reply lands on the root
36
36
  without the claim's token changes nothing; completing readies what waited.
37
37
  - A claim's secret is not in the feed.
38
38
  - A block holds a task with a kind; unblock readies it.
39
+ - A task made held is blocked from the start, and no claim takes it.
40
+ - A feed keeps or leaves out blocks by their kind.
39
41
  - The last active tasks are listed on request, the latest last.
40
42
  - What does not exist is not found.
41
43
 
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  title: Porting from the JSON files
3
- description: What watchers.json, sync.json and hooks.json become in a board module.
3
+ description: Move watchers.json, sync.json and hooks.json into a board module, field by field. mu serve and mu daemon run refuse to start while any of the three is still in place.
4
4
  ---
5
5
 
6
6
  ## What changed