vibe-coding-master 0.0.12 → 0.0.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (37) hide show
  1. package/README.md +33 -14
  2. package/dist/backend/api/claude-hook-routes.js +5 -0
  3. package/dist/backend/api/message-routes.js +4 -0
  4. package/dist/backend/api/round-routes.js +33 -0
  5. package/dist/backend/api/session-routes.js +2 -0
  6. package/dist/backend/api/task-routes.js +1 -0
  7. package/dist/backend/server.js +27 -3
  8. package/dist/backend/services/app-settings-service.js +2 -1
  9. package/dist/backend/services/claude-hook-service.js +70 -0
  10. package/dist/backend/services/harness-service.js +95 -0
  11. package/dist/backend/services/message-service.js +222 -49
  12. package/dist/backend/services/project-service.js +1 -1
  13. package/dist/backend/services/round-service.js +117 -0
  14. package/dist/backend/services/session-service.js +39 -0
  15. package/dist/backend/services/status-service.js +0 -76
  16. package/dist/backend/services/task-service.js +14 -6
  17. package/dist/backend/templates/harness/architect-agent.js +5 -0
  18. package/dist/backend/templates/harness/claude-root.js +6 -0
  19. package/dist/backend/templates/harness/coder-agent.js +5 -0
  20. package/dist/backend/templates/harness/gitignore.js +2 -1
  21. package/dist/backend/templates/harness/project-manager-agent.js +7 -0
  22. package/dist/backend/templates/harness/reviewer-agent.js +5 -0
  23. package/dist/backend/templates/message-envelope.js +3 -1
  24. package/dist/backend/ws/terminal-ws.js +15 -1
  25. package/dist/cli/vcmctl.js +30 -0
  26. package/dist/shared/types/claude-hook.js +1 -0
  27. package/dist/shared/types/round.js +1 -0
  28. package/dist-frontend/assets/index-DVhkEVnA.js +89 -0
  29. package/dist-frontend/assets/index-jEkUTnIY.css +32 -0
  30. package/dist-frontend/index.html +2 -2
  31. package/docs/cc-best-practices.md +15 -4
  32. package/docs/product-design.md +71 -38
  33. package/docs/v1-architecture-design.md +108 -49
  34. package/docs/v1-implementation-plan.md +107 -32
  35. package/package.json +1 -1
  36. package/dist-frontend/assets/index-Bi4X3GSR.css +0 -32
  37. package/dist-frontend/assets/index-DaHXq14j.js +0 -88
@@ -69,7 +69,6 @@ Main state lives in `App`:
69
69
  - task list
70
70
  - active task
71
71
  - active role
72
- - active workflow report
73
72
  - active messages
74
73
  - active orchestration state
75
74
  - task-local event list
@@ -93,8 +92,7 @@ Responsibilities:
93
92
  - Render collapsible sidebar sections.
94
93
  - Render repository connect form.
95
94
  - Render repository summary.
96
- - Render workflow panel.
97
- - Render settings section with Theme, Messages, Events, Auto orchestration.
95
+ - Render settings section with Theme, Round alert, Try alert, Messages, and Events.
98
96
  - Render harness status/actions.
99
97
  - 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
98
  - Render task list.
@@ -110,12 +108,15 @@ File:
110
108
 
111
109
  Responsibilities:
112
110
 
113
- - Fetch task status, messages, and orchestration state.
111
+ - Fetch task status, messages, orchestration state, and round state.
114
112
  - Poll those every three seconds.
115
113
  - Render compact header with task title, branch, immutable worktree path, role tabs, Refresh, and red `Close Task`.
116
114
  - Hold per-role permission mode selection.
115
+ - Hold task orchestration state and pass its on/off control to the active role console.
116
+ - Detect newly submitted auto-orchestration messages from Claude Code `UserPromptSubmit` hooks and switch the active role tab to the target role.
117
+ - Emit task round state to `App` so completion alerts can be deduplicated and displayed.
117
118
  - Render one `SessionConsole` per role but only show the active role.
