vibe-coding-master 0.2.5 → 0.2.7

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-BRrFbDjL.js"></script>
8
- <link rel="stylesheet" crossorigin href="/assets/index-DQ-pEUma.css">
7
+ <script type="module" crossorigin src="/assets/index-DHuS-DYr.js"></script>
8
+ <link rel="stylesheet" crossorigin href="/assets/index-7lq6YPCq.css">
9
9
  </head>
10
10
  <body>
11
11
  <div id="root"></div>
@@ -26,6 +26,12 @@ Product rules:
26
26
  VCM instance.
27
27
  - Gateway user messages talk only to the `project-manager` role.
28
28
  - Gateway never sends directly to `architect`, `coder`, or `reviewer`.
29
+ - When the desktop UI has a current task selected, Gateway should adopt that
30
+ project/task context automatically instead of requiring `/tasks` and
31
+ `/use-task` first.
32
+ - When Gateway is enabled, browser Flow pause alert should be forced off because
33
+ Weixin becomes the notification path and browser modal alerts can block the
34
+ workflow.
29
35
  - Gateway may push PM replies to Weixin whenever it is enabled, even when the PM
30
36
  turn was started from the desktop UI rather than from Weixin.
31
37
  - When translation is enabled, Chinese input is translated to English before it
@@ -37,8 +43,9 @@ The short product sentence is:
37
43
 
38
44
  ```text
39
45
  One phone DM binds to one desktop VCM; the phone can select project/task context,
40
- send ordinary messages to the current task's PM, and receive translated PM
41
- replies while gateway is enabled.
46
+ pull the connected base repository, create and initialize a task through the
47
+ saved launch template, send ordinary messages to the current task's PM, receive
48
+ translated PM replies, and close completed tasks while gateway is enabled.
42
49
  ```
43
50
 
44
51
  ## Binding Model
@@ -76,13 +83,18 @@ current project
76
83
  current task
77
84
  current role = project-manager
78
85
  translation enabled/disabled
86
+ saved launch template
79
87
  ```
80
88
 
81
89
  Plain text messages are sent to the PM session of the current task. If no
82
90
  project or task is selected, gateway replies with a short setup hint.
83
91
 
84
- The desktop UI remains the source of truth. Gateway only changes context through
85
- explicit commands.
92
+ VCM normally runs one project and one task at a time. When Gateway is enabled,
93
+ or when `/status` is called, VCM should refresh Gateway context from the
94
+ desktop-selected project/task when available.
95
+
96
+ The desktop UI remains the source of truth. Gateway changes mobile context or
97
+ task lifecycle state only through explicit commands.
86
98
 
87
99
  ## Command Surface
88
100
 
@@ -93,8 +105,12 @@ MVP commands:
93
105
  /status
94
106
  /projects
95
107
  /use-project <index-or-path>
108
+ /pull-current
96
109
  /tasks
97
110
  /use-task <index-or-task-slug>
111
+ /create-task <task-slug> [title]
112
+ /close-task
113
+ /close-task confirm <task-slug>
98
114
  /translate on
99
115
  /translate off
100
116
  ```
@@ -102,6 +118,25 @@ MVP commands:
102
118
  Plain text that does not start with `/` is treated as a PM message for the
103
119
  current task.
104
120
 
121
+ Task lifecycle commands:
122
+
123
+ - `/pull-current` calls `POST /api/projects/current/pull` for the selected
124
+ desktop VCM project. It runs the same connected-repository fast-forward-only
125
+ pull as the desktop button. It must fail if the base repo has uncommitted
126
+ changes, if the branch has no upstream, or if the current active task is an
127
+ inline task using the base repo directly.
128
+ - `/create-task <task-slug> [title]` creates a normal worktree-backed task,
129
+ selects it as the mobile current task, applies the saved launch template, and
130
+ starts the four role sessions (`project-manager`, `architect`, `coder`,
131
+ `reviewer`) through the same one-click-start path as the desktop UI. The saved
132
+ template controls permission mode, model, auto orchestration, and translation.
133
+ If no template has been saved, VCM uses the default launch template.
134
+ - `/close-task` starts a destructive confirmation flow for the current task.
135
+ Gateway replies with the exact confirmation command.
136
+ - `/close-task confirm <task-slug>` calls VCM Close Task cleanup for that task:
137
+ stop VCM-managed role sessions, remove the task worktree and task branch when
138
+ the task owns them, and remove VCM task/runtime metadata.
139
+
105
140
  Commands intentionally not in MVP:
