vibe-coding-master 0.0.9 → 0.0.11

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.
@@ -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-D59GuHCR.js"></script>
8
- <link rel="stylesheet" crossorigin href="/assets/index-CuiNNOzj.css">
7
+ <script type="module" crossorigin src="/assets/index-DaHXq14j.js"></script>
8
+ <link rel="stylesheet" crossorigin href="/assets/index-Bi4X3GSR.css">
9
9
  </head>
10
10
  <body>
11
11
  <div id="root"></div>
@@ -1486,11 +1486,11 @@ Branch rules:
1486
1486
  - large work should use phase commits on the same task branch unless phases are independently releasable
1487
1487
  - if a task becomes too large, split it into child tasks with explicit branch and PR ownership
1488
1488
 
1489
- Cleanup rules:
1489
+ Close Task rules:
1490
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
1491
+ - after task completion, use VCM `Close Task` only when the user is ready to delete task-local state
1492
+ - for worktree-backed tasks, `Close Task` deletes the task worktree, deletes the task branch by default, and removes VCM task/session/message/orchestration metadata
1493
+ - `Close Task` does not check running role sessions or uncommitted changes; finish, commit, or preserve anything important before using it
1494
1494
 
1495
1495
  Small commits:
1496
1496
 
@@ -66,7 +66,7 @@ The workflow is a soft guide in V1. VCM computes readiness from handoff artifact
66
66
 
67
67
  ### 4.1 Task Worktree Model
68
68
 
69
- Task-level worktree management is the current model for multi-task parallelism:
69
+ Task-level worktree management is the recommended default model for multi-task parallelism:
70
70
 
71
71
  ```text
72
72
  one task
@@ -78,7 +78,9 @@ one task
78
78
 
79
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
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.
81
+ When the user creates a task, `Create worktree and branch` is selected by default. With that option selected, VCM creates the branch and worktree immediately. If the user clears the option, VCM creates the task in the currently connected repository path and records the current branch.
82
+
83
+ There is no separate later button named `Create task worktree`, and a task cannot be switched between worktree and non-worktree mode after creation.
82
84
 
83
85
  Branch naming:
84
86
 
@@ -108,27 +110,34 @@ Task creation flow:
108
110
  ```text
109
111
  New Task submit
110
112
  -> 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>
113
+ -> verify .ai/vcm/ is ignored
114
+ -> if Create worktree and branch is selected:
115
+ -> derive branch feature/<task-name>
116
+ -> derive worktree path .ai/vcm/worktrees/<task-name>
117
+ -> verify the base repo is clean
118
+ -> git worktree add -b feature/<task-name> .ai/vcm/worktrees/<task-name> <base-ref>
119
+ -> otherwise:
120
+ -> use the connected repo path and current branch
115
121
  -> create task metadata
116
- -> create handoff structure inside the task worktree
117
- -> open the task workspace with role session cwd = task worktree
122
+ -> create handoff structure inside the task runtime repo
123
+ -> open the task workspace with role session cwd = task runtime repo
118
124
  ```
119
125
 
120
- Task cleanup flow:
126
+ Task close flow:
121
127
 
122
128
  ```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