118
- - Emit workflow/messages/orchestration/events back to `App` so sidebar stays synchronized.
119
+ - Emit messages/orchestration/events back to `App` so sidebar stays synchronized.
119
120
 
120
121
  ### SessionConsole
121
122
 
@@ -125,6 +126,12 @@ File:
125
126
 
126
127
  Responsibilities:
127
128
 
129
+ - Render role session controls and embedded terminal.
130
+ - Render `Auto orchestration` immediately to the left of `Translate`, using the same compact toggle styling.
131
+ - Render the translation split panel when `Translate` is enabled.
132
+
133
+ Responsibilities:
134
+
128
135
  - Render role toolbar.
129
136
  - Render embedded terminal for running sessions.
130
137
  - Render empty/resume state for stopped sessions.
@@ -242,7 +249,7 @@ feature/<taskSlug>
242
249
  Worktree path:
243
250
 
244
251
  ```text
245
- <baseRepoRoot>/.ai/vcm/worktrees/<taskSlug>
252
+ <baseRepoRoot>/.claude/worktrees/<taskSlug>
246
253
  ```
247
254
 
248
255
  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 +265,7 @@ worktreePath: undefined
258
265
  VCM does not create worktrees by role. All four role sessions for a task share the same task worktree:
259
266
 
260
267
  ```text
261
- .ai/vcm/worktrees/<taskSlug>/
268
+ .claude/worktrees/<taskSlug>/
262
269
  project-manager session cwd
263
270
  architect session cwd
264
271
  coder session cwd
@@ -274,11 +281,11 @@ VCM distinguishes:
274
281
  - `branch`: `feature/<taskSlug>`.
275
282
  - `worktreePath`: same as `taskRepoRoot`.
276
283
 
277
- Base repo state is only the task index and the container for nested task worktrees:
284
+ Base repo state is the task index plus the Claude-compatible container for nested task worktrees:
278
285
 
279
286
  ```text
280
287
  <baseRepoRoot>/.ai/vcm/tasks/<task>.json
281
- <baseRepoRoot>/.ai/vcm/worktrees/<task>/
288
+ <baseRepoRoot>/.claude/worktrees/<task>/
282
289
  ```
283
290
 
284
291
  Project configuration is app-local and stored outside the repository:
@@ -291,11 +298,11 @@ Project configuration is app-local and stored outside the repository:
291
298
  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
299
 
293
300
  ```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/vcm/handoffs/
