@mu-crew/mu 3.2.0 → 3.3.0

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 (71) hide show
  1. package/AGENTS.md +208 -599
  2. package/README.md +125 -329
  3. package/dist/cli.js +108 -78
  4. package/dist/cli.js.map +1 -1
  5. package/dist/extension/mu-pi.js +421 -56
  6. package/dist/extension/mu-pi.js.map +1 -1
  7. package/dist/index.d.ts +36 -10
  8. package/dist/index.js +89 -67
  9. package/dist/index.js.map +1 -1
  10. package/docs/ARCHITECTURE.md +176 -1072
  11. package/docs/ROADMAP.md +88 -169
  12. package/docs/VISION.md +205 -415
  13. package/docs/VOCABULARY.md +204 -466
  14. package/docs/architecture/control-socket.md +133 -0
  15. package/docs/architecture/dag.md +113 -0
  16. package/docs/architecture/mux.md +162 -0
  17. package/docs/architecture/ops-log.md +140 -0
  18. package/docs/architecture/sdk.md +185 -0
  19. package/docs/architecture/sync.md +129 -0
  20. package/docs/architecture/tui.md +146 -0
  21. package/docs/guide/README.md +30 -0
  22. package/docs/guide/backends.md +61 -0
  23. package/docs/guide/cleanup.md +74 -0
  24. package/docs/guide/delegate.md +87 -0
  25. package/docs/guide/dispatch.md +144 -0
  26. package/docs/guide/getting-started.md +180 -0
  27. package/docs/guide/recovery.md +135 -0
  28. package/docs/guide/remote.md +74 -0
  29. package/docs/guide/sql.md +76 -0
  30. package/docs/guide/stop-a-worker.md +64 -0
  31. package/docs/guide/sync.md +78 -0
  32. package/docs/guide/tui.md +98 -0
  33. package/docs/guide/upgrade.md +76 -0
  34. package/docs/history/CHANGELOG-pre-3.md +4866 -0
  35. package/docs/reference/env.md +87 -0
  36. package/docs/reference/naming.md +82 -0
  37. package/docs/specs/2026-09-28-agent-state-from-murmur.md +1 -1
  38. package/docs/specs/2026-09-29-task-substates.md +1 -1
  39. package/docs/specs/2026-10-03-keep-driving-nudge.md +142 -0
  40. package/package.json +2 -1
  41. package/prompts/mu-refute.md +8 -0
  42. package/prompts/mu-research.md +8 -0
  43. package/prompts/mu-review.md +8 -0
  44. package/prompts/mu-rules-audit.md +8 -0
  45. package/prompts/mu-tournament.md +9 -0
  46. package/prompts/ultrathink.md +9 -0
  47. package/skills/mu/SKILL.md +126 -255
  48. package/skills/mu/recipes/adversarial-review.md +83 -0
  49. package/skills/mu/recipes/brief.md +53 -0
  50. package/skills/mu/recipes/codemode-driver.md +54 -0
  51. package/skills/mu/recipes/deep-research.md +52 -0
  52. package/skills/mu/recipes/fan-out.md +36 -0
  53. package/skills/mu/recipes/hypothesis-panel.md +40 -0
  54. package/skills/mu/recipes/long-run.md +20 -0
  55. package/skills/mu/recipes/loop-until-done.md +38 -0
  56. package/skills/mu/recipes/orchestrator-loop.md +87 -0
  57. package/skills/mu/recipes/plan.md +54 -0
  58. package/skills/mu/recipes/recovery.md +26 -0
  59. package/skills/mu/recipes/refute.md +49 -0
  60. package/skills/mu/recipes/remote-workers.md +292 -0
  61. package/skills/mu/recipes/review-panel.md +57 -0
  62. package/skills/mu/recipes/rules-audit.md +70 -0
  63. package/skills/mu/recipes/tournament.md +37 -0
  64. package/skills/mu/recipes/triage.md +38 -0
  65. package/skills/mu/recipes/ultrathink.md +73 -0
  66. package/skills/mu/recipes/watcher.md +16 -0
  67. package/skills/mu/recipes/waves.md +19 -0
  68. package/skills/mu/recipes/worker.md +24 -0
  69. package/docs/HANDOVER.md +0 -486
  70. package/docs/USAGE_GUIDE.md +0 -2738
  71. package/skills/mu/REMOTE_WORKERS.md +0 -617