+ user clicks red Close Task
130
+ -> show destructive confirmation
131
+ -> stop VCM-managed running role sessions for the task
132
+ -> explain that VCM deletes the task worktree and task branch
133
+ -> explain that VCM does not check running sessions or uncommitted changes
134
+ -> remove git worktree when the task owns one
135
+ -> delete the task branch by default when the task owns one
136
+ -> remove VCM task metadata from the base repo
137
+ -> remove task runtime metadata from the task runtime repo
129
138
  ```
130
139
 
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.
140
+ Tasks created without a worktree do not own a separate branch/worktree, so Close Task stops VCM-managed running role sessions and removes only VCM metadata for those tasks.
132
141
 
133
142
  ## 5. Roles
134
143
 
@@ -242,10 +251,13 @@ The old `Dirty: yes/no` label is not used. The UI uses `Working tree: clean` or
242
251
 
243
252
  `Settings` contains:
244
253
 
254
+ - `Theme` button, cycling through `System`, `Light`, and `Dark`.
245
255
  - `Messages` button, opening a modal list of role messages.
246
256
  - `Events` button, opening a modal list of runtime UI events for the current task.
247
257
  - `Auto orchestration` on/off toggle.
248
258
 
259
+ The default theme mode is `System`, which follows the OS/browser color-scheme preference. The entire application chrome, sidebar, forms, modals, status badges, and workspace panels must support both light and dark rendering. Embedded terminals keep their terminal-native dark styling.
260
+
249
261
  There is no separate `Pause orchestration` or `Resume orchestration` control in the GUI. The current product model is one on/off toggle.
250
262
 
251
263
  `VCM Harness` shows whether VCM managed blocks are installed/up to date in the project rules files and `.gitignore`.
@@ -253,13 +265,14 @@ There is no separate `Pause orchestration` or `Resume orchestration` control in
253
265
  `New Task` contains:
254
266
 
255
267
  - `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>`
268
+ - a `Create worktree and branch` checkbox, selected by default
269
+ - generated branch preview when selected: `feature/<task-name>`
270
+ - generated worktree preview when selected: `.ai/vcm/worktrees/<task-name>`
271
+ - current repository/current branch note when cleared
259
272
 
260
273
  There is no optional title input in the current UI.
261
274
 
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.
275
+ The worktree/branch path is the recommended VCM task model, but the user may clear the checkbox for an inline task. VCM should not require a separate worktree creation action later.
263
276
 
264
277
  ### Task Workspace
265
278
 
@@ -367,7 +380,7 @@ For `.gitignore`, VCM uses hash comments:
367
380
  # VCM:END
368
381
  ```
369
382
 
370
- `.ai/vcm/` is the active VCM local control area for task state, session state, orchestration state, and task worktrees.
383
+ `.ai/vcm/` is the active VCM local control area. The base repo keeps the task index and nested worktrees; each task runtime repo keeps its own session, message, orchestration, and translation state.
371
384
 
372
385
  VCM must preserve all user-authored content outside the managed block.
373
386
 
@@ -426,9 +439,9 @@ Manual mode:
426
439
 
427
440
  - message status becomes `pending_approval` when the target role is running
428
441
  - user opens `Messages`
429
- - user clicks `Stage`
430
- - VCM writes a short prompt into the target terminal
431
- - VCM does not submit Enter
442
+ - message rows show sequence, timestamp, status, body preview, path, and `Copy`
443
+ - user decides whether to copy or manually act on the message
444
+ - VCM does not write to the target terminal or submit Enter
432
445
 
433
446
  Auto mode:
434
447
 
@@ -436,7 +449,7 @@ Auto mode:
436
449
  - PM remains the routing hub
437
450
  - non-PM roles reply to PM
438
451
 
439
- The backend still has a `paused` state field and pause/resume API routes for compatibility. The current GUI exposes only manual/auto.
452
+ The backend still has `stage`, `approve`, `reject`, `paused`, and pause/resume API compatibility paths. The current GUI exposes only message copy plus manual/auto orchestration.
440
453
 
441
454
  ## 12. Translation
442
455
 
@@ -468,7 +481,7 @@ Prompt slots:
468
481
  - `zh-to-en-with-context`
469
482
  - `en-to-zh`
470
483
 
471
- The settings modal shows the default prompt for each slot and allows a user override. Empty override means use the default prompt.
484
+ The settings modal shows all three prompt slots as direct editors. `Reset prompts` restores every prompt to its built-in default. The modal does not include separate enable/output/input-mode switches; opening the role toolbar `Translate` panel is the translation on/off control, and the panel-level `Auto-send` toggle controls whether translated user input is submitted automatically.
472
485
 
473
486
  ### Claude Output Translation
474
487
 
@@ -482,6 +495,16 @@ VCM tails Claude Code transcript JSONL files under:
482
495
 
483
496
  The transcript path is persisted in the role session record. If that path is missing, VCM falls back to resolving by current working directory and then scanning `~/.claude/projects` for the newest file with the session id.
484
497
 
498
+ VCM owns transcript listening in the backend. Opening the translation panel starts or confirms the backend tailer for the active role session. Closing the panel does not stop that tailer; it keeps collecting Claude output until the role session is stopped/restarted or the task is closed. This keeps translation capture independent from frontend rendering.
499
+
500
+ Backend translation cache lives under:
501
+
502
+ ```text
503
+ <taskRepoRoot>/.ai/vcm/translation/<task>/<role>/<session-id>.jsonl
504
+ ```
505
+
506
+ The frontend does not subscribe through WebSocket. It polls the backend with a cursor and receives new cached events. The cursor means "next expected seq": `after=18` confirms that seq `1..17` have already been displayed, so the backend can remove those cached events and return seq `18` and later. If the cursor is older than the retained cache, VCM still returns whatever newer events remain; it does not use a snapshot error mode.
507
+
485
508
  Transcript event handling:
