vibe-coding-master 0.3.28 → 0.3.30

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 (33) hide show
  1. package/README.md +14 -18
  2. package/dist/backend/api/project-routes.js +1 -1
  3. package/dist/backend/api/task-routes.js +2 -2
  4. package/dist/backend/api/{codex-translation-routes.js → translation-worker-routes.js} +21 -21
  5. package/dist/backend/cli/install-vcm-harness.js +30 -25
  6. package/dist/backend/gateway/gateway-service.js +24 -5
  7. package/dist/backend/server.js +12 -22
  8. package/dist/backend/services/claude-hook-service.js +93 -26
  9. package/dist/backend/services/harness-service.js +49 -29
  10. package/dist/backend/services/message-service.js +9 -6
  11. package/dist/backend/services/project-service.js +2 -2
  12. package/dist/backend/services/session-service.js +99 -172
  13. package/dist/backend/services/translation-service.js +17 -17
  14. package/dist/backend/services/{codex-translation-service.js → translation-worker-service.js} +11 -11
  15. package/dist/backend/templates/harness/gate-review.js +2 -58
  16. package/dist/shared/constants.js +19 -12
  17. package/dist/shared/types/app-settings.js +1 -1
  18. package/dist/shared/types/session.js +2 -14
  19. package/dist-frontend/assets/{index-Cfum1Prr.css → index-BvUHLq4X.css} +1 -1
  20. package/dist-frontend/assets/{index-x9I-bGUt.js → index-D0ezB4na.js} +36 -36
  21. package/dist-frontend/index.html +2 -2
  22. package/docs/{codex-translation-plan.md → claude-code-translation-plan.md} +151 -153
  23. package/docs/full-harness-baseline.md +3 -7
  24. package/docs/gate-review-gates.md +13 -5
  25. package/docs/gateway-design.md +1 -1
  26. package/docs/product-design.md +12 -11
  27. package/docs/v0.4-custom-workflow-plan.md +0 -1
  28. package/docs/vcm-cc-best-practices.md +2 -5
  29. package/package.json +1 -1
  30. package/dist/backend/api/codex-hook-routes.js +0 -9
  31. package/dist/backend/codex-sandbox-mode.js +0 -28
  32. package/dist/backend/services/codex-hook-service.js +0 -71
  33. package/dist/shared/types/codex-hook.js +0 -1
@@ -36,7 +36,7 @@ CLAUDE.md
36
36
  .claude/agents/coder.md
37
37
  .claude/agents/reviewer.md
38
38
  .claude/agents/gate-reviewer.md
39
- .ai/codex-translator/AGENTS.md
39
+ .claude/agents/translator.md
40
40
  ```
41
41
 
42
42
  Whole-file or raw-file harness files:
@@ -47,9 +47,7 @@ Whole-file or raw-file harness files:
47
47
  .claude/skills/vcm-long-running-validation/SKILL.md
48
48
  .claude/skills/vcm-harness-bootstrap/SKILL.md
49
49
  .claude/skills/vcm-gate-review/SKILL.md
50
- .ai/codex-translator/config.toml
51
- .ai/codex-translator/.codex/config.toml
52
- .ai/codex-translator/.codex/hooks.json
50
+ .claude/agents/translator.md
53
51
  .ai/tools/generate-module-index
54
52
  .ai/tools/generate-public-surface
55
53
  .ai/tools/request-gate-review
@@ -76,8 +74,6 @@ Directory roots created by the installer:
76
74
  .claude/skills/vcm-long-running-validation/
77
75
  .claude/skills/vcm-route-message/
78
76
  .claude/skills/vcm-gate-review/
79
- .ai/codex-translator/
80
- .ai/codex-translator/.codex/
81
77
  .ai/vcm/translations/
82
78
  .ai/vcm/gate-reviews/
83
79
  .ai/tools/
@@ -158,7 +154,7 @@ session recovery.
158
154
 
159
155
  Close Task removes the task-owned worktree, branch, app-local task record, and
160
156
  task-local runtime state. It stops task-scoped VCM role sessions for that task.
161
- It must not stop project-scoped Gate Reviewer or Codex Translator sessions.
157
+ It must not stop project-scoped Gate Reviewer or Translator sessions.
162
158
 
163
159
  Durable facts that should survive task cleanup must be promoted into code,
164
160
  tests, durable docs, PR text, commit history, or release notes before closing
@@ -3,8 +3,9 @@
3
3
  This document defines VCM Gate Review Gates.
4
4
 
5
5
  Gate Review is an optional quality layer for complex tasks. It uses a fifth
6
- role, `gate-reviewer`, powered by Claude Code. The role is independent from the
7
- normal PM -> architect -> coder -> reviewer workflow.
6
+ VCM flow role, `gate-reviewer`, powered by Claude Code. The role uses the same
7
+ hook, Round, terminal, and translation path as the normal VCM roles, but it
8
+ does not participate in PM route-file dispatch.
8
9
 
9
10
  ## Gates
10
11
 
@@ -32,7 +33,8 @@ VCM owns:
32
33
  - starting/resuming the project-scoped Gate Reviewer Claude Code session
33
34
  - sending the gate prompt
34
35
  - waiting for the report
35
- - marking the Gate Reviewer turn in Round state
36
+ - binding the project-scoped Gate Reviewer session to the current task for hook,
37
+ Round, and translation state
36
38
  - sending the callback to PM
37
39
 
38
40
  PM owns:
@@ -60,6 +62,11 @@ therefore name the current task and task worktree path explicitly. Prior
60
62
  session memory can help orientation, but only current worktree evidence can
61
63
  decide the gate.
62
64
 
65
+ When a task uses Gate Reviewer, VCM records the active task binding on the
66
+ project session. Hook events from the long-lived session are resolved through
67
+ that binding so Round state and translation output are written to the current
68
+ task.
69
+
63
70
  Gate reports remain task-scoped:
64
71
 
65
72
  ```text
