vibe-coding-master 0.0.7 → 0.0.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/README.md +47 -11
- package/dist/backend/adapters/filesystem.js +13 -0
- package/dist/backend/adapters/git-adapter.js +79 -1
- package/dist/backend/api/artifact-routes.js +13 -7
- package/dist/backend/api/message-routes.js +2 -0
- package/dist/backend/api/task-routes.js +14 -0
- package/dist/backend/server.js +2 -1
- package/dist/backend/services/command-dispatcher.js +4 -2
- package/dist/backend/services/harness-service.js +22 -4
- package/dist/backend/services/message-service.js +1 -1
- package/dist/backend/services/project-service.js +46 -9
- package/dist/backend/services/session-service.js +7 -5
- package/dist/backend/services/status-service.js +3 -1
- package/dist/backend/services/task-service.js +118 -4
- package/dist/backend/templates/harness/gitignore.js +9 -0
- package/dist-frontend/assets/index-CuiNNOzj.css +32 -0
- package/dist-frontend/assets/{index-Bp49_End.js → index-D59GuHCR.js} +18 -18
- package/dist-frontend/index.html +2 -2
- package/docs/cc-best-practices.md +16 -4
- package/docs/product-design.md +105 -14
- package/docs/v1-architecture-design.md +163 -29
- package/docs/v1-implementation-plan.md +131 -15
- package/package.json +1 -1
- package/dist-frontend/assets/index-BNASqKEK.css +0 -32
package/dist-frontend/index.html
CHANGED
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
<meta charset="UTF-8" />
|
|
5
5
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
6
|
<title>VibeCodingMaster</title>
|
|
7
|
-
<script type="module" crossorigin src="/assets/index-
|
|
8
|
-
<link rel="stylesheet" crossorigin href="/assets/index-
|
|
7
|
+
<script type="module" crossorigin src="/assets/index-D59GuHCR.js"></script>
|
|
8
|
+
<link rel="stylesheet" crossorigin href="/assets/index-CuiNNOzj.css">
|
|
9
9
|
</head>
|
|
10
10
|
<body>
|
|
11
11
|
<div id="root"></div>
|
|
@@ -68,6 +68,7 @@ Recommended structure:
|
|
|
68
68
|
```text
|
|
69
69
|
repo/
|
|
70
70
|
CLAUDE.md
|
|
71
|
+
.gitignore
|
|
71
72
|
|
|
72
73
|
docs/
|
|
73
74
|
ARCHITECTURE.md
|
|
@@ -95,6 +96,7 @@ repo/
|
|
|
95
96
|
commands/
|
|
96
97
|
|
|
97
98
|
.ai/
|
|
99
|
+
vcm/ # ignored local VCM control state
|
|
98
100
|
task-specs/
|
|
99
101
|
handoffs/
|
|
100
102
|
<task-slug>/
|
|
@@ -957,8 +959,8 @@ Worktree isolation is by task, not by role:
|
|
|
957
959
|
|
|
958
960
|
```text
|
|
959
961
|
one task
|
|
960
|
-
-> one branch
|
|
961
|
-
-> one worktree
|
|
962
|
+
-> one branch: feature/<task-slug>
|
|
963
|
+
-> one worktree: .ai/vcm/worktrees/<task-slug>
|
|
962
964
|
-> one handoff directory
|
|
963
965
|
-> architect -> coder -> reviewer in sequence
|
|
964
966
|
```
|
|
@@ -1436,8 +1438,8 @@ Default rule:
|
|
|
1436
1438
|
|
|
1437
1439
|
```text
|
|
1438
1440
|
one task
|
|
1439
|
-
-> one branch
|
|
1440
|
-
-> one worktree
|
|
1441
|
+
-> one branch: feature/<task-slug>
|
|
1442
|
+
-> one worktree: .ai/vcm/worktrees/<task-slug>
|
|
1441
1443
|
-> one handoff directory
|
|
1442
1444
|
-> one PR
|
|
1443
1445
|
```
|
|
@@ -1477,9 +1479,19 @@ Branch rules:
|
|
|
1477
1479
|
|
|
1478
1480
|
- never do AI implementation work directly on the main branch
|
|
1479
1481
|
- one task branch should map to one task worktree
|
|
1482
|
+
- VCM-managed task branches should use `feature/<task-slug>`
|
|
1483
|
+
- VCM-managed task worktrees should live under `.ai/vcm/worktrees/<task-slug>`
|
|
1484
|
+
- `.gitignore` should contain a VCM managed block that ignores `.ai/vcm/`
|
|
1485
|
+
- a task should not switch to a different branch/worktree after creation; create a new task instead
|
|
1480
1486
|
- large work should use phase commits on the same task branch unless phases are independently releasable
|
|
1481
1487
|
- if a task becomes too large, split it into child tasks with explicit branch and PR ownership
|
|
1482
1488
|
|
|
1489
|
+
Cleanup rules:
|
|
1490
|
+
|
|
1491
|
+
- after task completion, remove the task worktree only after role sessions are stopped and uncommitted work is handled
|
|
1492
|
+
- remove VCM task/session/message/orchestration metadata with the worktree cleanup
|
|
1493
|
+
- keep the task branch by default until PR merge; delete it only with explicit confirmation
|
|
1494
|
+
|
|
1483
1495
|
Small commits:
|
|
1484
1496
|
|
|
1485
1497
|
- one commit per phase
|
package/docs/product-design.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
# VibeCodingMaster Product Design
|
|
2
2
|
|
|
3
|
-
Last updated: 2026-05-
|
|
3
|
+
Last updated: 2026-05-31
|
|
4
4
|
|
|
5
|
-
This document describes the
|
|
5
|
+
This document describes the current product direction and implemented V1 behavior for VCM.
|
|
6
6
|
|
|
7
7
|
## 1. Product Positioning
|
|
8
8
|
|
|
@@ -24,7 +24,7 @@ VCM is not a hosted SaaS product. It runs locally, connects to a local repositor
|
|
|
24
24
|
VCM V1 must make multi-session Claude Code work visible and recoverable:
|
|
25
25
|
|
|
26
26
|
- Connect a local Git repository.
|
|
27
|
-
- Create a named task.
|
|
27
|
+
- Create a named task with its own branch and task-level worktree by default.
|
|
28
28
|
- Start, stop, restart, and resume one Claude Code session per role.
|
|
29
29
|
- Keep role terminals embedded in one GUI.
|
|
30
30
|
- Preserve task state, session state, handoff files, message history, and raw terminal logs.
|
|
@@ -32,6 +32,7 @@ VCM V1 must make multi-session Claude Code work visible and recoverable:
|
|
|
32
32
|
- Let users choose between manual message approval and auto orchestration.
|
|
33
33
|
- Install or update VCM role rules into `CLAUDE.md` and `.claude/agents/*.md`.
|
|
34
34
|
- Provide a low-cost translation layer so the user can write Chinese while Claude Code receives English engineering instructions.
|
|
35
|
+
- Clean up completed task worktrees and VCM task metadata when the task is done.
|
|
35
36
|
|
|
36
37
|
## 3. Non-Goals
|
|
37
38
|
|
|
@@ -39,6 +40,8 @@ V1 does not include:
|
|
|
39
40
|
|
|
40
41
|
- tmux.
|
|
41
42
|
- Worktree isolation per role.
|
|
43
|
+
- Switching a task to a different branch or worktree after task creation.
|
|
44
|
+
- A separate `Create task worktree` action after the task already exists.
|
|
42
45
|
- Concurrent edits across roles as a product workflow.
|
|
43
46
|
- Automatic confirmation of Claude Code permission prompts.
|
|
44
47
|
- A main-page artifact inspector.
|
|
@@ -61,6 +64,72 @@ project-manager
|
|
|
61
64
|
|
|
62
65
|
The workflow is a soft guide in V1. VCM computes readiness from handoff artifact checks and session state, then shows the result in the sidebar. It does not block the user from manually starting a role out of order.
|
|
63
66
|
|
|
67
|
+
### 4.1 Task Worktree Model
|
|
68
|
+
|
|
69
|
+
Task-level worktree management is the current model for multi-task parallelism:
|
|
70
|
+
|
|
71
|
+
```text
|
|
72
|
+
one task
|
|
73
|
+
-> one branch
|
|
74
|
+
-> one git worktree
|
|
75
|
+
-> one handoff directory
|
|
76
|
+
-> one set of role sessions
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
VCM must not create worktrees per role. `project-manager`, `architect`, `coder`, and `reviewer` for the same task all run in the same task worktree and hand off sequentially.
|
|
80
|
+
|
|
81
|
+
When the user creates a task, VCM creates the branch and worktree immediately. There is no separate later button named `Create task worktree`, and a task cannot be switched to another worktree after creation.
|
|
82
|
+
|
|
83
|
+
Branch naming:
|
|
84
|
+
|
|
85
|
+
```text
|
|
86
|
+
feature/<task-name>
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
Worktree path:
|
|
90
|
+
|
|
91
|
+
```text
|
|
92
|
+
<base-repo>/.ai/vcm/worktrees/<task-name>
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
Example:
|
|
96
|
+
|
|
97
|
+
```text
|
|
98
|
+
base repo: /workspace
|
|
99
|
+
task: docs-cleanup
|
|
100
|
+
branch: feature/docs-cleanup
|
|
101
|
+
worktree: /workspace/.ai/vcm/worktrees/docs-cleanup
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
The repo's `.gitignore` must ignore `.ai/vcm/`. This is mandatory because the task worktrees live under `.ai/vcm/worktrees/`, and the base repository must not see nested worktree files as untracked source files.
|
|
105
|
+
|
|
106
|
+
Task creation flow:
|
|
107
|
+
|
|
108
|
+
```text
|
|
109
|
+
New Task submit
|
|
110
|
+
-> validate task name
|
|
111
|
+
-> derive branch feature/<task-name>
|
|
112
|
+
-> derive worktree path .ai/vcm/worktrees/<task-name>
|
|
113
|
+
-> verify .ai/vcm/ is ignored and the base repo is clean
|
|
114
|
+
-> git worktree add -b feature/<task-name> .ai/vcm/worktrees/<task-name> <base-ref>
|
|
115
|
+
-> create task metadata
|
|
116
|
+
-> create handoff structure inside the task worktree
|
|
117
|
+
-> open the task workspace with role session cwd = task worktree
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
Task cleanup flow:
|
|
121
|
+
|
|
122
|
+
```text
|
|
123
|
+
task complete
|
|
124
|
+
-> stop running role sessions
|
|
125
|
+
-> verify task worktree is safe to remove
|
|
126
|
+
-> remove git worktree
|
|
127
|
+
-> remove VCM task/session/message/orchestration metadata
|
|
128
|
+
-> keep or delete branch according to guarded branch cleanup policy
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
Branch deletion should be a separate guarded confirmation, ideally only after the branch is merged or the user explicitly confirms deletion. Worktree cleanup itself removes the local working directory and task metadata.
|
|
132
|
+
|
|
64
133
|
## 5. Roles
|
|
65
134
|
|
|
66
135
|
### Project Manager
|
|
@@ -179,20 +248,25 @@ The old `Dirty: yes/no` label is not used. The UI uses `Working tree: clean` or
|
|
|
179
248
|
|
|
180
249
|
There is no separate `Pause orchestration` or `Resume orchestration` control in the GUI. The current product model is one on/off toggle.
|
|
181
250
|
|
|
182
|
-
`VCM Harness` shows whether VCM managed blocks are installed/up to date in the project rules files
|
|
251
|
+
`VCM Harness` shows whether VCM managed blocks are installed/up to date in the project rules files and `.gitignore`.
|
|
183
252
|
|
|
184
|
-
`New Task` contains
|
|
253
|
+
`New Task` contains:
|
|
185
254
|
|
|
186
255
|
- `task name`
|
|
256
|
+
- a checked, non-optional `Create worktree and branch` indicator
|
|
257
|
+
- generated branch preview: `feature/<task-name>`
|
|
258
|
+
- generated worktree preview: `.ai/vcm/worktrees/<task-name>`
|
|
187
259
|
|
|
188
260
|
There is no optional title input in the current UI.
|
|
189
261
|
|
|
262
|
+
The worktree/branch path is the normal VCM task model, not a separate mode users toggle later. The checked indicator is shown so the user understands what will happen; VCM should not require a separate worktree creation action later.
|
|
263
|
+
|
|
190
264
|
### Task Workspace
|
|
191
265
|
|
|
192
266
|
The task workspace header is one compact row:
|
|
193
267
|
|
|
194
268
|
```text
|
|
195
|
-
TASK WORKSPACE <task> <branch> [Project Manager] [Architect] [Coder] [Reviewer] [Refresh]
|
|
269
|
+
TASK WORKSPACE <task> <branch> <worktree> [Project Manager] [Architect] [Coder] [Reviewer] [Refresh]
|
|
196
270
|
```
|
|
197
271
|
|
|
198
272
|
Role tabs show the session status for each role.
|
|
@@ -268,6 +342,7 @@ On repository connect, VCM checks:
|
|
|
268
342
|
|
|
269
343
|
```text
|
|
270
344
|
CLAUDE.md
|
|
345
|
+
.gitignore
|
|
271
346
|
.claude/agents/project-manager.md
|
|
272
347
|
.claude/agents/architect.md
|
|
273
348
|
.claude/agents/coder.md
|
|
@@ -284,6 +359,17 @@ If a file already exists, VCM only inserts or replaces the managed block:
|
|
|
284
359
|
<!-- VCM:END -->
|
|
285
360
|
```
|
|
286
361
|
|
|
362
|
+
For `.gitignore`, VCM uses hash comments:
|
|
363
|
+
|
|
364
|
+
```gitignore
|
|
365
|
+
# VCM:BEGIN version=1
|
|
366
|
+
.ai/vcm/
|
|
367
|
+
.vcm/
|
|
368
|
+
# VCM:END
|
|
369
|
+
```
|
|
370
|
+
|
|
371
|
+
`.ai/vcm/` is the active VCM local control area. `.vcm/` is included only as a legacy ignore rule for older VCM state.
|
|
372
|
+
|
|
287
373
|
VCM must preserve all user-authored content outside the managed block.
|
|
288
374
|
|
|
289
375
|
After applying harness changes, the UI tells the user what changed and recommends reviewing and committing those files.
|
|
@@ -445,17 +531,20 @@ App-level settings:
|
|
|
445
531
|
Repository-level VCM state:
|
|
446
532
|
|
|
447
533
|
```text
|
|
448
|
-
.vcm/config.json
|
|
449
|
-
.vcm/tasks/<task>.json
|
|
450
|
-
.vcm/sessions/<task>.json
|
|
451
|
-
.vcm/messages/<task>.jsonl
|
|
452
|
-
.vcm/orchestration/<task>.json
|
|
534
|
+
.ai/vcm/config.json
|
|
535
|
+
.ai/vcm/tasks/<task>.json
|
|
536
|
+
.ai/vcm/sessions/<task>.json
|
|
537
|
+
.ai/vcm/messages/<task>.jsonl
|
|
538
|
+
.ai/vcm/orchestration/<task>.json
|
|
539
|
+
.ai/vcm/worktrees/<task>/
|
|
453
540
|
```
|
|
454
541
|
|
|
455
|
-
|
|
542
|
+
In task-worktree mode, the base repository's `.ai/vcm/` directory is the project control area. Task source changes and handoff artifacts live inside the task worktree at `.ai/vcm/worktrees/<task>/`.
|
|
543
|
+
|
|
544
|
+
Task worktree local files:
|
|
456
545
|
|
|
457
546
|
```text
|
|
458
|
-
.ai/handoffs/<task>/
|
|
547
|
+
.ai/vcm/worktrees/<task>/.ai/handoffs/<task>/
|
|
459
548
|
```
|
|
460
549
|
|
|
461
550
|
External Claude transcripts:
|
|
@@ -489,7 +578,8 @@ This protects against publishing raw TypeScript bin files or missing frontend as
|
|
|
489
578
|
VCM V1 is successful when:
|
|
490
579
|
|
|
491
580
|
- A user can connect a repo without global Git safe-directory setup.
|
|
492
|
-
- A user can create a task
|
|
581
|
+
- A user can create a task, which creates `feature/<task>` and `.ai/vcm/worktrees/<task>`.
|
|
582
|
+
- A user can start all four role sessions in that task worktree.
|
|
493
583
|
- Switching roles never loses the embedded terminal.
|
|
494
584
|
- Restart creates a fresh Claude session; Resume reconnects to the persisted one.
|
|
495
585
|
- Permission modes are reflected in the Claude command.
|
|
@@ -500,3 +590,4 @@ VCM V1 is successful when:
|
|
|
500
590
|
- Translation reads Claude transcript JSONL reliably after start, resume, and restart.
|
|
501
591
|
- Terminal and translation panel have equal, stable reading space.
|
|
502
592
|
- Harness install/update preserves user content outside VCM managed blocks.
|
|
593
|
+
- Completed tasks can cleanly remove their worktree and VCM task metadata without affecting other tasks.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# V1 Architecture Design
|
|
2
2
|
|
|
3
|
-
Last updated: 2026-05-
|
|
3
|
+
Last updated: 2026-05-31
|
|
4
4
|
|
|
5
5
|
This document describes the architecture implemented by the current VCM codebase.
|
|
6
6
|
|
|
@@ -28,7 +28,7 @@ browser
|
|
|
28
28
|
-> claude --agent <role>
|
|
29
29
|
```
|
|
30
30
|
|
|
31
|
-
The app is local-first. It writes
|
|
31
|
+
The app is local-first. It writes project control state under `.ai/vcm/`, handoff artifacts under `.ai/handoffs/` inside the active task worktree, app settings under `~/.vcm/settings.json`, and reads Claude transcript files under `~/.claude/projects/`.
|
|
32
32
|
|
|
33
33
|
## 2. Processes And Ports
|
|
34
34
|
|
|
@@ -96,7 +96,7 @@ Responsibilities:
|
|
|
96
96
|
- Render workflow panel.
|
|
97
97
|
- Render settings section with Messages, Events, Auto orchestration.
|
|
98
98
|
- Render harness status/actions.
|
|
99
|
-
- Render one-field
|
|
99
|
+
- Render task creation form with one task-name field, a checked non-optional worktree/branch indicator, and generated branch/path previews.
|
|
100
100
|
- Render task list.
|
|
101
101
|
- Render Messages and Events modals.
|
|
102
102
|
|
|
@@ -112,7 +112,7 @@ Responsibilities:
|
|
|
112
112
|
|
|
113
113
|
- Fetch task status, messages, and orchestration state.
|
|
114
114
|
- Poll those every three seconds.
|
|
115
|
-
- Render compact header with task title, branch, role tabs, and Refresh.
|
|
115
|
+
- Render compact header with task title, branch, immutable worktree path, role tabs, and Refresh.
|
|
116
116
|
- Hold per-role permission mode selection.
|
|
117
117
|
- Render one `SessionConsole` per role but only show the active role.
|
|
118
118
|
- Emit workflow/messages/orchestration/events back to `App` so sidebar stays synchronized.
|
|
@@ -202,8 +202,8 @@ POST /api/projects/connect
|
|
|
202
202
|
-> resolve path
|
|
203
203
|
-> check path exists
|
|
204
204
|
-> check .git marker directly
|
|
205
|
-
-> create .vcm/config.json
|
|
206
|
-
-> ensure .ai/
|
|
205
|
+
-> create .ai/vcm/config.json
|
|
206
|
+
-> ensure .ai/vcm state dirs
|
|
207
207
|
-> read branch and dirty state
|
|
208
208
|
-> record recent repo path in ~/.vcm/settings.json
|
|
209
209
|
```
|
|
@@ -222,7 +222,118 @@ git -c safe.directory=<repoRoot> -c safe.directory=<realpath(repoRoot)> ...
|
|
|
222
222
|
|
|
223
223
|
VCM does not require global `safe.directory` configuration.
|
|
224
224
|
|
|
225
|
-
## 6. Task
|
|
225
|
+
## 6. Task Worktree Architecture
|
|
226
|
+
|
|
227
|
+
Task-level worktree management is the current architecture for multi-task parallelism.
|
|
228
|
+
|
|
229
|
+
Rule:
|
|
230
|
+
|
|
231
|
+
```text
|
|
232
|
+
one VCM task = one branch + one git worktree + one handoff directory + one role-session set
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
Branch name:
|
|
236
|
+
|
|
237
|
+
```text
|
|
238
|
+
feature/<taskSlug>
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
Worktree path:
|
|
242
|
+
|
|
243
|
+
```text
|
|
244
|
+
<baseRepoRoot>/.ai/vcm/worktrees/<taskSlug>
|
|
245
|
+
```
|
|
246
|
+
|
|
247
|
+
VCM does not support switching a task to another branch or worktree after creation. If the user needs a different branch/worktree, they should create a new task.
|
|
248
|
+
|
|
249
|
+
VCM does not create worktrees by role. All four role sessions for a task share the same task worktree:
|
|
250
|
+
|
|
251
|
+
```text
|
|
252
|
+
.ai/vcm/worktrees/<taskSlug>/
|
|
253
|
+
project-manager session cwd
|
|
254
|
+
architect session cwd
|
|
255
|
+
coder session cwd
|
|
256
|
+
reviewer session cwd
|
|
257
|
+
```
|
|
258
|
+
|
|
259
|
+
### 6.1 Base Repo vs Task Worktree
|
|
260
|
+
|
|
261
|
+
VCM distinguishes:
|
|
262
|
+
|
|
263
|
+
- `baseRepoRoot`: repository the user connected.
|
|
264
|
+
- `taskRepoRoot`: git worktree path for a specific task.
|
|
265
|
+
- `branch`: `feature/<taskSlug>`.
|
|
266
|
+
- `worktreePath`: same as `taskRepoRoot`.
|
|
267
|
+
|
|
268
|
+
Project-level VCM control state stays under the base repo:
|
|
269
|
+
|
|
270
|
+
```text
|
|
271
|
+
<baseRepoRoot>/.ai/vcm/config.json
|
|
272
|
+
<baseRepoRoot>/.ai/vcm/tasks/<task>.json
|
|
273
|
+
<baseRepoRoot>/.ai/vcm/sessions/<task>.json
|
|
274
|
+
<baseRepoRoot>/.ai/vcm/messages/<task>.jsonl
|
|
275
|
+
<baseRepoRoot>/.ai/vcm/orchestration/<task>.json
|
|
276
|
+
<baseRepoRoot>/.ai/vcm/worktrees/<task>/
|
|
277
|
+
```
|
|
278
|
+
|
|
279
|
+
Task source changes and handoff artifacts live in the task worktree:
|
|
280
|
+
|
|
281
|
+
```text
|
|
282
|
+
<baseRepoRoot>/.ai/vcm/worktrees/<task>/.ai/handoffs/<task>/
|
|
283
|
+
```
|
|
284
|
+
|
|
285
|
+
This central base-state model lets VCM list and manage multiple tasks while each task's code changes happen in a separate worktree.
|
|
286
|
+
|
|
287
|
+
### 6.2 Git Ignore Requirement
|
|
288
|
+
|
|
289
|
+
The base repository must ignore `.ai/vcm/`.
|
|
290
|
+
|
|
291
|
+
Reason:
|
|
292
|
+
|
|
293
|
+
- `.ai/vcm/worktrees/<task>` is a nested git worktree.
|
|
294
|
+
- Without `.ai/vcm/` in `.gitignore`, the base repo sees worktree files as untracked noise.
|
|
295
|
+
- `.ai/vcm` also contains local task/session/message metadata that should not be committed by default.
|
|
296
|
+
|
|
297
|
+
The VCM harness manages a `.gitignore` block that ignores `.ai/vcm/` before task worktree creation.
|
|
298
|
+
|
|
299
|
+
### 6.3 Task Creation Flow
|
|
300
|
+
|
|
301
|
+
```text
|
|
302
|
+
POST /api/tasks
|
|
303
|
+
-> validate taskSlug
|
|
304
|
+
-> compute branch feature/<taskSlug>
|
|
305
|
+
-> compute worktreePath <baseRepoRoot>/.ai/vcm/worktrees/<taskSlug>
|
|
306
|
+
-> assert branch does not already exist
|
|
307
|
+
-> assert worktreePath does not already exist
|
|
308
|
+
-> assert .ai/vcm/ is ignored by Git
|
|
309
|
+
-> assert base repo has no uncommitted changes
|
|
310
|
+
-> git worktree add -b feature/<taskSlug> <worktreePath> <baseRef>
|
|
311
|
+
-> create handoff structure in taskRepoRoot
|
|
312
|
+
-> write central task metadata under baseRepoRoot/.ai/vcm/tasks/<task>.json
|
|
313
|
+
```
|
|
314
|
+
|
|
315
|
+
The default `baseRef` is the connected repo's current `HEAD`.
|
|
316
|
+
|
|
317
|
+
### 6.4 Task Cleanup Flow
|
|
318
|
+
|
|
319
|
+
```text
|
|
320
|
+
POST /api/tasks/:taskSlug/cleanup
|
|
321
|
+
-> require no running role sessions
|
|
322
|
+
-> load task metadata
|
|
323
|
+
-> verify worktree path belongs under <baseRepoRoot>/.ai/vcm/worktrees/
|
|
324
|
+
-> check worktree status
|
|
325
|
+
-> refuse cleanup when uncommitted work exists unless force is explicitly requested
|
|
326
|
+
-> git worktree remove <worktreePath>
|
|
327
|
+
-> delete central task/session/message/orchestration metadata
|
|
328
|
+
```
|
|
329
|
+
|
|
330
|
+
Branch deletion is intentionally separate:
|
|
331
|
+
|
|
332
|
+
- Keep `feature/<taskSlug>` by default.
|
|
333
|
+
- Allow branch deletion only with explicit confirmation.
|
|
334
|
+
- Prefer allowing deletion only when the branch has been merged, or when the user force-confirms.
|
|
335
|
+
|
|
336
|
+
## 7. Task And Artifact Model
|
|
226
337
|
|
|
227
338
|
File:
|
|
228
339
|
|
|
@@ -234,7 +345,7 @@ File:
|
|
|
234
345
|
Task state:
|
|
235
346
|
|
|
236
347
|
```text
|
|
237
|
-
|
|
348
|
+
<baseRepoRoot>/.ai/vcm/tasks/<task>.json
|
|
238
349
|
```
|
|
239
350
|
|
|
240
351
|
Each task stores:
|
|
@@ -242,8 +353,10 @@ Each task stores:
|
|
|
242
353
|
- `taskSlug`
|
|
243
354
|
- optional `title`
|
|
244
355
|
- timestamps
|
|
245
|
-
-
|
|
246
|
-
-
|
|
356
|
+
- `baseRepoRoot`
|
|
357
|
+
- `worktreePath`
|
|
358
|
+
- `repoRoot` / `taskRepoRoot`
|
|
359
|
+
- branch, always `feature/<taskSlug>` for VCM-created tasks
|
|
247
360
|
- handoff directory
|
|
248
361
|
- status
|
|
249
362
|
- optional spec path
|
|
@@ -253,15 +366,16 @@ Task creation:
|
|
|
253
366
|
```text
|
|
254
367
|
POST /api/tasks
|
|
255
368
|
-> validate slug
|
|
369
|
+
-> create branch and worktree
|
|
256
370
|
-> create handoff directories
|
|
257
371
|
-> create artifact templates
|
|
258
|
-
-> write .vcm/tasks/<task>.json
|
|
372
|
+
-> write base .ai/vcm/tasks/<task>.json
|
|
259
373
|
```
|
|
260
374
|
|
|
261
375
|
Handoff directory:
|
|
262
376
|
|
|
263
377
|
```text
|
|
264
|
-
|
|
378
|
+
<taskRepoRoot>/.ai/handoffs/<task>/
|
|
265
379
|
role-commands/
|
|
266
380
|
architect.md
|
|
267
381
|
coder.md
|
|
@@ -287,7 +401,7 @@ Artifact checks are simple V1 checks:
|
|
|
287
401
|
|
|
288
402
|
They are used for workflow readiness, not content quality judgment.
|
|
289
403
|
|
|
290
|
-
##
|
|
404
|
+
## 8. Workflow Computation
|
|
291
405
|
|
|
292
406
|
File:
|
|
293
407
|
|
|
@@ -315,7 +429,7 @@ Step readiness:
|
|
|
315
429
|
|
|
316
430
|
The report is displayed in the sidebar `Workflow` section.
|
|
317
431
|
|
|
318
|
-
##
|
|
432
|
+
## 9. Session Runtime
|
|
319
433
|
|
|
320
434
|
Files:
|
|
321
435
|
|
|
@@ -360,7 +474,7 @@ Permission flags:
|
|
|
360
474
|
Session persistence:
|
|
361
475
|
|
|
362
476
|
```text
|
|
363
|
-
|
|
477
|
+
<baseRepoRoot>/.ai/vcm/sessions/<task>.json
|
|
364
478
|
```
|
|
365
479
|
|
|
366
480
|
The persisted record includes:
|
|
@@ -380,7 +494,9 @@ The persisted record includes:
|
|
|
380
494
|
|
|
381
495
|
If a runtime process is gone but the role has a Claude session id, `getRoleSession` returns a recoverable `resumable` status.
|
|
382
496
|
|
|
383
|
-
|
|
497
|
+
In task-worktree mode, `cwd` must be the immutable task worktree path. Role sessions must not start in the base repo when a task worktree exists.
|
|
498
|
+
|
|
499
|
+
## 10. Terminal Runtime
|
|
384
500
|
|
|
385
501
|
File:
|
|
386
502
|
|
|
@@ -391,7 +507,7 @@ The runtime:
|
|
|
391
507
|
- spawns `node-pty`
|
|
392
508
|
- sets `TERM=xterm-256color`
|
|
393
509
|
- sets color-friendly env vars
|
|
394
|
-
- appends raw PTY output to
|
|
510
|
+
- appends raw PTY output to `<taskRepoRoot>/.ai/handoffs/<task>/logs/<role>.log`
|
|
395
511
|
- emits terminal output/input/exit events to WebSocket subscribers
|
|
396
512
|
- replays the log on terminal WebSocket subscribe
|
|
397
513
|
|
|
@@ -412,7 +528,7 @@ Server messages:
|
|
|
412
528
|
- exit
|
|
413
529
|
- error
|
|
414
530
|
|
|
415
|
-
##
|
|
531
|
+
## 11. Message Bus
|
|
416
532
|
|
|
417
533
|
Files:
|
|
418
534
|
|
|
@@ -423,8 +539,8 @@ Files:
|
|
|
423
539
|
State:
|
|
424
540
|
|
|
425
541
|
```text
|
|
426
|
-
.vcm/messages/<task>.jsonl
|
|
427
|
-
.vcm/orchestration/<task>.json
|
|
542
|
+
.ai/vcm/messages/<task>.jsonl
|
|
543
|
+
.ai/vcm/orchestration/<task>.json
|
|
428
544
|
.ai/handoffs/<task>/messages/<message-id>.md
|
|
429
545
|
```
|
|
430
546
|
|
|
@@ -458,7 +574,9 @@ The backend writes a `[VCM MESSAGE]` envelope to the target terminal and appends
|
|
|
458
574
|
|
|
459
575
|
The backend still exposes pause/resume orchestration API routes and stores `paused` for compatibility. The current GUI only toggles `mode` between `manual` and `auto`.
|
|
460
576
|
|
|
461
|
-
|
|
577
|
+
Messages and orchestration snapshots are central project state under `baseRepoRoot/.ai/vcm`. Message body markdown lives in the task worktree handoff directory.
|
|
578
|
+
|
|
579
|
+
## 12. Role Command Compatibility
|
|
462
580
|
|
|
463
581
|
Files:
|
|
464
582
|
|
|
@@ -488,7 +606,7 @@ The dispatcher:
|
|
|
488
606
|
|
|
489
607
|
This is a compatibility path. The preferred V1 coordination path is `vcmctl` message bus.
|
|
490
608
|
|
|
491
|
-
##
|
|
609
|
+
## 13. Harness Service
|
|
492
610
|
|
|
493
611
|
File:
|
|
494
612
|
|
|
@@ -498,6 +616,7 @@ Harness files:
|
|
|
498
616
|
|
|
499
617
|
```text
|
|
500
618
|
CLAUDE.md
|
|
619
|
+
.gitignore
|
|
501
620
|
.claude/agents/project-manager.md
|
|
502
621
|
.claude/agents/architect.md
|
|
503
622
|
.claude/agents/coder.md
|
|
@@ -512,6 +631,15 @@ Managed block:
|
|
|
512
631
|
<!-- VCM:END -->
|
|
513
632
|
```
|
|
514
633
|
|
|
634
|
+
`.gitignore` uses the same VCM managed-block concept with hash comments:
|
|
635
|
+
|
|
636
|
+
```gitignore
|
|
637
|
+
# VCM:BEGIN version=1
|
|
638
|
+
.ai/vcm/
|
|
639
|
+
.vcm/
|
|
640
|
+
# VCM:END
|
|
641
|
+
```
|
|
642
|
+
|
|
515
643
|
The service:
|
|
516
644
|
|
|
517
645
|
- checks whether files exist
|
|
@@ -522,7 +650,7 @@ The service:
|
|
|
522
650
|
|
|
523
651
|
It must not overwrite user content outside the VCM block.
|
|
524
652
|
|
|
525
|
-
##
|
|
653
|
+
## 14. Translation Architecture
|
|
526
654
|
|
|
527
655
|
Files:
|
|
528
656
|
|
|
@@ -626,7 +754,7 @@ POST translation/send -> runtime.write(session.id, englishText + "\r")
|
|
|
626
754
|
|
|
627
755
|
The backend strips trailing newlines before appending `\r`.
|
|
628
756
|
|
|
629
|
-
##
|
|
757
|
+
## 15. API Surface
|
|
630
758
|
|
|
631
759
|
Project:
|
|
632
760
|
|
|
@@ -651,8 +779,11 @@ GET /api/tasks
|
|
|
651
779
|
POST /api/tasks
|
|
652
780
|
GET /api/tasks/:taskSlug
|
|
653
781
|
GET /api/tasks/:taskSlug/status
|
|
782
|
+
POST /api/tasks/:taskSlug/cleanup
|
|
654
783
|
```
|
|
655
784
|
|
|
785
|
+
There is no task-level "switch worktree" API. Worktree selection happens only at task creation.
|
|
786
|
+
|
|
656
787
|
Sessions:
|
|
657
788
|
|
|
658
789
|
```text
|
|
@@ -708,7 +839,7 @@ WebSockets:
|
|
|
708
839
|
/ws/translation/:sessionId
|
|
709
840
|
```
|
|
710
841
|
|
|
711
|
-
##
|
|
842
|
+
## 16. Error Handling
|
|
712
843
|
|
|
713
844
|
File:
|
|
714
845
|
|
|
@@ -733,7 +864,7 @@ Fastify error handler returns:
|
|
|
733
864
|
}
|
|
734
865
|
```
|
|
735
866
|
|
|
736
|
-
##
|
|
867
|
+
## 17. Packaging Architecture
|
|
737
868
|
|
|
738
869
|
`package.json` publishes built artifacts:
|
|
739
870
|
|
|
@@ -755,7 +886,7 @@ Important scripts:
|
|
|
755
886
|
- `prepack`: build and package verification
|
|
756
887
|
- `postinstall`: fixes `node-pty` spawn helper when needed
|
|
757
888
|
|
|
758
|
-
##
|
|
889
|
+
## 18. Security And Safety Boundaries
|
|
759
890
|
|
|
760
891
|
Current boundaries:
|
|
761
892
|
|
|
@@ -764,13 +895,16 @@ Current boundaries:
|
|
|
764
895
|
- Relaxed Claude permission modes are user-selected per role launch.
|
|
765
896
|
- Translation API key is local in `~/.vcm/settings.json`.
|
|
766
897
|
- Translation output is UI/runtime state only unless a user or role copies it into a file.
|
|
767
|
-
-
|
|
898
|
+
- `.ai/vcm` is local project control state and must be ignored by Git.
|
|
899
|
+
- Task handoff artifacts live in the task worktree and users should decide whether those artifacts belong in task commits.
|
|
900
|
+
- Task worktrees are created only during task creation; VCM does not expose branch/worktree switching APIs.
|
|
768
901
|
- Sandbox isolation should come from a devContainer, Docker container, VM, or other user-controlled environment.
|
|
769
902
|
|
|
770
|
-
##
|
|
903
|
+
## 19. Known Implementation Boundaries
|
|
771
904
|
|
|
772
905
|
- No tmux backend.
|
|
773
906
|
- No per-role worktree manager.
|
|
907
|
+
- No branch switching for an existing task.
|
|
774
908
|
- No main-page artifact inspector.
|
|
775
909
|
- No raw PTY output translation.
|
|
776
910
|
- No hard workflow gate enforcement.
|