486
509
 
487
510
  - assistant text -> `prose` -> translated
@@ -496,9 +519,12 @@ Display behavior:
496
519
  - `prose` starts by showing the English source.
497
520
  - while translating, panel status shows `translating <elapsed>`.
498
521
  - when translation succeeds, the English source is replaced by Chinese translated text.
522
+ - `prose` content is rendered as Markdown, including headings, lists, code fences, tables, and links.
499
523
  - when translation fails, panel status shows `error` and the entry keeps the visible source plus an error.
500
524
  - `tool-output` is dim, one-line, truncated by CSS, and not translated.
501
525
 
526
+ Long translations do not block capture. Prose entries are pushed to the panel before provider translation starts. `tool_use` and `tool_result` entries are never added to the translation queue; they are displayed immediately.
527
+
502
528
  There is no keyword classifier that drops assistant text. A previous design skipped permission-looking or log-looking text; that is removed.
503
529
 
504
530
  ### User Input Translation
@@ -512,7 +538,9 @@ Keyboard behavior:
512
538
 
513
539
  After translation succeeds, the English draft replaces the original Chinese text in the same textarea.
514
540
 
515
- `Send English` writes the current English text to the active role terminal and submits Enter.
541
+ The translated user input is also shown in the translation panel as a conversation boundary. User-input entries have a thick divider and larger top spacing so the next Claude output reads as the answer to that prompt.
542
+
543
+ `Send English` pastes the current English text into the active role terminal, then sends Enter as a separate terminal input event.
516
544
 
517
545
  Translation panel `Auto-send` is separate from task `Auto orchestration`:
518
546
 
@@ -527,13 +555,16 @@ App-level settings:
527
555
  ~/.vcm/settings.json
528
556
  ```
529
557
 
558
+ Stored app-level settings include:
559
+
560
+ - UI theme mode: `system`, `light`, or `dark`
561
+ - translation provider settings and API key
562
+ - recent repository paths
563
+
530
564
  Repository-level VCM state:
531
565
 
532
566
  ```text
533
567
  .ai/vcm/tasks/<task>.json
534
- .ai/vcm/sessions/<task>.json
535
- .ai/vcm/messages/<task>.jsonl
536
- .ai/vcm/orchestration/<task>.json
537
568
  .ai/vcm/worktrees/<task>/
538
569
  ```
539
570
 
@@ -544,14 +575,20 @@ Project config:
544
575
  ~/.vcm/projects/index.json
545
576
  ```
546
577
 
547
- The base repository's `.ai/vcm/` directory is the repository-local runtime control area. Long-lived project config is stored under `~/.vcm` so it survives outside Git-ignored repo state. Task source changes and handoff artifacts live inside the task worktree at `.ai/vcm/worktrees/<task>/`.
578
+ The base repository's `.ai/vcm/` directory stores the task index and nested task worktrees. Long-lived project config is stored under `~/.vcm` so it survives outside Git-ignored repo state.
548
579
 
549
580
  Task worktree local files:
550
581
 
551
582
  ```text
583
+ .ai/vcm/worktrees/<task>/.ai/vcm/sessions/<task>.json
584
+ .ai/vcm/worktrees/<task>/.ai/vcm/messages/<task>.jsonl
585
+ .ai/vcm/worktrees/<task>/.ai/vcm/orchestration/<task>.json
586
+ .ai/vcm/worktrees/<task>/.ai/vcm/translation/<task>/
552
587
  .ai/vcm/worktrees/<task>/.ai/handoffs/<task>/
553
588
  ```
554
589
 
590
+ For tasks created without a worktree, the task runtime repo is the connected base repo, so the runtime state resolves under the base repo's `.ai/vcm/`.
591
+
555
592
  External Claude transcripts:
556
593
 