@@ -122,9 +129,10 @@ PM reaches gate
122
129
  -> VCM checks global gate switch and task state
123
130
  -> VCM starts or resumes project Gate Reviewer session
124
131
  -> VCM sends short prompt with task/worktree/report paths
125
- -> VCM marks Gate Reviewer running in current Round
132
+ -> VCM binds Gate Reviewer to the current task
126
133
  -> Gate Reviewer writes report
127
- -> VCM validates report and marks Gate Reviewer idle
134
+ -> standard Claude hooks update Gate Reviewer activity/Round state
135
+ -> VCM validates report
128
136
  -> VCM callbacks PM
129
137
  -> PM continues or routes follow-up
130
138
  ```
@@ -588,7 +588,7 @@ Service dependencies:
588
588
  template auto/manual orchestration mode.
589
589
  - `TerminalRuntime`: controlled PM terminal submission.
590
590
  - `ClaudeTranscriptService`: PM assistant output extraction.
591
- - `TranslationService` / Codex Translator: inbound Chinese-to-English and
591
+ - `TranslationService` / Translator: inbound Chinese-to-English and
592
592
  outbound target-language translation.
593
593
  - `ClaudeHookService` or hook event integration: trigger PM reply push after PM
594
594
  `Stop`.
@@ -84,10 +84,11 @@ project-manager
84
84
 
85
85
  ### 4.1 Gate Review Gates
86
86
 
87
- For complex tasks, VCM supports optional Gate Review Gates through an
88
- independent `gate-reviewer` Claude Code role. The reviewer uses a
89
- project-scoped long-lived session, but every gate prompt names the current task
90
- and task worktree so task evidence stays explicit.
87
+ For complex tasks, VCM supports optional Gate Review Gates through a
88
+ `gate-reviewer` Claude Code role. Gate Reviewer is a VCM flow role with the same
89
+ hook, Round, terminal, and translation behavior as the core roles. Its session
90
+ is project-scoped and reusable across tasks, but each gate turn is bound to the
91
+ current task and task worktree so task evidence stays explicit.
91
92
 
92
93
  ```text
93
94
  architect architecture plan
@@ -108,9 +109,9 @@ default to off.
108
109
 
109
110
  When any gate is on, or when a Gate Reviewer session already exists, the task
110
111
  workspace shows `Gate Reviewer` as a fifth terminal role. VCM sends a short gate
111
- prompt into that session and manually marks the role/Round running until the
112
- assigned report is valid. The role remains outside PM routing and normal
113
- auto-orchestration.
112
+ prompt into that project session and binds the session to the current task for
113
+ hooks, Round state, translation, and report polling. The role remains outside PM
114
+ route-file dispatch.
114
115
  Architecture-plan findings return to architect, validation-adequacy findings
115
116
  return to reviewer, and final-diff findings go to architect first for
116
117
  assessment. Gate Reviewer role rules live in `.claude/agents/gate-reviewer.md`.
@@ -409,7 +410,7 @@ The split should stay close to 50/50 width. Both panes expand vertically to fill
409
410
 
410
411
  ## 8. Flow Pause Detection
411
412
 
412
- VCM detects flow pauses from role hook events, not from terminal silence, message history, or pending route files. Claude Code roles report through `.claude/settings.json`; VCM directly records Gate Reviewer turns while a gate prompt is active.
413
+ VCM detects flow pauses from role hook events, not from terminal silence, message history, or pending route files. Claude Code VCM flow roles report through `.claude/settings.json`; Gate Reviewer follows the same hook path while VCM separately validates the assigned gate report.
413
414
 
