vibe-coding-master 0.0.16 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/README.md +74 -41
  2. package/dist/backend/api/artifact-routes.js +5 -5
  3. package/dist/backend/api/harness-routes.js +8 -0
  4. package/dist/backend/api/message-routes.js +4 -4
  5. package/dist/backend/api/round-routes.js +4 -2
  6. package/dist/backend/server.js +8 -2
  7. package/dist/backend/services/artifact-service.js +12 -12
  8. package/dist/backend/services/claude-hook-service.js +1 -1
  9. package/dist/backend/services/harness-service.js +579 -5
  10. package/dist/backend/services/message-service.js +71 -137
  11. package/dist/backend/services/project-service.js +4 -1
  12. package/dist/backend/services/round-service.js +14 -52
  13. package/dist/backend/services/session-service.js +1 -3
  14. package/dist/backend/services/task-service.js +16 -17
  15. package/dist/backend/templates/handoff.js +64 -26
  16. package/dist/backend/templates/harness/architect-agent.js +42 -12
  17. package/dist/backend/templates/harness/claude-root.js +42 -18
  18. package/dist/backend/templates/harness/coder-agent.js +15 -11
  19. package/dist/backend/templates/harness/known-issues-doc.js +22 -0
  20. package/dist/backend/templates/harness/project-manager-agent.js +66 -15
  21. package/dist/backend/templates/harness/pull-request-template.js +29 -0
  22. package/dist/backend/templates/harness/reviewer-agent.js +40 -12
  23. package/dist/backend/templates/harness/vcm-final-acceptance-skill.js +105 -0
  24. package/dist/backend/templates/harness/vcm-harness-bootstrap-skill.js +78 -0
  25. package/dist/backend/templates/harness/vcm-long-running-validation-skill.js +50 -0
  26. package/dist/backend/templates/harness/vcm-route-message-skill.js +86 -0
  27. package/dist/backend/templates/message-envelope.js +1 -0
  28. package/dist/backend/templates/role-command.js +7 -1
  29. package/dist/shared/validation/artifact-check.js +14 -9
  30. package/dist-frontend/assets/index-CrY5Ryps.js +90 -0
  31. package/dist-frontend/assets/index-CvvtrrCN.css +32 -0
  32. package/dist-frontend/index.html +2 -2
  33. package/docs/cc-best-practices.md +434 -192
  34. package/docs/full-harness-baseline.md +254 -0
  35. package/docs/product-design.md +31 -28
  36. package/docs/v0.2-implementation-plan.md +379 -0
  37. package/docs/vcm-cc-best-practices.md +449 -0
  38. package/package.json +3 -1
  39. package/scripts/harness-tools/generate-module-index +298 -0
  40. package/scripts/harness-tools/generate-public-surface +692 -0
  41. package/scripts/install-vcm-harness.mjs +1607 -0
  42. package/scripts/uninstall-vcm-harness.mjs +490 -0
  43. package/scripts/verify-package.mjs +4 -0
  44. package/dist-frontend/assets/index-CvtyKEfS.js +0 -89
  45. package/dist-frontend/assets/index-jEkUTnIY.css +0 -32
  46. package/docs/v1-architecture-design.md +0 -1009
  47. package/docs/v1-implementation-plan.md +0 -1376