557
594
  ```text
@@ -583,8 +620,9 @@ This protects against publishing raw TypeScript bin files or missing frontend as
583
620
  VCM V1 is successful when:
584
621
 
585
622
  - A user can connect a repo without global Git safe-directory setup.
586
- - A user can create a task, which creates `feature/<task>` and `.ai/vcm/worktrees/<task>`.
587
- - A user can start all four role sessions in that task worktree.
623
+ - A user can create a default task, which creates `feature/<task>` and `.ai/vcm/worktrees/<task>`.
624
+ - A user can clear `Create worktree and branch` and create a task in the connected repo/current branch.
625
+ - A user can start all four role sessions in the task runtime repo.
588
626
  - Switching roles never loses the embedded terminal.
589
627
  - Restart creates a fresh Claude session; Resume reconnects to the persisted one.
590
628
  - Permission modes are reflected in the Claude command.
@@ -21,7 +21,7 @@ Runtime shape:
21
21
  ```text
22
22
  browser
23
23
  -> React GUI
24
- -> HTTP API + WebSocket
24
+ -> HTTP API + terminal WebSocket
25
25
  -> Fastify backend
26
26
  -> services
27
27
  -> node-pty
@@ -94,9 +94,9 @@ Responsibilities:
94
94
  - Render repository connect form.
95
95
  - Render repository summary.
96
96
  - Render workflow panel.
97
- - Render settings section with Messages, Events, Auto orchestration.
97
+ - Render settings section with Theme, Messages, Events, Auto orchestration.
98
98
  - Render harness status/actions.
99
- - Render task creation form with one task-name field, a checked non-optional worktree/branch indicator, and generated branch/path previews.
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.
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, immutable worktree path, role tabs, and Refresh.
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
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.
@@ -140,11 +140,12 @@ File:
140
140
  Responsibilities:
141
141
 
142
142
  - Load translation settings and prompt previews.
143
- - Open translation WebSocket for the current terminal runtime session id.
143
+ - Start backend transcript listening for the current terminal runtime session id.
144
+ - Poll backend translation events with a cursor.
144
145
  - Render dark translation output panel.
145
146
  - Render translation status: `ready`, `translating <elapsed>`, or `error`.
146
147
  - Render preserved tool output as dim one-line rows.
147
- - Render prose source while translating, then translated text after completion.
148
+ - Render prose source while translating, then translated text after completion, using Markdown rendering for prose.
148
149
  - Render user composer.
149
150
  - Translate on `Enter`; newline on `Shift+Enter`.
150
151
  - Replace Chinese input with English draft after translation.
@@ -178,6 +179,7 @@ Entry:
178
179
 
179
180
  Fastify registers:
180
181
 
182
+ - app settings routes
181
183
  - project routes
182
184
  - harness routes
183
185
  - task routes
@@ -186,7 +188,6 @@ Fastify registers:
186
188
  - message routes
187
189
  - translation routes
188
190
  - terminal WebSocket
189
- - translation WebSocket
190
191
 
191
192
  ## 5. Repository Connection
192
193
 
@@ -224,12 +225,12 @@ VCM does not require global `safe.directory` configuration.
224
225
 
225
226
  ## 6. Task Worktree Architecture
226
227
 
227
- Task-level worktree management is the current architecture for multi-task parallelism.
228
+ Task-level worktree management is the default architecture for multi-task parallelism.
228
229
 
229
230
  Rule:
230
231
 
231
232
  ```text
232
- one VCM task = one branch + one git worktree + one handoff directory + one role-session set
233
+ default VCM task = one branch + one git worktree + one handoff directory + one role-session set
233
234
  ```
234
235
 
235
236
  Branch name:
@@ -244,7 +245,15 @@ Worktree path:
244
245
  <baseRepoRoot>/.ai/vcm/worktrees/<taskSlug>
245
246
  ```
246
247
 
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
+ 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.
249
+
250
+ When `Create worktree and branch` is cleared, the task uses:
251
+
252
+ ```text
253
+ branch: current connected-repo branch
254
+ runtime repo root: <baseRepoRoot>
255
+ worktreePath: undefined
256
+ ```
248
257
 
249
258
  VCM does not create worktrees by role. All four role sessions for a task share the same task worktree:
250
259
 
@@ -265,13 +274,10 @@ VCM distinguishes:
265
274
  - `branch`: `feature/<taskSlug>`.
266
275
  - `worktreePath`: same as `taskRepoRoot`.
267
276
 
268
- Project-level VCM control state stays under the base repo:
277
+ Base repo state is only the task index and the container for nested task worktrees:
269
278
 
270
279
  ```text
271
280
  <baseRepoRoot>/.ai/vcm/tasks/<task>.json