106
141
 
107
142
  ```text
@@ -109,13 +144,13 @@ Commands intentionally not in MVP:
109
144
  /reject
110
145
  /pause
111
146
  /resume
112
- /start-session
113
147
  /stop-session
114
148
  ```
115
149
 
116
- The first version should not expose state-changing workflow controls beyond
117
- selecting the mobile context and toggling gateway translation. More controls can
118
- be added later after the PM-only conversation path is reliable.
150
+ The first version should not expose arbitrary terminal controls, role-specific
151
+ start/stop controls, approve/reject gates, or shell execution. The state-changing
152
+ commands are limited to the VCM task lifecycle primitives needed to run a task
153
+ end to end from mobile.
119
154
 
120
155
  ## Inbound Message Flow
121
156
 
@@ -150,6 +185,77 @@ Gateway should use the same bracketed-paste terminal submission path as the VCM
150
185
  desktop input path. A terminal write only proves the text was written to the PTY;
151
186
  Claude Code `UserPromptSubmit` remains the acceptance signal.
152
187
 
188
+ ## Task Lifecycle Command Flows
189
+
190
+ ### Pull Current Base Repository
191
+
192
+ ```text
193
+ /pull-current
194
+ -> require current project
195
+ -> call POST /api/projects/current/pull
196
+ -> backend runs git pull --ff-only on connected base repo
197
+ -> refresh current project status
198
+ -> reply with branch, upstream, ahead/behind, and short commit
199
+ ```
200
+
201
+ Rules:
202
+
203
+ - Pull only the connected base repository, never a task worktree.
204
+ - Use the same backend guard as desktop Connected Repository Pull.
205
+ - Do not stash, merge, or continue after divergence.
206
+ - If pull fails, reply with the VCM error message and hint.
207
+
208
+ ### Create And Initialize Task
209
+
210
+ ```text
211
+ /create-task <task-slug> [title]
212
+ -> require current project
213
+ -> create a normal worktree-backed task through existing task service/API
214
+ -> select it as gateway current task
215
+ -> load saved launch template from app preferences
216
+ -> set orchestration from template
217
+ -> set gateway/desktop translation state from template
218
+ -> start four role sessions with template permission/model
219
+ -> switch mobile current role to project-manager
220
+ -> reply with task slug, branch, worktree, template summary, and session status
221
+ ```
222
+
223
+ Rules:
224
+
225
+ - Use the same task creation validation as desktop VCM.
226
+ - Default to `createWorktree: true`. Gateway should not create inline tasks in
227
+ the MVP, because inline tasks make mobile pull/cleanup semantics harder.
228
+ - Use the same one-click-start semantics as desktop VCM: only start from a newly
229
+ created task with no existing role sessions.
230
+ - If one role session fails to start, reply with the role that failed and leave
231
+ the partially created task visible in desktop VCM for manual recovery.
232
+ - Do not send the task request as a PM prompt. Task creation is a VCM control
233
+ command, not natural-language work for Claude.
234
+
235
+ ### Close Task
236
+
237
+ ```text
238
+ /close-task
239
+ -> require current task
240
+ -> reply with destructive confirmation text
241
+
242
+ /close-task confirm <task-slug>
243
+ -> require current task slug matches confirmation slug
244
+ -> call VCM Close Task cleanup
245
+ -> clear mobile current task if cleanup succeeds
246
+ -> reply with removed worktree, deleted branch, and cleaned state paths
247
+ ```
248
+
249
+ Rules:
250
+
251
+ - Close Task is destructive, so mobile requires explicit confirmation with the
252
+ task slug.
253
+ - Use the same cleanup path as desktop Close Task.
254
+ - Do not preflight or preserve uncommitted work beyond the existing desktop
255
+ Close Task behavior.
256
+ - After cleanup, gateway should ask the user to run `/tasks` or
257
+ `/create-task <task-slug>` for the next task.
258
+
153
259
  ## PM Reply Push Flow
154
260
 
