switchman-dev 0.1.7 → 0.1.9
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 +124 -195
- package/examples/README.md +9 -2
- package/package.json +6 -1
- package/src/cli/commands/audit.js +77 -0
- package/src/cli/commands/claude.js +37 -0
- package/src/cli/commands/gate.js +278 -0
- package/src/cli/commands/lease.js +256 -0
- package/src/cli/commands/mcp.js +45 -0
- package/src/cli/commands/monitor.js +191 -0
- package/src/cli/commands/queue.js +549 -0
- package/src/cli/commands/task.js +248 -0
- package/src/cli/commands/telemetry.js +108 -0
- package/src/cli/commands/worktree.js +85 -0
- package/src/cli/index.js +2072 -1649
- package/src/core/ci.js +1 -1
- package/src/core/db.js +143 -21
- package/src/core/enforcement.js +122 -10
- 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 +5 -3
- package/src/core/outcome.js +43 -44
- package/src/core/pipeline.js +66 -35
- package/src/core/planner.js +10 -6
- package/src/core/policy.js +1 -1
- package/src/core/queue.js +11 -2
- package/src/core/sync.js +216 -0
- package/src/mcp/server.js +18 -6
- package/src.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
|
@@ -1,54 +1,39 @@
|
|
|
1
1
|
# Switchman
|
|
2
2
|
|
|
3
|
-
**
|
|
3
|
+
**The operating system for parallel AI development.**
|
|
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
|
-
When you run multiple agents on the same repo, they
|
|
8
|
+
When you run multiple AI agents on the same repo, 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
9
|
|
|
9
|
-
|
|
10
|
+
Questions or feedback? Join the [Discord](https://discord.gg/pnT8BEC4D) · [hello@switchman.dev](mailto:hello@switchman.dev)
|
|
10
11
|
|
|
11
|
-
|
|
12
|
+
---
|
|
12
13
|
|
|
13
14
|
## Install
|
|
14
15
|
|
|
15
|
-
Requirements:
|
|
16
|
-
- Node.js 22.5+
|
|
17
|
-
- Git 2.5+
|
|
16
|
+
Requirements: Node.js 22.5+ · Git 2.5+
|
|
18
17
|
|
|
19
18
|
```bash
|
|
20
|
-
npm install -g
|
|
19
|
+
npm install -g switchman-dev
|
|
21
20
|
```
|
|
22
21
|
|
|
23
|
-
|
|
22
|
+
> Switchman uses the built-in `node:sqlite` runtime — no extra database to install or manage.
|
|
23
|
+
|
|
24
|
+
---
|
|
24
25
|
|
|
25
|
-
|
|
26
|
+
## 2 minute proof
|
|
26
27
|
|
|
27
28
|
```bash
|
|
28
29
|
switchman demo
|
|
29
30
|
```
|
|
30
31
|
|
|
31
|
-
|
|
32
|
-
-
|
|
33
|
-
-
|
|
34
|
-
-
|
|
35
|
-
- both branches landing
|
|
36
|
-
|
|
37
|
-
Typical proof output looks like:
|
|
38
|
-
|
|
39
|
-
```text
|
|
40
|
-
$ switchman demo
|
|
41
|
-
✓ Created Switchman demo repo
|
|
42
|
-
/tmp/switchman-demo-1234567890
|
|
43
|
-
proof: agent2 was blocked from src/auth.js
|
|
44
|
-
safe reroute: agent2 claimed docs/auth-flow.md instead
|
|
45
|
-
landing: 2 queue item(s) merged safely
|
|
46
|
-
|
|
47
|
-
Try these next:
|
|
48
|
-
cd /tmp/switchman-demo-1234567890
|
|
49
|
-
switchman status
|
|
50
|
-
switchman queue status
|
|
51
|
-
```
|
|
32
|
+
Creates a throwaway repo and shows:
|
|
33
|
+
- agent1 claiming `src/auth.js`
|
|
34
|
+
- agent2 getting blocked from the same file
|
|
35
|
+
- agent2 rerouting safely to `docs/auth-flow.md`
|
|
36
|
+
- both branches landing cleanly through the queue
|
|
52
37
|
|
|
53
38
|
Then inspect it:
|
|
54
39
|
|
|
@@ -58,110 +43,89 @@ switchman status
|
|
|
58
43
|
switchman queue status
|
|
59
44
|
```
|
|
60
45
|
|
|
61
|
-
|
|
46
|
+
---
|
|
62
47
|
|
|
63
|
-
|
|
48
|
+
## Switchman Pro
|
|
64
49
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
- task assignment, so agents do not duplicate work
|
|
68
|
-
- file locking, so parallel edits do not quietly collide
|
|
69
|
-
- live status, so you can see what is running, blocked, or stale
|
|
70
|
-
- stale-work recovery, so abandoned work does not clog the repo
|
|
71
|
-
- queue intelligence, so the clearest work lands first across competing goals
|
|
72
|
-
- governed landing, so finished work reaches `main` one item at a time with retries, checks, and policy enforcement
|
|
50
|
+
> **Unlimited agents · Team coordination · AI planning · $25/month**
|
|
51
|
+
> [switchman.dev/pro](https://switchman.dev/pro) · or run `switchman upgrade`
|
|
73
52
|
|
|
74
|
-
|
|
75
|
-
- Git gives you branches
|
|
76
|
-
- Switchman gives you coordination, governance, and a safe path to land
|
|
53
|
+
Pro removes the 3-agent limit, adds cloud-synced team coordination, AI task planning, and 90-day history. Free tier stays fully featured and MIT licensed forever.
|
|
77
54
|
|
|
78
|
-
|
|
55
|
+
```bash
|
|
56
|
+
switchman upgrade # open switchman.dev/pro
|
|
57
|
+
switchman login # activate after subscribing
|
|
58
|
+
switchman login --status # check your plan
|
|
59
|
+
```
|
|
79
60
|
|
|
80
|
-
|
|
81
|
-
-
|
|
82
|
-
-
|
|
83
|
-
-
|
|
61
|
+
**What's in Pro:**
|
|
62
|
+
- Unlimited concurrent agents (free: up to 3)
|
|
63
|
+
- Cloud-synced team activity across machines
|
|
64
|
+
- Team invites — `switchman team invite alice@example.com`
|
|
65
|
+
- AI task planning — `switchman plan "Add authentication" --apply`, `switchman plan --issue 47`, and optionally `--comment` back to the issue or PR
|
|
66
|
+
- 90-day audit trail (free: 7 days)
|
|
67
|
+
- Email support within 48 hours
|
|
68
|
+
|
|
69
|
+
**$25/month or $250/year per seat** · [switchman.dev/pro](https://switchman.dev/pro)
|
|
70
|
+
|
|
71
|
+
---
|
|
72
|
+
|
|
73
|
+
## Quickstart
|
|
84
74
|
|
|
85
75
|
```bash
|
|
86
76
|
cd my-project
|
|
87
|
-
switchman setup --agents
|
|
88
|
-
switchman verify-setup
|
|
89
|
-
|
|
77
|
+
switchman setup --agents 3
|
|
90
78
|
switchman task add "Implement auth helper" --priority 9
|
|
91
|
-
switchman task add "Add auth tests" --priority 8
|
|
92
|
-
switchman task add "Update auth docs" --priority 7
|
|
93
|
-
|
|
94
|
-
switchman status
|
|
95
79
|
switchman status --watch
|
|
96
80
|
switchman gate ci
|
|
81
|
+
switchman queue run
|
|
97
82
|
```
|
|
98
83
|
|
|
99
|
-
If you only do three things on the first run, do these:
|
|
100
|
-
1. `switchman setup --agents 5`
|
|
101
|
-
2. `switchman task add "Implement auth helper" --priority 9`
|
|
102
|
-
3. `switchman status --watch`
|
|
103
|
-
|
|
104
84
|
What `switchman setup` gives you:
|
|
105
|
-
-
|
|
106
|
-
- linked workspaces
|
|
107
|
-
-
|
|
108
|
-
|
|
109
|
-
Current limit:
|
|
110
|
-
- `switchman setup --agents` currently supports up to `10` agent workspaces in one command
|
|
85
|
+
- a shared Switchman database in `.switchman/`
|
|
86
|
+
- linked agent workspaces
|
|
87
|
+
- MCP config for Claude Code and Cursor
|
|
111
88
|
|
|
112
89
|
Fastest path to success:
|
|
113
|
-
1. Use Claude Code for the first run
|
|
114
|
-
2. Run `switchman verify-setup`
|
|
115
|
-
3.
|
|
116
|
-
4.
|
|
117
|
-
5.
|
|
118
|
-
6.
|
|
119
|
-
|
|
120
|
-
If you want the recommended editor setup guide, start here:
|
|
121
|
-
- [Claude Code setup](docs/setup-claude-code.md)
|
|
122
|
-
|
|
123
|
-
If you want a guided demo, see [examples/README.md](examples/README.md).
|
|
90
|
+
1. Use Claude Code for the first run
|
|
91
|
+
2. Run `switchman verify-setup` to confirm editor wiring
|
|
92
|
+
3. Run `switchman claude refresh` to generate a repo-aware `CLAUDE.md`
|
|
93
|
+
4. Open one Claude Code window per generated workspace
|
|
94
|
+
5. Add tasks before agents start
|
|
95
|
+
6. Keep `switchman status --watch` open in a separate terminal
|
|
96
|
+
7. Run `switchman gate ci && switchman queue run` when tasks finish
|
|
124
97
|
|
|
125
|
-
|
|
98
|
+
Editor setup guides:
|
|
99
|
+
- [Claude Code](docs/setup-claude-code.md)
|
|
100
|
+
- [Cursor](docs/setup-cursor.md)
|
|
101
|
+
- [Windsurf](docs/setup-windsurf.md)
|
|
126
102
|
|
|
127
|
-
|
|
128
|
-
- agents claim different files instead of stepping on each other
|
|
129
|
-
- `switchman status` stays calm and readable instead of filling with blocked work
|
|
130
|
-
- the landing queue moves finished work safely back toward `main`
|
|
131
|
-
- `switchman gate ci` passes cleanly
|
|
103
|
+
---
|
|
132
104
|
|
|
133
|
-
|
|
105
|
+
## Why Switchman?
|
|
134
106
|
|
|
135
|
-
|
|
107
|
+
Git gives you branches. Switchman gives you coordination.
|
|
136
108
|
|
|
137
|
-
|
|
138
|
-
-
|
|
139
|
-
-
|
|
140
|
-
-
|
|
141
|
-
-
|
|
109
|
+
Branches and worktrees solve isolation — they do not tell you:
|
|
110
|
+
- which task each agent should take next
|
|
111
|
+
- who already owns a file
|
|
112
|
+
- whether a session is stale
|
|
113
|
+
- whether finished work is safe to land
|
|
142
114
|
|
|
143
|
-
|
|
115
|
+
Switchman adds:
|
|
116
|
+
- **Task planning** — break goals into governed parallel work
|
|
117
|
+
- **File locking** — parallel edits don't quietly collide
|
|
118
|
+
- **Live status** — see what's running, blocked, or stale
|
|
119
|
+
- **Stale recovery** — abandoned work gets detected and requeued
|
|
120
|
+
- **Governed landing** — finished work reaches `main` one item at a time with retries and policy checks
|
|
144
121
|
|
|
145
|
-
Switchman is
|
|
122
|
+
Switchman is for the point where "we can manage this by hand" stops being true.
|
|
146
123
|
|
|
147
|
-
|
|
148
|
-
- break work into parallel tasks
|
|
149
|
-
- assign work across agents and humans
|
|
150
|
-
- stop overlapping edits early
|
|
151
|
-
- detect stale or drifted work before merge chaos
|
|
152
|
-
- route validation and governance follow-ups
|
|
153
|
-
- decide what should land next
|
|
154
|
-
- leave an audit trail of what happened and why
|
|
124
|
+
---
|
|
155
125
|
|
|
156
126
|
## Real-World Walkthrough
|
|
157
127
|
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
1. Product work arrives:
|
|
161
|
-
- harden auth flows
|
|
162
|
-
- ship a schema update
|
|
163
|
-
- refresh related docs
|
|
164
|
-
2. You create parallel work:
|
|
128
|
+
Three goals arrive at once: harden auth, ship a schema update, refresh docs.
|
|
165
129
|
|
|
166
130
|
```bash
|
|
167
131
|
switchman setup --agents 5
|
|
@@ -171,28 +135,16 @@ switchman task add "Update auth and schema docs" --priority 6
|
|
|
171
135
|
switchman status --watch
|
|
172
136
|
```
|
|
173
137
|
|
|
174
|
-
|
|
175
|
-
- agent1 takes auth
|
|
176
|
-
- agent2 takes the migration
|
|
177
|
-
- agent3 takes docs
|
|
178
|
-
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.
|
|
179
|
-
5. While work is running, `switchman status` shows:
|
|
180
|
-
- what is active
|
|
181
|
-
- what is blocked
|
|
182
|
-
- what has gone stale
|
|
183
|
-
- what should land next
|
|
184
|
-
6. When branches finish, queue them:
|
|
138
|
+
Agents pick up work in separate workspaces. If two reach for the same file, Switchman blocks the second claim early. When branches finish:
|
|
185
139
|
|
|
186
140
|
```bash
|
|
187
141
|
switchman queue add agent1
|
|
188
142
|
switchman queue add agent2
|
|
189
143
|
switchman queue add agent3
|
|
190
|
-
switchman queue status
|
|
191
144
|
switchman queue run --follow-plan --merge-budget 2
|
|
192
145
|
```
|
|
193
146
|
|
|
194
|
-
|
|
195
|
-
8. Before merge, run the repo gate:
|
|
147
|
+
Before merge:
|
|
196
148
|
|
|
197
149
|
```bash
|
|
198
150
|
switchman gate ci
|
|
@@ -201,60 +153,31 @@ switchman gate ci
|
|
|
201
153
|
What good looks like:
|
|
202
154
|
- each agent stayed in its own lane
|
|
203
155
|
- overlap was blocked before wasted work spread
|
|
204
|
-
- stale work was visible instead of silently wrong
|
|
205
156
|
- the queue made it obvious what should land now and what should wait
|
|
206
|
-
- the repo reached `main` through a governed path
|
|
207
|
-
|
|
208
|
-
## Why not just use branches or worktrees?
|
|
209
|
-
|
|
210
|
-
Because branches and worktrees solve isolation, not coordination.
|
|
157
|
+
- the repo reached `main` through a governed path
|
|
211
158
|
|
|
212
|
-
|
|
213
|
-
- which task each agent should take next
|
|
214
|
-
- who already owns a file
|
|
215
|
-
- whether a session is stale
|
|
216
|
-
- whether finished work is still safe to land
|
|
159
|
+
---
|
|
217
160
|
|
|
218
|
-
|
|
161
|
+
## Enforcement Gateway
|
|
219
162
|
|
|
220
|
-
|
|
163
|
+
Switchman is strongest when agents write through the governed gateway instead of editing files directly.
|
|
221
164
|
|
|
222
|
-
|
|
165
|
+
- MCP agents should prefer `switchman_write_file`, `switchman_append_file`, `switchman_make_directory`, `switchman_move_path`, and `switchman_remove_path`
|
|
166
|
+
- CLI operators can use `switchman write` and `switchman wrap`
|
|
167
|
+
- `switchman monitor` runs automatically in the background to catch rogue edits
|
|
223
168
|
|
|
224
|
-
|
|
225
|
-
|------|------|
|
|
226
|
-
| Claude Code | [Claude Code setup](docs/setup-claude-code.md) |
|
|
227
|
-
| Cursor | [Cursor setup](docs/setup-cursor.md) |
|
|
228
|
-
| Windsurf | [Windsurf setup](docs/setup-windsurf.md) |
|
|
229
|
-
| Any CLI-driven agent | [CLI agent setup](docs/setup-cli-agents.md) |
|
|
169
|
+
---
|
|
230
170
|
|
|
231
171
|
## If something feels stuck
|
|
232
172
|
|
|
233
|
-
Use `switchman status` first.
|
|
234
|
-
|
|
235
|
-
It is the main terminal dashboard for the repo:
|
|
236
|
-
- top health banner and compact counts
|
|
237
|
-
- boxed sections for `Running`, `Blocked`, `Warnings`, `Queue`, and `Next action`
|
|
238
|
-
- exact follow-up commands when something needs attention
|
|
239
|
-
- `--watch` mode for a live terminal view
|
|
240
|
-
|
|
241
|
-
Useful commands:
|
|
242
|
-
|
|
243
173
|
```bash
|
|
244
|
-
switchman status
|
|
245
|
-
switchman status --watch
|
|
246
|
-
switchman
|
|
247
|
-
switchman
|
|
248
|
-
switchman gate ci
|
|
174
|
+
switchman status # main dashboard
|
|
175
|
+
switchman status --watch # live view
|
|
176
|
+
switchman scan # conflict scan
|
|
177
|
+
switchman gate ci # repo gate check
|
|
249
178
|
```
|
|
250
179
|
|
|
251
|
-
|
|
252
|
-
- [Status and recovery](docs/status-and-recovery.md)
|
|
253
|
-
- [Merge queue](docs/merge-queue.md)
|
|
254
|
-
- [Stale lease policy](docs/stale-lease-policy.md)
|
|
255
|
-
- [Telemetry](docs/telemetry.md)
|
|
256
|
-
|
|
257
|
-
The most useful explain commands when something is unclear:
|
|
180
|
+
Explain commands:
|
|
258
181
|
|
|
259
182
|
```bash
|
|
260
183
|
switchman explain claim src/auth/login.js
|
|
@@ -263,58 +186,64 @@ switchman explain stale --pipeline <pipeline-id>
|
|
|
263
186
|
switchman explain landing <pipeline-id>
|
|
264
187
|
```
|
|
265
188
|
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
189
|
+
More help:
|
|
190
|
+
- [Status and recovery](docs/status-and-recovery.md)
|
|
191
|
+
- [Merge queue](docs/merge-queue.md)
|
|
192
|
+
- [Pipelines and PRs](docs/pipelines.md)
|
|
193
|
+
- [Telemetry](docs/telemetry.md)
|
|
194
|
+
- [Command reference](docs/command-reference.md)
|
|
269
195
|
|
|
270
|
-
|
|
271
|
-
switchman gate install-ci
|
|
272
|
-
```
|
|
196
|
+
---
|
|
273
197
|
|
|
274
|
-
|
|
275
|
-
- runs `switchman gate ci --github` on pushes and pull requests
|
|
276
|
-
- auto-runs `switchman pipeline sync-pr --pipeline-from-env --skip-missing-pipeline --pr-from-env --github` on pull request updates
|
|
277
|
-
- publishes a readable Switchman summary into the GitHub job output
|
|
278
|
-
- fails the PR check when Switchman detects unmanaged changes, stale work, or risky overlap
|
|
198
|
+
## PR Checks
|
|
279
199
|
|
|
280
|
-
|
|
200
|
+
Block risky changes in GitHub the same way your local terminal does:
|
|
281
201
|
|
|
282
202
|
```bash
|
|
283
|
-
switchman
|
|
203
|
+
switchman gate install-ci
|
|
284
204
|
```
|
|
285
205
|
|
|
286
|
-
|
|
206
|
+
Installs `.github/workflows/switchman-gate.yml` — runs the repo gate on every push and PR.
|
|
287
207
|
|
|
288
|
-
|
|
289
|
-
switchman pipeline sync-pr pipe-123 --pr-from-env --github
|
|
290
|
-
```
|
|
208
|
+
---
|
|
291
209
|
|
|
292
|
-
##
|
|
210
|
+
## Change Policy
|
|
293
211
|
|
|
294
|
-
|
|
212
|
+
Enforce review or validation for high-risk areas like auth, schema, or payments:
|
|
295
213
|
|
|
296
214
|
```bash
|
|
297
215
|
switchman policy init-change
|
|
298
216
|
switchman policy show-change
|
|
299
217
|
```
|
|
300
218
|
|
|
301
|
-
|
|
219
|
+
---
|
|
302
220
|
|
|
303
|
-
##
|
|
221
|
+
## What's next
|
|
304
222
|
|
|
305
|
-
-
|
|
306
|
-
-
|
|
307
|
-
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
223
|
+
- Zero-argument `switchman plan` — reads full repo context automatically
|
|
224
|
+
- Live web dashboard for repo and agent visibility
|
|
225
|
+
- Homebrew install path
|
|
226
|
+
|
|
227
|
+
---
|
|
228
|
+
|
|
229
|
+
## What's included today
|
|
230
|
+
|
|
231
|
+
- Agent worktree setup and repo verification
|
|
232
|
+
- Lease, claim, heartbeat, and stale-reap coordination
|
|
233
|
+
- Governed write gateways and rogue-edit monitor
|
|
234
|
+
- Repo status, repair, queue planning, and safe landing
|
|
235
|
+
- Pipeline planning, execution, PR bundles, and GitHub sync
|
|
236
|
+
- Audit trail, change policy enforcement, and CI integration
|
|
237
|
+
- MCP support for Claude Code, Cursor, and Windsurf
|
|
238
|
+
|
|
239
|
+
---
|
|
311
240
|
|
|
312
241
|
## Feedback
|
|
313
242
|
|
|
314
|
-
Building this in public. If you
|
|
243
|
+
Building this in public. If you hit something broken or missing, I'd love to hear about it.
|
|
315
244
|
|
|
316
|
-
- GitHub Issues
|
|
317
|
-
-
|
|
245
|
+
- [GitHub Issues](https://github.com/switchman-dev/switchman/issues)
|
|
246
|
+
- [hello@switchman.dev](mailto:hello@switchman.dev)
|
|
318
247
|
|
|
319
248
|
## License
|
|
320
249
|
|
package/examples/README.md
CHANGED
|
@@ -45,12 +45,19 @@ Good rule of thumb:
|
|
|
45
45
|
- want the 2-minute proof: `switchman demo`
|
|
46
46
|
- want the 5-10 minute “how would a team actually use this?” version: use `examples/`
|
|
47
47
|
|
|
48
|
-
Make sure Switchman is installed globally first
|
|
48
|
+
Make sure Switchman is installed globally first.
|
|
49
|
+
|
|
50
|
+
If you cloned the Switchman repo:
|
|
49
51
|
```bash
|
|
50
52
|
npm install -g . # from the switchman repo root
|
|
51
53
|
```
|
|
52
54
|
|
|
53
|
-
|
|
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:
|
|
54
61
|
```bash
|
|
55
62
|
bash examples/setup.sh
|
|
56
63
|
bash examples/demo.sh
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "switchman-dev",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.9",
|
|
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
|
},
|