272
- <baseRepoRoot>/.ai/vcm/sessions/<task>.json
273
- <baseRepoRoot>/.ai/vcm/messages/<task>.jsonl
274
- <baseRepoRoot>/.ai/vcm/orchestration/<task>.json
275
281
  <baseRepoRoot>/.ai/vcm/worktrees/<task>/
276
282
  ```
277
283
 
@@ -282,13 +288,19 @@ Project configuration is app-local and stored outside the repository:
282
288
  ~/.vcm/projects/index.json
283
289
  ```
284
290
 
285
- Task source changes and handoff artifacts live in the task worktree:
291
+ Task runtime state, source changes, and handoff artifacts live in the task runtime repo. For worktree-backed tasks this is the nested task worktree:
286
292
 
287
293
  ```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>/
288
298
  <baseRepoRoot>/.ai/vcm/worktrees/<task>/.ai/handoffs/<task>/
289
299
  ```
290
300
 
291
- This central base-state model lets VCM list and manage multiple tasks while each task's code changes happen in a separate worktree.
301
+ For inline tasks, `taskRepoRoot` is the connected base repo, so these same runtime paths resolve under the connected repo's `.ai/vcm/`.
302
+
303
+ 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.
292
304
 
293
305
  ### 6.2 Git Ignore Requirement
294
306
 
@@ -307,37 +319,39 @@ The VCM harness manages a `.gitignore` block that ignores `.ai/vcm/` before task
307
319
  ```text
308
320
  POST /api/tasks
309
321
  -> validate taskSlug
310
- -> compute branch feature/<taskSlug>
311
- -> compute worktreePath <baseRepoRoot>/.ai/vcm/worktrees/<taskSlug>
312
- -> assert branch does not already exist
313
- -> assert worktreePath does not already exist
314
322
  -> assert .ai/vcm/ is ignored by Git
315
- -> assert base repo has no uncommitted changes
316
- -> git worktree add -b feature/<taskSlug> <worktreePath> <baseRef>
323
+ -> if createWorktree is not false:
324
+ -> compute branch feature/<taskSlug>
325
+ -> compute worktreePath <baseRepoRoot>/.ai/vcm/worktrees/<taskSlug>
326
+ -> assert branch does not already exist
327
+ -> assert worktreePath does not already exist
328
+ -> assert base repo has no uncommitted changes
329
+ -> git worktree add -b feature/<taskSlug> <worktreePath> <baseRef>
330
+ -> otherwise:
331
+ -> read current base repo branch
332
+ -> leave worktreePath undefined
317
333
  -> create handoff structure in taskRepoRoot
318
334
  -> write central task metadata under baseRepoRoot/.ai/vcm/tasks/<task>.json
319
335
  ```
320
336
 
321
337
  The default `baseRef` is the connected repo's current `HEAD`.
322
338
 
323
- ### 6.4 Task Cleanup Flow
339
+ ### 6.4 Task Close Flow
324
340
 
325
341
  ```text
326
342
  POST /api/tasks/:taskSlug/cleanup
327
- -> require no running role sessions
328
343
  -> load task metadata
329
- -> verify worktree path belongs under <baseRepoRoot>/.ai/vcm/worktrees/
330
- -> check worktree status
331
- -> refuse cleanup when uncommitted work exists unless force is explicitly requested
332
- -> git worktree remove <worktreePath>
333
- -> delete central task/session/message/orchestration metadata
344
+ -> list role sessions for the task
345
+ -> stop each VCM-managed role session whose runtime status is running
346
+ -> stop translation tailers and clear task translation cache
347
+ -> when worktreePath exists, verify it belongs under <baseRepoRoot>/.ai/vcm/worktrees/
348
+ -> when worktreePath exists, git worktree remove --force <worktreePath>
349
+ -> when worktreePath exists, delete the task branch by default
350
+ -> delete base task metadata
351
+ -> delete task runtime session/message/orchestration/translation metadata
334
352
  ```
335
353
 
336
- Branch deletion is intentionally separate:
337
-
338
- - Keep `feature/<taskSlug>` by default.
339
- - Allow branch deletion only with explicit confirmation.
340
- - Prefer allowing deletion only when the branch has been merged, or when the user force-confirms.
354
+ 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.
341
355
 
342
356
  ## 7. Task And Artifact Model
343
357
 
@@ -359,9 +373,8 @@ Each task stores:
359
373
  - `taskSlug`