155
261
  Gateway push is not limited to gateway-originated turns. If gateway is enabled,
@@ -200,6 +306,25 @@ If no task is selected:
200
306
  No task is selected. Use /tasks and /use-task first.
201
307
  ```
202
308
 
309
+ If `/pull-current` cannot run because the base repo is dirty, has no upstream,
310
+ or is blocked by an inline task, reply with the same VCM reason shown in the
311
+ desktop Connected Repository section.
312
+
313
+ If `/create-task` fails task validation, reply with the VCM error and hint.
314
+ Common examples are invalid task slug, dirty base repo, existing task branch, or
315
+ missing harness ignore rules for `.ai/vcm/` / `.claude/worktrees/`.
316
+
317
+ If `/create-task` creates the task but one of the four role sessions fails to
318
+ start, do not hide the partial state. Reply with:
319
+
320
+ ```text
321
+ Task was created, but <role> failed to start. Open desktop VCM to recover or retry.
322
+ ```
323
+
324
+ If `/close-task confirm <task-slug>` does not match the current task, do not
325
+ clean up anything. Reply with the current task slug and the exact confirmation
326
+ command.
327
+
203
328
  If gateway translation fails before sending to PM, do not send the original
204
329
  Chinese. Reply with a translation failure message and ask the user to retry.
205
330
 
@@ -357,6 +482,13 @@ Settings shape:
357
482
  "dedupe": {
358
483
  "recentInboundMessageIds": []
359
484
  },
485
+ "pendingConfirmations": {
486
+ "closeTask": {
487
+ "taskSlug": null,
488
+ "createdAt": null,
489
+ "expiresAt": null
490
+ }
491
+ },
360
492
  "pushCursors": {
361
493
  "<taskSlug>:project-manager:<claudeSessionId>": {
362
494
  "lastTranscriptEventId": null,
@@ -381,7 +513,7 @@ Audit log rules:
381
513
 
382
514
  ## Backend Architecture
383
515
 
384
- Suggested files:
516
+ Implemented files:
385
517
 
386
518
  ```text
387
519
  src/shared/types/gateway.ts
@@ -390,8 +522,6 @@ src/backend/gateway/
390
522
  gateway-service.ts
391
523
  gateway-settings-service.ts
392
524
  gateway-command-parser.ts
393
- gateway-pm-bridge.ts
394
- gateway-notifier.ts
395
525
  gateway-audit-log.ts
396
526
  channels/
397
527
  weixin-ilink-channel.ts
@@ -404,19 +534,26 @@ Responsibilities:
404
534
  - `gateway-settings-service`: load/save app-local gateway settings and secrets.
405
535
  - `weixin-ilink-channel`: QR login, long polling, send text, token expiration.
406
536
  - `gateway-command-parser`: parse `/help`, `/status`, `/projects`,
407
- `/use-project`, `/tasks`, `/use-task`, and `/translate`.
408
- - `gateway-pm-bridge`: submit plain messages to the current task PM session.
409
- - `gateway-notifier`: push PM transcript replies to Weixin after PM Stop.
537
+ `/use-project`, `/pull-current`, `/tasks`, `/use-task`, `/create-task`,
538
+ `/close-task`, and `/translate`.
410
539
  - `gateway-audit-log`: append redacted JSONL audit entries.
411
- - `gateway-service`: lifecycle, poll loop, dispatch, and error backoff.
540
+ - `gateway-service`: lifecycle, poll loop, command dispatch, PM terminal
541
+ submission, PM Stop reply push, and error backoff.
412
542
  - `gateway-routes`: desktop UI settings, QR login start/status, enable/disable,
413
543
  rebind, and gateway status.
414
544
 
415
545
  Service dependencies:
416
546
 
417
- - `ProjectService`: current project and recent project paths.
418
- - `TaskService`: task list and selected task validation.
419
- - `SessionService`: PM session state and Claude session metadata.
547
+ - `ProjectService`: current project, recent project paths, connected-repo
548
+ status, and fast-forward-only pull.
549
+ - `TaskService`: task list, task creation, selected task validation, and Close
550
+ Task cleanup.
551
+ - `SessionService`: PM session state, Claude session metadata, and role session
552
+ start for launch-template initialization.
553
+ - `AppSettingsService`: saved launch template with permission mode, model, auto
554
+ orchestration, and translation defaults.
555
+ - `MessageService` / orchestration state service: set the newly created task to
556
+ template auto/manual orchestration mode.
420
557
  - `TerminalRuntime`: controlled PM terminal submission.
