vibe-coding-master 0.0.11 → 0.0.13

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.
@@ -28,7 +28,7 @@ browser
28
28
  -> claude --agent <role>
29
29
  ```
30
30
 
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/`.
31
+ The app is local-first. It writes project control state under `.ai/vcm/`, handoff artifacts under `.ai/vcm/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
 
@@ -94,7 +94,7 @@ Responsibilities:
94
94
  - Render repository connect form.
95
95
  - Render repository summary.
96
96
  - Render workflow panel.
97
- - Render settings section with Theme, Messages, Events, Auto orchestration.
97
+ - Render settings section with Theme, Round alert, Messages, and Events.
98
98
  - Render harness status/actions.
99
99
  - Render task creation form with one task-name field, a `Create worktree and branch` checkbox selected by default, and generated branch/path previews when selected.
100
100
  - Render task list.
@@ -110,10 +110,13 @@ File:
110
110
 
111
111
  Responsibilities:
112
112
 
113
- - Fetch task status, messages, and orchestration state.
113
+ - Fetch task status, messages, orchestration state, and round state.
114
114
  - Poll those every three seconds.
115
115
  - Render compact header with task title, branch, immutable worktree path, role tabs, Refresh, and red `Close Task`.
116
116
  - Hold per-role permission mode selection.
117
+ - Hold task orchestration state and pass its on/off control to the active role console.
118
+ - Detect newly delivered auto-orchestration messages and switch the active role tab to the target role.
119
+ - Emit task round state to `App` so completion alerts can be deduplicated and displayed.
117
120
  - Render one `SessionConsole` per role but only show the active role.
118
121
  - Emit workflow/messages/orchestration/events back to `App` so sidebar stays synchronized.
119
122
 
@@ -125,6 +128,12 @@ File:
125
128
 
126
129
  Responsibilities:
127
130
 
131
+ - Render role session controls and embedded terminal.
132
+ - Render `Auto orchestration` immediately to the left of `Translate`, using the same compact toggle styling.
133
+ - Render the translation split panel when `Translate` is enabled.
134
+
135
+ Responsibilities:
136
+
128
137
  - Render role toolbar.
129
138
  - Render embedded terminal for running sessions.
130
139
  - Render empty/resume state for stopped sessions.
@@ -242,7 +251,7 @@ feature/<taskSlug>
242
251
  Worktree path:
243
252
 
244
253
  ```text
245
- <baseRepoRoot>/.ai/vcm/worktrees/<taskSlug>
254
+ <baseRepoRoot>/.claude/worktrees/<taskSlug>
246
255
  ```
247
256
 
248
257
  VCM does not support switching a task to another branch or worktree mode after creation. If the user needs a different branch/worktree choice, they should create a new task.
@@ -258,7 +267,7 @@ worktreePath: undefined
258
267
  VCM does not create worktrees by role. All four role sessions for a task share the same task worktree:
259
268
 
260
269
  ```text
261
- .ai/vcm/worktrees/<taskSlug>/
270
+ .claude/worktrees/<taskSlug>/
262
271
  project-manager session cwd
263
272
  architect session cwd
264
273
  coder session cwd
@@ -274,11 +283,11 @@ VCM distinguishes:
274
283
  - `branch`: `feature/<taskSlug>`.
275
284
  - `worktreePath`: same as `taskRepoRoot`.
276
285
 
277
- Base repo state is only the task index and the container for nested task worktrees:
286
+ Base repo state is the task index plus the Claude-compatible container for nested task worktrees:
278
287
 
279
288
  ```text
280
289
  <baseRepoRoot>/.ai/vcm/tasks/<task>.json
281
- <baseRepoRoot>/.ai/vcm/worktrees/<task>/
290
+ <baseRepoRoot>/.claude/worktrees/<task>/
282
291
  ```
283
292
 
284
293
  Project configuration is app-local and stored outside the repository:
@@ -291,28 +300,30 @@ Project configuration is app-local and stored outside the repository:
291
300
  Task runtime state, source changes, and handoff artifacts live in the task runtime repo. For worktree-backed tasks this is the nested task worktree:
292
301
 