414
415
  Backend role state:
415
416
 
@@ -417,7 +418,7 @@ Backend role state:
417
418
  - `Stop`: role becomes `idle` and records `lastTurnEndedAt`.
418
419
  - `PostCompact`: refreshes role session metadata and records `lastCompactAt` without changing `running`/`idle`.
419
420
  - `StopFailure`: first checks completion evidence. If the role already wrote an outgoing route file, VCM marks the role idle and dispatches normally. If not, VCM sends a recovery prompt to the same role without marking it idle.
420
- - The role tab and flow pause state react to Claude Code hook events plus VCM-recorded Gate Reviewer gate turns.
421
+ - The role tab and flow pause state react to Claude Code hook events for all VCM flow roles, including Gate Reviewer.
421
422
 
422
423
  Task-level Round state:
423
424
 
@@ -634,7 +635,7 @@ The settings file stores:
634
635
  - global translation target language
635
636
  - recent repository paths
636
637
 
637
- Translation work is routed through the long-lived Codex Translator session. VCM no longer exposes API-key, provider, or prompt-slot settings for the old API-backed translation path.
638
+ Translation work is routed through the long-lived Translator session. VCM no longer exposes API-key, provider, or prompt-slot settings for the old API-backed translation path.
638
639
 
639
640
  Sidebar controls:
640
641
 
@@ -688,7 +689,7 @@ Display behavior:
688
689
  - when translation fails, panel status shows `error` and the entry keeps the visible source plus an error.
689
690
  - `tool-output` is dim, one-line, truncated by CSS, and not translated.
690
691
 
691
- Long translations do not block capture. Translatable prose entries are pushed to the panel before Codex translation starts. Claude Code prose output waits up to 10 seconds so adjacent entries can be batched into one Codex prompt and one temporary result file. When an `end_turn` assistant text arrives, VCM adds it to the current batch and flushes the batch immediately. The default output mode is `final summary`, which translates only `end_turn` assistant text to save Codex quota. In `all output` mode, intermediate assistant text and structured question/todo/agent events are also translated. `tool_use` and `tool_result` entries are never added to the translation queue; they are displayed immediately.
692
+ Long translations do not block capture. Translatable prose entries are pushed to the panel before translation starts. Claude Code prose output waits up to 10 seconds so adjacent entries can be batched into one Claude Code Translator prompt and one temporary result file. When an `end_turn` assistant text arrives, VCM adds it to the current batch and flushes the batch immediately. The default output mode is `PM final reply`, which translates only Project Manager `end_turn` assistant text to reduce translation work. In `all output` mode, intermediate assistant text and structured question/todo/agent events are also translated. `tool_use` and `tool_result` entries are never added to the translation queue; they are displayed immediately.
692
693
 
693
694
  There is no keyword classifier that drops assistant text. A previous design skipped permission-looking or log-looking text; that is removed.
694
695
 
@@ -228,7 +228,6 @@ The role model should not assume every role uses the same CLI.
228
228
  Recommended initial engines:
229
229
 
230
230
  - `claude-code`
231
- - `codex-cli`
232
231
  - `manual`
233
232
  - `command`
234
233
 
@@ -7,7 +7,7 @@ It is based on the latest `example/rust-layered` harness baseline.
7
7
 
8
8
  Do not install this document into target repositories. Target repositories should
9
9
  receive a concise root `CLAUDE.md` VCM block, role agents, repo-local VCM
10
- skills, harness tools, Codex Translator harness files, and project-owned
10
+ skills, harness tools, Translator harness files, and project-owned
11
11
  durable docs.
12
12
 
13
13
  `docs/cc-best-practices.md` is archived as the old generic baseline. Current VCM
@@ -48,10 +48,7 @@ CLAUDE.md
48
48
  .claude/skills/vcm-long-running-validation/SKILL.md
49
49
  .claude/skills/vcm-harness-bootstrap/SKILL.md
50
50
  .claude/skills/vcm-gate-review/SKILL.md
51
- .ai/codex-translator/AGENTS.md
52
- .ai/codex-translator/config.toml
53
- .ai/codex-translator/.codex/config.toml
54
- .ai/codex-translator/.codex/hooks.json
51
+ .claude/agents/translator.md
55
52
  .ai/tools/generate-module-index
56
53
  .ai/tools/generate-public-surface
57
54
  .ai/tools/request-gate-review
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vibe-coding-master",
3
- "version": "0.3.28",
3
+ "version": "0.3.30",
4
4
  "description": "Local GUI session cockpit for Claude Code role sessions.",