301
+ <baseRepoRoot>/.claude/worktrees/<task>/.ai/vcm/sessions/<task>.json
302
+ <baseRepoRoot>/.claude/worktrees/<task>/.ai/vcm/messages/<task>.jsonl
303
+ <baseRepoRoot>/.claude/worktrees/<task>/.ai/vcm/orchestration/<task>.json
304
+ <baseRepoRoot>/.claude/worktrees/<task>/.ai/vcm/translation/<task>/
305
+ <baseRepoRoot>/.claude/worktrees/<task>/.ai/vcm/handoffs/
299
306
  ```
300
307
 
301
308
  For inline tasks, `taskRepoRoot` is the connected base repo, so these same runtime paths resolve under the connected repo's `.ai/vcm/`.
@@ -306,15 +313,15 @@ This split lets VCM list tasks from the base repo after worktrees are created, w
306
313
 
307
314
  ### 6.2 Git Ignore Requirement
308
315
 
309
- The base repository must ignore `.ai/vcm/`.
316
+ The base repository must ignore `.ai/vcm/` and `.claude/worktrees/`.
310
317
 
311
318
  Reason:
312
319
 
313
- - `.ai/vcm/worktrees/<task>` is a nested git worktree.
314
- - Without `.ai/vcm/` in `.gitignore`, the base repo sees worktree files as untracked noise.
320
+ - `.claude/worktrees/<task>` is a nested git worktree.
321
+ - Without `.claude/worktrees/` in `.gitignore`, the base repo sees worktree files as untracked noise.
315
322
  - `.ai/vcm` also contains local task/session/message metadata that should not be committed by default.
316
323
 
317
- The VCM harness manages a `.gitignore` block that ignores `.ai/vcm/` before task worktree creation.
324
+ The VCM harness manages a `.gitignore` block that ignores `.ai/vcm/` and `.claude/worktrees/` before task worktree creation.
318
325
 
319
326
  ### 6.3 Task Creation Flow
320
327
 
@@ -323,8 +330,9 @@ POST /api/tasks
323
330
  -> validate taskSlug
324
331
  -> assert .ai/vcm/ is ignored by Git
325
332
  -> if createWorktree is not false:
333
+ -> assert .claude/worktrees/ is ignored by Git
326
334
  -> compute branch feature/<taskSlug>
327
- -> compute worktreePath <baseRepoRoot>/.ai/vcm/worktrees/<taskSlug>
335
+ -> compute worktreePath <baseRepoRoot>/.claude/worktrees/<taskSlug>
328
336
  -> assert branch does not already exist
329
337
  -> assert worktreePath does not already exist
330
338
  -> assert base repo has no uncommitted changes
@@ -347,7 +355,7 @@ POST /api/tasks/:taskSlug/cleanup
347
355
  -> list role sessions for the task
348
356
  -> stop each VCM-managed role session whose runtime status is running
349
357
  -> stop translation tailers and clear task translation cache
350
- -> when worktreePath exists, verify it belongs under <baseRepoRoot>/.ai/vcm/worktrees/
358
+ -> when worktreePath exists, verify it belongs under <baseRepoRoot>/.claude/worktrees/
351
359
  -> when worktreePath exists, git worktree remove --force <worktreePath>
352
360
  -> when worktreePath exists, delete the task branch by default
353
361
  -> delete base task metadata
@@ -424,9 +432,9 @@ Artifact checks are simple V1 checks:
424
432
  - placeholder / incomplete
425
433
  - ok
426
434
 
427
- They are used for workflow readiness, not content quality judgment.
435
+ They are used for missing/incomplete artifact warnings, not content quality judgment.
428
436
 
429
- ## 8. Workflow Computation
437
+ ## 8. Task Status Report
430
438
 
431
439
  File:
432
440
 
@@ -438,21 +446,7 @@ Endpoint:
438
446
  GET /api/tasks/:taskSlug/status
439
447
  ```
440
448
 
441
- The workflow has five steps:
442
-
443
- ```text
444
- architecture-plan -> implementation -> review -> docs-sync -> final-acceptance
445
- ```
446
-
447
- Step readiness:
448
-
449
- - Architecture is ready until `architecture-plan.md` is ok.
450
- - Implementation is blocked until architecture is ok.
451
- - Review is blocked until `implementation-log.md` and `validation-log.md` are ok.
452
- - Docs Sync is blocked until `review-report.md` is ok.
453
- - PM Final is blocked until `docs-sync-report.md` is ok.
454
-
455
- The report is displayed in the sidebar `Workflow` section.
449
+ The status report returns the task record, role sessions, artifact checks, and warnings. VCM no longer computes or renders a Workflow panel; role sequencing is guided by the injected Claude rules and PM-mediated messages.
456
450
 
457
451
  ## 9. Session Runtime
458
452
 
@@ -581,21 +575,69 @@ Manual mode:
581
575
  send -> pending_approval or queued -> Messages modal -> Copy/manual action
582
576
  ```
583
577
 
584
- 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.
578
+ The current GUI shows sequence, timestamp, status, body preview, path, `Copy`, and `Mark All Done`. 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.
585
579
 
586
580
  Auto mode:
587
581
 
588
582
  ```text