293
302
  ```text
294
- <baseRepoRoot>/.ai/vcm/worktrees/<task>/.ai/vcm/sessions/<task>.json
295
- <baseRepoRoot>/.ai/vcm/worktrees/<task>/.ai/vcm/messages/<task>.jsonl
296
- <baseRepoRoot>/.ai/vcm/worktrees/<task>/.ai/vcm/orchestration/<task>.json
297
- <baseRepoRoot>/.ai/vcm/worktrees/<task>/.ai/vcm/translation/<task>/
298
- <baseRepoRoot>/.ai/vcm/worktrees/<task>/.ai/handoffs/<task>/
303
+ <baseRepoRoot>/.claude/worktrees/<task>/.ai/vcm/sessions/<task>.json
304
+ <baseRepoRoot>/.claude/worktrees/<task>/.ai/vcm/messages/<task>.jsonl
305
+ <baseRepoRoot>/.claude/worktrees/<task>/.ai/vcm/orchestration/<task>.json
306
+ <baseRepoRoot>/.claude/worktrees/<task>/.ai/vcm/translation/<task>/
307
+ <baseRepoRoot>/.claude/worktrees/<task>/.ai/vcm/handoffs/
299
308
  ```
300
309
 
301
310
  For inline tasks, `taskRepoRoot` is the connected base repo, so these same runtime paths resolve under the connected repo's `.ai/vcm/`.
302
311
 
312
+ Because the handoff directory is `<taskRepoRoot>/.ai/vcm/handoffs/` without a task slug segment, VCM rejects creating a second active inline task in the same connected repository. Parallel tasks should use the default worktree mode.
313
+
303
314
  This split lets VCM list tasks from the base repo after worktrees are created, while each task's runtime state follows the same root as the role sessions.
304
315
 
305
316
  ### 6.2 Git Ignore Requirement
306
317
 
307
- The base repository must ignore `.ai/vcm/`.
318
+ The base repository must ignore `.ai/vcm/` and `.claude/worktrees/`.
308
319
 
309
320
  Reason:
310
321
 
311
- - `.ai/vcm/worktrees/<task>` is a nested git worktree.
312
- - Without `.ai/vcm/` in `.gitignore`, the base repo sees worktree files as untracked noise.
322
+ - `.claude/worktrees/<task>` is a nested git worktree.
323
+ - Without `.claude/worktrees/` in `.gitignore`, the base repo sees worktree files as untracked noise.
313
324
  - `.ai/vcm` also contains local task/session/message metadata that should not be committed by default.
314
325
 
315
- The VCM harness manages a `.gitignore` block that ignores `.ai/vcm/` before task worktree creation.
326
+ The VCM harness manages a `.gitignore` block that ignores `.ai/vcm/` and `.claude/worktrees/` before task worktree creation.
316
327
 
317
328
  ### 6.3 Task Creation Flow
318
329
 
@@ -321,15 +332,17 @@ POST /api/tasks
321
332
  -> validate taskSlug
322
333
  -> assert .ai/vcm/ is ignored by Git
323
334
  -> if createWorktree is not false:
335
+ -> assert .claude/worktrees/ is ignored by Git
324
336
  -> compute branch feature/<taskSlug>
325
- -> compute worktreePath <baseRepoRoot>/.ai/vcm/worktrees/<taskSlug>
337
+ -> compute worktreePath <baseRepoRoot>/.claude/worktrees/<taskSlug>
326
338
  -> assert branch does not already exist
327
339
  -> assert worktreePath does not already exist
328
340
  -> assert base repo has no uncommitted changes
329
341
  -> git worktree add -b feature/<taskSlug> <worktreePath> <baseRef>
330
- -> otherwise:
331
- -> read current base repo branch
332
- -> leave worktreePath undefined
342
+ -> otherwise:
343
+ -> read current base repo branch
344
+ -> leave worktreePath undefined
345
+ -> reject when another inline task is already active
333
346
  -> create handoff structure in taskRepoRoot
334
347
  -> write central task metadata under baseRepoRoot/.ai/vcm/tasks/<task>.json
335
348
  ```
@@ -344,11 +357,12 @@ POST /api/tasks/:taskSlug/cleanup
344
357
  -> list role sessions for the task
345
358
  -> stop each VCM-managed role session whose runtime status is running
346
359
  -> stop translation tailers and clear task translation cache
347
- -> when worktreePath exists, verify it belongs under <baseRepoRoot>/.ai/vcm/worktrees/
360
+ -> when worktreePath exists, verify it belongs under <baseRepoRoot>/.claude/worktrees/
348
361
  -> when worktreePath exists, git worktree remove --force <worktreePath>
349
362
  -> when worktreePath exists, delete the task branch by default
350
363
  -> delete base task metadata
351
364
  -> delete task runtime session/message/orchestration/translation metadata
365
+ -> delete task runtime handoff directory
352
366
  ```
