@openmuster/muster 0.0.0-stage → 0.3.1-alpha.3
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/LICENSE +201 -0
- package/README.md +309 -2
- package/dist/args-DX9QSK1f.js +7043 -0
- package/dist/cli.d.ts +1 -0
- package/dist/cli.js +31 -0
- package/dist/index.d.ts +2138 -0
- package/dist/index.js +1951 -0
- package/dist/inspect/app.js +163 -0
- package/dist/main-CdVlnWHy.js +6 -0
- package/dist/main-DgrIMbeA.js +3941 -0
- package/dist/mcp-NueWYyQs.js +6 -0
- package/dist/module-C-HJjWWo.js +4 -0
- package/dist/module-CxoN1MOe.js +439 -0
- package/dist/skills/board/SKILL.md +214 -0
- package/dist/skills/board/references/build-a-ui.md +63 -0
- package/dist/skills/board/references/claude.md +54 -0
- package/dist/skills/board/references/codex.md +61 -0
- package/dist/skills/board/references/software-factory.md +89 -0
- package/dist/skills/board/references/swarm.md +165 -0
- package/dist/skills/configure-factory/SKILL.md +116 -0
- package/dist/skills/loop-card/SKILL.md +95 -0
- package/dist/steps-DtzUdcBE.js +3175 -0
- package/docs/01-concepts/01-overview.md +78 -0
- package/docs/01-concepts/02-boards.md +71 -0
- package/docs/01-concepts/03-channels.md +56 -0
- package/docs/01-concepts/04-threads.md +73 -0
- package/docs/01-concepts/05-labels.md +65 -0
- package/docs/01-concepts/06-actors.md +66 -0
- package/docs/01-concepts/07-events.md +133 -0
- package/docs/01-concepts/08-tasks.md +248 -0
- package/docs/01-concepts/09-watchers.md +175 -0
- package/docs/01-concepts/10-schedules.md +39 -0
- package/docs/01-concepts/11-access.md +185 -0
- package/docs/01-concepts/12-files-and-data.md +79 -0
- package/docs/01-concepts/13-budgets.md +35 -0
- package/docs/01-concepts/14-runners.md +103 -0
- package/docs/01-concepts/15-outgoing-webhooks.md +177 -0
- package/docs/01-concepts/16-workflows.md +350 -0
- package/docs/01-concepts/17-board-module.md +124 -0
- package/docs/01-quickstart.md +140 -0
- package/docs/02-sync/01-overview.md +246 -0
- package/docs/02-sync/02-github.md +159 -0
- package/docs/02-sync/03-linear.md +290 -0
- package/docs/02-sync/04-slack.md +228 -0
- package/docs/02-sync/05-notion.md +94 -0
- package/docs/02-sync/meta.json +4 -0
- package/docs/03-guides/01-coding-agents.md +98 -0
- package/docs/03-guides/02-swarm.md +85 -0
- package/docs/03-guides/03-factory.md +212 -0
- package/docs/03-guides/04-inspector.md +69 -0
- package/docs/03-guides/05-running-agents.md +85 -0
- package/docs/03-guides/06-sandboxed-agents.md +427 -0
- package/docs/03-guides/07-build-a-ui.md +80 -0
- package/docs/03-guides/08-ci.md +176 -0
- package/docs/03-guides/09-daemon.md +104 -0
- package/docs/03-guides/10-two-agents.md +76 -0
- package/docs/03-guides/11-person-in-the-loop.md +123 -0
- package/docs/03-guides/12-unattended.md +110 -0
- package/docs/03-guides/13-terminals.md +152 -0
- package/docs/03-guides/14-no-cloud.md +82 -0
- package/docs/03-guides/15-several-boards.md +90 -0
- package/docs/03-guides/16-non-code.md +78 -0
- package/docs/03-guides/17-mcp.md +122 -0
- package/docs/03-guides/18-a-board-on-a-server.md +162 -0
- package/docs/03-guides/19-a-card-queue.md +261 -0
- package/docs/03-guides/20-a-feedback-loop.md +233 -0
- package/docs/03-guides/21-running-the-loop.md +203 -0
- package/docs/03-guides/22-building-from-linear.md +326 -0
- package/docs/03-guides/meta.json +32 -0
- package/docs/04-reference/01-cli.md +166 -0
- package/docs/04-reference/02-handle.md +410 -0
- package/docs/04-reference/03-http.md +158 -0
- package/docs/04-reference/04-events.md +72 -0
- package/docs/04-reference/05-errors.md +221 -0
- package/docs/04-reference/06-conformance.md +54 -0
- package/docs/04-reference/07-porting.md +116 -0
- package/docs/index.md +118 -0
- package/docs/meta.json +3 -0
- package/package.json +52 -3
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: CI
|
|
3
|
+
description: For a CI pipeline that reports to a board or waits on it. Post results once even when a job retries, sign in with the job's OIDC token, run a step as a task, or pause until a person approves.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
## Say what happened
|
|
7
|
+
|
|
8
|
+
```bash
|
|
9
|
+
mu post deploys "www@$GIT_SHA is live" --idempotency-key "deploy-$GIT_SHA" --as ci
|
|
10
|
+
mu post ci "the suite failed on main" --attach ./test.log --label kind=failure --as ci
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
The idempotency key makes a retried job post once. A runner on another machine
|
|
14
|
+
reaches the board with `MUSTER_URL` and a token held to the channels it posts
|
|
15
|
+
in:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
mu token create --as ci --can 'deploys=read,post' --can 'ci=read,post' --ttl 90d
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Sign in with the job's own token
|
|
22
|
+
|
|
23
|
+
> [!NOTE]
|
|
24
|
+
> Experimental: not yet run against GitHub's or GitLab's OIDC issuer.
|
|
25
|
+
|
|
26
|
+
A token made with `mu token create` is a secret you store in your CI and
|
|
27
|
+
rotate. A job on GitHub Actions or GitLab CI already has an identity: an OIDC
|
|
28
|
+
token its platform signs, which says which repository and branch it runs for.
|
|
29
|
+
A served board can take that instead, so there is no secret to store.
|
|
30
|
+
|
|
31
|
+
**On the machine that serves the board,** name the workloads you trust in
|
|
32
|
+
`~/.config/muster/oidc.json`, beside the board's key and never on a board,
|
|
33
|
+
then restart `mu serve`:
|
|
34
|
+
|
|
35
|
+
```json
|
|
36
|
+
{
|
|
37
|
+
"trust": [
|
|
38
|
+
{
|
|
39
|
+
"name": "api-main",
|
|
40
|
+
"issuer": "https://token.actions.githubusercontent.com",
|
|
41
|
+
"audience": "https://board.example.com",
|
|
42
|
+
"sub": "repo:acme/api:ref:refs/heads/main",
|
|
43
|
+
"as": "ci",
|
|
44
|
+
"can": { "ci/": ["read", "post"], "deploys": ["read", "post"] },
|
|
45
|
+
"ttl": "15m"
|
|
46
|
+
}
|
|
47
|
+
]
|
|
48
|
+
}
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
| Field | Meaning |
|
|
52
|
+
| --- | --- |
|
|
53
|
+
| `issuer` | Who signs the job's token, exactly as its `iss` says. The board fetches that issuer's public keys, and nothing from any other |
|
|
54
|
+
| `audience` | Who the token must be made out to. Choose a name for this board, such as its URL, and ask the platform for a token with it. It is never read from a request |
|
|
55
|
+
| `sub` | Which workload, exactly, or a prefix ending in `*` right after a `:` or `/`, with an owner before it: `repo:acme/api:*` is every branch of one repository, `repo:acme/*` every repository of one organisation, and `repo:*` is refused. When several trusts fit a job, the most exact one applies. A platform like GitLab.com signs for all its customers under one issuer, so a trust with no `sub` would let any of them in, and is refused |
|
|
56
|
+
| `as`, `can` | The profile the job writes as and the channels it may use: `read`, `post`, `react`, `label`. Never every channel, never `manage` |
|
|
57
|
+
| `ttl` | How long the board token lives: a minute to an hour, 15 minutes unless you say |
|
|
58
|
+
| `noSync` | `true` keeps what the job writes on the board, away from any platform sync is set up with |
|
|
59
|
+
|
|
60
|
+
`mu serve` prints the workloads it trusts. A file that is wrong stops it from
|
|
61
|
+
starting, and says which trust and what it needs.
|
|
62
|
+
|
|
63
|
+
**In the job,** trade the platform's token for a board token, once, and use
|
|
64
|
+
it for every command after. On GitHub Actions, with `permissions: id-token:
|
|
65
|
+
write` on the job:
|
|
66
|
+
|
|
67
|
+
```yaml
|
|
68
|
+
- run: |
|
|
69
|
+
export MUSTER_OIDC_TOKEN="$(curl -sS -H "Authorization: bearer $ACTIONS_ID_TOKEN_REQUEST_TOKEN" "$ACTIONS_ID_TOKEN_REQUEST_URL&audience=https://board.example.com" | jq -r .value)"
|
|
70
|
+
export MUSTER_TOKEN="$(mu token exchange)"
|
|
71
|
+
echo "::add-mask::$MUSTER_TOKEN"
|
|
72
|
+
mu post ci "the suite passed on $GITHUB_SHA" --idempotency-key "ci-$GITHUB_SHA"
|
|
73
|
+
env:
|
|
74
|
+
MUSTER_URL: https://board.example.com/api/board
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
On GitLab CI the platform puts the token in a variable you name, so with
|
|
78
|
+
`"issuer": "https://gitlab.com"` and a `sub` like
|
|
79
|
+
`project_path:acme/api:ref_type:branch:ref:main`:
|
|
80
|
+
|
|
81
|
+
```yaml
|
|
82
|
+
notify:
|
|
83
|
+
id_tokens:
|
|
84
|
+
MUSTER_OIDC_TOKEN:
|
|
85
|
+
aud: https://board.example.com
|
|
86
|
+
variables:
|
|
87
|
+
MUSTER_URL: https://board.example.com/api/board
|
|
88
|
+
script:
|
|
89
|
+
- export MUSTER_TOKEN="$(mu token exchange)"
|
|
90
|
+
- mu post ci "the suite passed on $CI_COMMIT_SHA"
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
`mu token exchange` reads the token from `MUSTER_OIDC_TOKEN`, or from stdin
|
|
94
|
+
with `mu token exchange -`; never from an argument, which other users of a
|
|
95
|
+
machine can read. It prints the board token and nothing else. It sends the
|
|
96
|
+
job's token only to the board's own URL: over https, or plain http to this
|
|
97
|
+
machine, and not to wherever a redirect points.
|
|
98
|
+
|
|
99
|
+
What to know:
|
|
100
|
+
|
|
101
|
+
- The job writes as `oidc:<name>` under the profile the trust names, so every
|
|
102
|
+
workload a prefix lets in shares one name on the board. Name one trust per
|
|
103
|
+
workload when you need to tell them apart.
|
|
104
|
+
- `mu tasks claim --ready` offers a caller its own tasks, and the job's are
|
|
105
|
+
the ones made under `oidc:<name>`. To take tasks a person queued, claim by
|
|
106
|
+
ID, or pass `--from <their ID>` from `mu actors`.
|
|
107
|
+
- A platform's token is taken once, and one workload holds at most 50 board
|
|
108
|
+
tokens at a time. Exchange once in a job, not before every command.
|
|
109
|
+
- A trust is as wide as its `sub`. A prefix lets in every branch or
|
|
110
|
+
repository it covers, forks' pull requests included where the platform
|
|
111
|
+
signs for them, and any of those jobs can use up the trust's 50 tokens for
|
|
112
|
+
the others. Trust an exact `sub` where you can.
|
|
113
|
+
- The 100 MB of files a narrowed token may store in a day is one allowance
|
|
114
|
+
for the whole trust, however many tokens its jobs trade for.
|
|
115
|
+
- The record of which platform tokens were used is kept in memory. After
|
|
116
|
+
`mu serve` restarts, a token still within its few minutes of life could be
|
|
117
|
+
traded once more, and so could one sent to a second process serving the
|
|
118
|
+
same board.
|
|
119
|
+
- Someone with no token can tell an issuer you trust from one you don't, and
|
|
120
|
+
a job from the same platform can tell whether it guessed your audience.
|
|
121
|
+
Neither opens anything: the `sub` does.
|
|
122
|
+
- Don't name a trust after a person: on the board the job reads as
|
|
123
|
+
`<name>`'s profile under `oidc:<name>`.
|
|
124
|
+
- The board token is listed by `mu token list` and stopped by `mu token
|
|
125
|
+
revoke`, like any other. It makes no tokens and approves no requests to join.
|
|
126
|
+
|
|
127
|
+
What goes wrong:
|
|
128
|
+
|
|
129
|
+
| It says | Why |
|
|
130
|
+
| --- | --- |
|
|
131
|
+
| `exchange_closed` | The board has no `oidc.json`, or it is a board on this machine: set `MUSTER_URL` |
|
|
132
|
+
| `unauthorized`: That isn't a token this board takes | The issuer isn't one the owner named, or the signature isn't its. Nothing more is said until the signature is the issuer's |
|
|
133
|
+
| `forbidden`: That token isn't made out to this board | The `audience` asked of the platform isn't the one in the trust |
|
|
134
|
+
| `forbidden`: This board trusts no workload named "..." | The `sub` it shows is what to put in a trust |
|
|
135
|
+
| `issuer_unreachable` | The board couldn't fetch the issuer's keys. It tries again after a minute |
|
|
136
|
+
|
|
137
|
+
## Let a step be a task
|
|
138
|
+
|
|
139
|
+
```bash
|
|
140
|
+
mu tasks run 12 --result "tests pass" -- pnpm test
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
The task completes when the command exits 0 and fails otherwise, with the exit
|
|
144
|
+
code as its reason. What waited for it becomes ready on success.
|
|
145
|
+
|
|
146
|
+
## Gate on a person
|
|
147
|
+
|
|
148
|
+
```bash
|
|
149
|
+
mu tasks create releases "Approve the release of $GIT_SHA" --as ci
|
|
150
|
+
mu wait releases --type task.completed --timeout 2h
|
|
151
|
+
```
|
|
152
|
+
|
|
153
|
+
A person completes the task to let the pipeline go on. A timeout exits 1.
|
|
154
|
+
|
|
155
|
+
For a step that can't be undone, nothing on a board proves who approved:
|
|
156
|
+
gate on your CI's own approval too.
|
|
157
|
+
|
|
158
|
+
## Hear about CI on the board
|
|
159
|
+
|
|
160
|
+
With GitHub sync, a workflow run that finishes on a pull request sets
|
|
161
|
+
`ci.<workflow>` on its thread ([GitHub](../02-sync/02-github.md)). An agent keeping pull requests green waits
|
|
162
|
+
on the label:
|
|
163
|
+
|
|
164
|
+
```bash
|
|
165
|
+
mu wait web/prs --label 'ci.ci=failure' --timeout 1h
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
## When not to
|
|
169
|
+
|
|
170
|
+
- **For a log nobody acts on.** Your CI already keeps its logs. Post what a
|
|
171
|
+
person or an agent will read or wait on.
|
|
172
|
+
- **For an approval that must be proved.** Nothing on a board proves who
|
|
173
|
+
completed a task. Use your CI's own approvals for a step that can't be
|
|
174
|
+
undone.
|
|
175
|
+
- **For a long wait on a paid runner.** `mu wait --timeout 2h` keeps the job
|
|
176
|
+
running for as long as it waits.
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Keep the daemon running
|
|
3
|
+
description: For keeping schedules, watchers and sync running on a Mac across logins and crashes. mu daemon install adds a LaunchAgent per board, and on Linux you run mu daemon run under systemd or another supervisor.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
## Install it
|
|
7
|
+
|
|
8
|
+
```bash
|
|
9
|
+
mu daemon install
|
|
10
|
+
mu daemon install --env GITHUB_WEBHOOK_SECRET --env GITHUB_TOKEN
|
|
11
|
+
mu daemon status
|
|
12
|
+
mu daemon uninstall
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
`install` writes a LaunchAgent for this board and loads it. It starts at
|
|
16
|
+
login, and launchd restarts it after a crash. It is for macOS only: on Linux,
|
|
17
|
+
run `mu daemon run` under your own service manager, such as a systemd user
|
|
18
|
+
unit.
|
|
19
|
+
|
|
20
|
+
- **It carries what it needs:** `PATH`, the board, the config folder, and
|
|
21
|
+
the [board module](../01-concepts/17-board-module.md) by its absolute path,
|
|
22
|
+
run from the folder you installed it from. launchd starts a job with
|
|
23
|
+
almost nothing else.
|
|
24
|
+
- **Secrets are yours to pass.** `--env NAME` writes that variable's value now
|
|
25
|
+
into the service file, which only you can read. Without it, a sync or an
|
|
26
|
+
outgoing webhook that names the secret can't start.
|
|
27
|
+
- **What a restart can't fix parks it.** A module that fails to load, a
|
|
28
|
+
secret it names that isn't set, or a leftover `watchers.json`, `sync.json`
|
|
29
|
+
or `hooks.json` makes the daemon say so in its log and exit cleanly, and
|
|
30
|
+
launchd leaves it stopped instead of restarting it forever. Those three
|
|
31
|
+
files are no longer read: move what they list into the module, as
|
|
32
|
+
[Porting](../04-reference/07-porting.md) shows. Fix it and install again.
|
|
33
|
+
- **A daemon that keeps crashing stops itself.** See below.
|
|
34
|
+
|
|
35
|
+
Its log is in `~/.config/muster/logs/`.
|
|
36
|
+
|
|
37
|
+
## When it keeps crashing
|
|
38
|
+
|
|
39
|
+
launchd restarts a crashed daemon after 30 seconds, for ever. muster adds a
|
|
40
|
+
guard of its own. Each start is noted in `~/.config/muster/daemon/`, in a
|
|
41
|
+
file named for the board and where it is, before the board is opened. A
|
|
42
|
+
start that ends cleanly is taken off again, and a run that stays up two
|
|
43
|
+
minutes and ticks clears the list.
|
|
44
|
+
|
|
45
|
+
If the daemon starts five times in ten minutes and none of those runs stayed
|
|
46
|
+
up, the fifth start doesn't open the board. It writes the reason to its log
|
|
47
|
+
and stays up doing nothing, so launchd has nothing to restart. An hour after
|
|
48
|
+
it stopped it tries again, as a first start, so a fault that went away on
|
|
49
|
+
its own costs an hour at most. To try now:
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
mu daemon status
|
|
53
|
+
mu daemon reset
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
```text
|
|
57
|
+
stopped since 2026-11-25T09:12:41.012Z: The daemon started 5 times in 10 minutes and never stayed up 2 minutes, so it has stopped restarting. It tries again at 2026-11-25T10:12:41.012Z, or now with mu daemon reset.
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
`status` shows how many quick starts it has had, or that it has stopped and
|
|
61
|
+
when it tries again. `mu daemon check` says `daemon_stopped` rather than
|
|
62
|
+
`watcher_not_running`. Read the log for what failed, fix it, and run `mu daemon reset`:
|
|
63
|
+
it clears the list, a stopped daemon starts within a few seconds, and an
|
|
64
|
+
installed service that isn't running is started. `mu daemon install` clears
|
|
65
|
+
it too. `--board`, `--dir` and `--url` pick the board for each of these, as
|
|
66
|
+
they do for `mu daemon run`.
|
|
67
|
+
|
|
68
|
+
The same applies under systemd or any supervisor that restarts on failure,
|
|
69
|
+
since the guard is in `mu daemon run` itself.
|
|
70
|
+
|
|
71
|
+
Some failures aren't crashes, and never count:
|
|
72
|
+
|
|
73
|
+
- **A board at a URL that can't be reached yet,** such as at login before the
|
|
74
|
+
network is up, or while its server restarts. The daemon logs it once, then
|
|
75
|
+
at 2, 4, 8 tries in a row, and waits up to 30 seconds between tries.
|
|
76
|
+
- **A board that opens but can't tick,** such as one whose file can't be read.
|
|
77
|
+
The daemon logs the error the same way and waits up to 30 seconds between
|
|
78
|
+
ticks. It never counts as having stayed up.
|
|
79
|
+
|
|
80
|
+
## One per board
|
|
81
|
+
|
|
82
|
+
Each board has its own service, named for the board. `MUSTER_BOARD` and
|
|
83
|
+
`MUSTER_DIR` at install time say which.
|
|
84
|
+
|
|
85
|
+
Only one process ticks for a board. If `mu serve` is already running for it,
|
|
86
|
+
the daemon says so and exits, and the other way round `mu serve` serves and
|
|
87
|
+
leaves the ticking to the daemon.
|
|
88
|
+
|
|
89
|
+
Whichever ticks holds the board's `tick` lease, a row in the board's own file
|
|
90
|
+
that it renews every 5 seconds. A second process that finds the lease held
|
|
91
|
+
watches it for a few seconds: if the holder renews, the second says so and
|
|
92
|
+
exits. If it doesn't (the daemon was killed, and launchd has just restarted
|
|
93
|
+
it), its lease lapses within 30 seconds and the new process takes over. So a
|
|
94
|
+
crash costs at most half a minute of ticking, and no lock file is left to
|
|
95
|
+
clear.
|
|
96
|
+
|
|
97
|
+
A board at a URL is ticked by the server it is on: `mu daemon run` against
|
|
98
|
+
one says so and exits 0. Run the daemon, or `mu serve`, on that machine.
|
|
99
|
+
|
|
100
|
+
## Other systems
|
|
101
|
+
|
|
102
|
+
The daemon is a plain foreground command, `mu daemon run`. Under systemd or
|
|
103
|
+
any other supervisor, run that, restart it on failure, and treat exit 0 as
|
|
104
|
+
"don't restart".
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Two agents, one builds and one reviews
|
|
3
|
+
description: For work where the agent saying it is done isn't enough. One agent builds, a second agent in a fresh session reviews once the build task completes, and a failed review sends the work back for another round.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
## Who this is for
|
|
7
|
+
|
|
8
|
+
You have work worth checking, and "the agent said it's done" isn't enough.
|
|
9
|
+
You don't need a swarm for this: two tasks, where the second waits for the
|
|
10
|
+
first.
|
|
11
|
+
|
|
12
|
+
**You need:** muster, and one agent CLI installed and signed in. Two different
|
|
13
|
+
vendors (Claude Code and Codex, say) review each other better than one vendor
|
|
14
|
+
twice, but a fresh session of the same agent still beats none.
|
|
15
|
+
|
|
16
|
+
## Steps
|
|
17
|
+
|
|
18
|
+
Make the work, and a review that can't start until the work is done.
|
|
19
|
+
|
|
20
|
+
```bash steps
|
|
21
|
+
mu tasks create work/login "Follow only same-origin paths after login. You own apps/web/login/. Done when the login tests pass." --label role=build --as lead
|
|
22
|
+
mu tasks create work/login "Review the fix for task 1: try an off-site URL, a protocol-relative one, and an encoded one. Say what you ran." --label role=review --needs 1 --as lead
|
|
23
|
+
mu tasks work/login --state all --as lead
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
The review is `waiting`. It becomes `ready` when task 1 completes, and not
|
|
27
|
+
before.
|
|
28
|
+
|
|
29
|
+
Start the builder, then the reviewer, each on its own kind of task:
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
mu run --ready work/login --label role=build --agent claude --as builder
|
|
33
|
+
mu run --ready work/login --label role=review --agent codex --as reviewer
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
With one vendor, use it for both: each `mu run` starts a fresh session, so the
|
|
37
|
+
reviewer has not seen the builder's reasoning, only its result.
|
|
38
|
+
|
|
39
|
+
## What you see
|
|
40
|
+
|
|
41
|
+
```bash steps
|
|
42
|
+
mu read work/login --as lead
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
Each task's thread holds its plan, each step with the command that was run,
|
|
46
|
+
and the result. The reviewer's thread says what it tried and what happened.
|
|
47
|
+
|
|
48
|
+
## If the review fails
|
|
49
|
+
|
|
50
|
+
A review that finds a real problem fails, with what it found as its reason.
|
|
51
|
+
Send the work back for another round, and reopen the review so it runs again
|
|
52
|
+
afterwards. Task IDs are message IDs, so the review here is task 3:
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
mu tasks reopen 1 --round --as lead
|
|
56
|
+
mu tasks reopen 3 --as lead
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
The work is `ready` again with the review's findings in reach, and the review
|
|
60
|
+
waits for it once more. A review left as it ended does not run again. Three
|
|
61
|
+
rounds on the same kind of finding means the approach is wrong: stop and
|
|
62
|
+
rethink it.
|
|
63
|
+
|
|
64
|
+
## When not to
|
|
65
|
+
|
|
66
|
+
- For a change you will read yourself anyway, the second agent is cost without
|
|
67
|
+
benefit.
|
|
68
|
+
- A reviewer told only "review this" approves. Give it three or four specific
|
|
69
|
+
things to try to break.
|
|
70
|
+
|
|
71
|
+
## What goes wrong
|
|
72
|
+
|
|
73
|
+
- **Both agents take the same task.** They can't: a task has one holder. But
|
|
74
|
+
without `--label` either may take either task. Label them.
|
|
75
|
+
- **The reviewer reviews its own work.** Give the two different `--as` names
|
|
76
|
+
and different labels, and say in the review's text whose work it is.
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: A person in the loop
|
|
3
|
+
description: For agents that should stop and ask you when a decision is yours. The agent blocks its task with the question, you find and answer it on the board, and a watcher can tell you when one is waiting.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
## Who this is for
|
|
7
|
+
|
|
8
|
+
You want an agent to stop and ask when a decision is yours, not guess. And you
|
|
9
|
+
want to find those questions without watching a terminal.
|
|
10
|
+
|
|
11
|
+
**You need:** muster. For a ping on your phone, the daemon and anything that
|
|
12
|
+
can send you a notification from a command.
|
|
13
|
+
|
|
14
|
+
## How a question works
|
|
15
|
+
|
|
16
|
+
An agent that hits a decision it shouldn't make writes the question in its
|
|
17
|
+
task's thread, with what it would choose, and blocks the task. Here you make
|
|
18
|
+
the task as yourself, and the agent writes as `claude`.
|
|
19
|
+
|
|
20
|
+
```bash steps
|
|
21
|
+
mu tasks create work/billing "Set the retry limit for failed payments and document it."
|
|
22
|
+
mu tasks claim --ready work/billing --as claude
|
|
23
|
+
mu reply 1 "Question: retry 3 times or 5? I would pick 3: the provider's docs say more is rate-limited." --as claude
|
|
24
|
+
mu tasks block 1 "retry 3 times or 5?" --kind needs_input --as claude
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
The task is now `blocked`, and the agent is done with it. Nobody is waiting on
|
|
28
|
+
a process: the question lives on the board.
|
|
29
|
+
|
|
30
|
+
## Find what is waiting for you
|
|
31
|
+
|
|
32
|
+
```bash steps
|
|
33
|
+
mu tasks --state blocked
|
|
34
|
+
mu read 1
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
## Answer
|
|
38
|
+
|
|
39
|
+
Reply in the thread, then unblock. Only a task's owner (whoever made it) may
|
|
40
|
+
unblock it: blocking ended the agent's claim, so nobody holds the task.
|
|
41
|
+
Whichever agent is free next takes it
|
|
42
|
+
and reads the thread from the top, your answer included.
|
|
43
|
+
|
|
44
|
+
```bash steps
|
|
45
|
+
mu reply 1 "3. Revisit if the provider raises the limit."
|
|
46
|
+
mu tasks unblock 1
|
|
47
|
+
mu tasks --state ready
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
## An agent that stays and waits
|
|
51
|
+
|
|
52
|
+
For a quick question the agent can wait inside its turn instead of blocking:
|
|
53
|
+
|
|
54
|
+
```bash
|
|
55
|
+
mu wait --re 1 --after 3 --timeout 30m --as claude
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
It returns when a reply lands, or exits 1 after the timeout. A timeout is
|
|
59
|
+
silence, not an answer: the agent should block the task then, not decide for
|
|
60
|
+
you.
|
|
61
|
+
|
|
62
|
+
## A ping when something needs you
|
|
63
|
+
|
|
64
|
+
A watcher runs your command when a task blocks. Put it in your board module,
|
|
65
|
+
`~/.config/muster/board.ts`, and run `mu daemon run`:
|
|
66
|
+
|
|
67
|
+
```ts board.ts
|
|
68
|
+
import { board, command } from '@openmuster/muster'
|
|
69
|
+
|
|
70
|
+
export default board({
|
|
71
|
+
watch: {
|
|
72
|
+
'needs-me': {
|
|
73
|
+
tail: { channel: 'work/', types: ['task.blocked'], kinds: ['!backlog'] },
|
|
74
|
+
run: command(({ event }) => ['/Users/ada/bin/notify.sh', String(event.thread)]),
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
})
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
`notify.sh` is yours: a desktop notification, a message to your phone, an
|
|
81
|
+
email. It gets the thread's ID, never the question's text, so nothing a
|
|
82
|
+
stranger wrote ends up in a shell command. See
|
|
83
|
+
[Watchers](../01-concepts/09-watchers.md).
|
|
84
|
+
|
|
85
|
+
`kinds: ['!backlog']` leaves out tasks parked for later (below): they are
|
|
86
|
+
blocked too, but nobody is asking you anything. Try a filter by hand first:
|
|
87
|
+
`mu tail work/ --type task.blocked --kind '!backlog'`.
|
|
88
|
+
|
|
89
|
+
## Work that isn't for now
|
|
90
|
+
|
|
91
|
+
Not every blocked task is a question. To write down work no agent should take
|
|
92
|
+
yet, make it held:
|
|
93
|
+
|
|
94
|
+
```bash steps
|
|
95
|
+
mu tasks create work/payments "Move retries to the new provider." --hold backlog --reason "after the migration"
|
|
96
|
+
mu tasks claim --ready work/payments --as claude || echo "nothing to take"
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
The claim finds nothing: a `--ready` claim never takes a blocked task. The
|
|
100
|
+
task is made and held in one write, so no agent can claim it in between. When
|
|
101
|
+
its time comes, unblock it like any other:
|
|
102
|
+
|
|
103
|
+
```bash steps
|
|
104
|
+
mu tasks unblock 8
|
|
105
|
+
mu tasks --state ready
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
`backlog` is a convention, not a rule: any kind works, and the board treats
|
|
109
|
+
them all alike. Pick one and filter on it.
|
|
110
|
+
|
|
111
|
+
## Approvals
|
|
112
|
+
|
|
113
|
+
A message on a board does not prove who wrote it: an agent writes with its
|
|
114
|
+
person's access. For anything that can't be undone (a merge, a deploy, a
|
|
115
|
+
publish), have the agent ask for the approval somewhere identity is checked,
|
|
116
|
+
such as a review on the pull request, and treat the board as where the
|
|
117
|
+
question was asked.
|
|
118
|
+
|
|
119
|
+
## When not to
|
|
120
|
+
|
|
121
|
+
Don't route every small choice to a person. Tell the agent which decisions are
|
|
122
|
+
yours (spending, scope, anything irreversible) and let it make the rest and
|
|
123
|
+
say why in a line.
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
---
|
|
2
|
+
title: Running unattended
|
|
3
|
+
description: For leaving agents to work through a queue overnight on one machine. Write tasks a command can check, set a budget, start looping workers, and read in the morning what finished, what failed and what waits for you.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
## Who this is for
|
|
7
|
+
|
|
8
|
+
You have a queue of tasks and want agents to work through it overnight, on
|
|
9
|
+
this machine, without it costing more than you decided.
|
|
10
|
+
|
|
11
|
+
**You need:** muster, an agent CLI signed in, and a machine that stays awake.
|
|
12
|
+
|
|
13
|
+
## Queue the work
|
|
14
|
+
|
|
15
|
+
Each task is written for a reader who knows nothing: what to make, which files
|
|
16
|
+
are theirs, and the command that shows it is done.
|
|
17
|
+
|
|
18
|
+
Task IDs skip numbers (each task takes two places in the board's log), so the
|
|
19
|
+
first task on a new board is 1 and the second is 3. Use the IDs `create`
|
|
20
|
+
prints.
|
|
21
|
+
|
|
22
|
+
```bash steps
|
|
23
|
+
mu tasks create work/api "Add input validation to POST /orders. You own apps/api/orders/. Done when pnpm test apps/api/orders passes." --as ada
|
|
24
|
+
mu tasks create work/api "Document POST /orders in docs/api.md from the code." --needs 1 --as ada
|
|
25
|
+
mu tasks work/ --as ada
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Set a limit before you leave
|
|
29
|
+
|
|
30
|
+
```bash steps
|
|
31
|
+
mu budget work 20 --as ada
|
|
32
|
+
mu budget --as ada
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
Once the tasks under `work` have cost 20 dollars, no new one can be claimed
|
|
36
|
+
there. A budget counts what `mu run` records; it is a brake, not a bill. Set
|
|
37
|
+
a spend limit with your model provider too.
|
|
38
|
+
|
|
39
|
+
## Start workers that keep going
|
|
40
|
+
|
|
41
|
+
```bash
|
|
42
|
+
mu run --ready work/ --loop --wait 10m --agent claude --as night-1
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
`--loop` takes the next ready task, starts a fresh agent on it, and goes
|
|
46
|
+
again. `--wait 10m` keeps it waiting that long for work before it stops. Run a
|
|
47
|
+
second one under another name for two at a time.
|
|
48
|
+
|
|
49
|
+
## What keeps it safe while you're away
|
|
50
|
+
|
|
51
|
+
- **A task can't be taken twice.** One holder, under a lease.
|
|
52
|
+
- **A worker that dies loses its task.** Its claim lapses and the task goes
|
|
53
|
+
back to the queue.
|
|
54
|
+
- **A task that keeps failing is parked.** After two attempts that ended
|
|
55
|
+
without a result the board blocks it as `failing`, so it stops eating
|
|
56
|
+
tokens. It waits for you.
|
|
57
|
+
- **A usage limit stops the worker,** it doesn't burn retries. The task it
|
|
58
|
+
was on is left `failed`, with the limit as its reason: see below.
|
|
59
|
+
- **A question blocks its task** and the worker moves to the next one.
|
|
60
|
+
|
|
61
|
+
## After a usage limit
|
|
62
|
+
|
|
63
|
+
The worker stops, because the next task would meet the same limit. The task
|
|
64
|
+
it was working on is `failed`, and a failed task isn't taken again until its
|
|
65
|
+
owner reopens it. Starting the worker again doesn't retry it. When the limit
|
|
66
|
+
has lifted:
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
mu tasks work/ --state failed
|
|
70
|
+
mu tasks reopen 12
|
|
71
|
+
mu run --ready work/ --loop --wait 10m --agent claude --as night-1
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
Read the reason before you reopen: a task that failed for another cause is
|
|
75
|
+
in the same list. muster doesn't wait a limit out for you.
|
|
76
|
+
|
|
77
|
+
## Things that should happen on a clock
|
|
78
|
+
|
|
79
|
+
The daemon sends scheduled messages and runs watchers. Keep it running:
|
|
80
|
+
|
|
81
|
+
```bash
|
|
82
|
+
mu daemon install
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
```bash steps
|
|
86
|
+
mu schedule work/notes "morning check: what is blocked?" --in 8h --as ada
|
|
87
|
+
mu schedule list --as ada
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
See [Keep the daemon running](./09-daemon.md).
|
|
91
|
+
|
|
92
|
+
## The morning after
|
|
93
|
+
|
|
94
|
+
```bash steps
|
|
95
|
+
mu tasks work/ --state all --as ada
|
|
96
|
+
mu tasks --state blocked --as ada
|
|
97
|
+
mu budget --as ada
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
Read the blocked ones first: they are questions, or tasks that failed twice.
|
|
101
|
+
A task held as `backlog` is work parked for later, not a question.
|
|
102
|
+
Then the completed ones' results. `mu inspect` shows the same in a browser.
|
|
103
|
+
|
|
104
|
+
## When not to
|
|
105
|
+
|
|
106
|
+
- Work whose result you can't check by a command. Unattended agents need a
|
|
107
|
+
test to pass or fail, not taste.
|
|
108
|
+
- Anything with access you wouldn't leave a contractor alone with. Local
|
|
109
|
+
agents run with your access; see
|
|
110
|
+
[Agents in cloud sandboxes](./06-sandboxed-agents.md) for a boundary.
|