421
558
  - `ClaudeTranscriptService`: PM assistant output extraction.
422
559
  - `TranslationService` / translation provider: inbound Chinese-to-English and
@@ -446,7 +583,7 @@ The user should be able to:
446
583
  - start QR login
447
584
  - see whether the phone is bound
448
585
  - reset binding
449
- - select current project/task from desktop
586
+ - inspect the current gateway project/task context
450
587
  - toggle gateway translation
451
588
  - inspect recent gateway errors
452
589
 
@@ -482,7 +619,7 @@ Validation:
482
619
  expiration, redirect host, and retry backoff.
483
620
  - Manual smoke test with a real Weixin DM before wiring PM submission.
484
621
 
485
- ### Phase 3: Inbound Command Handling
622
+ ### Phase 3: Inbound Context Commands
486
623
 
487
624
  - Implement `/help`, `/status`, `/projects`, `/use-project`, `/tasks`,
488
625
  `/use-task`, `/translate on`, and `/translate off`.
@@ -495,7 +632,31 @@ Validation:
495
632
  - Parser tests for known commands and invalid commands.
496
633
  - Gateway service tests for ignored unbound users and deduped messages.
497
634
 
498
- ### Phase 4: PM Message Submission
635
+ ### Phase 4: Task Lifecycle Commands
636
+
637
+ - Implement `/pull-current` by calling the connected repository pull path:
638
+ `POST /api/projects/current/pull` or the equivalent project service method.
639
+ - Implement `/create-task <task-slug> [title]` by creating a worktree-backed
640
+ task, selecting it as mobile current task, applying the saved launch template,
641
+ setting orchestration mode, setting translation state, and starting the four
642
+ role sessions.
643
+ - Implement `/close-task` and `/close-task confirm <task-slug>` as a two-step
644
+ destructive confirmation around the same Close Task cleanup path as desktop
645
+ VCM.
646
+ - Persist close-task pending confirmation outside the repository.
647
+
648
+ Validation:
649
+
650
+ - Parser tests for `/pull-current`, `/create-task`, `/close-task`, and
651
+ confirmation mismatch.
652
+ - Service tests for pull success and pull-blocked reasons.
653
+ - Service tests that task creation uses `createWorktree: true` and launch
654
+ template role settings.
655
+ - Service tests for partial role-session start failure reporting.
656
+ - Service tests that Close Task calls the existing cleanup path only after exact
657
+ slug confirmation.
658
+
659
+ ### Phase 5: PM Message Submission
499
660
 
500
661
  - Treat plain DM text as PM input for the current task.
501
662
  - Require current project, current task, running PM session, and idle PM
@@ -512,9 +673,9 @@ Validation:
512
673
  - Tests that translated prompts do not include original Chinese.
513
674
  - Tests that successful submit records a gateway turn audit entry.
514
675
 
515
- ### Phase 5: PM Reply Push
676
+ ### Phase 6: PM Reply Push
516
677
 
517
- - Hook PM `Stop` handling into `gateway-notifier`.
678
+ - Hook PM `Stop` handling into `gateway-service`.
518
679
  - Load PM transcript and extract new assistant text since the last push cursor.
519
680
  - Push PM replies whenever gateway is enabled, regardless of whether the user
520
681
  turn started from gateway or desktop.
@@ -527,7 +688,7 @@ Validation:
527
688
  - Deduplication tests across repeated Stop hooks and app restart.
528
689
  - Translation failure fallback test.
529
690
 
530
- ### Phase 6: Audit, Recovery, And Packaging
691
+ ### Phase 7: Audit, Recovery, And Packaging
531
692
 
532
693
  - Add redacted audit JSONL writer.
533
694
  - Add gateway lifecycle shutdown on VCM server stop.
@@ -542,10 +703,13 @@ Validation:
542
703
  - Manual iLink smoke test:
543
704
  - QR bind
544
705
  - `/status`
706
+ - `/pull-current`
707
+ - `/create-task mobile-demo`
545
708
  - `/tasks`
