@martintrojer/mu 0.4.0 → 0.4.2

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/AGENTS.md CHANGED
@@ -14,7 +14,7 @@ write code. Follow the conventions below.
14
14
  1. **[docs/USAGE_GUIDE.md](docs/USAGE_GUIDE.md)** — what mu does
15
15
  from a user's perspective. ~10 minutes.
16
16
  2. **[CHANGELOG.md](CHANGELOG.md)** — the upcoming version's
17
- entry (currently `[0.4.0] — unreleased`). Single source of truth
17
+ entry (currently `[0.4.1] — 2026-05-14`). Single source of truth
18
18
  for the verb list, schema, env vars.
19
19
  3. **[docs/VISION.md](docs/VISION.md)** — the load-bearing pillars.
20
20
  The design principles you must not violate.
@@ -60,7 +60,7 @@ mu/
60
60
  ├── src/ # all source (root files: SDK + shared infra; one
61
61
  │ # level of subdirs OK for cohesive clusters — see
62
62
  │ # `src/cli/`, `src/agents/`, `src/tasks/` below)
63
- │ ├── db.ts # SQLite schema + openDb (single CREATE-IF-NOT-EXISTS block; v7)
63
+ │ ├── db.ts # SQLite schema + openDb (single CREATE-IF-NOT-EXISTS block; v8)
64
64
  │ ├── tmux.ts # tmux wrapper, send protocol, pane validation
65
65
  │ ├── detect.ts # pi status detector + Braille-spinner fallback for other CLIs
66
66
  │ ├── reconcile.ts # ghost prune + status detect + orphan surface
@@ -86,8 +86,9 @@ mu/
86
86
  │ ├── tracks.ts # parallel-tracks union-find with diamond merge
87
87
  │ ├── workstream.ts # ensureWorkstream / list / summarize / destroy / export
88
88
  │ ├── archives.ts # cross-workstream archive bucket SDK hub (re-exports src/archives/*)
89
- │ ├── exporting.ts # unified bucket renderer (workstream + archive export)
90
- │ ├── importing.ts # inverse of exporting.ts: parse a bucket dir live DB rows
89
+ │ ├── exporting.ts # unified bucket renderer (workstream + archive export; read-only buckets)
90
+ │ ├── db-sync.ts # whole-DB export/import + drift detection + sidecar park SDK
91
+ │ ├── db-sync-replay.ts # manual replay of divergence sidecars parked by db import --force-source
91
92
  │ ├── logs.ts # agent_logs SDK (append, list, latestSeq, emitEvent)
92
93
  │ ├── vcs.ts # VcsBackend hub (re-exports src/vcs/*: jj/sl/git/none impls)
93
94
  │ ├── workspace.ts # per-agent VCS workspaces hub (re-exports src/workspace/*)
@@ -113,7 +114,7 @@ mu/
113
114
  │ │ │ └── wire.ts # Commander glue
114
115
  │ │ ├── workspace.ts # workspace create / list / free / path / orphans / refresh / commits
115
116
  │ │ ├── log.ts # log read / write / tail
116
- │ │ ├── archive.ts # archive create / list / show / add / remove / delete
117
+ │ │ ├── archive.ts # archive create / list / show / add / restore / remove / delete
117
118
  │ │ ├── state.ts # `mu state` (canonical state card); --tui dispatches to src/cli/tui/
118
119
  │ │ ├── staleness.ts # shared workspace-staleness CLI helpers + warn formatter
119
120
  │ │ ├── tui-launch-focus.ts # initial-tab focus ladder for bare `mu` and `mu state --tui`
@@ -150,6 +151,7 @@ mu/
150
151
  │ │ │ # cursor-row.tsx, scroll.ts (applyCursor/applyScroll), viewport.ts,
151
152
  │ │ │ # show-loader.ts (shared subprocess-preserving loader)
152
153
  │ │ ├── snapshot.ts # undo / snapshot list / snapshot show
154
+ │ │ ├── db.ts # db export / import / replay
153
155
  │ │ ├── sql.ts # sql escape hatch
154
156
  │ │ ├── doctor.ts # doctor diagnostic
155
157
  │ │ ├── format.ts # pure rendering helpers (table renderers, status colourers, truncate/relTime)
@@ -377,21 +379,24 @@ real friction proves itself.
377
379
 
378
380
  ### "Update the schema"
379
381
 