589
- send -> delivered
583
+ send -> delivering when target has no active message
584
+ UserPromptSubmit hook containing message id -> submitted
585
+ send -> queued when target is already handling an active delivering/submitted/staged message
586
+ target role reply/result -> acknowledge active message -> deliver next queued message for that role
590
587
  ```
591
588
 
592
- The backend pastes a `[VCM MESSAGE]` envelope into the target terminal, then sends Enter as a separate terminal input event.
589
+ The backend pastes a `[VCM MESSAGE]` envelope into the target terminal, then sends Enter as a separate terminal input event. That terminal write is only `delivering`. Delivery is confirmed by the target Claude Code `UserPromptSubmit` hook, which includes the submitted prompt and message id. 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 workflow-complete signal for that message.
590
+
591
+ VCM Harness owns Claude Code hook injection through `.claude/settings.json`. V1 injects only `UserPromptSubmit` and `Stop`. `UserPromptSubmit` switches the role activity badge to `running` and confirms submitted messages. `Stop` switches the role activity badge to `idle`. VCM does not use Claude Code Subagent hooks for role delegation.
592
+
593
+ `Mark All Done` is a manual recovery action for stuck orchestration. It appends `acknowledged` snapshots for open messages, including `pending_approval`, `queued`, `staged`, `delivering`, `submitted`, `delivered`, and failed message states. It is intended for the case where the user manually copied or delivered stuck messages and wants auto orchestration to continue.
594
+
595
+ 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.
593
596
 
594
597
  The backend still exposes pause/resume orchestration API routes and stores `paused` for compatibility. The current GUI only toggles `mode` between `manual` and `auto`.
595
598
 
596
599
  Messages and orchestration snapshots are task runtime state under `taskRepoRoot/.ai/vcm`. Message body markdown also lives in the task worktree handoff directory.
597
600
 
598
- ## 12. Role Command Compatibility
601
+ ## 12. Round Completion Architecture
602
+
603
+ Files:
604
+
605
+ - `src/backend/services/round-service.ts`
606
+ - `src/backend/api/round-routes.ts`
607
+ - `src/shared/types/round.ts`
608
+
609
+ API:
610
+
611
+ ```text
612
+ GET /api/tasks/:taskSlug/round
613
+ ```
614
+
615
+ The round service reads hook-driven role activity from `RoleSessionRecord`. It does not use transcript tailing as the source of truth for round completion.
616
+
617
+ - `unknown`
618
+ - `idle`
619
+ - `answering`
620
+
621
+ Mapping:
622
+
623
+ - `UserPromptSubmit` updates the session to `activityStatus: "running"` and the round role state to `answering`
624
+ - `Stop` updates the session to `activityStatus: "idle"`, records `lastStopAt`, and the round role state becomes `idle`
625
+
626
+ Task-level completion:
627
+
628
+ - If a message is currently `delivering`, `submitted`, `delivered`, or `staged`, the latest such message defines the round target.
629
+ - In a PM -> role -> PM chain, completion follows the newest active message, so the round completes after PM emits hook `Stop` for the final response.
630
+ - Queued or pending messages prevent completion.
631
+ - If no VCM message is in the round, the latest direct role `Stop` can still produce a completion state.
632
+
633
+ Frontend behavior:
634
+
635
+ - `TaskWorkspace` polls the round endpoint with the other task state.
636
+ - `App` stores the sidebar `Round alert` preference in `~/.vcm/settings.json`.
637
+ - `Try alert` is frontend-only and calls the same round completion notice/sound path without persisting any setting.
638
+ - `App` deduplicates `completionId`, then shows a small `Round complete` prompt and plays a short Web Audio tone when alerts are enabled.
639
+
640
+ ## 13. Role Command Compatibility
599
641
 
600
642
  Files:
601
643
 
@@ -625,7 +667,7 @@ The dispatcher:
625
667
 
626
668
  This is a compatibility path. The preferred V1 coordination path is `vcmctl` message bus.
627
669
 
628
- ## 13. Harness Service
670
+ ## 14. Harness Service
629
671
 
630
672
  File:
631
673
 
@@ -636,6 +678,7 @@ Harness files:
636
678
  ```text
637
679
  CLAUDE.md
638
680
  .gitignore
681
+ .claude/settings.json
639
682
  .claude/agents/project-manager.md
640
683
  .claude/agents/architect.md
641
684
  .claude/agents/coder.md
