switchman-dev 0.1.6 → 0.1.8
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/.github/workflows/ci.yml +26 -0
- package/CHANGELOG.md +36 -0
- package/CLAUDE.md +113 -0
- package/README.md +296 -15
- package/examples/README.md +37 -2
- package/package.json +6 -1
- package/src/cli/index.js +3939 -130
- package/src/core/ci.js +205 -1
- package/src/core/db.js +963 -45
- package/src/core/enforcement.js +140 -15
- package/src/core/git.js +286 -1
- package/src/core/ignore.js +1 -0
- package/src/core/licence.js +365 -0
- package/src/core/mcp.js +41 -2
- package/src/core/merge-gate.js +22 -5
- package/src/core/outcome.js +43 -44
- package/src/core/pipeline.js +2459 -88
- package/src/core/planner.js +35 -11
- package/src/core/policy.js +106 -1
- package/src/core/queue.js +654 -29
- package/src/core/semantic.js +71 -5
- package/src/core/sync.js +216 -0
- package/src/mcp/server.js +18 -6
- package/tests.zip +0 -0
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches:
|
|
6
|
+
- main
|
|
7
|
+
pull_request:
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
test:
|
|
11
|
+
runs-on: ubuntu-latest
|
|
12
|
+
steps:
|
|
13
|
+
- name: Check out repo
|
|
14
|
+
uses: actions/checkout@v4
|
|
15
|
+
|
|
16
|
+
- name: Set up Node
|
|
17
|
+
uses: actions/setup-node@v4
|
|
18
|
+
with:
|
|
19
|
+
node-version: '22'
|
|
20
|
+
cache: 'npm'
|
|
21
|
+
|
|
22
|
+
- name: Install dependencies
|
|
23
|
+
run: npm install
|
|
24
|
+
|
|
25
|
+
- name: Run test suite
|
|
26
|
+
run: npm test
|
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to Switchman will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on Keep a Changelog, adapted for the project’s current stage.
|
|
6
|
+
|
|
7
|
+
## [Unreleased]
|
|
8
|
+
|
|
9
|
+
## [0.1.7] - 2026-03-13
|
|
10
|
+
|
|
11
|
+
### Added
|
|
12
|
+
- plan-aware merge queue execution with merge budgets
|
|
13
|
+
- clearer first-run guidance in `switchman setup`, `switchman demo`, and `switchman status`
|
|
14
|
+
- richer queue planning, stale-wave handling, policy evidence, and governed landing documentation
|
|
15
|
+
- CI workflow for running the test suite on pushes and pull requests
|
|
16
|
+
|
|
17
|
+
### Changed
|
|
18
|
+
- `switchman status` now leads with a simpler summary, top attention item, and one exact next command
|
|
19
|
+
- `switchman queue status` no longer crashes on an empty queue summary shape
|
|
20
|
+
- `switchman setup` now re-registers existing worktrees cleanly without leaking raw git branch-exists noise
|
|
21
|
+
- CLI output now suppresses the noisy Node SQLite experimental warning on normal happy-path runs
|
|
22
|
+
|
|
23
|
+
### Fixed
|
|
24
|
+
- broken install docs that pointed at the org name instead of the package name
|
|
25
|
+
- queue status regression found in manual smoke testing before publish
|
|
26
|
+
|
|
27
|
+
## [0.1.6] - 2026-03-12
|
|
28
|
+
|
|
29
|
+
### Added
|
|
30
|
+
- stronger governed landing flows, recovery loops, and PR/CI handoff
|
|
31
|
+
- policy-aware planning, policy evidence, and landing enforcement
|
|
32
|
+
- stale cluster grouping, stale-wave reasoning, and richer operator explainability
|
|
33
|
+
- synthetic landing branches, refresh, recover, resume, and cleanup
|
|
34
|
+
|
|
35
|
+
### Changed
|
|
36
|
+
- the core product moved from basic coordination toward governed parallel delivery
|
package/CLAUDE.md
ADDED
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
# Switchman Agent Instructions
|
|
2
|
+
|
|
3
|
+
This repository uses **Switchman** to coordinate parallel AI coding agents.
|
|
4
|
+
You MUST follow these instructions every session to avoid conflicting with other agents.
|
|
5
|
+
|
|
6
|
+
You must use the Switchman MCP tools for coordination. Do not read from or write to `.switchman/switchman.db` directly, and do not bypass Switchman by issuing raw SQLite queries.
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## Your worktree
|
|
11
|
+
|
|
12
|
+
Find your worktree name by running:
|
|
13
|
+
```bash
|
|
14
|
+
git worktree list
|
|
15
|
+
```
|
|
16
|
+
The path that matches your current directory is your worktree. Use the last path segment as your worktree name (e.g. `/projects/myapp-feature-auth` → `feature-auth`). The main repo root is always named `main`.
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## Required workflow — follow this every session
|
|
21
|
+
|
|
22
|
+
### 1. Start of session — get your task
|
|
23
|
+
|
|
24
|
+
Call the `switchman_task_next` MCP tool with your worktree name:
|
|
25
|
+
```
|
|
26
|
+
switchman_task_next({ worktree: "<your-worktree-name>", agent: "claude-code" })
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
- If `task` is `null` — the queue is empty. Ask the user what to work on, or stop.
|
|
30
|
+
- If you receive a task — note the `task.id`. You'll need it in the next steps.
|
|
31
|
+
- If the `switchman_*` tools are unavailable, stop and tell the user the MCP server is not connected. Do not fall back to direct SQLite access.
|
|
32
|
+
|
|
33
|
+
### 2. Before editing any files — claim them
|
|
34
|
+
|
|
35
|
+
Call `switchman_task_claim` with every file you plan to edit **before you edit them**:
|
|
36
|
+
```
|
|
37
|
+
switchman_task_claim({
|
|
38
|
+
task_id: "<task-id>",
|
|
39
|
+
worktree: "<your-worktree-name>",
|
|
40
|
+
files: ["src/auth/login.js", "tests/auth.test.js"]
|
|
41
|
+
})
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
- If `safe_to_proceed` is `false` — there are conflicts. Do NOT edit those files.
|
|
45
|
+
Read the `conflicts` array to see which worktrees own them, then either:
|
|
46
|
+
- Choose different files that accomplish the same goal
|
|
47
|
+
- Ask the user how to proceed
|
|
48
|
+
|
|
49
|
+
- If `safe_to_proceed` is `true` — you are clear to edit.
|
|
50
|
+
|
|
51
|
+
### 3. Do the work
|
|
52
|
+
|
|
53
|
+
Implement the task. Make commits as normal. Other agents will avoid your claimed files.
|
|
54
|
+
|
|
55
|
+
If you discover mid-task that you need to edit additional files, call `switchman_task_claim` again for those files before editing them.
|
|
56
|
+
|
|
57
|
+
When MCP write tools are available, prefer the Switchman enforcement gateway over native file writes:
|
|
58
|
+
```text
|
|
59
|
+
switchman_write_file(...)
|
|
60
|
+
switchman_append_file(...)
|
|
61
|
+
switchman_make_directory(...)
|
|
62
|
+
switchman_move_path(...)
|
|
63
|
+
switchman_remove_path(...)
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
These tools validate your active lease and claimed paths before changing the filesystem. Use native file writes only when the Switchman write tools are unavailable and you have already claimed the path.
|
|
67
|
+
|
|
68
|
+
### 4. End of session — mark complete or failed
|
|
69
|
+
|
|
70
|
+
**On success:**
|
|
71
|
+
```
|
|
72
|
+
switchman_task_done({ task_id: "<task-id>" })
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
**On failure (can't complete the task):**
|
|
76
|
+
```
|
|
77
|
+
switchman_task_fail({ task_id: "<task-id>", reason: "Brief explanation of what blocked you" })
|
|
78
|
+
```
|
|
79
|
+
|
|
80
|
+
Always call one of these before ending your session. Released file claims allow other agents to proceed.
|
|
81
|
+
|
|
82
|
+
---
|
|
83
|
+
|
|
84
|
+
## Checking for conflicts
|
|
85
|
+
|
|
86
|
+
At any time you can scan for conflicts across all worktrees:
|
|
87
|
+
```
|
|
88
|
+
switchman_scan()
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
Run this before merging your branch. If `safe_to_proceed` is `false`, do not merge until conflicts are resolved.
|
|
92
|
+
|
|
93
|
+
---
|
|
94
|
+
|
|
95
|
+
## Checking system state
|
|
96
|
+
|
|
97
|
+
To see what other agents are doing:
|
|
98
|
+
```
|
|
99
|
+
switchman_status()
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
This shows all pending and in-progress tasks, file claims per worktree, and worktree list.
|
|
103
|
+
|
|
104
|
+
---
|
|
105
|
+
|
|
106
|
+
## Rules
|
|
107
|
+
|
|
108
|
+
1. **Always claim files before editing them** — not after.
|
|
109
|
+
2. **Always call `switchman_task_done` or `switchman_task_fail` at end of session** — never leave tasks as `in_progress` when you stop.
|
|
110
|
+
3. **If `safe_to_proceed` is false, do not edit the conflicting files** — coordinate first.
|
|
111
|
+
4. **Do not claim files you don't need** — over-claiming blocks other agents unnecessarily.
|
|
112
|
+
5. **One task per session** — complete or fail your current task before taking another.
|
|
113
|
+
6. **Never query or mutate the Switchman SQLite database directly** — use MCP tools only.
|
package/README.md
CHANGED
|
@@ -2,9 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
**Run 10+ agents on one codebase. Safely.**
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
[](https://github.com/switchman-dev/switchman/actions/workflows/ci.yml)
|
|
6
|
+
[](https://www.npmjs.com/package/switchman-dev)
|
|
6
7
|
|
|
7
|
-
|
|
8
|
+
Switchman is the coordination and governance layer for AI-native software teams. It helps you plan work, route tasks across agents, prevent overlap, and land changes safely instead of stitching parallel output back together by hand.
|
|
9
|
+
|
|
10
|
+
When you run multiple agents on the same repo, they need shared coordination or they collide, duplicate work, and create risky merges. Switchman gives them leases, scoped ownership, policy gates, queue planning, and governed landing workflows so they can move in parallel without stepping on each other.
|
|
8
11
|
|
|
9
12
|
In the docs, `workspace` means the folder each agent works in. Some commands still use the Git term `worktree`, because that is the underlying Git feature.
|
|
10
13
|
|
|
@@ -16,8 +19,54 @@ Requirements:
|
|
|
16
19
|
- Node.js 22.5+
|
|
17
20
|
- Git 2.5+
|
|
18
21
|
|
|
22
|
+
Why Node 22.5+?
|
|
23
|
+
- Switchman uses the built-in `node:sqlite` runtime support for its repo-local coordination database.
|
|
24
|
+
- Keeping that dependency in the Node runtime makes install and recovery simpler, but it currently means targeting newer Node releases on purpose.
|
|
25
|
+
|
|
26
|
+
TypeScript and API surface
|
|
27
|
+
- Switchman is CLI-first today. The supported interface is the `switchman` command and the MCP integration, not a stable embeddable library API yet.
|
|
28
|
+
- That means there are no published TypeScript types right now by design. We plan to add typed surfaces once the programmatic API is stable enough to support cleanly.
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
npm install -g switchman-dev
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## 2 minute proof
|
|
35
|
+
|
|
36
|
+
If you want the fastest possible “does this actually work?” run:
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
switchman demo
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
That creates a throwaway repo and shows:
|
|
43
|
+
- one agent claiming `src/auth.js`
|
|
44
|
+
- another agent getting blocked from claiming the same file
|
|
45
|
+
- that second agent rerouting to a safe docs file instead
|
|
46
|
+
- both branches landing back through the queue cleanly
|
|
47
|
+
|
|
48
|
+
Typical proof output looks like:
|
|
49
|
+
|
|
50
|
+
```text
|
|
51
|
+
$ switchman demo
|
|
52
|
+
✓ Created Switchman demo repo
|
|
53
|
+
/tmp/switchman-demo-1234567890
|
|
54
|
+
proof: agent2 was blocked from src/auth.js
|
|
55
|
+
safe reroute: agent2 claimed docs/auth-flow.md instead
|
|
56
|
+
landing: 2 queue item(s) merged safely
|
|
57
|
+
|
|
58
|
+
Try these next:
|
|
59
|
+
cd /tmp/switchman-demo-1234567890
|
|
60
|
+
switchman status
|
|
61
|
+
switchman queue status
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
Then inspect it:
|
|
65
|
+
|
|
19
66
|
```bash
|
|
20
|
-
|
|
67
|
+
cd /tmp/switchman-demo-...
|
|
68
|
+
switchman status
|
|
69
|
+
switchman queue status
|
|
21
70
|
```
|
|
22
71
|
|
|
23
72
|
## Why Switchman?
|
|
@@ -25,15 +74,17 @@ npm install -g @switchman-dev
|
|
|
25
74
|
Git worktrees, branches, and raw coding agents are useful, but they do not coordinate themselves.
|
|
26
75
|
|
|
27
76
|
What it adds that plain Git does not:
|
|
77
|
+
- task planning, so incoming goals can be broken into governed parallel work
|
|
28
78
|
- task assignment, so agents do not duplicate work
|
|
29
79
|
- file locking, so parallel edits do not quietly collide
|
|
30
80
|
- live status, so you can see what is running, blocked, or stale
|
|
31
81
|
- stale-work recovery, so abandoned work does not clog the repo
|
|
32
|
-
-
|
|
82
|
+
- queue intelligence, so the clearest work lands first across competing goals
|
|
83
|
+
- governed landing, so finished work reaches `main` one item at a time with retries, checks, and policy enforcement
|
|
33
84
|
|
|
34
85
|
In short:
|
|
35
86
|
- Git gives you branches
|
|
36
|
-
- Switchman gives you coordination
|
|
87
|
+
- Switchman gives you coordination, governance, and a safe path to land
|
|
37
88
|
|
|
38
89
|
## Quickstart
|
|
39
90
|
|
|
@@ -44,35 +95,45 @@ Recommended first run:
|
|
|
44
95
|
|
|
45
96
|
```bash
|
|
46
97
|
cd my-project
|
|
47
|
-
switchman
|
|
48
|
-
switchman
|
|
49
|
-
|
|
98
|
+
switchman demo
|
|
99
|
+
switchman setup --agents 3
|
|
50
100
|
switchman task add "Implement auth helper" --priority 9
|
|
51
|
-
switchman task add "Add auth tests" --priority 8
|
|
52
|
-
switchman task add "Update auth docs" --priority 7
|
|
53
|
-
|
|
54
|
-
switchman status
|
|
55
101
|
switchman status --watch
|
|
56
102
|
switchman gate ci
|
|
103
|
+
switchman queue run
|
|
57
104
|
```
|
|
58
105
|
|
|
106
|
+
If you only do five things on the first run, do these:
|
|
107
|
+
1. `switchman demo`
|
|
108
|
+
2. `switchman setup --agents 3`
|
|
109
|
+
3. `switchman task add "Implement auth helper" --priority 9`
|
|
110
|
+
4. `switchman status --watch`
|
|
111
|
+
5. `switchman gate ci && switchman queue run`
|
|
112
|
+
|
|
59
113
|
What `switchman setup` gives you:
|
|
60
114
|
- one shared Switchman database in `.switchman/`
|
|
61
115
|
- linked workspaces for each agent
|
|
62
116
|
- local MCP config for Claude Code and Cursor
|
|
63
117
|
|
|
118
|
+
Current limit:
|
|
119
|
+
- `switchman setup --agents` currently supports up to `10` agent workspaces in one command
|
|
120
|
+
|
|
64
121
|
Fastest path to success:
|
|
65
122
|
1. Use Claude Code for the first run.
|
|
66
123
|
2. Run `switchman verify-setup` once so editor wiring is confirmed before you start.
|
|
67
124
|
3. Open one Claude Code window per generated workspace.
|
|
68
|
-
4.
|
|
69
|
-
5.
|
|
70
|
-
6.
|
|
125
|
+
4. Add clear tasks before the agents start.
|
|
126
|
+
5. Let each agent pick up one clearly separate task.
|
|
127
|
+
6. Keep `switchman status --watch` open in another terminal.
|
|
128
|
+
7. Run `switchman gate ci`, then `switchman queue run`, when the tasks finish.
|
|
71
129
|
|
|
72
130
|
If you want the recommended editor setup guide, start here:
|
|
73
131
|
- [Claude Code setup](docs/setup-claude-code.md)
|
|
74
132
|
|
|
75
133
|
If you want a guided demo, see [examples/README.md](examples/README.md).
|
|
134
|
+
If you want the deeper multi-task planning and PR workflow, see [docs/pipelines.md](docs/pipelines.md).
|
|
135
|
+
|
|
136
|
+
> Free tier supports up to 3 agents. Run `switchman upgrade` for unlimited.
|
|
76
137
|
|
|
77
138
|
## What good looks like
|
|
78
139
|
|
|
@@ -84,6 +145,90 @@ You know the first run is working when:
|
|
|
84
145
|
|
|
85
146
|
That is the moment Switchman should feel different from “just using a few branches.”
|
|
86
147
|
|
|
148
|
+
## Start Here
|
|
149
|
+
|
|
150
|
+
If you are trying to decide where to start:
|
|
151
|
+
- want the fastest proof: run `switchman demo`
|
|
152
|
+
- want to wire up a real repo: run `switchman setup --agents 3`
|
|
153
|
+
- want to add real work: run `switchman task add "Your task" --priority 8`
|
|
154
|
+
- want to understand blocked or stale work: run `switchman status`
|
|
155
|
+
- want a longer hands-on walkthrough: open [examples/README.md](examples/README.md)
|
|
156
|
+
|
|
157
|
+
## Enforcement Gateway
|
|
158
|
+
|
|
159
|
+
Switchman is strongest when agents write through the governed gateway instead of editing files directly.
|
|
160
|
+
|
|
161
|
+
- MCP agents should prefer `switchman_write_file`, `switchman_append_file`, `switchman_make_directory`, `switchman_move_path`, and `switchman_remove_path`
|
|
162
|
+
- CLI operators can use `switchman write` and `switchman wrap` for governed writes and wrapped commands
|
|
163
|
+
- `switchman monitor` is started automatically by `switchman setup` unless you opt out, so rogue edits are detected in the background
|
|
164
|
+
|
|
165
|
+
That closes the gap between "please follow the claiming protocol" and "Switchman can actually catch ungoverned writes when something goes wrong."
|
|
166
|
+
|
|
167
|
+
## The Workflow
|
|
168
|
+
|
|
169
|
+
Switchman is built for the workflow of turning multiple competing engineering goals into coordinated parallel execution and a trusted, dependency-aware path to merge.
|
|
170
|
+
|
|
171
|
+
In practice, that means it helps teams:
|
|
172
|
+
- break work into parallel tasks
|
|
173
|
+
- assign work across agents and humans
|
|
174
|
+
- stop overlapping edits early
|
|
175
|
+
- detect stale or drifted work before merge chaos
|
|
176
|
+
- route validation and governance follow-ups
|
|
177
|
+
- decide what should land next
|
|
178
|
+
- leave an audit trail of what happened and why
|
|
179
|
+
|
|
180
|
+
## Real-World Walkthrough
|
|
181
|
+
|
|
182
|
+
Here is what a real first team workflow can look like across several goals in one shared repo:
|
|
183
|
+
|
|
184
|
+
1. Product work arrives:
|
|
185
|
+
- harden auth flows
|
|
186
|
+
- ship a schema update
|
|
187
|
+
- refresh related docs
|
|
188
|
+
2. You create parallel work:
|
|
189
|
+
|
|
190
|
+
```bash
|
|
191
|
+
switchman setup --agents 5
|
|
192
|
+
switchman task add "Harden auth middleware" --priority 9
|
|
193
|
+
switchman task add "Ship schema migration" --priority 8
|
|
194
|
+
switchman task add "Update auth and schema docs" --priority 6
|
|
195
|
+
switchman status --watch
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
3. Agents pick up work in separate workspaces:
|
|
199
|
+
- agent1 takes auth
|
|
200
|
+
- agent2 takes the migration
|
|
201
|
+
- agent3 takes docs
|
|
202
|
+
4. If two agents reach for the same file, Switchman blocks the second claim early instead of letting the overlap turn into merge cleanup later.
|
|
203
|
+
5. While work is running, `switchman status` shows:
|
|
204
|
+
- what is active
|
|
205
|
+
- what is blocked
|
|
206
|
+
- what has gone stale
|
|
207
|
+
- what should land next
|
|
208
|
+
6. When branches finish, queue them:
|
|
209
|
+
|
|
210
|
+
```bash
|
|
211
|
+
switchman queue add agent1
|
|
212
|
+
switchman queue add agent2
|
|
213
|
+
switchman queue add agent3
|
|
214
|
+
switchman queue status
|
|
215
|
+
switchman queue run --follow-plan --merge-budget 2
|
|
216
|
+
```
|
|
217
|
+
|
|
218
|
+
7. If a shared change invalidates another task, Switchman marks it stale and points at the exact recovery command instead of leaving the team to guess.
|
|
219
|
+
8. Before merge, run the repo gate:
|
|
220
|
+
|
|
221
|
+
```bash
|
|
222
|
+
switchman gate ci
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
What good looks like:
|
|
226
|
+
- each agent stayed in its own lane
|
|
227
|
+
- overlap was blocked before wasted work spread
|
|
228
|
+
- stale work was visible instead of silently wrong
|
|
229
|
+
- the queue made it obvious what should land now and what should wait
|
|
230
|
+
- the repo reached `main` through a governed path instead of manual merge babysitting
|
|
231
|
+
|
|
87
232
|
## Why not just use branches or worktrees?
|
|
88
233
|
|
|
89
234
|
Because branches and worktrees solve isolation, not coordination.
|
|
@@ -96,6 +241,96 @@ They do not tell you:
|
|
|
96
241
|
|
|
97
242
|
Switchman is for the point where “we can manage this by hand” stops being true.
|
|
98
243
|
|
|
244
|
+
## Safety note on `--force`
|
|
245
|
+
|
|
246
|
+
`switchman claim --force` exists for manual recovery, not normal operation.
|
|
247
|
+
|
|
248
|
+
Legitimate use:
|
|
249
|
+
- you have already confirmed the conflicting claim is stale, abandoned, or otherwise incorrect
|
|
250
|
+
- you are performing operator-led cleanup and need to unblock the repo deliberately
|
|
251
|
+
|
|
252
|
+
Not a legitimate use:
|
|
253
|
+
- "the other agent is probably done"
|
|
254
|
+
- "I just want to keep moving"
|
|
255
|
+
- "we'll clean it up in the PR later"
|
|
256
|
+
|
|
257
|
+
Normal path:
|
|
258
|
+
1. run `switchman status`
|
|
259
|
+
2. run `switchman explain claim <path>`
|
|
260
|
+
3. reap or retry the stale work if needed
|
|
261
|
+
4. only then use `--force` if you intentionally want to override a known-bad claim
|
|
262
|
+
|
|
263
|
+
If that feels too risky, that is the point. It is meant to be an escape hatch, not a convenience flag.
|
|
264
|
+
|
|
265
|
+
## Releases and changelog
|
|
266
|
+
|
|
267
|
+
If you want to track what changed between versions:
|
|
268
|
+
- [CHANGELOG.md](CHANGELOG.md)
|
|
269
|
+
- [GitHub releases](https://github.com/switchman-dev/switchman/releases)
|
|
270
|
+
|
|
271
|
+
## What's included today
|
|
272
|
+
|
|
273
|
+
Today Switchman already includes:
|
|
274
|
+
- agent worktree setup and repo verification
|
|
275
|
+
- lease, claim, heartbeat, and stale-reap coordination
|
|
276
|
+
- governed write gateways and a rogue-edit monitor
|
|
277
|
+
- repo status, repair, queue planning, and safe landing
|
|
278
|
+
- pipeline planning, execution, PR bundles, and GitHub sync
|
|
279
|
+
- audit trail, change policy enforcement, and CI integration
|
|
280
|
+
- MCP support for Claude Code, Cursor, and Windsurf
|
|
281
|
+
|
|
282
|
+
## Switchman Pro
|
|
283
|
+
|
|
284
|
+
Pro gives you unlimited agents, cloud-synced team coordination, and 90-day history.
|
|
285
|
+
|
|
286
|
+
```bash
|
|
287
|
+
switchman upgrade # open switchman.dev/pro in your browser
|
|
288
|
+
switchman login # activate Pro after subscribing
|
|
289
|
+
switchman login --status # check your current plan
|
|
290
|
+
```
|
|
291
|
+
|
|
292
|
+
**What's included in Pro:**
|
|
293
|
+
- Unlimited concurrent agents (free tier: up to 3)
|
|
294
|
+
- Cloud-synced task queues and lease state across your team
|
|
295
|
+
- Team invites — `switchman team invite alice@example.com`
|
|
296
|
+
- AI task planning — `switchman plan "Add authentication"` proposes parallel tasks from an explicit goal
|
|
297
|
+
- 90-day audit trail (free tier: 7 days)
|
|
298
|
+
- Email support within 48 hours
|
|
299
|
+
|
|
300
|
+
**Pricing:** $25/month or $250/year per seat · [switchman.dev/pro](https://switchman.dev/pro)
|
|
301
|
+
|
|
302
|
+
After subscribing, activate in your terminal:
|
|
303
|
+
```bash
|
|
304
|
+
switchman login
|
|
305
|
+
# Opens GitHub sign-in, saves credentials locally
|
|
306
|
+
# Credentials cached 24h · works offline for 7 days
|
|
307
|
+
|
|
308
|
+
switchman setup --agents 10
|
|
309
|
+
# Pro removes the 3-agent limit
|
|
310
|
+
```
|
|
311
|
+
|
|
312
|
+
### Pro planning launch order
|
|
313
|
+
|
|
314
|
+
Switchman Pro planning ships in this order:
|
|
315
|
+
- `switchman plan "goal"` first
|
|
316
|
+
- `switchman plan --issue 47` next
|
|
317
|
+
- zero-argument `switchman plan` later, once real usage data makes that inference trustworthy
|
|
318
|
+
|
|
319
|
+
Today, the supported Pro planning flow is:
|
|
320
|
+
|
|
321
|
+
```bash
|
|
322
|
+
switchman plan "Add authentication"
|
|
323
|
+
switchman plan "Add authentication" --apply
|
|
324
|
+
```
|
|
325
|
+
|
|
326
|
+
## What's next
|
|
327
|
+
|
|
328
|
+
The next product steps are:
|
|
329
|
+
- `switchman plan --issue 47`
|
|
330
|
+
- a more magical zero-argument planning flow that can read richer repo and issue context
|
|
331
|
+
- a web dashboard for repo and landing visibility
|
|
332
|
+
- a Homebrew install path for faster first-run setup
|
|
333
|
+
|
|
99
334
|
## Choose your setup
|
|
100
335
|
|
|
101
336
|
Pick the guide that matches how you work:
|
|
@@ -133,6 +368,52 @@ More help:
|
|
|
133
368
|
- [Stale lease policy](docs/stale-lease-policy.md)
|
|
134
369
|
- [Telemetry](docs/telemetry.md)
|
|
135
370
|
|
|
371
|
+
The most useful explain commands when something is unclear:
|
|
372
|
+
|
|
373
|
+
```bash
|
|
374
|
+
switchman explain claim src/auth/login.js
|
|
375
|
+
switchman explain queue <item-id>
|
|
376
|
+
switchman explain stale --pipeline <pipeline-id>
|
|
377
|
+
switchman explain landing <pipeline-id>
|
|
378
|
+
```
|
|
379
|
+
|
|
380
|
+
## Turn On PR Checks
|
|
381
|
+
|
|
382
|
+
If you want GitHub to block risky changes the same way your local terminal does:
|
|
383
|
+
|
|
384
|
+
```bash
|
|
385
|
+
switchman gate install-ci
|
|
386
|
+
```
|
|
387
|
+
|
|
388
|
+
That installs `.github/workflows/switchman-gate.yml`, which:
|
|
389
|
+
- runs `switchman gate ci --github` on pushes and pull requests
|
|
390
|
+
- auto-runs `switchman pipeline sync-pr --pipeline-from-env --skip-missing-pipeline --pr-from-env --github` on pull request updates
|
|
391
|
+
- publishes a readable Switchman summary into the GitHub job output
|
|
392
|
+
- fails the PR check when Switchman detects unmanaged changes, stale work, or risky overlap
|
|
393
|
+
|
|
394
|
+
For pipeline-specific landing state in GitHub job summaries or PR checks, use:
|
|
395
|
+
|
|
396
|
+
```bash
|
|
397
|
+
switchman pipeline bundle pipe-123 --github
|
|
398
|
+
```
|
|
399
|
+
|
|
400
|
+
If you want one command that bundles artifacts, updates the PR comment, and emits GitHub outputs together:
|
|
401
|
+
|
|
402
|
+
```bash
|
|
403
|
+
switchman pipeline sync-pr pipe-123 --pr-from-env --github
|
|
404
|
+
```
|
|
405
|
+
|
|
406
|
+
## Add Change Policy
|
|
407
|
+
|
|
408
|
+
If you want Switchman to enforce extra review or validation for high-risk areas like auth, schema, or payments:
|
|
409
|
+
|
|
410
|
+
```bash
|
|
411
|
+
switchman policy init-change
|
|
412
|
+
switchman policy show-change
|
|
413
|
+
```
|
|
414
|
+
|
|
415
|
+
That writes `.switchman/change-policy.json`, which planning and follow-up generation use to require the right tests, docs, and governance work before landing.
|
|
416
|
+
|
|
136
417
|
## More docs
|
|
137
418
|
|
|
138
419
|
- [Merge queue](docs/merge-queue.md)
|
package/examples/README.md
CHANGED
|
@@ -2,6 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
A real Express REST API used to test Switchman locally.
|
|
4
4
|
|
|
5
|
+
This folder is the best place to go after `switchman demo` if you want to feel the fuller workflow:
|
|
6
|
+
- multiple agents
|
|
7
|
+
- one real repo
|
|
8
|
+
- an intentional claim conflict
|
|
9
|
+
- clean landing back through the queue
|
|
10
|
+
|
|
5
11
|
## What's in here
|
|
6
12
|
|
|
7
13
|
```
|
|
@@ -27,12 +33,31 @@ examples/
|
|
|
27
33
|
|
|
28
34
|
This is the fastest way to understand Switchman as a new user.
|
|
29
35
|
|
|
30
|
-
|
|
36
|
+
If you just want the shortest proof run, start with:
|
|
37
|
+
|
|
38
|
+
```bash
|
|
39
|
+
switchman demo
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
Use the `examples/` scripts when you want a longer walkthrough you can customize or record.
|
|
43
|
+
|
|
44
|
+
Good rule of thumb:
|
|
45
|
+
- want the 2-minute proof: `switchman demo`
|
|
46
|
+
- want the 5-10 minute “how would a team actually use this?” version: use `examples/`
|
|
47
|
+
|
|
48
|
+
Make sure Switchman is installed globally first.
|
|
49
|
+
|
|
50
|
+
If you cloned the Switchman repo:
|
|
31
51
|
```bash
|
|
32
52
|
npm install -g . # from the switchman repo root
|
|
33
53
|
```
|
|
34
54
|
|
|
35
|
-
|
|
55
|
+
If you installed from npm instead:
|
|
56
|
+
```bash
|
|
57
|
+
cd "$(npm root -g)/switchman-dev"
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
Then from the Switchman package root:
|
|
36
61
|
```bash
|
|
37
62
|
bash examples/setup.sh
|
|
38
63
|
bash examples/demo.sh
|
|
@@ -44,6 +69,14 @@ If you want the shortest path:
|
|
|
44
69
|
- `demo.sh` is the 45-90 second recordable version
|
|
45
70
|
- `walkthrough.sh` shows one complete 3-agent happy path, including a real claim conflict
|
|
46
71
|
|
|
72
|
+
If you only want one script after setup, use:
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
bash examples/walkthrough.sh
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
That is the clearest “real workflow” version of Switchman in this repo.
|
|
79
|
+
|
|
47
80
|
## Recordable demo
|
|
48
81
|
|
|
49
82
|
If you want the short “wow” version for recording or showing the product quickly:
|
|
@@ -81,6 +114,8 @@ At the end of the walkthrough, you want to see:
|
|
|
81
114
|
- `switchman scan` showing no unclaimed changes
|
|
82
115
|
- `switchman status` giving a clean overview of what happened
|
|
83
116
|
|
|
117
|
+
If that all happens without confusion, the onboarding is doing its job.
|
|
118
|
+
|
|
84
119
|
## The taskapi project
|
|
85
120
|
|
|
86
121
|
A minimal but real Express API with:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "switchman-dev",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.8",
|
|
4
4
|
"description": "Project manager for AI coding assistants running safely on one codebase",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/index.js",
|
|
@@ -17,11 +17,16 @@
|
|
|
17
17
|
"mcp": "node src/mcp/server.js",
|
|
18
18
|
"test": "NODE_NO_WARNINGS=1 node tests/test.js"
|
|
19
19
|
},
|
|
20
|
+
"engines": {
|
|
21
|
+
"node": ">=22.5.0"
|
|
22
|
+
},
|
|
20
23
|
"dependencies": {
|
|
24
|
+
"@anthropic-ai/sdk": "^0.78.0",
|
|
21
25
|
"@modelcontextprotocol/sdk": "^1.27.1",
|
|
22
26
|
"chalk": "^5.3.0",
|
|
23
27
|
"commander": "^12.0.0",
|
|
24
28
|
"node-sqlite3-wasm": "^0.8.35",
|
|
29
|
+
"open": "^11.0.0",
|
|
25
30
|
"ora": "^8.0.1",
|
|
26
31
|
"zod": "^4.3.6"
|
|
27
32
|
},
|