380
- 1. Current schema version is **v7** (see `CURRENT_SCHEMA_VERSION`
382
+ 1. Current schema version is **v8** (see `CURRENT_SCHEMA_VERSION`
381
383
  in `src/db.ts`). The schema lives in `src/db.ts` as the
382
384
  `applySchema(db)` block, which is idempotent CREATE-IF-NOT-EXISTS
383
385
  plus targeted `DROP TABLE IF EXISTS` for retired tables
384
- (e.g. v7's `DROP TABLE IF EXISTS approvals`). `openDb` rejects
385
- pre-current DBs with `SchemaTooOldError` (exit 4) and a
386
- migration hint.
386
+ (e.g. v7's `DROP TABLE IF EXISTS approvals`). v8 is additive:
387
+ `machine_identity` and `workstream_sync` are
388
+ `CREATE TABLE IF NOT EXISTS`, and `openDb` seeds the single
389
+ `machine_identity` row on first open. `openDb` rejects pre-current
390
+ DBs with `SchemaTooOldError` (exit 4) and a migration hint.
387
391
  2. Bump `CURRENT_SCHEMA_VERSION` in `src/db.ts` and mirror the new
388
- shape in `CURRENT_SCHEMA`. Two of the last three bumps were
392
+ shape in `CURRENT_SCHEMA`. Three of the last four bumps were
389
393
  script-free: v5 → v6 was purely additive (existing
390
394
  CREATE-TABLE-IF-NOT-EXISTS picked up new tables); v6 → v7 was a
391
- destructive-but-idempotent `DROP TABLE` block. Reach for a
392
- one-shot migration script only when the change can't be
393
- expressed that way (the v4 v5 surrogate-PK substrate switch
394
- was the canonical example).
395
+ destructive-but-idempotent `DROP TABLE` block; v7 v8 is
396
+ additive plus the `machine_identity` seed. Reach for a one-shot
397
+ migration script only when the change can't be expressed that way
398
+ (the v4 → v5 surrogate-PK substrate switch was the canonical
399
+ example).
395
400
  3. Update tests that exercise the schema (`test/db.test.ts`).
396
401
  4. Update [CHANGELOG.md](CHANGELOG.md) under the upcoming version's
397
402
  `### Changed` section.
package/README.md CHANGED
@@ -26,17 +26,15 @@ mu state -w auth-refactor --json # agent/script API: typed static state for jq
26
26
  mu log --tail # subscribe to every state change
27
27
  ```
28
28
 
29
- The crew is real (tmux panes you can attach to), the work graph is
30
- real (SQLite + a parallel-tracks algorithm with diamond-merge), the
31
- workspaces are real (jj workspace / sl share / git worktree), and
32
- **mu stays out of the model's way.** Tasks, workspaces, panes, notes,
33
- and logs persist state and coordinate handoffs; the model still
34
- decides what to do. Workers use the bundled
35
- [SKILL.md](skills/mu/SKILL.md) when they need the full in-pane ground
36
- truth. Bare `mu` is the human front door when stdout is attached to a
37
- TTY: it launches the read-only TUI with every workstream loaded.
38
- Piped/scripted calls print help instead; use typed verbs plus `--json`
39
- (or `MU_NO_TUI=1`) for agent/API flows.
29
+ Crew, graph, and workspaces are all real things you can poke at:
30
+ tmux panes (`tmux attach`), a SQLite DAG with parallel-tracks +
31
+ diamond-merge, and jj workspace / sl share / git worktree on disk.
32
+ **mu persists state and coordinates handoffs; the model still
33
+ decides what to do.** Workers reach for the bundled
34
+ [SKILL.md](skills/mu/SKILL.md) when they need in-pane ground truth.
35
+ Bare `mu` on a TTY launches the read-only multi-workstream TUI;
36
+ piped/scripted calls print help, so use typed verbs + `--json` (or
37
+ `MU_NO_TUI=1`) for agent/API flows.
40
38
 
41
39
  ---
42
40
 
@@ -54,9 +52,7 @@ Piped/scripted calls print help instead; use typed verbs plus `--json`
54
52
  drive; mu records, scopes, and yanks the next command.
55
53
  - **A local typed state surface.** One CLI, one SQLite registry,
56
54
  typed verbs, `--json` everywhere useful, and a read-only dashboard
57
- for humans. Contributor-facing boundaries and rejected ideas live
58
- in [ROADMAP.md](docs/ROADMAP.md); the README stays focused on how
59
- mu feels to use.
55
+ for humans.
60
56
 
61
57
  ## What mu is NOT
62
58
 
@@ -193,6 +189,24 @@ expanded [dashboard/state guide](docs/USAGE_GUIDE.md#5-see-the-graph-dashboard--
193
189
 
194
190
  ---
195
191
 
192
+ ## Portability and handoff
193
+
194
+ State lives in one SQLite DB, so it travels. `mu db export <file>`
195
+ writes a consistent whole-DB copy plus a manifest sidecar; `mu db
196
+ import <file>` ships it back, with per-workstream drift detection
197
+ (dry-run by default; `--apply` commits) and a sharp `--force-source`
198
+ that parks the loser to a sidecar before clobbering. Hard rule: don't
199
+ edit the same workstream on two machines concurrently.
200
+
201
+ For humans / git / docs, `mu workstream export` and `mu archive
202
+ export` render a workstream (or an archive bucket) as Markdown:
203
+ per-task `.md` files plus an `INDEX.md`, suitable for committing,
204
+ reviewing, or pasting. Bucket exports are read-only artifacts; the
205
+ lossless un-archive path back into a live workstream is `mu archive
206
+ restore <label> --as <new-ws>`.
207
+
208
+ ---
209
+
196
210
  ## vs `pi-subagents`
197
211
 
198
212
  | | [`pi-subagents`](https://github.com/nicobailon/pi-subagents) | `mu` |