360
374
  - optional `title`
361
375
  - timestamps
362
- - `baseRepoRoot`
363
- - `worktreePath`
364
- - `repoRoot` / `taskRepoRoot`
376
+ - `repoRoot`, which is the connected base repository
377
+ - optional `worktreePath`, which is the task runtime repo when present
365
378
  - branch, always `feature/<taskSlug>` for VCM-created tasks
366
379
  - handoff directory
367
380
  - status
@@ -378,6 +391,8 @@ POST /api/tasks
378
391
  -> write base .ai/vcm/tasks/<task>.json
379
392
  ```
380
393
 
394
+ Task cleanup is orchestrated by `src/backend/api/task-routes.ts` because it coordinates session stopping, translation tailer stopping, and `TaskService.cleanupTask`.
395
+
381
396
  Handoff directory:
382
397
 
383
398
  ```text
@@ -480,7 +495,7 @@ Permission flags:
480
495
  Session persistence:
481
496
 
482
497
  ```text
483
- <baseRepoRoot>/.ai/vcm/sessions/<task>.json
498
+ <taskRepoRoot>/.ai/vcm/sessions/<task>.json
484
499
  ```
485
500
 
486
501
  The persisted record includes:
@@ -545,9 +560,9 @@ Files:
545
560
  State:
546
561
 
547
562
  ```text
548
- .ai/vcm/messages/<task>.jsonl
549
- .ai/vcm/orchestration/<task>.json
550
- .ai/handoffs/<task>/messages/<message-id>.md
563
+ <taskRepoRoot>/.ai/vcm/messages/<task>.jsonl
564
+ <taskRepoRoot>/.ai/vcm/orchestration/<task>.json
565
+ <taskRepoRoot>/.ai/handoffs/<task>/messages/<message-id>.md
551
566
  ```
552
567
 
553
568
  Policy:
@@ -559,16 +574,10 @@ Policy:
559
574
  Manual mode:
560
575
 
561
576
  ```text
562
- send -> pending_approval -> Stage -> staged
577
+ send -> pending_approval or queued -> Messages modal -> Copy/manual action
563
578
  ```
564
579
 
565
- `Stage` writes:
566
-
567
- ```text
568
- Read and handle VCM message <id> at <bodyPath>
569
- ```
570
-
571
- It does not append Enter.
580
+ The current GUI shows sequence, timestamp, status, body preview, path, and a `Copy` button. It does not expose Open Role, Stage, or Reject buttons. The backend still exposes stage/approve/reject routes; `Stage` writes `Read and handle VCM message <id> at <bodyPath>` without appending Enter.
572
581
 
573
582
  Auto mode:
574
583
 
@@ -576,11 +585,11 @@ Auto mode:
576
585
  send -> delivered