546
709
  - `/use-task`
547
710
  - Chinese plain text to PM
548
711
  - PM reply pushed back to Weixin
712
+ - `/close-task` + `/close-task confirm mobile-demo`
549
713
  - restart without replaying old messages
550
714
 
551
715
  ## Key Risks And Decisions
@@ -555,9 +719,11 @@ transcript events, not raw PTY output, because terminal output contains tool
555
719
  logs, redraws, and partial text. The notifier must persist a per-PM-session
556
720
  cursor.
557
721
 
558
- The second risk is accidental command scope growth. The MVP must stay PM-only
559
- and avoid workflow actions such as approve/reject/start/stop until the mobile
560
- conversation path is proven.
722
+ The second risk is accidental command scope growth. Gateway should support the
723
+ small task lifecycle needed to run work end to end from mobile: pull base repo,
724
+ create and initialize a task, talk to PM, receive PM replies, and close the
725
+ task. It should still avoid arbitrary terminal control, approve/reject gates,
726
+ role-specific start/stop controls, shell commands, and direct non-PM prompts.
561
727
 
562
728
  The third risk is token and message leakage. Gateway credentials and audit logs
563
729
  must stay under `~/.vcm/gateway`, with secrets redacted from logs and never
@@ -575,10 +741,17 @@ Gateway MVP is complete when:
575
741
  - Desktop VCM can QR-bind one Weixin DM identity.
576
742
  - Bound phone can send `/status` and receive current VCM status.
577
743
  - Bound phone can list and select current project/task context.
744
+ - Bound phone can run `/pull-current` to update the connected base repository
745
+ through VCM's fast-forward-only pull path.
746
+ - Bound phone can run `/create-task <task-slug> [title]` to create a
747
+ worktree-backed task, select it, apply the saved launch template, and start
748
+ the four role sessions.
578
749
  - Bound phone can send Chinese plain text to current task PM.
579
750
  - PM receives only the translated English prompt, without original Chinese.
580
751
  - Gateway can push PM assistant replies to Weixin whenever enabled.
581
752
  - PM replies are translated to Chinese when gateway translation is enabled.
753
+ - Bound phone can close a completed task through `/close-task` plus exact slug
754
+ confirmation, using the same cleanup path as desktop Close Task.
582
755
  - Duplicate iLink messages and duplicate PM Stop hooks do not produce duplicate
583
756
  sends.
584
757
  - Expired iLink token is reported clearly and requires rebind.
@@ -1,6 +1,6 @@
1
1
  # VibeCodingMaster Product Design
2
2
 
3
- Last updated: 2026-06-09
3
+ Last updated: 2026-06-10
4
4
 
5
5
  This document describes the current product direction and implemented V1 behavior for VCM.
6
6
 
@@ -19,6 +19,26 @@ The user should mostly talk to `project-manager`. The project manager coordinate
19
19
 
20
20
  VCM is not a hosted SaaS product. It runs locally, connects to a local repository path, starts local Claude Code processes, and writes local task metadata into that repository.
21
21
 
22
+ ### 1.1 VCM Statistics Terminology
23
+
24
+ VCM statistics use a task-level hierarchy:
25
+
26
+ ```text
27
+ Session = n x Round = m x Turn
28
+ ```
29
+
30
+ - `Session`: one VCM task. It is the statistics container for the whole task, from task creation until Close Task.
31
+ - `Round`: one VCM conversation cycle. It starts with an accepted user prompt or VCM-delivered prompt, continues through sequential role orchestration, and ends when the final role turn stops and no next turn starts inside the 10 second stop window. In the normal orchestrated workflow, the final visible result comes back from `project-manager`.
32
+ - `Turn`: one role-level Claude Code conversation. It starts when a prompt is submitted to one role session and ends when that role's Claude Code process emits `Stop`.
33
+
34
+ Turns inside one Round are strictly sequential. VCM should finish one role Turn before starting the next role Turn in that Round.
35
+
36
+ Session state is intentionally small: `created` means no Round has started yet, `running` means there is a current running Round, and `stopped` means there is no current running Round after at least one Round has stopped. Starting Claude Code role sessions does not make the VCM Session `running`.
37
+
38
+ Round state is only `running` or `stopped`. After a `Stop` hook, the 10 second stop window still counts as `running`; the Round becomes `stopped` only when the timer expires without another `UserPromptSubmit`.
39
+
40
+ This `Session` term is only for VCM statistics. It must not be confused with a Claude Code role session, terminal runtime session, or Claude transcript session id. VCM still runs one Claude Code role session per role inside one task-level VCM Session.
41
+
22
42
  ## 2. Product Goals