353
367
 
354
368
  Close Task is intentionally destructive after user confirmation. It actively stops VCM-managed running role sessions, but it does not preflight running sessions or uncommitted worktree changes. Tasks created without a worktree remove VCM metadata only because there is no VCM-owned branch/worktree to delete.
@@ -396,7 +410,7 @@ Task cleanup is orchestrated by `src/backend/api/task-routes.ts` because it coor
396
410
  Handoff directory:
397
411
 
398
412
  ```text
399
- <taskRepoRoot>/.ai/handoffs/<task>/
413
+ <taskRepoRoot>/.ai/vcm/handoffs/
400
414
  role-commands/
401
415
  architect.md
402
416
  coder.md
@@ -528,7 +542,7 @@ The runtime:
528
542
  - spawns `node-pty`
529
543
  - sets `TERM=xterm-256color`
530
544
  - sets color-friendly env vars
531
- - appends raw PTY output to `<taskRepoRoot>/.ai/handoffs/<task>/logs/<role>.log`
545
+ - appends raw PTY output to `<taskRepoRoot>/.ai/vcm/handoffs/logs/<role>.log`
532
546
  - emits terminal output/input/exit events to WebSocket subscribers
533
547
  - replays the log on terminal WebSocket subscribe
534
548
 
@@ -562,7 +576,7 @@ State:
562
576
  ```text
563
577
  <taskRepoRoot>/.ai/vcm/messages/<task>.jsonl
564
578
  <taskRepoRoot>/.ai/vcm/orchestration/<task>.json
565
- <taskRepoRoot>/.ai/handoffs/<task>/messages/<message-id>.md
579
+ <taskRepoRoot>/.ai/vcm/handoffs/messages/<message-id>.md
566
580
  ```
567
581
 
568
582
  Policy:
@@ -582,16 +596,58 @@ The current GUI shows sequence, timestamp, status, body preview, path, and a `Co
582
596
  Auto mode:
583
597
 
584
598
  ```text
585
- send -> delivered
599
+ send -> delivered when target has no active message
600
+ send -> queued when target is already handling a delivered message
601
+ target role reply/result -> acknowledge active message -> deliver next queued message for that role
586
602
  ```
587
603
 
588
- The backend pastes a `[VCM MESSAGE]` envelope into the target terminal, then sends Enter as a separate terminal input event.
604
+ The backend pastes a `[VCM MESSAGE]` envelope into the target terminal, then sends Enter as a separate terminal input event. Delivery is serialized per target role. VCM does not infer Claude Code readiness from PTY silence; it treats `vcmctl reply` and `vcmctl result` from that role as the turn-complete signal.
605
+
606
+ The message service also serializes message mutations per task inside the VCM process so concurrent API calls cannot bypass the per-role in-flight check.
589
607
 
590
608
  The backend still exposes pause/resume orchestration API routes and stores `paused` for compatibility. The current GUI only toggles `mode` between `manual` and `auto`.
591
609
 
592
610
  Messages and orchestration snapshots are task runtime state under `taskRepoRoot/.ai/vcm`. Message body markdown also lives in the task worktree handoff directory.
593
611
 