5
5
  "type": "module",
6
6
  "files": [
@@ -1,9 +0,0 @@
1
- export function registerCodexHookRoutes(app, deps) {
2
- app.post("/api/hooks/codex-translator", async (request) => {
3
- return deps.codexHookService.handleHook(request.body);
4
- });
5
- app.post("/api/hooks/codex-translator/stop", async (request) => {
6
- await deps.codexHookService.handleStopHook(request.body);
7
- return {};
8
- });
9
- }
@@ -1,28 +0,0 @@
1
- import { existsSync } from "node:fs";
2
- export function resolveCodexSandboxMode(env = process.env, pathExists = existsSync) {
3
- const explicit = env.VCM_SANDBOX?.trim();
4
- if (explicit) {
5
- return explicit;
6
- }
7
- if (isTruthy(env.VCM_CODEX_DISABLE_SANDBOX) ||
8
- isTruthy(env.VCM_CODEX_BYPASS_SANDBOX) ||
9
- isTruthy(env.CODESPACES) ||
10
- isTruthy(env.REMOTE_CONTAINERS) ||
11
- isTruthy(env.DEVCONTAINER)) {
12
- return "devcontainer";
13
- }
14
- const containerName = (env.container ?? env.CONTAINER ?? "").toLowerCase();
15
- if (containerName === "devcontainer" || containerName === "docker" || containerName === "podman") {
16
- return "devcontainer";
17
- }
18
- if (env.KUBERNETES_SERVICE_HOST || pathExists("/.dockerenv") || pathExists("/run/.containerenv")) {
19
- return "devcontainer";
20
- }
21
- return undefined;
22
- }
23
- function isTruthy(value) {
24
- if (!value) {
25
- return false;
26
- }
27
- return !["0", "false", "no", "off"].includes(value.trim().toLowerCase());
28
- }
@@ -1,71 +0,0 @@
1
- import { isCodexRoleName } from "../../shared/constants.js";
2
- import { VcmError } from "../errors.js";
3
- export function createCodexHookService(deps) {
4
- async function getHookContext(input) {
5
- if (!isCodexRoleName(input.role)) {
6
- throw new VcmError({
7
- code: "CODEX_HOOK_ROLE_INVALID",
8
- message: `Unknown Codex hook role: ${input.role}`,
9
- statusCode: 400
10
- });
11
- }
12
- const project = await deps.projectService.getCurrentProject();
13
- if (!project) {
14
- throw new VcmError({
15
- code: "PROJECT_NOT_CONNECTED",
16
- message: "Connect a repository before accepting Codex hooks.",
17
- statusCode: 409
18
- });
19
- }
20
- return {
21
- project
22
- };
23
- }
24
- async function processHook(input, expectedEventName) {
25
- const eventName = parseHookEvent(input.event.hook_event_name);
26
- if (eventName !== expectedEventName) {
27
- throw new VcmError({
28
- code: "CODEX_HOOK_EVENT_UNSUPPORTED",
29
- message: `Unsupported Codex hook event for this endpoint: ${eventName}`,
30
- statusCode: 400
31
- });
32
- }
33
- const context = await getHookContext(input);
34
- const session = await deps.sessionService.recordProjectTranslatorHookEvent(context.project.repoRoot, {
35
- eventName,
36
- sessionId: stringOrUndefined(input.event.session_id),
37
- transcriptPath: stringOrUndefined(input.event.transcript_path),
38
- cwd: stringOrUndefined(input.event.cwd)
39
- });
40
- await deps.codexTranslationService?.handleCodexHook(context.project.repoRoot, eventName, input.taskSlug);
41
- return {
42
- ok: true,
43
- eventName,
44
- taskSlug: input.taskSlug,
45
- role: input.role,
46
- sessionUpdated: Boolean(session)
47
- };
48
- }
49
- return {
50
- handleHook(input) {
51
- return processHook(input, "UserPromptSubmit");
52
- },
53
- handleStopHook(input) {
54
- return processHook(input, "Stop");
55
- }
56
- };
57
- }
58
- function parseHookEvent(value) {
59
- if (value === "UserPromptSubmit" || value === "Stop") {
60
- return value;
61
- }
62
- throw new VcmError({
63
- code: "CODEX_HOOK_EVENT_UNSUPPORTED",
64
- message: `Unsupported Codex hook event: ${String(value)}`,
65
- statusCode: 400,
66
- hint: "VCM accepts Codex UserPromptSubmit and Stop hooks only."
67
- });
68
- }
69
- function stringOrUndefined(value) {
70
- return typeof value === "string" ? value : undefined;
71
- }
@@ -1 +0,0 @@
1
- export {};