23
43
 
24
44
  VCM V1 must make multi-session Claude Code work visible and recoverable:
@@ -217,13 +237,13 @@ All sidebar groups are collapsible and default to collapsed. When no task is sel
217
237
  Sections:
218
238
 
219
239
  - `Repository Path`
220
- - `Repository`
240
+ - `Connected Repository`
221
241
  - `Settings`
222
242
  - `VCM Harness`
223
243
  - `New Task`
224
244
  - `Tasks`
225
245
 
226
- The connected active task also has a bottom status dock. It is not a collapsible sidebar section. It stays at the bottom of the sidebar and shows the active task title, task status, task start time, total elapsed time, total flow-round count, and Claude Code active runtime. When the current round is active or settling, it also shows that round's start time and Claude Code active runtime.
246
+ The connected active task also has a bottom status dock. It is not a collapsible sidebar section. It stays at the bottom of the sidebar and shows the active VCM Session title, task status, Session start time, total elapsed time, total Round count, and Claude Code active runtime. When the current Round is running, it also shows the Current Round start time, total elapsed time, Claude Code active runtime, and Turn count.
227
247
 
228
248
  `Repository Path` layout:
229
249
 
@@ -233,13 +253,29 @@ Repository Path
233
253
  [ Recent v ] [ Connect ]