594
- ## 12. Role Command Compatibility
612
+ ## 12. Round Completion Architecture
613
+
614
+ Files:
615
+
616
+ - `src/backend/services/round-service.ts`
617
+ - `src/backend/api/round-routes.ts`
618
+ - `src/shared/types/round.ts`
619
+
620
+ API:
621
+
622
+ ```text
623
+ GET /api/tasks/:taskSlug/round
624
+ ```
625
+
626
+ The round service subscribes to the same backend Claude transcript tailer used by translation. It tracks one lightweight state record per running role session:
627
+
628
+ - `unknown`
629
+ - `answering`
630
+ - `using_tools`
631
+ - `waiting_user`
632
+ - `abnormal`
633
+ - `idle`
634
+
635
+ `stop_reason === "end_turn"` is treated only as a candidate answer end. The service waits until pending tool uses are cleared and a short debounce passes before marking that role `idle`.
636
+
637
+ Task-level completion:
638
+
639
+ - If a message is currently `delivered` or `staged`, the latest such message defines the round target.
640
+ - In a PM -> role -> PM chain, completion follows the newest delivered message, so the round completes after PM finishes the final response.
641
+ - Queued or pending messages prevent completion.
642
+ - If no VCM message is in the round, the latest direct role answer can still produce a completion state.
643
+
644
+ Frontend behavior:
645
+
646
+ - `TaskWorkspace` polls the round endpoint with the other task state.
647
+ - `App` stores the sidebar `Round alert` preference in `~/.vcm/settings.json`.
648
+ - `App` deduplicates `completionId`, then shows a small `Round complete` prompt and plays a short Web Audio tone when alerts are enabled.
649
+
650
+ ## 13. Role Command Compatibility
595
651
 
596
652
  Files:
597
653
 
@@ -621,7 +677,7 @@ The dispatcher:
621
677
 
622
678
  This is a compatibility path. The preferred V1 coordination path is `vcmctl` message bus.
623
679
 
624
- ## 13. Harness Service
680
+ ## 14. Harness Service
625
681
 
626
682
  File:
627
683
 
@@ -651,6 +707,7 @@ Managed block:
651
707
  ```gitignore
652
708
  # VCM:BEGIN version=1
653
709
  .ai/vcm/
710
+ .claude/worktrees/
654
711
  # VCM:END
655
712
  ```
656
713
 
@@ -664,7 +721,7 @@ The service:
664
721
 
665
722
  It must not overwrite user content outside the VCM block.
666
723
 
667
- ## 14. Translation Architecture
724
+ ## 15. Translation Architecture
668
725
 
669
726
  Files:
670
727
 
@@ -778,7 +835,7 @@ POST translation/send -> bracketed paste English text -> short delay -> runtime.
778
835
 
779
836
  The backend strips trailing newlines before pasting and sends Enter separately. This avoids Claude Code TUI cases where a single large PTY write containing both text and `\r` fills the input line but does not submit it.
780
837
 
781
- ## 15. API Surface
838
+ ## 16. API Surface
782
839
 
783
840
  Project:
784
841
 
@@ -843,6 +900,12 @@ POST /api/tasks/:taskSlug/orchestration/pause
843
900
  POST /api/tasks/:taskSlug/orchestration/resume
844
901
  ```
845
902
 
903
+ Round:
904
+
905
+ ```text
906
+ GET /api/tasks/:taskSlug/round
907
+ ```
908
+
846
909
  App settings:
847
910
 
848
911
  ```text
@@ -871,7 +934,7 @@ WebSockets:
871
934
  /ws/terminal/:sessionId
872
935
  ```
873
936
 
874
- ## 16. Error Handling
937
+ ## 17. Error Handling
875
938
 
876
939
  File:
877
940
 
@@ -896,7 +959,7 @@ Fastify error handler returns:
896
959
  }
897
960
  ```
898
961
 
899
- ## 17. Packaging Architecture
962
+ ## 18. Packaging Architecture
900
963
 
901
964
  `package.json` publishes built artifacts:
902
965
 
@@ -918,7 +981,7 @@ Important scripts:
918
981
  - `prepack`: build and package verification
919
982
  - `postinstall`: fixes `node-pty` spawn helper when needed
920
983
 
921
- ## 18. Security And Safety Boundaries
984
+ ## 19. Security And Safety Boundaries
922
985
 
923
986
  Current boundaries:
924
987
 
@@ -928,11 +991,11 @@ Current boundaries:
928
991
  - Translation API key is local in `~/.vcm/settings.json`.
929
992
  - Translation output is UI/runtime state only unless a user or role copies it into a file.
930
993
  - `.ai/vcm` is local project control state and must be ignored by Git.
931
- - Task handoff artifacts live in the task worktree and users should decide whether those artifacts belong in task commits.
994
+ - Task handoff artifacts live under `.ai/vcm/handoffs/` as task-local runtime state and are removed by Close Task. Durable conclusions belong in normal project docs, code comments, commit messages, or PR text.
932
995
  - Task worktrees are created only during task creation; VCM does not expose branch/worktree switching APIs.