@@ -655,9 +698,12 @@ Managed block:
655
698
  ```gitignore
656
699
  # VCM:BEGIN version=1
657
700
  .ai/vcm/
701
+ .claude/worktrees/
658
702
  # VCM:END
659
703
  ```
660
704
 
705
+ `.claude/settings.json` is JSON-merged by the harness. VCM preserves existing settings and adds command hooks for `UserPromptSubmit` and `Stop` that call `vcmctl hook-event` through the session-provided `VCM_CTL_COMMAND`.
706
+
661
707
  The service:
662
708
 
663
709
  - checks whether files exist
@@ -668,7 +714,7 @@ The service:
668
714
 
669
715
  It must not overwrite user content outside the VCM block.
670
716
 
671
- ## 14. Translation Architecture
717
+ ## 15. Translation Architecture
672
718
 
673
719
  Files:
674
720
 
@@ -782,7 +828,7 @@ POST translation/send -> bracketed paste English text -> short delay -> runtime.
782
828
 
783
829
  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.
784
830
 
785
- ## 15. API Surface
831
+ ## 16. API Surface
786
832
 
787
833
  Project:
788
834
 
@@ -838,6 +884,7 @@ Messages:
838
884
  ```text
839
885
  GET /api/tasks/:taskSlug/messages
840
886
  POST /api/tasks/:taskSlug/messages
887
+ POST /api/tasks/:taskSlug/messages/mark-all-done
841
888
  POST /api/tasks/:taskSlug/messages/:messageId/stage
842
889
  POST /api/tasks/:taskSlug/messages/:messageId/approve
843
890
  POST /api/tasks/:taskSlug/messages/:messageId/reject
@@ -847,6 +894,18 @@ POST /api/tasks/:taskSlug/orchestration/pause
847
894
  POST /api/tasks/:taskSlug/orchestration/resume
848
895
  ```
849
896
 
897
+ Claude Code hooks:
898
+
899
+ ```text
900
+ POST /api/hooks/claude-code
901
+ ```
902
+
903
+ Round:
904
+
905
+ ```text
906
+ GET /api/tasks/:taskSlug/round
907
+ ```
908
+
850
909
  App settings:
851
910
 
852
911
  ```text
@@ -875,7 +934,7 @@ WebSockets:
875
934
  /ws/terminal/:sessionId
876
935
  ```
877
936
 
878
- ## 16. Error Handling
937
+ ## 17. Error Handling
879
938
 
880
939
  File:
881
940
 
@@ -900,7 +959,7 @@ Fastify error handler returns:
900
959
  }
901
960
  ```
902
961
 
903
- ## 17. Packaging Architecture
962
+ ## 18. Packaging Architecture
904
963
 
905
964
  `package.json` publishes built artifacts:
906
965
 
@@ -922,7 +981,7 @@ Important scripts:
922
981
  - `prepack`: build and package verification
923
982
  - `postinstall`: fixes `node-pty` spawn helper when needed
924
983
 
925
- ## 18. Security And Safety Boundaries
984
+ ## 19. Security And Safety Boundaries
926
985
 
927
986
  Current boundaries:
928
987
 
@@ -936,13 +995,13 @@ Current boundaries:
936
995
  - Task worktrees are created only during task creation; VCM does not expose branch/worktree switching APIs.
937
996
  - Sandbox isolation should come from a devContainer, Docker container, VM, or other user-controlled environment.
938
997
 
939
- ## 19. Known Implementation Boundaries
998
+ ## 20. Known Implementation Boundaries
940
999
 
941
1000
  - No tmux backend.
942
1001
  - No per-role worktree manager.
943
1002
  - No branch switching for an existing task.
944
1003
  - No main-page artifact inspector.
945
1004
  - No raw PTY output translation.
946
- - No hard workflow gate enforcement.
1005
+ - No computed Workflow panel or hard gate enforcement.
947
1006
  - No durable backend event log for the sidebar Events modal; current events are frontend runtime events for the active task.
948
1007
  - No hosted multi-user collaboration.