577
586
  ```
578
587
 
579
- The backend writes a `[VCM MESSAGE]` envelope to the target terminal and appends Enter.
588
+ The backend pastes a `[VCM MESSAGE]` envelope into the target terminal, then sends Enter as a separate terminal input event.
580
589
 
581
590
  The backend still exposes pause/resume orchestration API routes and stores `paused` for compatibility. The current GUI only toggles `mode` between `manual` and `auto`.
582
591
 
583
- Messages and orchestration snapshots are central project state under `baseRepoRoot/.ai/vcm`. Message body markdown lives in the task worktree handoff directory.
592
+ Messages and orchestration snapshots are task runtime state under `taskRepoRoot/.ai/vcm`. Message body markdown also lives in the task worktree handoff directory.
584
593
 
585
594
  ## 12. Role Command Compatibility
586
595
 
@@ -608,7 +617,7 @@ The dispatcher:
608
617
  2. Reads the role command artifact.
609
618
  3. Rejects missing, empty, or placeholder role commands.
610
619
  4. Resolves primary command path `role-commands/<role>.md`, with legacy fallback `<role>-command.md`.
611
- 5. Writes `Please read and execute the role command at: <path>` to the target terminal and submits Enter.
620
+ 5. Pastes `Please read and execute the role command at: <path>` to the target terminal, then sends Enter as a separate terminal input event.
612
621
 
613
622
  This is a compatibility path. The preferred V1 coordination path is `vcmctl` message bus.
614
623
 
@@ -664,7 +673,6 @@ Files:
664
673
  - `src/backend/services/translation-prompts.ts`
665
674
  - `src/backend/services/claude-transcript-service.ts`
666
675
  - `src/backend/adapters/translation-provider.ts`
667
- - `src/backend/ws/translation-ws.ts`
668
676
  - `src/backend/api/translation-routes.ts`
669
677
  - `src/frontend/components/translation-panel.tsx`
670
678
  - `src/frontend/components/translation-settings-modal.tsx`
@@ -683,6 +691,7 @@ Storage:
683
691
 
684
692
  Stored data:
685
693
 
694
+ - UI theme preference: `system`, `light`, or `dark`
686
695
  - translation settings
687
696
  - translation secrets
688
697
  - recent repository paths, max 5
@@ -718,8 +727,11 @@ Tailer:
718
727
  - validates file exists
719
728
  - can replay history since session start minus a grace window
720
729
  - uses `fs.watch`
721
- - also polls every 500ms
730
+ - also polls every 200ms
722
731
  - parses only complete newline-delimited JSON records
732
+ - is owned by the backend translation service, not the frontend panel
733
+ - stays running after the panel closes
734
+ - stops only when the role session is stopped/restarted or the task is closed
723
735
 
724
736
  Parsed transcript events:
725
737
 
@@ -736,9 +748,21 @@ Translation service behavior:
736
748
  - ignores thinking
737
749
  - translates text/question/todo/agent as prose
738
750
  - preserves tool_use/tool_result as tool-output
739
- - queues translation per runtime session id
740
- - emits WebSocket `translation-entry`
741
- - emits WebSocket `translation-status`
751
+ - queues provider translation per runtime session id
752
+ - pushes prose entries before provider translation starts
753
+ - pushes tool_use/tool_result immediately without entering the translation queue
754
+ - writes translation events to `<taskRepoRoot>/.ai/vcm/translation/<task>/<role>/<session-id>.jsonl`
755
+ - exposes HTTP polling for frontend rendering
756
+
757
+ Polling protocol:
758
+
759
+ - `seq` starts at 1 for each translation session cache.
760
+ - the frontend calls `GET /api/translation/sessions/:sessionId/events?after=<cursor>`.
761
+ - `after` is the next expected seq, not the last displayed seq.
762
+ - `after=18` lets the backend delete cached events with `seq < 18` and return events with `seq >= 18`.
763
+ - if `after` is older than the retained cache, the backend returns whatever newer events still exist.
764
+ - no snapshot mismatch error is used.
765
+ - translated prose replacement is a later `entry` event with the same translation entry id and a newer `seq`.
742
766
 
743
767
  ### User Input Path
744
768
 
@@ -749,10 +773,10 @@ textarea -> POST translation/input -> provider -> English draft in the same text
749
773
  Send path:
750
774
 
751
775
  ```text
752
- POST translation/send -> runtime.write(session.id, englishText + "\r")
776
+ POST translation/send -> bracketed paste English text -> short delay -> runtime.write(session.id, "\r")
753
777
  ```
754
778
 
755
- The backend strips trailing newlines before appending `\r`.
779
+ 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.
756
780
 
757
781
  ## 15. API Surface
758
782
 
@@ -819,6 +843,13 @@ POST /api/tasks/:taskSlug/orchestration/pause
819
843
  POST /api/tasks/:taskSlug/orchestration/resume
820
844
  ```
821
845
 
846
+ App settings:
847
+
848
+ ```text
849
+ GET /api/settings/preferences
850
+ PUT /api/settings/preferences
851
+ ```
852
+
822
853
  Translation:
823
854
 
824
855
  ```text
@@ -826,6 +857,8 @@ GET /api/translation/settings
826
857
  PUT /api/translation/settings
827
858
  GET /api/translation/prompts
828
859
  POST /api/translation/test
860
+ POST /api/tasks/:taskSlug/sessions/:role/translation/start
861
+ GET /api/translation/sessions/:sessionId/events?after=<cursor>&limit=<n>
829
862
  POST /api/tasks/:taskSlug/sessions/:role/translation/input
830
863
  POST /api/tasks/:taskSlug/sessions/:role/translation/send
831
864
  POST /api/translation/sessions/:sessionId/clear
@@ -836,7 +869,6 @@ WebSockets:
836
869
 
837
870
  ```text
838
871
  /ws/terminal/:sessionId
839
- /ws/translation/:sessionId
840
872
  ```
841
873
 
842
874
  ## 16. Error Handling