933
996
  - Sandbox isolation should come from a devContainer, Docker container, VM, or other user-controlled environment.
934
997
 
935
- ## 19. Known Implementation Boundaries
998
+ ## 20. Known Implementation Boundaries
936
999
 
937
1000
  - No tmux backend.
938
1001
  - No per-role worktree manager.
@@ -17,7 +17,7 @@ V1 is implemented as a local GUI app with:
17
17
  - API-driven message bus.
18
18
  - Translation panel based on Claude transcript JSONL tailing.
19
19
  - npm packaging with built `dist` and `dist-frontend` output.
20
- - Task creation creates one `feature/<task>` branch and one `.ai/vcm/worktrees/<task>` git worktree by default; users may clear `Create worktree and branch` to create an inline task in the connected repository/current branch.
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
21
 
22
22
  ## 2. Package And Build
23
23
 
@@ -193,6 +193,11 @@ Theme modes:
193
193
  - `light`
194
194
  - `dark`
195
195
 
196
+ Preferences:
197
+
198
+ - `themeMode`
199
+ - `roundCompletionAlerts`, default `true`
200
+
196
201
  ### `src/shared/types/task.ts`
197
202
 
198
203
  Defines:
@@ -210,7 +215,7 @@ Worktree fields:
210
215
  - `cleanupStatus?: "active" | "cleaned"`
211
216
  - `cleanedAt?: string`
212
217
 
213
- `CreateTaskRequest` supports `createWorktree?: boolean`. It creates a worktree and branch by default, and skips both when `createWorktree === false`.
218
+ `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.
214
219
 
215
220
  ### `src/shared/types/session.ts`
216
221
 
@@ -239,6 +244,17 @@ Defines:
239
244
 
240
245
  The state type includes `paused` for backend/API compatibility. The current GUI only exposes manual/auto.
241
246
 
247
+ ### `src/shared/types/round.ts`
248
+
249
+ Defines:
250
+
251
+ - `VcmRoleTurnStatus`
252
+ - `VcmTaskRoundStatus`
253
+ - `VcmRoleTurnState`
254
+ - `VcmTaskRoundState`
255
+
256
+ 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.
257
+
242
258
  ### `src/shared/types/translation.ts`
243
259
 
244
260
  Defines:
@@ -413,7 +429,7 @@ Worktree methods:
413
429
  Required safety:
414
430
 
415
431
  - all Git commands keep command-scoped `safe.directory`
416
- - `TaskService` verifies Close Task worktree paths are under `<baseRepoRoot>/.ai/vcm/worktrees/`
432
+ - `TaskService` verifies Close Task worktree paths are under `<baseRepoRoot>/.claude/worktrees/`
417
433
  - VCM-created task branches are derived from validated task slugs as `feature/<taskSlug>`
418
434
 
419
435
  ### `src/backend/adapters/claude-adapter.ts`
@@ -503,7 +519,7 @@ Responsibilities:
503
519
  - record recent repo paths in app settings
504
520
  - create `~/.vcm/projects/<project-id>/config.json`
505
521
  - ensure base state directories
506
- - ensure `.ai/vcm/` is ignored by Git before task-worktree creation
522
+ - ensure `.ai/vcm/` and `.claude/worktrees/` are ignored by Git before task-worktree creation
507
523
  - expose base repo as the project control root
508
524
 
509
525
  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.
@@ -539,17 +555,19 @@ createTask(baseRepoRoot, { taskSlug })
539
555
  -> assertValidTaskSlug(taskSlug)
540
556
  -> assert .ai/vcm/ is ignored
541
557
  -> if createWorktree is not false:
558
+ -> assert .claude/worktrees/ is ignored
542
559
  -> branch = feature/<taskSlug>
543
- -> worktreePath = <baseRepoRoot>/.ai/vcm/worktrees/<taskSlug>
560
+ -> worktreePath = <baseRepoRoot>/.claude/worktrees/<taskSlug>
544
561
  -> assert base repo has no uncommitted changes
545
562
  -> assert branch does not exist
546
563
  -> assert worktree path does not exist
547
564
  -> git.createWorktree({ baseRepoRoot, branch, worktreePath, baseRef: HEAD })
548
565
  -> taskRepoRoot = worktreePath
549
- -> otherwise:
550
- -> branch = current base repo branch
551
- -> worktreePath = undefined
552
- -> taskRepoRoot = baseRepoRoot
566
+ -> otherwise:
567
+ -> branch = current base repo branch
568
+ -> worktreePath = undefined
569
+ -> taskRepoRoot = baseRepoRoot
570
+ -> reject if another inline task is already active
553
571
  -> artifactService.ensureHandoffStructure({ repoRoot: taskRepoRoot, handoffDir })
554
572
  -> artifactService.createArtifactTemplates({ repoRoot: taskRepoRoot, handoffDir })
555
573
  -> ensure task runtime state dirs under <taskRepoRoot>/.ai/vcm/
@@ -564,10 +582,11 @@ cleanupTask(baseRepoRoot, taskSlug, options)
564
582
  -> route layer lists role sessions
565
583
  -> route layer stops each VCM-managed role session with status running
566
584
  -> route layer stops translation tailers and clears task translation cache
567
- -> if worktreePath exists, verify it is under <baseRepoRoot>/.ai/vcm/worktrees/
585
+ -> if worktreePath exists, verify it is under <baseRepoRoot>/.claude/worktrees/
568
586
  -> if worktreePath exists, git.removeWorktree(baseRepoRoot, worktreePath, force=true)
569
587
  -> if worktreePath exists, git.deleteBranch(baseRepoRoot, task.branch, force=true) by default
570
- -> delete <baseRepoRoot>/.ai/vcm/tasks/<task>.json
588
+ -> delete <baseRepoRoot>/.ai/vcm/tasks/<task>.json
589
+ -> delete <taskRepoRoot>/.ai/vcm/handoffs/
571
590
  -> delete <taskRepoRoot>/.ai/vcm/sessions/<task>.json
572
591
  -> delete <taskRepoRoot>/.ai/vcm/messages/<task>.jsonl
573
592
  -> delete <taskRepoRoot>/.ai/vcm/orchestration/<task>.json
@@ -599,13 +618,13 @@ In task-worktree mode, artifact paths are still repo-relative, but `repoRoot` mu
599
618
  Primary role command path:
600
619
 
601
620
  ```text