@@ -0,0 +1,64 @@
1
+ # How to stop a worker
2
+
3
+ Use the gentlest step that works, in this order: abort, kick, close.
4
+
5
+ ## Abort the turn (pi agents)
6
+
7
+ ```bash
8
+ mu agent abort worker-1 -w auth
9
+ ```
10
+
11
+ `mu agent abort` does what Esc does in the pane, through the control
12
+ socket, and waits for pi to settle. It kills the running tool and
13
+ keeps the session and its context. It works for remote agents too.
14
+
15
+ - An idle agent is left alone (exit 0).
16
+ - Exit 5 means pi was still busy after `--timeout` (default 30 s).
17
+ Go to the next step.
18
+ - A follow-up queued before the abort does not run. pi puts it back
19
+ into the pane's editor, unsent. Send it again if you still want it.
20
+
21
+ To give the agent new work after the abort, send with `--fresh`. See
22
+ [Dispatch work to a worker](dispatch.md#pick-the-send-mode).
23
+
24
+ ## Kick the foreground process
25
+
26
+ Use `mu agent kick` when abort failed, when the agent is not pi, or
27
+ when pi's socket is gone:
28
+
29
+ ```bash
30
+ mu agent kick worker-1 -w auth # SIGINT
31
+ mu agent kick worker-1 -w auth --signal SIGTERM
32
+ mu agent kick worker-1 -w auth --signal SIGKILL
33
+ ```
34
+
35
+ mu finds the foreground process group on the pane's TTY and signals
36
+ it. This is the fix for a worker stuck on an unbounded `find /` or a
37
+ busy-wait loop. Typing Ctrl-C into the pane does not work, because
38
+ the agent CLI catches it as input.
39
+
40
+ - Kick refuses with `NoForegroundProcessError` when the foreground
41
+ process is the agent CLI itself. Close the agent instead.
42
+ - Kick works on local panes only. On herdr it works on Linux only.
43
+
44
+ To prevent the problem, scope worker prompts to the workspace. Do not
45
+ ask for filesystem-wide `find` or `grep -r /`.
46
+
47
+ ## Close the agent
48
+
49
+ ```bash
50
+ mu agent close worker-1 -w auth
51
+ ```
52
+
53
+ Close kills the pane and deletes the agent row. A clean workspace is
54
+ freed with it. If the workspace has edits or commits, close refuses
55
+ with exit 4. Then do one of these:
56
+
57
+ - Run `mu workspace free worker-1 -w auth --commit` to commit pending
58
+ changes and free the workspace, then close.
59
+ - Run `mu agent close worker-1 -w auth --discard-workspace` to free
60
+ and close in one step. You lose the changes.
61
+
62
+ If the worker owned a task, its pane is gone, so the reaper returns
63
+ the task to `OPEN` on the next reconcile. A `mu task wait` on that task
64
+ exits 6.
@@ -0,0 +1,78 @@
1
+ # How to sync between machines
2
+
3
+ Set one environment variable to the same folder on every machine:
4
+
5
+ ```bash
6
+ export MU_SYNC_DIR=$HOME/Sync/mu
7
+ ```
8
+
9
+ Every `mu` command then writes your ops to
10
+ `$MU_SYNC_DIR/<machine_id>.jsonl` and reads every other `.jsonl` file
11
+ in the folder. There is no export, import, or peer list. A new machine
12
+ appears when its file does.
13
+
14
+ ```bash
15
+ # laptop
16
+ mu task add auth_fix -w app -t "Fix the auth redirect" -i 80 -e 2
17
+ # devserver, after the folder syncs
18
+ mu task close auth_fix -w app --evidence "shipped in #412"
19
+ ```
20
+
21
+ ## Keep the DB out of the sync folder
22
+
23
+ Never put `MU_DB_PATH` inside `MU_SYNC_DIR`. A live SQLite DB is three
24
+ files (`mu.db`, `-wal`, `-shm`). A file syncer copies them out of
25
+ order and can bring back a stale `-wal`, which corrupts the DB with no
26
+ error. `mu doctor` fails the `db-vs-sync` row when you do this.
27
+
28
+ Also keep the DB off NFS, SMB, and sshfs. `mu doctor` warns in the
29
+ `db-filesystem` row.
30
+
31
+ ## Move the files
32
+
33
+ mu never runs ssh, scp, or rsync. Segments are append-only and each
34
+ file has one writer, so any file mover works:
35
+
36
+ | Mover | How |
37
+ | ----- | --- |
38
+ | Syncthing (recommended) | share `$MU_SYNC_DIR` on every machine |
39
+ | rsync | `rsync -av host:$MU_SYNC_DIR/ $MU_SYNC_DIR/`, in both directions |
40
+ | sshfs or NFS | point `MU_SYNC_DIR` at the mounted folder |
41
+ | scp or a USB stick | copy the `.jsonl` files whenever you like |
42
+
43
+ Copying is safe in any direction and any number of times. An
44
+ interrupted copy leaves a cut last line that mu skips until the next
45
+ copy completes it.
46
+
47
+ On macOS, do not use iCloud Drive, Dropbox, Google Drive File Stream,
48
+ or OneDrive Files On-Demand. They replace idle files with network
49
+ stubs, and mu reads the folder on every command, so commands hang.
50
+
51
+ ## Check peers
52
+
53
+ ```bash
54
+ mu sync
55
+ ```
56
+
57
+ The table lists each peer by `machine_id` prefix, when you last saw
58
+ it, and `behind`: lines you hold but have not applied. A non-zero
59
+ `behind` is either a copy in flight or a cut file.
60
+
61
+ ```bash
62
+ mu sync --repair c8ec # re-read a peer's file from the start
63
+ mu sync --from /mnt/devserver/.local/state/mu/mu.db # read a peer's DB directly
64
+ MU_SYNC_DIR=/media/usb-stick mu state # one-off folder
65
+ ```
66
+
67
+ Ingest is idempotent, so `--repair` is safe at any time.
68
+
69
+ ## Know what travels
70
+
71
+ Workstreams, tasks, edges, and notes travel. Agents and workspaces
72
+ stay on their machine, because a pane id and a local path mean nothing
73
+ elsewhere. So task ownership does not sync: a task claimed on the
74
+ devserver shows no owner on your laptop.
75
+
76
+ Merges are per field. If the laptop changes a task's impact while the
77
+ devserver closes it, both changes survive. If both machines change the
78
+ same field, the later hybrid logical clock (HLC) wins with no warning.
@@ -0,0 +1,98 @@
1
+ # How to use the TUI dashboard
2
+
3
+ The dashboard is read-only. To change anything, press `y` on a row to
4
+ copy its `mu` command, then run it in your shell.
5
+
6
+ ## Open it
7
+
8
+ ```bash
9
+ mu # every workstream, as tabs
10
+ mu state --tui -w a,b # only these workstreams
11
+ MU_NO_TUI=1 mu # print help instead
12
+ ```
13
+
14
+ Bare `mu` opens the dashboard only when stdout is a terminal. Scripts
15
+ get help text. For a static card or JSON, use `mu state` and
16
+ `mu state --json`. Quit with `q` or `Ctrl-C`.
17
+
18
+ The first active tab is the first match of: `$MU_SESSION`, the current
19
+ `mu-<ws>` tmux session, a workspace that contains the current
20
+ directory, a project root that contains it, then the first tab.
21
+
22
+ ## Read the cards
23
+
24
+ | Key | Card | Shows |
25
+ | --- | ---- | ----- |
26
+ | `0` | Commits | recent commits in the project root |
27
+ | `1` | Agents | agents with runtime state, CLI, and role |
28
+ | `2` | Tracks | parallel tracks of tasks |
29
+ | `3` | Ready | tasks with no open blockers |
30
+ | `4` | Activity log | recent ops as prose |
31
+ | `5` | Workspaces | per-agent workspaces, commits behind, dirty flag |
32
+ | `6` | In-progress | `IN_PROGRESS` tasks |
33
+ | `7` | Blocked | tasks with an open blocker |
34
+ | `8` | Recent | recently closed tasks |
35
+ | `9` | Doctor | quick health checks |
36
+ | `g` | DAG | the whole task graph (popup only) |
37
+ | `t` | All tasks | every task, sortable (popup only) |
38
+
39
+ A digit hides or shows its card. `Shift` plus the digit opens the
40
+ card as a popup. Only one popup is open at a time.
41
+
42
+ Cards reflow into 2, 3, or 4 columns at 120, 180, and 240 columns
43
+ wide. On a short terminal, low-priority cards drop out and the footer
44
+ says how many are hidden.
45
+
46
+ With two or more workstreams, a tab strip appears. `Tab` and
47
+ `Shift-Tab` switch tabs. A `*` marks `scratch`. A torn-down
48
+ workstream's tab stays, dimmed and struck through.
49
+
50
+ ## Drill into rows
51
+
52
+ `Enter` opens the focused row. On a task it opens the task's notes.
53
+ `Esc` or `q` goes back one level.
54
+
55
+ - Tracks: track, then its tasks, then a task's notes.
56
+ - Workspaces: workspace, then its commits, then `git show`.
57
+ - Commits: commit, then the backend's show view.
58
+ - Activity log: the full text of the entry.
59
+ - Doctor: the remediation text for the check.
60
+
61
+ In a `git show` view, `t` opens `tuicr -r <sha>`. In the Commits popup,
62
+ `l` opens lazygit. In the Agents popup, `a` attaches to the agent's
63
+ pane. The dashboard comes back when the tool exits.
64
+
65
+ ## Filter and sort
66
+
67
+ `/` filters the popup's rows by substring as you type. `Enter` keeps
68
+ the filter. `Esc` clears it.
69
+
70
+ In task popups, `o`, `i`, and `c` toggle `OPEN`, `IN_PROGRESS`, and
71
+ `CLOSED`. In the DAG and All-tasks popups, `p` toggles parked tasks and
72
+ `w` toggles tasks closed as anything but `done`. In All tasks, `b`
73
+ cycles the blocked filter and `s` cycles the sort: ROI, recency, age,
74
+ id.
75
+
76
+ ## Keys
77
+
78
+ | Where | Keys | Action |
79
+ | ----- | ---- | ------ |
80
+ | dashboard | `+` or `=`, `-` | refresh faster (100 ms floor), slower (10 s ceiling) |
81
+ | dashboard | `r` or `F5` | refresh now |
82
+ | dashboard | `c` | clear the footer |
83
+ | any | `?` | help overlay |
84
+ | popup | `j` `k` | move |
85
+ | popup | `g` `G` | top, bottom |
86
+ | popup | `Ctrl-D` `Ctrl-U`, `PgDn` `PgUp` | half page, full page |
87
+ | popup | `y` | copy the row's `mu` command |
88
+
89
+ The mouse works for navigation only. Double-click a card to open it,
90
+ double-click a row to drill in, and scroll inside lists. There is no
91
+ mouse binding for back.
92
+
93
+ ## Refresh
94
+
95
+ Task, track, and log data refreshes every second from SQLite. Agent
96
+ state, workspace dirty flags, commits, and doctor checks come from
97
+ subprocesses and refresh every 10 seconds. Switching tabs refreshes
98
+ the new tab at once.
@@ -0,0 +1,76 @@
1
+ # How to upgrade mu
2
+
3
+ ## Upgrade the package
4
+
5
+ ```bash
6
+ npm i -g @mu-crew/mu@latest
7
+ mu link pi
8
+ mu doctor
9
+ ```
10
+
11
+ `mu link pi` installs a one-line shim at
12
+ `~/.pi/agent/extensions/mu.ts` that loads the installed extension, and
13
+ links `~/.agents/skills/mu` to the package's skill. Later upgrades
14
+ update both with no relink. `MU_PI_HOME` changes the home directory
15
+ that both paths start from.
16
+
17
+ - `--copy` copies the extension instead of the shim. You then have to
18
+ relink after every upgrade.
19
+ - `--force` replaces a skill symlink that points elsewhere, such as a
20
+ dev checkout. mu never replaces a real directory there (exit 4).
21
+ - `--extension-only` and `--skill-only` install one part.
22
+
23
+ For agents other than pi, see [README § Install](../../README.md#install).
24
+
25
+ ## Reload running pi agents
26
+
27
+ A running pi keeps the extension it loaded at start. After an upgrade,
28
+ type `/reload` in each agent's pane, or respawn the agent. From a
29
+ shell:
30
+
31
+ ```bash
32
+ mu agent send worker-1 -w auth '/reload' --via mux
33
+ ```
34
+
35
+ Until then, the `ctl` row of `mu doctor` warns
36
+ `extension X older than installed Y`. Ops the old extension lacks,
37
+ such as `send --fresh`, fail with exit 4.
38
+
39
+ ## Upgrade from 3.1 or earlier
40
+
41
+ Before 3.2.0, mu pasted text into pi panes. Now it sends through a
42
+ control socket. Agents started before `mu link pi` have no socket, so
43
+ sends to them fail with `ctl missing` instead of pasting. Restart those
44
+ agents, or force the old path with `--via mux`.
45
+
46
+ ## Migrate an old DB
47
+
48
+ mu refuses a DB older than schema v11 with `SchemaTooOldError`, and a
49
+ newer one with `SchemaTooNewError`. Both exit 4 and leave the file
50
+ alone. `scripts/migrate.ts` converts a v7, v8, v9, or v10 DB into a new
51
+ v11 file. It never writes in place.
52
+
53
+ ```bash
54
+ DB=${MU_DB_PATH:-$HOME/.local/state/mu/mu.db}
55
+ BACKUP="$HOME/mu-old-backup-$(date +%Y%m%d-%H%M%S).db"
56
+ sqlite3 "$DB" ".backup '$BACKUP'"
57
+ npx tsx scripts/migrate.ts "$BACKUP" --out "${DB}.v11"
58
+ MU_DB_PATH="${DB}.v11" mu doctor --deep
59
+ mv "$DB" "${DB}.old-kept" && mv "${DB}.v11" "$DB"
60
+ mu doctor
61
+ ```
62
+
63
+ Legacy `REJECTED` tasks become `CLOSED/rejected`, and `DEFERRED` tasks
64
+ become `OPEN/parked`. Flags and the rules for what carries over are in
65
+ [scripts/README.md](../../scripts/README.md).
66
+
67
+ ## Run mu from a checkout
68
+
69
+ ```bash
70
+ npm install && npm run build
71
+ alias mu="node $PWD/dist/cli.js"
72
+ ```
73
+
74
+ Or run `npm install -g .` in the checkout. Its `prepare` script builds
75
+ first. Run `mu link pi --force` to point the skill link at the
76
+ checkout.