234
254
  ```
235
255
 
236
- `Repository` shows:
256
+ `Connected Repository` shows the connected base repository, not the active task
257
+ worktree:
258
+
259
+ - base repo path
260
+ - current branch
261
+ - upstream branch when configured
262
+ - ahead/behind status relative to upstream
263
+ - current commit hash
264
+ - base repo working tree state
265
+ - last checked time
266
+ - a `Pull` button
267
+
268
+ Opening this section refreshes the connected repository status through
269
+ `GET /api/projects/current`. VCM does not poll this state at high frequency.
237
270
 
238
- - path
239
- - branch
240
- - working tree state
271
+ The `Pull` button runs `git pull --ff-only` only against the connected base
272
+ repository. It is disabled when the base repository has uncommitted changes,
273
+ when the branch has no upstream, or when the active task is an inline task using
274
+ the base repository directly. VCM does not stash, merge, or mutate task
275
+ worktrees from this button.
241
276
 
242
- The old `Dirty: yes/no` label is not used. The UI uses `Working tree: clean` or `Working tree: uncommitted changes`.
277
+ The old `Dirty: yes/no` label is not used. The UI uses `Working tree: clean` or
278
+ `Working tree: uncommitted changes`.
243
279
 
244
280
  `Settings` contains:
245
281
 
@@ -252,7 +288,7 @@ The old `Dirty: yes/no` label is not used. The UI uses `Working tree: clean` or
252
288
  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.
253
289
 
254
290
  When `Flow pause alert` is on, VCM plays a short, soft, two-note local chime after a role flow stops advancing. If the flow lasted less than 2 minutes, the chime plays 3 times, 1.4 seconds apart, and stops. If the flow lasted 2 minutes or longer, VCM shows an in-app alert dialog and repeats the chime until the user confirms the dialog. The alert sound must reuse one browser audio context after user activation instead of creating a fresh context for each repeat, because Safari can block repeated timer-driven playback when every repeat looks like a new autoplay attempt.
255
- `Try alert` must work even when no flow has just paused so the user can verify browser sound and notification behavior.
291
+ `Try alert` must work even when no flow has just stopped advancing so the user can verify browser sound and notification behavior.
256
292
  Safari may still require the user to manually set `Safari > Website Settings > Auto-Play > Allow All Auto-Play`; Chrome is the recommended browser for reliable repeated alert sound.
257
293
 
258
294
  There is no separate `Pause orchestration` or `Resume orchestration` control in the GUI. The current product model is one on/off toggle in the role console toolbar.
@@ -325,21 +361,22 @@ VCM detects flow pauses from Claude Code hook events, not from terminal silence,
325
361
  Backend role state:
326
362
 
327
363
  - VCM terminal submit: role becomes `running`.
328
- - `Stop`: role becomes `idle` and records `lastStopAt`.
364
+ - `Stop`: role becomes `idle` and records `lastTurnEndedAt`.
329
365
  - The role tab and flow pause state both react to Claude Code hook events.
330
366
 
331
- Task-level round state:
367
+ Task-level Round state:
332
368
 
333
- - The first `UserPromptSubmit` starts a flow round.
334
- - Each later `UserPromptSubmit` inside the same flow increments `promptSubmitCount`.
335
- - `Stop` moves the round into a 10 second settling window.
336
- - A new `UserPromptSubmit` inside the window continues the same round.
337
- - If no new prompt is accepted before the deadline, the round becomes `paused`.
338
- - The pause transition is timer-driven from the `Stop` event. Round-state reads do not end a round.
339
- - Before pausing, VCM checks `.ai/vcm/handoffs/messages`; if a pending route message exists and can be delivered, VCM retries delivery and extends the settling window instead of alerting.
340
- - The same round state stores total round count, prompt-submit count, stop count, and Claude Code active runtime. Active runtime is measured only between `UserPromptSubmit` and `Stop`, not during the settling window.
369
+ - The first `UserPromptSubmit` starts a Round for the current VCM Session.
370
+ - Each accepted `UserPromptSubmit` is the start of one Turn.
371
+ - `Stop` ends the current Turn and starts a 10 second stop timer; during that timer, the Round is still `running`.
372
+ - A new `UserPromptSubmit` inside the window continues the same Round and starts the next Turn.
373
+ - If no new prompt is accepted before the deadline, the Round becomes `stopped`.
374
+ - The stop transition is timer-driven from the `Stop` event. Round-state reads do not end a Round.
375
+ - Before stopping, VCM checks `.ai/vcm/handoffs/messages`; if a pending route message exists and can be delivered, VCM retries delivery and extends the stop window instead of alerting.
376
+ - The same Round state stores total Round count, Turn count, completed Turn count, and Claude Code active runtime. Active runtime is measured only between `UserPromptSubmit` and `Stop`, not during the stop window.
377
+ - The Current Round dock shows both wall-clock Round duration and Claude Code active runtime. `Total` is `now - Round.startedAt`; `CC runtime` is the accumulated active runtime across Turns in that Round; `Turn count` is the number of accepted prompts in the Round.
341
378
 
342
- The frontend polls this task-level round state and deduplicates each paused round so the same paused state does not alert on every poll. Flow duration is measured from the first `UserPromptSubmit` to `pausedAt`, falling back to the last `Stop` when needed. Pauses under 2 minutes trigger the weak 3-chime reminder at 1.4 second intervals. Pauses at or above 2 minutes trigger the strong alert dialog and repeating sound until confirmation.
379
+ The frontend polls this task-level Round state and deduplicates each stopped Round so the same stopped state does not alert on every poll. Flow duration is measured from the first `UserPromptSubmit` to `stoppedAt`, falling back to the last `Stop` when needed. Runs under 2 minutes trigger the weak 3-chime reminder at 1.4 second intervals. Runs at or above 2 minutes trigger the strong alert dialog and repeating sound until confirmation.
343
380
 
344
381
  ## 9. Session Lifecycle
345
382
 
@@ -1,6 +1,6 @@
1
1
  # VCM 0.2 Implementation Plan
2
2
 
3
- Last updated: 2026-06-08
3
+ Last updated: 2026-06-10
4
4
 
5
5
  VCM 0.2 has two product tracks:
6
6
 
@@ -12,8 +12,9 @@ This document is an implementation plan, not a target-repository harness file.
12
12
 
13
13
  ## 1. Mobile Gateway Goal
14
14
 
15
- VCM 0.2 should let one mobile Weixin DM bind to one desktop VCM instance and
16
- talk to the current task's `project-manager` role.
15
+ VCM 0.2 should let one mobile Weixin DM bind to one desktop VCM instance,
16
+ manage the basic task lifecycle, and talk to the current task's
17
+ `project-manager` role.
17
18
 
18
19
  The detailed gateway product design and implementation plan lives in
19
20
  `docs/gateway-design.md`.
@@ -25,6 +26,12 @@ Current decisions:
25
26
  - Binding is not project-specific and not task-specific.
26
27
  - The bound phone can select among the projects and tasks available to the
27
28
  desktop VCM instance.
29
+ - The bound phone can pull the selected connected base repo through VCM's
30
+ fast-forward-only connected repository pull path.
31
+ - The bound phone can create a worktree-backed task and ask VCM to initialize it
32
+ through the saved launch template.
33
+ - The bound phone can close a completed task through VCM's Close Task cleanup
34
+ path after explicit confirmation.
28
35
  - Plain mobile text is sent only to the current task's `project-manager`.
29
36
  - Gateway never sends directly to `architect`, `coder`, or `reviewer`.
30
37
  - PM replies may be pushed to Weixin whenever gateway is enabled, even when the
@@ -45,7 +52,8 @@ VCM 0.2 gateway should not:
45
52
  - store gateway credentials in the connected repository
46
53
  - send directly to non-PM roles
47
54
  - run shell commands from gateway messages
48
- - provide approve/reject/start/stop workflow controls in the MVP
55
+ - provide approve/reject gates, arbitrary role-specific start/stop controls, or
56
+ shell execution in the MVP
49
57
  - bypass existing backend task/session/orchestration services
50
58
 
51
59
  ## 3. Gateway Shape
@@ -64,7 +72,7 @@ The iLink channel is outbound-first from the VCM process. It long-polls iLink
64
72
  for direct messages and sends replies through the iLink send API. This avoids a
65
73
  public callback URL for the first gateway version.
66
74
 
67
- Suggested backend files:
75
+ Implemented backend files:
68
76
 
69
77
  ```text