602
- .ai/handoffs/<task>/role-commands/<role>.md
621
+ .ai/vcm/handoffs/role-commands/<role>.md
603
622
  ```
604
623
 
605
624
  Legacy fallback:
606
625
 
607
626
  ```text
608
- .ai/handoffs/<task>/role-commands/<role>-command.md
627
+ .ai/vcm/handoffs/role-commands/<role>-command.md
609
628
  ```
610
629
 
611
630
  ### `src/backend/services/status-service.ts`
@@ -674,6 +693,10 @@ Responsibilities:
674
693
  - stage/approve/reject messages
675
694
  - get/update orchestration state
676
695
  - enforce message policy
696
+ - enforce per-target-role in-flight delivery
697
+ - queue extra messages for a busy target role
698
+ - acknowledge a role's active message when that role sends `vcmctl reply` or `vcmctl result`
699
+ - deliver the next queued message for that role after acknowledgement
677
700
  - persist message snapshots
678
701
  - write message body markdown
679
702
  - write staged or delivered messages to target terminal
@@ -682,8 +705,9 @@ In task-worktree mode:
682
705
 
683
706
  - message snapshots live under `task.worktreePath/.ai/vcm/messages`
684
707
  - orchestration state lives under `task.worktreePath/.ai/vcm/orchestration`
685
- - message body files live under `task.worktreePath/.ai/handoffs/<task>/messages`
708
+ - message body files live under `task.worktreePath/.ai/vcm/handoffs/messages`
686
709
  - terminal delivery uses the runtime session for the role, whose cwd is the task worktree
710
+ - message mutations are serialized per task inside the VCM process to avoid concurrent API calls bypassing the in-flight check
687
711
 
688
712
  ### `src/backend/services/command-dispatcher.ts`
689
713
 
@@ -810,6 +834,26 @@ Responsibilities:
810
834
 
811
835
  Terminal submission is delegated to `src/backend/runtime/terminal-submit.ts`, which bracket-pastes text, waits briefly, then sends Enter separately.
812
836
 
837
+ ### `src/backend/services/round-service.ts`
838
+
839
+ Exports:
840
+
841
+ - `RoundService`
842
+ - `TaskRoundInput`
843
+ - `RoundServiceDeps`
844
+ - `createRoundService(deps)`
845
+ - `evaluateTaskRoundState(input)`
846
+
847
+ Responsibilities:
848
+
849
+ - subscribe to Claude transcript events for running role sessions
850
+ - track per-role turn state, pending tool use ids, and debounced `end_turn`
851
+ - mark a role idle only after `stop_reason === "end_turn"`, no pending tools, and debounce
852
+ - evaluate task-level round completion from messages plus role states
853
+ - wait for the latest delivered/staged target role in PM -> role -> PM chains
854
+ - ignore completion while queued or pending messages exist
855
+ - stop trackers on session stop/restart and task close
856
+
813
857
  ## 9. Backend API
814
858
 
815
859
  ### `src/backend/server.ts`
@@ -835,6 +879,7 @@ Registers HTTP routes and the terminal WebSocket.
835
879
  - `src/backend/api/session-routes.ts`: session lifecycle and dispatch compatibility endpoint
836
880
  - `src/backend/api/artifact-routes.ts`: artifact, role command, and log reads/writes
837
881
  - `src/backend/api/message-routes.ts`: messages and orchestration
882
+ - `src/backend/api/round-routes.ts`: task round completion state
838
883
  - `src/backend/api/translation-routes.ts`: settings, prompt previews, provider test, start/poll, input/send, clear/retry
839
884
 
840
885
  Worktree task API:
@@ -853,6 +898,8 @@ Terminal WebSocket forwards PTY output/input/resize.
853
898
 
854
899
  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.
855
900
 
901
+ Round completion is HTTP-polled too. `GET /api/tasks/:taskSlug/round` returns `VcmTaskRoundState` from backend transcript trackers and message state; it is not a WebSocket stream.
902
+
856
903
  ## 10. Backend Templates
857
904
 
858
905
  ### `src/backend/templates/handoff.ts`
@@ -908,6 +955,7 @@ It calls:
908
955
  - artifact endpoints
909
956
  - message endpoints
910
957
  - orchestration endpoints
958
+ - round completion endpoint
911
959
  - translation endpoints
912
960
 
913
961
  Implemented task cleanup method:
@@ -941,10 +989,12 @@ Responsibilities:
941
989
 
942
990
  - own top-level app state
943
991
  - load current project and recent paths on startup
992
+ - load app preferences, including `themeMode` and `roundCompletionAlerts`
944
993
  - load tasks and harness status after connect
945
994
  - pass sidebar props to `ProjectDashboard`
946
995
  - pass task props to `TaskWorkspace`
947
996
  - keep active workflow/messages/orchestration/events synchronized by task
997
+ - dedupe task round `completionId` values and show/play completion alerts when enabled
948
998
 
949
999
  ### `src/frontend/routes/project-dashboard.tsx`
950
1000
 
@@ -960,6 +1010,7 @@ Responsibilities:
960
1010
  - repository summary
961
1011
  - workflow panel
962
1012
  - settings section
1013
+ - round completion alert toggle
963
1014
  - messages modal
964
1015
  - events modal
965
1016
  - harness panel
@@ -979,6 +1030,7 @@ Responsibilities:
979
1030
  - red `Close Task` action with destructive confirmation
980
1031
  - show branch and immutable worktree path for the active task
981
1032
  - status/message/orchestration refresh
1033
+ - round state refresh
982
1034
  - periodic polling
983
1035
  - session lifecycle actions
984
1036
  - per-role permission state
@@ -1071,7 +1123,7 @@ Exports:
1071
1123
  - `SessionConsoleProps`
1072
1124
  - `SessionConsole(props)`
1073
1125
 
1074
- Role console and translation split.
1126
+ Role console, `Auto orchestration` toggle, and translation split.
1075
1127
 
1076
1128
  ### `src/frontend/components/session-toolbar.tsx`
1077
1129
 
@@ -1145,8 +1197,9 @@ Sidebar:
1145
1197
 
1146
1198
  - all groups default collapsed
1147
1199
  - `Repository Path` default open only when no task is selected
1148
- - `Settings` includes `Theme`, `Messages`, `Events`, and `Auto orchestration`
1200
+ - `Settings` includes `Theme`, `Round alert`, `Messages`, and `Events`
1149
1201
  - `Theme` cycles through `System`, `Light`, and `Dark`; `System` follows the browser/OS color-scheme preference
1202
+ - `Round alert` is on by default and controls the in-app completion prompt plus short sound
1150
1203
 
1151
1204
  Task workspace:
1152
1205
 
@@ -1154,6 +1207,15 @@ Task workspace:
1154
1207
  - workflow is not in main workspace
1155
1208
  - messages/events are not in main workspace
1156
1209
  - active role console fills available space
1210
+ - `Auto orchestration` appears immediately to the left of `Translate` and uses the same compact toggle style
1211
+
1212
+ Round completion:
1213
+
1214
+ - backend transcript trackers use `stop_reason === "end_turn"` only after pending tools clear and debounce
1215
+ - task state follows the latest delivered/staged message target role
1216
+ - PM -> role -> PM chains complete after PM's final `end_turn`, not after the intermediate role's `end_turn`
1217
+ - queued or pending messages keep the round active
1218
+ - frontend dedupes `completionId` before showing a prompt or playing sound
1157
1219
 
1158
1220
  Translation:
1159
1221
 
@@ -1171,7 +1233,7 @@ App settings:
1171
1233
  ~/.vcm/settings.json
1172
1234
  ```