@@ -1,1376 +0,0 @@
1
- # V1 Implementation Plan And File Map
2
-
3
- Last updated: 2026-05-31
4
-
5
- This document is the current implementation map for VCM V1.
6
-
7
- ## 1. Current Status
8
-
9
- V1 is implemented as a local GUI app with:
10
-
11
- - Fastify backend.
12
- - React frontend.
13
- - `node-pty` embedded terminals.
14
- - `xterm.js` terminal rendering.
15
- - Four Claude Code role sessions.
16
- - VCM harness installer.
17
- - API-driven message bus.
18
- - Translation panel based on Claude transcript JSONL tailing.
19
- - npm packaging with built `dist` and `dist-frontend` output.
20
- - Task creation creates one `feature/<task>` branch and one `.claude/worktrees/<task>` git worktree by default; users may clear `Create worktree and branch` to create an inline task in the connected repository/current branch. Because handoffs are scoped as `.ai/vcm/handoffs/` under the task runtime repo, only one active inline task is allowed per connected repository.
21
-
22
- ## 2. Package And Build
23
-
24
- File:
25
-
26
- - `package.json`
27
-
28
- Current package facts:
29
-
30
- - package name: `vibe-coding-master`
31
- - current version: `0.0.14`
32
- - type: ESM
33
- - `bin.vcm`: `dist/main.js`
34
- - published files: `dist`, `dist-frontend`, `docs`, `scripts`, `README.md`
35
-
36
- Scripts:
37
-
38
- - `clean`: remove build output.
39
- - `fix:node-pty`: fix packaged `node-pty` spawn helper.
40
- - `postinstall`: run `fix:node-pty`.
41
- - `verify:package`: verify required package files.
42
- - `prepack`: run build and package verification.
43
- - `dev`: start backend plus Vite dev server.
44
- - `build`: clean, compile Node TypeScript, build frontend.
45
- - `start`: run built backend.
46
- - `typecheck`: TypeScript no-emit checks for browser and Node configs.
47
- - `test`: Vitest.
48
- - `e2e`: Playwright.
49
-
50
- Packaging guard:
51
-
52
- - `scripts/verify-package.mjs`
53
-
54
- It verifies required files, shebangs, packaged static path behavior, and frontend built assets.
55
-
56
- ## 3. Source Tree
57
-
58
- ```text
59
- src/
60
- main.ts
61
- shared/
62
- constants.ts
63
- types/
64
- validation/
65
- backend/
66
- server.ts
67
- adapters/
68
- api/
69
- runtime/
70
- services/
71
- templates/
72
- ws/
73
- frontend/
74
- app.tsx
75
- main.tsx
76
- routes/
77
- components/
78
- state/
79
- terminal/
80
- styles.css
81
- ```
82
-
83
- Removed/obsolete files that must not be documented as active:
84
-
85
- - `src/shared/validation/translation-classifier.ts`
86
- - `src/frontend/state/translation-store.ts`
87
- - `src/frontend/components/translation-entry-row.tsx`
88
- - `src/frontend/state/task-store.ts`
89
-
90
- ## 4. Entry Points
91
-
92
- ### `src/main.ts`
93
-
94
- Exports:
95
-
96
- - `MainOptions`
97
- - `parseMainArgs(argv): MainOptions`
98
- - `main(argv): Promise<void>`
99
-
100
- Responsibilities:
101
-
102
- - parse `--dev`, `--open`, `--host=`, `--port=`
103
- - start backend on port `4173` by default
104
- - start Vite on port `5173` in dev mode
105
- - serve `dist-frontend` through backend in production mode
106
- - close backend/Vite on `SIGINT`
107
-
108
- ### Removed CLI Surface
109
-
110
- The target design removes `vcmctl` completely. Role sessions must not call a VCM CLI to send messages or hook events.
111
-
112
- Remove:
113
-
114
- - `src/cli/vcmctl.ts`
115
- - `bin.vcmctl` from `package.json`
116
- - packaged `dist/cli/vcmctl.js`
117
- - `VCM_CTL_COMMAND` session environment
118
- - harness rules that mention `vcmctl`
119
-
120
- Role sessions still receive enough environment for direct hook POSTs and backend-aware terminal delivery:
121
-
122
- - `VCM_API_URL`
123
- - `VCM_TASK_SLUG`
124
- - `VCM_ROLE`
125
- - `VCM_SESSION_ID`
126
-
127
- ## 5. Shared Layer
128
-
129
- ### `src/shared/constants.ts`
130
-
131
- Exports:
132
-
133
- - `DEFAULT_BACKEND_PORT`
134
- - `DEFAULT_FRONTEND_PORT`
135
- - `ROLE_DEFINITIONS`
136
- - `ROLE_NAMES`
137
- - `DISPATCHABLE_ROLES`
138
- - `isRoleName(value)`
139
- - `isDispatchableRole(value)`
140
- - `getRoleDefinition(role)`
141
-
142
- Roles:
143
-
144
- - `project-manager`
145
- - `architect`
146
- - `coder`
147
- - `reviewer`
148
-
149
- Dispatchable roles:
150
-
151
- - `architect`
152
- - `coder`
153
- - `reviewer`
154
-
155
- ### `src/shared/types/role.ts`
156
-
157
- Defines:
158
-
159
- - `RoleName`
160
- - `DispatchableRole`
161
- - `RoleStatus`
162
- - `RoleDefinition`
163
-
164
- ### `src/shared/types/project.ts`
165
-
166
- Defines:
167
-
168
- - `ProjectConfig`
169
- - `ProjectSummary`
170
- - `ConnectProjectRequest`
171
-
172
- Important fields:
173
-
174
- - `handoffRoot`
175
- - `stateRoot`
176
- - `terminalBackend`
177
- - `claudeCommand`
178
- - `isDirty`
179
-
180
- ### `src/shared/types/app-settings.ts`
181
-
182
- Defines:
183
-
184
- - `ThemeMode`
185
- - `AppPreferences`
186
- - `UpdateAppPreferencesRequest`
187
-
188
- Theme modes:
189
-
190
- - `system`
191
- - `light`
192
- - `dark`
193
-
194
- Preferences:
195
-
196
- - `themeMode`
197
- - `roundCompletionAlerts`, default `true`
198
-
199
- ### `src/shared/types/task.ts`
200
-
201
- Defines:
202
-
203
- - `TaskStatus`
204
- - `TaskRecord`
205
- - `CreateTaskRequest`
206
-
207
- Current UI sends `taskSlug` and `createWorktree`; the API type still permits optional `title` and `specPath`.
208
-
209
- Worktree fields:
210
-
211
- - `worktreePath?: string`
212
- - `branch: feature/<taskSlug>` when worktree creation is selected, otherwise the connected repo's current branch
213
- - `cleanupStatus?: "active" | "cleaned"`
214
- - `cleanedAt?: string`
215
-
216
- `CreateTaskRequest` supports `createWorktree?: boolean`. It creates a worktree and branch by default, and skips both when `createWorktree === false`. Inline creation rejects a second active inline task in the same connected repository.
217
-
218
- ### `src/shared/types/session.ts`
219
-
220
- Defines:
221
-
222
- - `ClaudePermissionMode`
223
- - `RoleSessionRecord`
224
- - `TaskSessionRecord`
225
- - `RoleSessionPointer`
226
- - `StartRoleSessionRequest`
227
-
228
- `RoleSessionRecord` includes `claudeSessionId` and `transcriptPath`, which are required for resume and translation transcript lookup.
229
-
230
- ### `src/shared/types/message.ts`
231
-
232
- Defines:
233
-
234
- - `VcmMessageActor`
235
- - `VcmMessageType`
236
- - `VcmMessageStatus`
237
- - `VcmOrchestrationMode`
238
- - `VcmRoleMessage`
239
- - `VcmOrchestrationState`
240
- - `VcmRouteFile`
241
- - `VcmRouteFileDispatchResult`
242
-
243
- The state type should only expose the current manual/auto mode. Remove compatibility-only paused state when deleting `vcmctl`.
244
-
245
- ### `src/shared/types/round.ts`
246
-
247
- Defines:
248
-
249
- - `VcmRoleTurnStatus`
250
- - `VcmTaskRoundStatus`
251
- - `VcmRoleTurnState`
252
- - `VcmTaskRoundState`
253
-
254
- Round state is task-level. It reports the latest active/completed role, queued and pending message counts, and a stable `completionId` for frontend notification dedupe.
255
-
256
- ### `src/shared/types/translation.ts`
257
-
258
- Defines:
259
-
260
- - `TranslationProviderType`
261
- - `TranslationDirection`
262
- - `TranslationInputMode`
263
- - `TranslationPromptKey`
264
- - `TRANSLATION_PROMPT_KEYS`
265
- - `TranslationSourceKind`
266
- - `TranslationStatus`
267
- - `TranslationSettings`
268
- - `TranslationSecretSettings`
269
- - `TranslationEntry`
270
- - `TranslateUserInputRequest`
271
- - `TranslateUserInputResult`
272
- - `SendTranslatedInputRequest`
273
- - `TranslationProviderTestResult`
274
- - `TranslationPromptPreview`
275
- - `TranslationSessionStatus`
276
- - `TranslationSessionEvent`
277
- - `StartTranslationSessionResult`
278
- - `PollTranslationSessionResult`
279
-
280
- Prompt keys:
281
-
282
- - `zh-to-en`
283
- - `zh-to-en-with-context`
284
- - `en-to-zh`
285
-
286
- Source kinds:
287
-
288
- - `prose`
289
- - `tool-output`
290
-
291
- Statuses:
292
-
293
- - `queued`
294
- - `translating`
295
- - `translated`
296
- - `failed`
297
- - `preserved`
298
-
299
- ### `src/shared/types/api.ts`
300
-
301
- Defines:
302
-
303
- - `ApiErrorResponse`
304
- - `TaskStatusReport`
305
- - `DispatchRoleCommandResult`
306
- - `BootstrapState`
307
-
308
- ### `src/shared/types/artifact.ts`
309
-
310
- Defines:
311
-
312
- - `ArtifactKind`
313
- - `HandoffPaths`
314
- - `ArtifactCheckResult`
315
- - `ArtifactSummary`
316
-
317
- Artifact kinds:
318
-
319
- - `architecture-plan`
320
- - `implementation-log`
321
- - `validation-log`
322
- - `review-report`
323
- - `docs-sync-report`
324
-
325
- ### `src/shared/types/harness.ts`
326
-
327
- Defines:
328
-
329
- - `HarnessFileKind`
330
- - `HarnessFileAction`
331
- - `HarnessFileStatus`
332
- - `HarnessPlannedChange`
333
- - `HarnessStatusReport`
334
- - `HarnessApplyResult`
335
-
336
- ### `src/shared/types/terminal.ts`
337
-
338
- Defines:
339
-
340
- - `ClientTerminalMessage`
341
- - `ServerTerminalMessage`
342
- - `TerminalEvent`
343
-
344
- ### `src/shared/validation/slug-check.ts`
345
-
346
- Exports:
347
-
348
- - `validateTaskSlug(taskSlug)`
349
- - `assertValidTaskSlug(taskSlug)`
350
-
351
- Current rule:
352
-
353
- - lowercase slug-style task names
354
- - safe for local paths and URLs
355
-
356
- ### `src/shared/validation/artifact-check.ts`
357
-
358
- Exports:
359
-
360
- - `checkMarkdownArtifact(kind, path, content)`
361
-
362
- Current checks are title/placeholder oriented and do not judge semantic quality.
363
-
364
- ### `src/shared/validation/language-detect.ts`
365
-
366
- Exports:
367
-
368
- - `cjkRatio(value)`
369
- - `isProbablyCjk(value, threshold)`
370
- - `shouldSkipForTargetLanguage(value, targetLanguage)`
371
-
372
- These helpers remain available, but current Claude-output translation no longer uses a classifier to skip assistant prose.
373
-
374
- ## 6. Backend Adapters
375
-
376
- ### `src/backend/adapters/filesystem.ts`
377
-
378
- Exports:
379
-
380
- - `FileSystemAdapter`
381
- - `EnsureFileOptions`
382
- - `createNodeFileSystemAdapter()`
383
- - `resolveRepoPath(repoRoot, repoRelativePath)`
384
- - `toRepoRelativePath(repoRoot, absolutePath)`
385
-
386
- Used by all services that touch repo/app files.
387
-
388
- ### `src/backend/adapters/command-runner.ts`
389
-
390
- Exports:
391
-
392
- - `CommandResult`
393
- - `CommandRunner`
394
- - `CommandRunnerOptions`
395
- - `createCommandRunner()`
396
-
397
- Used by Git and Claude adapters.
398
-
399
- ### `src/backend/adapters/git-adapter.ts`
400
-
401
- Exports:
402
-
403
- - `GitRepoCheck`
404
- - `GitAdapter`
405
- - `createGitAdapter(runner)`
406
-
407
- Important behavior:
408
-
409
- - checks `.git` directly
410
- - accepts normal `.git` directories
411
- - accepts `.git` pointer files
412
- - passes per-command `safe.directory`
413
-
414
- Worktree methods:
415
-
416
- - `branchExists(repoRoot, branch): Promise<boolean>`
417
- - `createWorktree(input): Promise<void>`
418
- - `removeWorktree(repoRoot, worktreePath, options): Promise<void>`
419
- - `deleteBranch(repoRoot, branch, options): Promise<void>`
420
- - `getStatusPorcelain(repoRoot): Promise<string>`
421
- - `isIgnored(repoRoot, repoRelativePath): Promise<boolean>`
422
-
423
- Required safety:
424
-
425
- - all Git commands keep command-scoped `safe.directory`
426
- - `TaskService` verifies Close Task worktree paths are under `<baseRepoRoot>/.claude/worktrees/`
427
- - VCM-created task branches are derived from validated task slugs as `feature/<taskSlug>`
428
-
429
- ### `src/backend/adapters/claude-adapter.ts`
430
-
431
- Exports:
432
-
433
- - `ClaudeAdapter`
434
- - `createClaudeAdapter(runner)`
435
-
436
- Builds role commands:
437
-
438
- ```text
439
- claude --agent <role> --session-id <uuid>
440
- claude --agent <role> --resume <uuid>
441
- ```
442
-
443
- Adds permission flags for `bypassPermissions` and `dangerously-skip-permissions`.
444
-
445
- ### `src/backend/adapters/translation-provider.ts`
446
-
447
- Exports:
448
-
449
- - `TranslationProviderRequest`
450
- - `TranslationProviderResult`
451
- - `TranslationProvider`
452
- - `TranslationProviderError`
453
- - `createOpenAiCompatibleTranslationProvider(fetchImpl)`
454
- - `buildChatCompletionsUrl(baseUrl)`
455
- - `parseOpenAiUsage(raw)`
456
-
457
- Implements OpenAI-compatible chat completions.
458
-
459
- ## 7. Backend Runtime
460
-
461
- ### `src/backend/runtime/terminal-runtime.ts`
462
-
463
- Defines the runtime interface:
464
-
465
- - `CreateTerminalSessionInput`
466
- - `TerminalSession`
467
- - `TerminalEventListener`
468
- - `Unsubscribe`
469
- - `SubscribeTerminalOptions`
470
- - `TerminalRuntime`
471
-
472
- ### `src/backend/runtime/node-pty-runtime.ts`
473
-
474
- Exports:
475
-
476
- - `NodePtyRuntimeDeps`
477
- - `createNodePtyTerminalRuntime(deps)`
478
- - `buildPtyEnvironment(baseEnv, inputEnv)`
479
-
480
- Responsibilities:
481
-
482
- - spawn Claude Code with `node-pty`
483
- - append raw output to role log file
484
- - emit terminal output/input/exit events
485
- - replay logs on subscribe
486
- - handle writes, resize, stop
487
- - set color-friendly terminal env vars
488
-
489
- ### `src/backend/runtime/session-registry.ts`
490
-
491
- Exports:
492
-
493
- - `SessionRegistry`
494
- - `createSessionRegistry()`
495
-
496
- In-memory index for live/persisted role records by runtime session id and role.
497
-
498
- ## 8. Backend Services
499
-
500
- ### `src/backend/services/project-service.ts`
501
-
502
- Exports:
503
-
504
- - `ProjectService`
505
- - `ProjectServiceDeps`
506
- - `createProjectService(deps)`
507
- - `buildDefaultProjectConfig(repoRoot)`
508
-
509
- Responsibilities:
510
-
511
- - connect repo
512
- - store current project in process memory
513
- - record recent repo paths in app settings
514
- - create `~/.vcm/projects/<project-id>/config.json`
515
- - ensure base state directories
516
- - ensure `.ai/vcm/` and `.claude/worktrees/` are ignored by Git before task-worktree creation
517
- - expose base repo as the project control root
518
-
519
- Repository connect should keep connecting to the base repo. Task worktrees are managed under that base repo and should not be treated as separate projects in the normal task list.
520
-
521
- ### `src/backend/services/task-service.ts`
522
-
523
- Exports:
524
-
525
- - `TaskService`
526
- - `TaskServiceDeps`
527
- - `createTaskService(deps)`
528
-
529
- Responsibilities:
530
-
531
- - create task
532
- - list tasks
533
- - load task
534
- - save task
535
- - update task status
536
- - create task branch and worktree
537
- - clean up completed task worktree and task metadata
538
-
539
- Task files:
540
-
541
- ```text
542
- <baseRepoRoot>/.ai/vcm/tasks/<task>.json
543
- ```
544
-
545
- Create flow:
546
-
547
- ```text
548
- createTask(baseRepoRoot, { taskSlug })
549
- -> assertValidTaskSlug(taskSlug)
550
- -> assert .ai/vcm/ is ignored
551
- -> if createWorktree is not false:
552
- -> assert .claude/worktrees/ is ignored
553
- -> branch = feature/<taskSlug>
554
- -> worktreePath = <baseRepoRoot>/.claude/worktrees/<taskSlug>
555
- -> assert base repo has no uncommitted changes
556
- -> assert branch does not exist
557
- -> assert worktree path does not exist
558
- -> git.createWorktree({ baseRepoRoot, branch, worktreePath, baseRef: HEAD })
559
- -> taskRepoRoot = worktreePath
560
- -> otherwise:
561
- -> branch = current base repo branch
562
- -> worktreePath = undefined
563
- -> taskRepoRoot = baseRepoRoot
564
- -> reject if another inline task is already active
565
- -> artifactService.ensureHandoffStructure({ repoRoot: taskRepoRoot, handoffDir })
566
- -> artifactService.createArtifactTemplates({ repoRoot: taskRepoRoot, handoffDir })
567
- -> ensure task runtime state dirs under <taskRepoRoot>/.ai/vcm/
568
- -> write central task record under <baseRepoRoot>/.ai/vcm/tasks/<task>.json
569
- ```
570
-
571
- Close Task flow:
572
-
573
- ```text
574
- cleanupTask(baseRepoRoot, taskSlug, options)
575
- -> load central task record
576
- -> route layer lists role sessions
577
- -> route layer stops each VCM-managed role session with status running
578
- -> route layer stops translation tailers and clears task translation cache
579
- -> if worktreePath exists, verify it is under <baseRepoRoot>/.claude/worktrees/
580
- -> if worktreePath exists, git.removeWorktree(baseRepoRoot, worktreePath, force=true)
581
- -> if worktreePath exists, git.deleteBranch(baseRepoRoot, task.branch, force=true) by default
582
- -> delete <baseRepoRoot>/.ai/vcm/tasks/<task>.json
583
- -> delete <taskRepoRoot>/.ai/vcm/handoffs/
584
- -> delete <taskRepoRoot>/.ai/vcm/sessions/<task>.json
585
- -> delete <taskRepoRoot>/.ai/vcm/messages/<task>.jsonl
586
- -> delete <taskRepoRoot>/.ai/vcm/orchestration/<task>.json
587
- -> delete <taskRepoRoot>/.ai/vcm/translation/<task>/
588
- ```
589
-
590
- The UI labels this operation `Close Task`, styles it as a red destructive action, and shows a browser confirmation that names running role-session shutdown, the worktree, branch, and metadata that will be deleted. VCM actively stops VCM-managed running role sessions, but it does not preflight running sessions or uncommitted changes before closing. Tasks created without a worktree remove VCM metadata only.
591
-
592
- ### `src/backend/services/artifact-service.ts`
593
-
594
- Exports:
595
-
596
- - `ArtifactService`
597
- - input interfaces for handoff, artifacts, role commands, logs
598
- - `createArtifactService(fs)`
599
-
600
- Responsibilities:
601
-
602
- - compute handoff paths
603
- - create handoff directory structure
604
- - create artifact templates
605
- - list artifact checks
606
- - read artifacts
607
- - read/save role commands
608
- - append role logs
609
-
610
- In task-worktree mode, artifact paths are still repo-relative, but `repoRoot` must be the task worktree path, not the base repo path.
611
-
612
- Primary role command path:
613
-
614
- ```text
615
- .ai/vcm/handoffs/role-commands/<role>.md
616
- ```
617
-
618
- Legacy fallback:
619
-
620
- ```text
621
- .ai/vcm/handoffs/role-commands/<role>-command.md
622
- ```
623
-
624
- ### `src/backend/services/status-service.ts`
625
-
626
- Exports:
627
-
628
- - `StatusService`
629
- - `StatusServiceDeps`
630
- - `createStatusService(deps)`
631
-
632
- Responsibilities:
633
-
634
- - assemble `TaskStatusReport`
635
- - list sessions
636
- - list artifact checks
637
- - emit missing/incomplete artifact warnings
638
-
639
- ### `src/backend/services/session-service.ts`
640
-
641
- Exports:
642
-
643
- - `SessionService`
644
- - `SessionServiceDeps`
645
- - `createSessionService(deps)`
646
-
647
- Responsibilities:
648
-
649
- - start role session
650
- - resume role session
651
- - restart role session
652
- - stop role session
653
- - get role session
654
- - list role sessions
655
-
656
- Persistence:
657
-
658
- ```text
659
- <taskRepoRoot>/.ai/vcm/sessions/<task>.json
660
- ```
661
-
662
- Environment passed to Claude Code:
663
-
664
- - `VCM_API_URL`
665
- - `VCM_CTL_COMMAND`
666
- - `VCM_TASK_SLUG`
667
- - `VCM_ROLE`
668
-
669
- In task-worktree mode:
670
-
671
- - session cwd is `task.worktreePath`
672
- - session persistence is written under `task.worktreePath/.ai/vcm/sessions`
673
- - raw logs and handoff artifacts are written under the task worktree
674
-
675
- ### `src/backend/services/message-service.ts`
676
-
677
- Exports:
678
-
679
- - `MessageService`
680
- - `ScanPendingRouteFilesInput`
681
- - `DispatchPendingRouteFileInput`
682
- - `RouteFileRecord`
683
- - `createMessageService(deps)`
684
-
685
- Responsibilities:
686
-
687
- - list messages
688
- - scan route-file outboxes after Claude Code `Stop`
689
- - snapshot pending route-file messages
690
- - mark all open messages done for manual recovery
691
- - get/update orchestration state
692
- - enforce message policy
693
- - enforce per-target-role in-flight delivery
694
- - leave non-empty route files pending when a target role is busy, unavailable, or terminal submission fails
695
- - deliver the next pending route file when a target role becomes idle
696
- - persist message snapshots
697
- - archive dispatched route-file bodies before clearing source files
698
- - submit route-file messages to the target terminal
699
-
700
- In task-worktree mode:
701
-
702
- - message snapshots live under `task.worktreePath/.ai/vcm/messages`
703
- - orchestration state lives under `task.worktreePath/.ai/vcm/orchestration`
704
- - pending route files live under `task.worktreePath/.ai/vcm/handoffs/messages`
705
- - terminal delivery uses the runtime session for the role, whose cwd is the task worktree
706
- - message mutations are serialized per task inside the VCM process to avoid concurrent API calls bypassing the in-flight check
707
-
708
- Route-file protocol:
709
-
710
- - route file name is `<from-role>-<to-role>.md`
711
- - the filename is the authoritative route; frontmatter cannot override `from` or `to`
712
- - blank or whitespace-only files are ignored
713
- - non-empty files are pending
714
- - each directed route has exactly one pending file, so repeated sends by the same role to the same target become edits to the same file
715
- - VCM scans after every `Stop` hook
716
- - VCM scans the stopped role's outgoing files and pending files targeting newly idle roles
717
- - VCM delivers at most one route file per target role per scan
718
- - if several files target the same idle role, choose oldest modified time, then route name
719
- - successful terminal write snapshots the body as `delivering`
720
- - `UserPromptSubmit` confirms Claude Code accepted the prompt, stores `submitted`, then clears the source route file if it still contains that same message
721
- - failed, blocked, manual, or unavailable delivery leaves the source route file unchanged
722
- - `markAllDone` appends `acknowledged` snapshots and may clear pending route files only after user confirmation
723
-
724
- Required service functions:
725
-
726
- - `listMessages(taskSlug): Promise<VcmRoleMessage[]>`
727
- - `listPendingRouteFiles(repoRoot, taskSlug): Promise<RouteFileRecord[]>`
728
- - `scanAndDispatchPendingRouteFiles(input: { repoRoot: string; taskSlug: string; stoppedRole: RoleName }): Promise<void>`
729
- - `readRouteFile(path): Promise<RouteFileRecord | null>`
730
- - `dispatchPendingRouteFile(record): Promise<VcmRouteFileDispatchResult>`
731
- - `appendMessageSnapshot(message): Promise<void>`
732
- - `clearRouteFile(path): Promise<void>`
733
- - `markAllDone(taskSlug, options): Promise<MarkAllMessagesDoneResult>`
734
-
735
- `dispatchPendingRouteFile` must snapshot before clearing. Clearing means truncating the route file to an empty string, not deleting it.
736
-
737
- ### `src/backend/services/claude-hook-service.ts`
738
-
739
- Exports:
740
-
741
- - `ClaudeHookService`
742
- - `createClaudeHookService(deps)`
743
-
744
- Responsibilities:
745
-
746
- - accept Claude Code `UserPromptSubmit` and `Stop` hook events directly over HTTP
747
- - map hook events to the current VCM project, task, role, and persisted Claude session id
748
- - update `RoleSessionRecord.activityStatus`: `UserPromptSubmit -> running`, `Stop -> idle`
749
- - call `MessageService.confirmPromptSubmitted` when `UserPromptSubmit` includes a VCM message envelope
750
- - call `MessageService.scanAndDispatchPendingRouteFiles` after recording the stop event
751
- - never require `vcmctl hook-event`
752
-
753
- ### `src/backend/services/command-dispatcher.ts`
754
-
755
- Exports:
756
-
757
- - `CommandDispatcher`
758
- - `DispatchRoleCommandInput`
759
- - `CommandDispatcherDeps`
760
- - `createCommandDispatcher(deps)`
761
-
762
- Obsolete role-command dispatch path. Remove this as part of the route-file messaging migration; preferred orchestration is `MessageService` scanning `.ai/vcm/handoffs/messages/<from-role>-<to-role>.md` after `Stop`.
763
-
764
- ### `src/backend/services/harness-service.ts`
765
-
766
- Exports:
767
-
768
- - `HarnessService`
769
- - `HarnessServiceDeps`
770
- - `VCM_HARNESS_VERSION`
771
- - `createHarnessService(deps)`
772
-
773
- Responsibilities:
774
-
775
- - inspect harness files
776
- - manage `.gitignore` entries for VCM local state
777
- - plan create/insert/update/ok
778
- - apply VCM managed blocks
779
- - preserve user content outside managed blocks
780
-
781
- ### `src/backend/services/app-settings-service.ts`
782
-
783
- Exports:
784
-
785
- - `StoredTranslationConfig`
786
- - `AppSettingsFile`
787
- - `AppSettingsService`
788
- - `AppSettingsServiceDeps`
789
- - `createAppSettingsService(deps)`
790
-
791
- Settings responsibilities:
792
-
793
- - persist UI theme mode: `system`, `light`, or `dark`
794
- - persist translation settings and translation secrets
795
- - persist up to five recent repository paths
796
-
797
- Storage:
798
-
799
- ```text
800
- ~/.vcm/settings.json
801
- ```
802
-
803
- ### `src/backend/services/translation-prompts.ts`
804
-
805
- Exports:
806
-
807
- - `TranslationPromptInput`
808
- - `BuiltTranslationPrompt`
809
- - `buildTranslationPrompt(input)`
810
- - `getTranslationPromptKey(input)`
811
- - `getBaseTranslationPrompt(key, settings)`
812
- - `resolveTranslationSystemPrompt(key, settings)`
813
- - `getTranslationPromptPreviews(settings)`
814
-
815
- Owns default prompts and user overrides.
816
-
817
- ### `src/backend/services/translation-queue.ts`
818
-
819
- Exports:
820
-
821
- - `SerialTranslationQueue`
822
- - `TranslationQueueRegistry`
823
- - `createSerialTranslationQueue()`
824
- - `createTranslationQueueRegistry()`
825
-
826
- Ensures translations for one session run serially.
827
-
828
- ### `src/backend/services/claude-transcript-service.ts`
829
-
830
- Exports:
831
-
832
- - transcript event types
833
- - `ClaudeTranscriptService`
834
- - `TranscriptTail`
835
- - `createClaudeTranscriptService()`
836
- - `resolveExistingClaudeTranscriptPath(session)`
837
- - `findClaudeTranscriptPathBySessionId(claudeSessionId)`
838
- - `claudeProjectsRoot()`
839
- - `projectHash(projectDir)`
840
- - `projectsTranscriptDir(projectDir)`
841
- - `claudeTranscriptPath(projectDir, claudeSessionId)`
842
- - `parseAssistantContent(line)`
843
-
844
- Responsibilities:
845
-
846
- - tail Claude JSONL transcript files
847
- - resolve transcript path after start/resume/restart
848
- - parse assistant messages, tool uses, tool results, questions, todos, and agent calls
849
-
850
- ### `src/backend/services/translation-service.ts`
851
-
852
- Exports:
853
-
854
- - `TranslationService`
855
- - `TranslateUserInputServiceInput`
856
- - `SendTranslatedInputServiceInput`
857
- - `TranslationEventListener`
858
- - `TranslationServiceDeps`
859
- - `createTranslationService(deps)`
860
-
861
- Responsibilities:
862
-
863
- - load/update translation settings
864
- - expose prompt previews
865
- - test provider
866
- - start backend transcript listening for a role session
867
- - poll cached translation events by cursor
868
- - translate user input
869
- - send English text to active terminal
870
- - clear session entries and cached events
871
- - stop session/task translation listeners
872
- - retry failed output translation
873
- - subscribe to Claude transcript service
874
- - translate prose output and preserve tool output
875
-
876
- Terminal submission is delegated to `src/backend/runtime/terminal-submit.ts`, which bracket-pastes text, waits briefly, then sends Enter separately.
877
-
878
- ### `src/backend/services/round-service.ts`
879
-
880
- Exports:
881
-
882
- - `RoundService`
883
- - `TaskRoundInput`
884
- - `RoundServiceDeps`
885
- - `createRoundService(deps)`
886
- - `evaluateTaskRoundState(input)`
887
-
888
- Responsibilities:
889
-
890
- - read hook-driven role activity from `RoleSessionRecord`
891
- - map `activityStatus: "running"` to role state `answering`
892
- - map `activityStatus: "idle"` plus `lastStopAt` to role state `idle`
893
- - evaluate task-level round completion from messages plus role states
894
- - wait for the latest active delivering/submitted target role in PM -> role -> PM chains
895
- - ignore completion while queued or pending messages exist
896
-
897
- ## 9. Backend API
898
-
899
- ### `src/backend/server.ts`
900
-
901
- Exports:
902
-
903
- - `CreateServerOptions`
904
- - `ServerDeps`
905
- - `createServer(deps, options)`
906
- - `startServer(options)`
907
- - `CreateDefaultServerDepsOptions`
908
- - `createDefaultServerDeps(options)`
909
- - `getDefaultStaticDir()`
910
-
911
- Registers HTTP routes and the terminal WebSocket.
912
-
913
- ### Route files
914
-
915
- - `src/backend/api/app-settings-routes.ts`: UI preferences
916
- - `src/backend/api/project-routes.ts`: health, recent paths, connect/current project
917
- - `src/backend/api/harness-routes.ts`: harness status/apply
918
- - `src/backend/api/task-routes.ts`: tasks, task status, and Close Task cleanup endpoint; Close Task stops running role sessions before translation/task cleanup
919
- - `src/backend/api/session-routes.ts`: session lifecycle
920
- - `src/backend/api/artifact-routes.ts`: artifact and log reads/writes
921
- - `src/backend/api/message-routes.ts`: message history, pending route files, Mark All Done recovery, and orchestration
922
- - `src/backend/api/claude-hook-routes.ts`: Claude Code `UserPromptSubmit` and `Stop` hook receiver
923
- - `src/backend/api/round-routes.ts`: task round completion state
924
- - `src/backend/api/translation-routes.ts`: settings, prompt previews, provider test, start/poll, input/send, clear/retry
925
-
926
- Worktree task API:
927
-
928
- ```text
929
- POST /api/tasks/:taskSlug/cleanup
930
- ```
931
-
932
- Do not add a "switch task worktree" endpoint. Worktree assignment happens only during task creation.
933
-
934
- ### WebSocket files
935
-
936
- - `src/backend/ws/terminal-ws.ts`
937
-
938
- Terminal WebSocket forwards PTY output/input/resize.
939
-
940
- Translation does not use WebSocket. The backend writes cached translation events under `<taskRepoRoot>/.ai/vcm/translation/<task>/<role>/<session-id>.jsonl`; the frontend polls `GET /api/translation/sessions/:sessionId/events?after=<cursor>`. The cursor is the next expected seq, so `after=18` means seq `1..17` can be removed and seq `18+` should be returned.
941
-
942
- Round completion is HTTP-polled too. `GET /api/tasks/:taskSlug/round` returns `VcmTaskRoundState` from hook-driven role activity and message state; it is not a WebSocket stream.
943
-
944
- ## 10. Backend Templates
945
-
946
- ### `src/backend/templates/handoff.ts`
947
-
948
- Exports:
949
-
950
- - `renderArchitecturePlanTemplate(taskSlug)`
951
- - `renderImplementationLogTemplate(taskSlug)`
952
- - `renderValidationLogTemplate(taskSlug)`
953
- - `renderReviewReportTemplate(taskSlug)`
954
- - `renderDocsSyncReportTemplate(taskSlug)`
955
-
956
- ### `src/backend/templates/role-command.ts`
957
-
958
- Exports:
959
-
960
- - `renderRoleCommandTemplate(taskSlug, role)`
961
-
962
- ### `src/backend/templates/message-envelope.ts`
963
-
964
- Exports:
965
-
966
- - `renderMessageEnvelope(message)`
967
- - `renderManualStagePrompt(message)`
968
-
969
- Manual stage prompt does not submit Enter.
970
-
971
- Auto delivery envelope is submitted with Enter.
972
-
973
- ### Harness templates
974
-
975
- - `src/backend/templates/harness/claude-root.ts`
976
- - `src/backend/templates/harness/gitignore.ts`
977
- - `src/backend/templates/harness/project-manager-agent.ts`
978
- - `src/backend/templates/harness/architect-agent.ts`
979
- - `src/backend/templates/harness/coder-agent.ts`
980
- - `src/backend/templates/harness/reviewer-agent.ts`
981
-
982
- Each exports one render function for VCM managed rules.
983
-
984
- ## 11. Frontend State And API Client
985
-
986
- ### `src/frontend/state/api-client.ts`
987
-
988
- Central browser API wrapper.
989
-
990
- It calls:
991
-
992
- - project endpoints
993
- - harness endpoints
994
- - task endpoints
995
- - session endpoints
996
- - artifact endpoints
997
- - message endpoints
998
- - orchestration endpoints
999
- - route-file inspection endpoints for the Messages modal
1000
- - round completion endpoint
1001
- - translation endpoints
1002
-
1003
- Implemented task cleanup method:
1004
-
1005
- - `cleanupTask(taskSlug, options)`
1006
-
1007
- There are no branch/worktree switching APIs in the current frontend client.
1008
-
1009
- ### `src/frontend/state/app-store.ts`
1010
-
1011
- Exports:
1012
-
1013
- - `AppStateSnapshot`
1014
- - `selectActiveTask(tasks, activeTaskSlug)`
1015
-
1016
- ### `src/frontend/state/session-store.ts`
1017
-
1018
- Exports:
1019
-
1020
- - `getSessionForRole(sessions, role)`
1021
-
1022
- ## 12. Frontend Routes
1023
-
1024
- ### `src/frontend/app.tsx`
1025
-
1026
- Exports:
1027
-
1028
- - `App()`
1029
-
1030
- Responsibilities:
1031
-
1032
- - own top-level app state
1033
- - load current project and recent paths on startup
1034
- - load app preferences, including `themeMode` and `roundCompletionAlerts`
1035
- - load tasks and harness status after connect
1036
- - pass sidebar props to `ProjectDashboard`
1037
- - pass task props to `TaskWorkspace`
1038
- - keep active messages/orchestration/events synchronized by task
1039
- - dedupe task round `completionId` values and show/play completion alerts when enabled
1040
-
1041
- ### `src/frontend/routes/project-dashboard.tsx`
1042
-
1043
- Exports:
1044
-
1045
- - `ProjectDashboardProps`
1046
- - `ProjectDashboard(props)`
1047
-
1048
- Responsibilities:
1049
-
1050
- - collapsible sidebar
1051
- - repository connect form
1052
- - repository summary
1053
- - settings section
1054
- - round completion alert toggle
1055
- - try alert test button
1056
- - messages modal
1057
- - events modal
1058
- - harness panel
1059
- - task creation with one task-name field, `Create worktree and branch` checkbox selected by default, branch preview, and worktree path preview
1060
- - task navigation
1061
-
1062
- ### `src/frontend/routes/task-workspace.tsx`
1063
-
1064
- Exports:
1065
-
1066
- - `TaskWorkspaceProps`
1067
- - `TaskWorkspace(props)`
1068
-
1069
- Responsibilities:
1070
-
1071
- - task header with role tabs and refresh
1072
- - red `Close Task` action with destructive confirmation
1073
- - show branch and immutable worktree path for the active task
1074
- - status/message/orchestration refresh
1075
- - round state refresh
1076
- - periodic polling
1077
- - session lifecycle actions
1078
- - per-role permission state
1079
- - runtime event collection for sidebar Events modal
1080
-
1081
- ## 13. Frontend Components
1082
-
1083
- ### `src/frontend/components/app-shell.tsx`
1084
-
1085
- Exports:
1086
-
1087
- - `AppShellProps`
1088
- - `AppShell({ sidebar, children })`
1089
-
1090
- Two-column page shell.
1091
-
1092
- ### `src/frontend/components/repo-connect-form.tsx`
1093
-
1094
- Exports:
1095
-
1096
- - `RepoConnectFormProps`
1097
- - `RepoConnectForm(props)`
1098
-
1099
- Layout:
1100
-
1101
- - path input row
1102
- - recent select plus connect button row
1103
-
1104
- This form connects the base repository. It is not used to switch an existing task to another worktree.
1105
-
1106
- ### `src/frontend/components/harness-panel.tsx`
1107
-
1108
- Exports:
1109
-
1110
- - `HarnessPanelProps`
1111
- - `HarnessPanel(props)`
1112
-
1113
- Shows harness status and install/update action.
1114
-
1115
- ### `src/frontend/components/message-timeline.tsx`
1116
-
1117
- Exports:
1118
-
1119
- - `MessageTimelineProps`
1120
- - `getMessageCounts(messages)`
1121
- - `MessageTimeline(props)`
1122
-
1123
- Used inside the Messages modal. Current UI rows show sequence, timestamp, route, type, status, body preview, source route file path, and a `Copy` button. The modal header includes `Mark All Done` for manual recovery from stuck queued/in-flight messages. Stage/approve/reject backend APIs should be removed with the route-file migration.
1124
-
1125
- ### `src/frontend/components/event-log.tsx`
1126
-
1127
- Exports:
1128
-
1129
- - `EventLogProps`
1130
- - `EventLog(props)`
1131
-
1132
- Used inside the Events modal.
1133
-
1134
- ### `src/frontend/components/task-nav.tsx`
1135
-
1136
- Exports:
1137
-
1138
- - `TaskNavProps`
1139
- - `TaskNav(props)`
1140
-
1141
- Task list in sidebar.
1142
-
1143
- ### `src/frontend/components/role-session-tabs.tsx`
1144
-
1145
- Exports:
1146
-
1147
- - `RoleSessionTabsProps`
1148
- - `RoleSessionTabs(props)`
1149
-
1150
- Header role tabs with status badges.
1151
-
1152
- ### `src/frontend/components/session-console.tsx`
1153
-
1154
- Exports:
1155
-
1156
- - `SessionConsoleProps`
1157
- - `SessionConsole(props)`
1158
-
1159
- Role console, `Auto orchestration` toggle, and translation split.
1160
-
1161
- ### `src/frontend/components/session-toolbar.tsx`
1162
-
1163
- Exports:
1164
-
1165
- - `SessionToolbarProps`
1166
- - `SessionToolbar(props)`
1167
-
1168
- Renders permission select and session lifecycle buttons.
1169
-
1170
- There is no visible primary `Send Command` button in the current toolbar. Role-command dispatch should be removed with the route-file migration.
1171
-
1172
- ### `src/frontend/components/translation-panel.tsx`
1173
-
1174
- Exports:
1175
-
1176
- - `TranslationPanelProps`
1177
- - `TranslationPanel(props)`
1178
-
1179
- Renders output translations, settings actions, auto-send toggle, and composer.
1180
-
1181
- Important current behavior:
1182
-
1183
- - panel-level status only
1184
- - no per-entry status label
1185
- - no `Original` buttons
1186
- - tool output is preserved, dim, one-line
1187
- - prose source is replaced by translated text after completion
1188
- - prose renders Markdown with GFM support
1189
- - user-input translation entries add a thick divider and larger top spacing to mark question/answer boundaries
1190
- - no separate translated-English textarea
1191
-
1192
- ### `src/frontend/components/translation-settings-modal.tsx`
1193
-
1194
- Exports:
1195
-
1196
- - `TranslationSettingsModalProps`
1197
- - `TranslationSettingsModal(props)`
1198
-
1199
- Settings:
1200
-
1201
- - base URL
1202
- - API key as text input
1203
- - model
1204
- - target language
1205
- - context
1206
- - timeout
1207
- - temperature
1208
- - direct editors for `zh-to-en`, `zh-to-en-with-context`, and `en-to-zh`
1209
- - reset prompts to built-in defaults
1210
- - provider test
1211
-
1212
- ### `src/frontend/components/status-badge.tsx`
1213
-
1214
- Exports:
1215
-
1216
- - `StatusBadgeProps`
1217
- - `StatusBadge(props)`
1218
-
1219
- ### `src/frontend/terminal/xterm-view.tsx`
1220
-
1221
- Renders `xterm.js`, connects to terminal WebSocket, sends input and resize, and preserves terminal colors.
1222
-
1223
- ### `src/frontend/terminal/terminal-client.ts`
1224
-
1225
- Terminal WebSocket client wrapper.
1226
-
1227
- ## 14. UI State Details
1228
-
1229
- Sidebar:
1230
-
1231
- - all groups default collapsed
1232
- - `Repository Path` default open only when no task is selected
1233
- - `Settings` includes `Theme`, `Round alert`, `Try alert`, `Messages`, and `Events`
1234
- - `Theme` cycles through `System`, `Light`, and `Dark`; `System` follows the browser/OS color-scheme preference
1235
- - `Round alert` is on by default and controls the in-app completion prompt plus a soft two-note completion chime
1236
- - `Try alert` calls the same prompt/sound path without waiting for a real completed round
1237
-
1238
- Task workspace:
1239
-
1240
- - role tabs in the first header row
1241
- - messages/events are not in main workspace
1242
- - active role console fills available space
1243
- - `Auto orchestration` appears immediately to the left of `Translate` and uses the same compact toggle style
1244
-
1245
- Round completion:
1246
-
1247
- - task state follows the latest active delivering/submitted message target role
1248
- - role activity uses Claude Code `UserPromptSubmit` -> `running` and Claude Code `Stop` -> `idle`; VCM terminal submit also optimistically marks the target role `running`
1249
- - PM -> role -> PM chains complete after PM's final hook `Stop`, not after the intermediate role's `Stop`
1250
- - queued or pending messages keep the round active
1251
- - frontend dedupes `completionId` before showing a prompt or playing sound
1252
-
1253
- Translation:
1254
-
1255
- - top role toolbar button label is `✅ Translate` when on and `× Translate` when off
1256
- - translation panel `Auto-send` label is `✅ Auto-send` when on and `× Auto-send` when off
1257
- - panel uses terminal-like dark styling
1258
- - composer height is compact
1259
- - `Enter` translates/sends, `Shift+Enter` inserts newline
1260
-
1261
- ## 15. Data Persistence Summary
1262
-
1263
- App settings:
1264
-
1265
- ```text
1266
- ~/.vcm/settings.json
1267
- ```
1268
-
1269
- Contains UI theme preference, round-completion alert preference, translation settings/secrets, and recent repository paths.
1270
-
1271
- Project config:
1272
-
1273
- ```text
1274
- ~/.vcm/projects/<project-id>/config.json
1275
- ~/.vcm/projects/index.json
1276
- ```
1277
-
1278
- Task state:
1279
-
1280
- ```text
1281
- <baseRepoRoot>/.ai/vcm/tasks/<task>.json
1282
- ```
1283
-
1284
- Session state:
1285
-
1286
- ```text
1287
- <taskRepoRoot>/.ai/vcm/sessions/<task>.json
1288
- ```
1289
-
1290
- Messages:
1291
-
1292
- ```text
1293
- <taskRepoRoot>/.ai/vcm/messages/<task>.jsonl
1294
- <taskRepoRoot>/.ai/vcm/handoffs/messages/<from-role>-<to-role>.md
1295
- ```
1296
-
1297
- Orchestration:
1298
-
1299
- ```text
1300
- <taskRepoRoot>/.ai/vcm/orchestration/<task>.json
1301
- ```
1302
-
1303
- Translation cache:
1304
-
1305
- ```text
1306
- <taskRepoRoot>/.ai/vcm/translation/<task>/
1307
- ```
1308
-
1309
- Task worktrees:
1310
-
1311
- ```text
1312
- .claude/worktrees/<task>/
1313
- ```
1314
-
1315
- Handoff artifacts:
1316
-
1317
- ```text
1318
- .ai/vcm/handoffs/
1319
- ```
1320
-
1321
- Claude transcripts:
1322
-
1323
- ```text
1324
- ~/.claude/projects/<project-hash>/<claude-session-id>.jsonl
1325
- ```
1326
-
1327
- ## 16. Validation Checklist
1328
-
1329
- Before release or publish:
1330
-
1331
- ```bash
1332
- npm run typecheck
1333
- npm test
1334
- npm run build
1335
- npm run verify:package
1336
- ```
1337
-
1338
- For frontend layout changes, also verify manually:
1339
-
1340
- - connect repository
1341
- - confirm `.ai/vcm/` and `.claude/worktrees/` are ignored before creating a task worktree
1342
- - create task and verify branch `feature/<task>` is created
1343
- - verify worktree path is `<baseRepoRoot>/.claude/worktrees/<task>`
1344
- - open task
1345
- - verify role sessions start with cwd set to the task worktree
1346
- - role tabs stay in header
1347
- - sidebar sections collapse/open correctly
1348
- - embedded terminal remains visible after role switch
1349
- - translation split is 50/50
1350
- - Messages modal opens from sidebar Settings
1351
- - Events modal opens from sidebar Settings
1352
- - Auto orchestration toggles on/off from the role toolbar
1353
- - Auto orchestration switches to the target role tab when VCM submits a route-file message
1354
- - Round alert can be toggled from sidebar Settings and fires once after a chained round truly completes
1355
- - `Enter` in translation composer translates/sends
1356
- - `Shift+Enter` inserts newline
1357
- - close a worktree-backed task and verify it stops running role sessions, removes the worktree, deletes the task branch, and removes central task metadata
1358
-
1359
- ## 17. V1 Boundaries To Preserve
1360
-
1361
- Do not reintroduce these into V1 docs or UI unless the product direction changes:
1362
-
1363
- - tmux persistence backend
1364
- - CLI-first task management as the main product mode
1365
- - main workspace artifact panel
1366
- - Pause/Resume orchestration buttons in GUI
1367
- - raw PTY output translation
1368
- - translation classifier that drops assistant prose
1369
- - separate translated-English textarea
1370
- - optional title input in New Task
1371
- - `Dirty: yes/no` sidebar label
1372
- - role command dispatch as the primary orchestration path
1373
- - `vcmctl` as an active CLI or agent-facing message path
1374
- - per-role worktrees
1375
- - switching a task to another branch/worktree after creation
1376
- - a separate `Create task worktree` button outside task creation