70
78
  src/shared/types/gateway.ts
@@ -73,8 +81,6 @@ src/backend/gateway/
73
81
  gateway-service.ts
74
82
  gateway-settings-service.ts
75
83
  gateway-command-parser.ts
76
- gateway-pm-bridge.ts
77
- gateway-notifier.ts
78
84
  gateway-audit-log.ts
79
85
  channels/
80
86
  weixin-ilink-channel.ts
@@ -101,8 +107,12 @@ MVP commands:
101
107
  /status
102
108
  /projects
103
109
  /use-project <index-or-path>
110
+ /pull-current
104
111
  /tasks
105
112
  /use-task <index-or-task-slug>
113
+ /create-task <task-slug> [title]
114
+ /close-task
115
+ /close-task confirm <task-slug>
106
116
  /translate on
107
117
  /translate off
108
118
  ```
@@ -139,10 +149,15 @@ Gateway MVP is acceptable when:
139
149
  - desktop VCM can QR-bind one Weixin DM identity
140
150
  - the bound phone can DM `/status` and receive current VCM status
141
151
  - the bound phone can list and select current project/task context
152
+ - the bound phone can run `/pull-current` to update the connected base repo
153
+ - the bound phone can run `/create-task <task-slug> [title]` to create a task
154
+ and start four role sessions through the saved launch template
142
155
  - the bound phone can send Chinese plain text to current task PM
143
156
  - PM receives only the translated English prompt, without original Chinese
144
157
  - gateway pushes PM assistant replies to Weixin whenever enabled
145
158
  - PM replies are translated to Chinese when gateway translation is enabled
159
+ - the bound phone can close a completed task through `/close-task` and exact
160
+ slug confirmation
146
161
  - restart does not replay already handled iLink messages or PM replies
147
162
  - credentials and audit logs stay outside connected repos
148
163
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vibe-coding-master",
3
- "version": "0.2.5",
3
+ "version": "0.2.7",
4
4
  "description": "Local GUI session cockpit for Claude Code role sessions.",
5
5
  "type": "module",
6
6
  "files": [
@@ -43,6 +43,7 @@
43
43
  "execa": "^9.6.0",
44
44
  "fastify": "^5.3.3",
45
45
  "node-pty": "^1.0.0",
46
+ "qrcode-generator": "^2.0.4",
46
47
  "react": "^19.1.0",
47
48
  "react-dom": "^19.1.0",
48
49
  "react-markdown": "^10.1.0",