1173
1235
 
1174
- Contains UI theme preference, translation settings/secrets, and recent repository paths.
1236
+ Contains UI theme preference, round-completion alert preference, translation settings/secrets, and recent repository paths.
1175
1237
 
1176
1238
  Project config:
1177
1239
 
@@ -1196,7 +1258,7 @@ Messages:
1196
1258
 
1197
1259
  ```text
1198
1260
  <taskRepoRoot>/.ai/vcm/messages/<task>.jsonl
1199
- <taskRepoRoot>/.ai/handoffs/<task>/messages/<message-id>.md
1261
+ <taskRepoRoot>/.ai/vcm/handoffs/messages/<message-id>.md
1200
1262
  ```
1201
1263
 
1202
1264
  Orchestration:
@@ -1214,13 +1276,13 @@ Translation cache:
1214
1276
  Task worktrees:
1215
1277
 
1216
1278
  ```text
1217
- .ai/vcm/worktrees/<task>/
1279
+ .claude/worktrees/<task>/
1218
1280
  ```
1219
1281
 
1220
1282
  Handoff artifacts:
1221
1283
 
1222
1284
  ```text
1223
- .ai/handoffs/<task>/
1285
+ .ai/vcm/handoffs/
1224
1286
  ```
1225
1287
 
1226
1288
  Claude transcripts:
@@ -1243,9 +1305,9 @@ npm run verify:package
1243
1305
  For frontend layout changes, also verify manually:
1244
1306
 
1245
1307
  - connect repository
1246
- - confirm `.ai/vcm/` is ignored before creating a task worktree
1308
+ - confirm `.ai/vcm/` and `.claude/worktrees/` are ignored before creating a task worktree
1247
1309
  - create task and verify branch `feature/<task>` is created
1248
- - verify worktree path is `<baseRepoRoot>/.ai/vcm/worktrees/<task>`
1310
+ - verify worktree path is `<baseRepoRoot>/.claude/worktrees/<task>`
1249
1311
  - open task
1250
1312
  - verify role sessions start with cwd set to the task worktree
1251
1313
  - role tabs stay in header
@@ -1254,7 +1316,9 @@ For frontend layout changes, also verify manually:
1254
1316
  - translation split is 50/50
1255
1317
  - Messages modal opens from sidebar Settings
1256
1318
  - Events modal opens from sidebar Settings
1257
- - Auto orchestration toggles on/off
1319
+ - Auto orchestration toggles on/off from the role toolbar
1320
+ - Auto orchestration switches to the target role tab when a new message is delivered
1321
+ - Round alert can be toggled from sidebar Settings and fires once after a chained round truly completes
1258
1322
  - `Enter` in translation composer translates/sends
1259
1323
  - `Shift+Enter` inserts newline
1260
1324
  - close a worktree-backed task and verify it stops running role sessions, removes the worktree, deletes the task branch, and removes central task metadata
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vibe-coding-master",
3
- "version": "0.0.11",
3
+ "version": "0.0.13",
4
4
  "description": "Local GUI session cockpit for Claude Code role sessions.",
5
5
  "type": "module",
6
6
  "files": [