vibe-coding-master 0.3.26 → 0.3.28
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.
- package/README.md +33 -29
- package/dist/backend/api/codex-hook-routes.js +0 -7
- package/dist/backend/api/gate-review-routes.js +58 -0
- package/dist/backend/api/task-routes.js +2 -2
- package/dist/backend/cli/install-vcm-harness.js +15 -57
- package/dist/backend/server.js +6 -8
- package/dist/backend/services/app-settings-service.js +15 -15
- package/dist/backend/services/codex-hook-service.js +8 -50
- package/dist/backend/services/{codex-review-service.js → gate-review-service.js} +108 -108
- package/dist/backend/services/harness-service.js +15 -63
- package/dist/backend/services/session-service.js +257 -41
- package/dist/backend/services/task-service.js +2 -2
- package/dist/backend/templates/harness/claude-root.js +2 -2
- package/dist/backend/templates/harness/{codex-review.js → gate-review.js} +35 -278
- package/dist/backend/templates/harness/project-manager-agent.js +7 -7
- package/dist/backend/templates/harness/vcm-final-acceptance-skill.js +5 -5
- package/dist/shared/constants.js +8 -5
- package/dist/shared/types/{codex-review.js → gate-review.js} +1 -1
- package/dist-frontend/assets/{index-CKWy15WL.js → index-x9I-bGUt.js} +37 -37
- package/dist-frontend/index.html +1 -1
- package/docs/codex-translation-plan.md +83 -136
- package/docs/full-harness-baseline.md +113 -207
- package/docs/gate-review-gates.md +133 -0
- package/docs/gateway-design.md +6 -8
- package/docs/product-design.md +66 -38
- package/docs/v0.2-implementation-plan.md +4 -0
- package/docs/vcm-cc-best-practices.md +36 -33
- package/package.json +1 -1
- package/scripts/verify-package.mjs +4 -4
- package/dist/backend/api/codex-review-routes.js +0 -58
- package/docs/codex-review-gates.md +0 -593
package/docs/product-design.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# VibeCodingMaster Product Design
|
|
2
2
|
|
|
3
|
-
Last updated: 2026-06-
|
|
3
|
+
Last updated: 2026-06-21
|
|
4
4
|
|
|
5
5
|
This document describes the current product direction and implemented V1 behavior for VCM.
|
|
6
6
|
|
|
@@ -44,7 +44,7 @@ This `Session` term is only for VCM statistics. It must not be confused with a C
|
|
|
44
44
|
VCM V1 must make multi-session Claude Code work visible and recoverable:
|
|
45
45
|
|
|
46
46
|
- Connect a local Git repository.
|
|
47
|
-
- Create a named task with its own branch and task-level worktree
|
|
47
|
+
- Create a named task with its own branch and task-level worktree.
|
|
48
48
|
- Start, stop, restart, and resume one Claude Code session per role.
|
|
49
49
|
- Keep role terminals embedded in one GUI.
|
|
50
50
|
- Preserve task state, session state, handoff files, and message history.
|
|
@@ -82,43 +82,40 @@ project-manager
|
|
|
82
82
|
-> project-manager final acceptance, commit, and PR
|
|
83
83
|
```
|
|
84
84
|
|
|
85
|
-
### 4.1
|
|
85
|
+
### 4.1 Gate Review Gates
|
|
86
86
|
|
|
87
|
-
For complex tasks, VCM supports optional
|
|
88
|
-
|
|
89
|
-
|
|
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.
|
|
90
91
|
|
|
91
92
|
```text
|
|
92
93
|
architect architecture plan
|
|
93
|
-
->
|
|
94
|
+
-> Gate Reviewer checks plan quality before coder starts
|
|
94
95
|
|
|
95
96
|
reviewer review-report
|
|
96
|
-
->
|
|
97
|
+
-> Gate Reviewer checks validation adequacy before final acceptance
|
|
97
98
|
|
|
98
99
|
final task diff
|
|
99
|
-
->
|
|
100
|
+
-> Gate Reviewer checks code and PR readiness before PR preparation
|
|
100
101
|
```
|
|
101
102
|
|
|
102
103
|
Each gate returns `approve` or `request_changes`. PM triggers gates through the
|
|
103
|
-
`vcm-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
`.ai/codex/.codex/hooks.json`, so the fifth role participates in session and
|
|
114
|
-
Round state while a gate is running.
|
|
104
|
+
`vcm-gate-review` skill at the three workflow points; VCM owns the sidebar
|
|
105
|
+
toggles, gate state, Gate Reviewer session, report polling, and PM callback.
|
|
106
|
+
Reports are task-scoped under `.ai/vcm/gate-reviews/`. All three gate toggles
|
|
107
|
+
default to off.
|
|
108
|
+
|
|
109
|
+
When any gate is on, or when a Gate Reviewer session already exists, the task
|
|
110
|
+
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.
|
|
115
114
|
Architecture-plan findings return to architect, validation-adequacy findings
|
|
116
115
|
return to reviewer, and final-diff findings go to architect first for
|
|
117
|
-
assessment.
|
|
118
|
-
including `.ai/codex/AGENTS.md` and `.ai/codex/config.toml`, so VCM does not
|
|
119
|
-
require a root-level `AGENTS.md`.
|
|
116
|
+
assessment. Gate Reviewer role rules live in `.claude/agents/gate-reviewer.md`.
|
|
120
117
|
|
|
121
|
-
The detailed design lives in `docs/
|
|
118
|
+
The detailed design lives in `docs/gate-review-gates.md`.
|
|
122
119
|
|
|
123
120
|
### 4.2 Task Worktree Model
|
|
124
121
|
|
|
@@ -277,6 +274,9 @@ Sections:
|
|
|
277
274
|
- `Repository Path`
|
|
278
275
|
- `Connected Repository`
|
|
279
276
|
- `Settings`
|
|
277
|
+
- `Translation`
|
|
278
|
+
- `Gate Review Gates`
|
|
279
|
+
- `Gateway`
|
|
280
280
|
- `VCM Harness`
|
|
281
281
|
- `New Task`
|
|
282
282
|
- `Tasks`
|
|
@@ -330,6 +330,24 @@ Safari may still require the user to manually set `Safari > Website Settings > A
|
|
|
330
330
|
|
|
331
331
|
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.
|
|
332
332
|
|
|
333
|
+
`Translation` contains:
|
|
334
|
+
|
|
335
|
+
- `Conversation translation`
|
|
336
|
+
- `Auto-send`
|
|
337
|
+
- `Language`
|
|
338
|
+
- `Reply scope`
|
|
339
|
+
- `File translation`
|
|
340
|
+
- `Bootstrap`
|
|
341
|
+
- `Update memory`
|
|
342
|
+
- `Session status`
|
|
343
|
+
- `Open Session`
|
|
344
|
+
|
|
345
|
+
`Gate Review Gates` contains three independent switches:
|
|
346
|
+
|
|
347
|
+
- `Architecture plan`
|
|
348
|
+
- `Validation adequacy`
|
|
349
|
+
- `Final diff`
|
|
350
|
+
|
|
333
351
|
`VCM Harness` shows whether VCM managed blocks are installed/up to date in the project rules files and `.gitignore`.
|
|
334
352
|
|
|
335
353
|
`New Task` contains:
|
|
@@ -345,14 +363,16 @@ There is no optional title input in the current UI.
|
|
|
345
363
|
The task workspace header is one compact row:
|
|
346
364
|
|
|
347
365
|
```text
|
|
348
|
-
<task> [Project Manager] [Architect] [Coder] [Reviewer] [
|
|
366
|
+
<task> [Project Manager] [Architect] [Coder] [Reviewer] [Gate Reviewer?] [Auto orchestration] [Close Task]
|
|
349
367
|
```
|
|
350
368
|
|
|
351
369
|
The header does not show `TASK WORKSPACE`, branch, or worktree path. Task branch/worktree details remain task metadata, but they are not first-row chrome.
|
|
352
370
|
|
|
353
371
|
The task workspace does not show a manual `Refresh` button. Task status, role status, messages, orchestration state, and flow pause state refresh automatically. The only remaining `Refresh` control is inside the sidebar `VCM Harness` section, where it rechecks managed project files.
|
|
354
372
|
|
|
355
|
-
Role tabs show the session status for each role.
|
|
373
|
+
Role tabs show the session status for each visible role. `Gate Reviewer` appears
|
|
374
|
+
only when a Gate Review switch is enabled or a Gate Reviewer session already
|
|
375
|
+
exists.
|
|
356
376
|
|
|
357
377
|
The main task workspace only renders the active role console. Messages and Events are opened from the sidebar.
|
|
358
378
|
|
|
@@ -389,7 +409,7 @@ The split should stay close to 50/50 width. Both panes expand vertically to fill
|
|
|
389
409
|
|
|
390
410
|
## 8. Flow Pause Detection
|
|
391
411
|
|
|
392
|
-
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`;
|
|
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.
|
|
393
413
|
|
|
394
414
|
Backend role state:
|
|
395
415
|
|
|
@@ -397,7 +417,7 @@ Backend role state:
|
|
|
397
417
|
- `Stop`: role becomes `idle` and records `lastTurnEndedAt`.
|
|
398
418
|
- `PostCompact`: refreshes role session metadata and records `lastCompactAt` without changing `running`/`idle`.
|
|
399
419
|
- `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.
|
|
400
|
-
- The role tab and flow pause state
|
|
420
|
+
- The role tab and flow pause state react to Claude Code hook events plus VCM-recorded Gate Reviewer gate turns.
|
|
401
421
|
|
|
402
422
|
Task-level Round state:
|
|
403
423
|
|
|
@@ -587,18 +607,13 @@ VCM Harness injects Claude Code hooks into `.claude/settings.json`:
|
|
|
587
607
|
|
|
588
608
|
VCM uses `UserPromptSubmit` as the Claude Code acceptance signal. A successful PTY write only proves VCM delivered text to the embedded terminal; `UserPromptSubmit` proves Claude Code accepted the prompt.
|
|
589
609
|
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
- `UserPromptSubmit`: posts directly to `/api/hooks/codex-reviewer`, marks the fifth role running, and starts or continues the shared Round state
|
|
593
|
-
- `Stop`: posts directly to `/api/hooks/codex-reviewer/stop`, marks the fifth role idle, and lets the Round settle normally
|
|
594
|
-
|
|
595
|
-
Codex Reviewer hooks do not dispatch route files. PM receives Codex review completion through the Codex Review Gate callback managed by VCM.
|
|
610
|
+
Gate Reviewer does not dispatch route files. PM receives Gate Review completion through the Gate Review callback managed by VCM.
|
|
596
611
|
|
|
597
612
|
The injected role rules require asynchronous file messaging: after writing or updating a route file, the role must end the current Claude Code turn and wait for VCM to deliver a later reply. Roles should use `.claude/skills/vcm-route-message/SKILL.md` to author route files. Roles must not poll files, start shell loops, keep the turn open waiting for another role to answer, paste directly into another role terminal, or use Claude Code Task/Subagent for VCM role delegation.
|
|
598
613
|
|
|
599
614
|
Roles must not run background Bash; a `PreToolUse` hook (`.ai/tools/vcm-bash-guard`) denies `run_in_background`, `nohup`, `setsid`, `disown`, and trailing `&`. The only sanctioned long-running mechanism is `.ai/tools/run-long-check` plus `.ai/tools/watch-job` through `vcm-long-running-validation`: the detached job worker enforces the 60 minute ceiling and a supervision lease that kills unwatched jobs, `watch-job` renews the lease in foreground windows of up to 8 minutes (exit `125` means call it again in the same turn), and the VCM backend blocks a role's turn-end while one of its validation jobs is still running.
|
|
600
615
|
|
|
601
|
-
There is no `vcmctl` in the target design. Hook entrypoints are direct HTTP from Claude Code
|
|
616
|
+
There is no `vcmctl` in the target design. Hook entrypoints are direct HTTP from Claude Code hooks to the local VCM backend.
|
|
602
617
|
|
|
603
618
|
## 13. Translation
|
|
604
619
|
|
|
@@ -711,7 +726,11 @@ Translation panel `Auto-send` is separate from task `Auto orchestration`:
|
|
|
711
726
|
- `Auto-send` on: translate and send if there is no translation warning.
|
|
712
727
|
- `Auto-send` off: translate to English draft and wait for user send.
|
|
713
728
|
|
|
714
|
-
Task `Auto orchestration` is a compact selected/unselected button in the
|
|
729
|
+
Task `Auto orchestration` is a compact selected/unselected button in the task
|
|
730
|
+
workspace header next to `Close Task`. New tasks default to auto orchestration.
|
|
731
|
+
Conversation translation is controlled by the sidebar `Translation` group; when
|
|
732
|
+
enabled, each running core VCM role console shows the translation split, so
|
|
733
|
+
switching roles keeps the same global translation setting.
|
|
715
734
|
|
|
716
735
|
## 14. Mobile Gateway
|
|
717
736
|
|
|
@@ -777,7 +796,6 @@ and audit logs live under `vcmDataDir`. VCM resolves `vcmDataDir` from
|
|
|
777
796
|
Repository-level VCM state:
|
|
778
797
|
|
|
779
798
|
```text
|
|
780
|
-
.ai/vcm/tasks/<task>.json
|
|
781
799
|
.claude/worktrees/<task>/
|
|
782
800
|
```
|
|
783
801
|
|
|
@@ -797,10 +815,20 @@ Task worktree local files:
|
|
|
797
815
|
.claude/worktrees/<task>/.ai/vcm/messages/<task>.jsonl
|
|
798
816
|
.claude/worktrees/<task>/.ai/vcm/orchestration/<task>.json
|
|
799
817
|
.claude/worktrees/<task>/.ai/vcm/translation/<task>/
|
|
818
|
+
.claude/worktrees/<task>/.ai/vcm/gate-reviews/
|
|
800
819
|
.claude/worktrees/<task>/.ai/vcm/handoffs/
|
|
801
820
|
.claude/worktrees/<task>/.ai/vcm/handoffs/messages/<from-role>-<to-role>.md
|
|
802
821
|
```
|
|
803
822
|
|
|
823
|
+
Project-scoped local files:
|
|
824
|
+
|
|
825
|
+
```text
|
|
826
|
+
.ai/vcm/gate-reviewer/session.json
|
|
827
|
+
.ai/vcm/translations/
|
|
828
|
+
.ai/vcm/bootstrap/session.json
|
|
829
|
+
.ai/vcm/bootstrap/bootstrap.log
|
|
830
|
+
```
|
|
831
|
+
|
|
804
832
|
External Claude transcripts:
|
|
805
833
|
|
|
806
834
|
```text
|
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
Last updated: 2026-06-10
|
|
4
4
|
|
|
5
|
+
> Archived historical plan. This document records the 0.2 design context and is
|
|
6
|
+
> not the current implementation reference. For current behavior, use
|
|
7
|
+
> `README.md`, `docs/gateway-design.md`, and `docs/full-harness-baseline.md`.
|
|
8
|
+
|
|
5
9
|
VCM 0.2 has two product tracks:
|
|
6
10
|
|
|
7
11
|
- Mobile gateway through Tencent iLink Bot API / Weixin DM.
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
# VCM Claude Code Best Practices
|
|
2
2
|
|
|
3
|
-
Last updated: 2026-06-
|
|
3
|
+
Last updated: 2026-06-21
|
|
4
4
|
|
|
5
5
|
This is the current VCM-specific Claude Code / AI coding best-practices guide.
|
|
6
6
|
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
|
-
receive a concise root `CLAUDE.md` VCM block,
|
|
10
|
-
skills, harness tools, and project-owned
|
|
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
|
|
11
|
+
durable docs.
|
|
11
12
|
|
|
12
13
|
`docs/cc-best-practices.md` is archived as the old generic baseline. Current VCM
|
|
13
14
|
implementation should use this document and `docs/full-harness-baseline.md`.
|
|
@@ -17,7 +18,7 @@ implementation should use this document and `docs/full-harness-baseline.md`.
|
|
|
17
18
|
VCM separates three concerns:
|
|
18
19
|
|
|
19
20
|
- Harness-managed files: VCM owns, upgrades, repairs, audits, and can uninstall
|
|
20
|
-
these through
|
|
21
|
+
these through deterministic installer definitions and managed markers.
|
|
21
22
|
- Project-owned durable docs: VCM bootstrap may create or initialize these, but
|
|
22
23
|
they become project truth and are not VCM-owned harness.
|
|
23
24
|
- Runtime state: VCM writes these during task execution and cleans them up after
|
|
@@ -41,13 +42,19 @@ CLAUDE.md
|
|
|
41
42
|
.claude/agents/architect.md
|
|
42
43
|
.claude/agents/coder.md
|
|
43
44
|
.claude/agents/reviewer.md
|
|
45
|
+
.claude/agents/gate-reviewer.md
|
|
44
46
|
.claude/skills/vcm-route-message/SKILL.md
|
|
45
47
|
.claude/skills/vcm-final-acceptance/SKILL.md
|
|
46
48
|
.claude/skills/vcm-long-running-validation/SKILL.md
|
|
47
49
|
.claude/skills/vcm-harness-bootstrap/SKILL.md
|
|
48
|
-
.
|
|
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
|
|
49
55
|
.ai/tools/generate-module-index
|
|
50
56
|
.ai/tools/generate-public-surface
|
|
57
|
+
.ai/tools/request-gate-review
|
|
51
58
|
.ai/tools/run-long-check
|
|
52
59
|
.ai/tools/watch-job
|
|
53
60
|
.ai/tools/vcm-bash-guard
|
|
@@ -61,9 +68,8 @@ Derived bootstrap artifacts:
|
|
|
61
68
|
.ai/generated/public-surface.json
|
|
62
69
|
```
|
|
63
70
|
|
|
64
|
-
The generated artifacts are
|
|
65
|
-
|
|
66
|
-
bootstrap or later maintenance work. They are not hand-authored fixed templates.
|
|
71
|
+
The generated artifacts are produced by generator tools during bootstrap or
|
|
72
|
+
later maintenance work. They are not hand-authored fixed templates.
|
|
67
73
|
|
|
68
74
|
Runtime roots:
|
|
69
75
|
|
|
@@ -80,6 +86,7 @@ Not part of the current baseline:
|
|
|
80
86
|
.ai/task-specs/
|
|
81
87
|
.ai/vcm/tasks/
|
|
82
88
|
.ai/vcm/handoffs/role-commands/
|
|
89
|
+
.ai/vcm-harness-manifest.json
|
|
83
90
|
docs/plans/active/
|
|
84
91
|
docs/plans/completed/
|
|
85
92
|
docs/MODULE_MAP.md
|
|
@@ -100,35 +107,31 @@ docs/AI_WORKFLOW.md
|
|
|
100
107
|
|
|
101
108
|
Do not reintroduce these unless there is a current VCM requirement.
|
|
102
109
|
|
|
103
|
-
## 3. Harness
|
|
110
|
+
## 3. Harness Ownership
|
|
104
111
|
|
|
105
|
-
|
|
106
|
-
|
|
112
|
+
VCM harness ownership is defined by the installer code and by managed markers.
|
|
113
|
+
The current implementation does not use `.ai/vcm-harness-manifest.json`.
|
|
107
114
|
|
|
108
|
-
|
|
115
|
+
VCM-owned managed blocks use markers such as:
|
|
109
116
|
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
- generated context artifacts under `.ai/generated/`
|
|
116
|
-
- PR template managed blocks
|
|
117
|
-
- lifecycle labels
|
|
118
|
-
- runtime roots
|
|
119
|
-
- uninstall actions
|
|
117
|
+
```md
|
|
118
|
+
<!-- VCM:BEGIN version=1 -->
|
|
119
|
+
...
|
|
120
|
+
<!-- VCM:END -->
|
|
121
|
+
```
|
|
120
122
|
|
|
121
|
-
|
|
123
|
+
For `.gitignore`, VCM uses:
|
|
122
124
|
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
- placeholder `.gitkeep` files
|
|
125
|
+
```gitignore
|
|
126
|
+
# VCM:BEGIN version=1
|
|
127
|
+
...
|
|
128
|
+
# VCM:END
|
|
129
|
+
```
|
|
129
130
|
|
|
130
|
-
|
|
131
|
-
|
|
131
|
+
Whole-file and raw-file harness files are owned by VCM only when their paths are
|
|
132
|
+
listed by the fixed installer. VCM uninstall should remove only VCM-owned
|
|
133
|
+
managed blocks or unchanged VCM-owned whole files. User-authored project docs
|
|
134
|
+
must not be deleted by harness uninstall.
|
|
132
135
|
|
|
133
136
|
## 4. Project-Owned Durable Docs
|
|
134
137
|
|
|
@@ -169,6 +172,7 @@ Current runtime files and directories:
|
|
|
169
172
|
.ai/vcm/handoffs/docs-sync-report.md
|
|
170
173
|
.ai/vcm/handoffs/final-acceptance.md
|
|
171
174
|
.ai/vcm/handoffs/known-issues.md
|
|
175
|
+
.ai/vcm/gate-reviews/
|
|
172
176
|
.ai/vcm/jobs/<job-id>/
|
|
173
177
|
.ai/vcm/bootstrap/session.json
|
|
174
178
|
.ai/vcm/bootstrap/bootstrap.log
|
|
@@ -417,7 +421,7 @@ an invisible background task:
|
|
|
417
421
|
|
|
418
422
|
The UI should expose both stages: fixed install status and bootstrap completion
|
|
419
423
|
status. A failed or disconnected bootstrap terminal should be restartable
|
|
420
|
-
without treating project-owned durable docs as VCM-owned
|
|
424
|
+
without treating project-owned durable docs as VCM-owned harness files.
|
|
421
425
|
|
|
422
426
|
## 12. Final Acceptance
|
|
423
427
|
|
|
@@ -444,7 +448,6 @@ Temporary files should be deleted after the task:
|
|
|
444
448
|
- route messages
|
|
445
449
|
- handoff artifacts
|
|
446
450
|
- job logs and status files
|
|
447
|
-
- raw terminal logs
|
|
448
451
|
- app-local task records
|
|
449
452
|
- routine completed plans
|
|
450
453
|
|
package/package.json
CHANGED
|
@@ -16,10 +16,10 @@ const requiredFiles = [
|
|
|
16
16
|
"dist/main.js",
|
|
17
17
|
"dist/backend/server.js",
|
|
18
18
|
"dist/backend/api/harness-routes.js",
|
|
19
|
-
"dist/backend/api/
|
|
19
|
+
"dist/backend/api/gate-review-routes.js",
|
|
20
20
|
"dist/backend/runtime/node-pty-runtime.js",
|
|
21
21
|
"dist/backend/ws/terminal-ws.js",
|
|
22
|
-
"dist/backend/services/
|
|
22
|
+
"dist/backend/services/gate-review-service.js",
|
|
23
23
|
"dist/backend/services/harness-service.js",
|
|
24
24
|
"dist/backend/services/session-service.js",
|
|
25
25
|
"dist/backend/services/project-service.js",
|
|
@@ -29,9 +29,9 @@ const requiredFiles = [
|
|
|
29
29
|
"dist/backend/templates/harness/architect-agent.js",
|
|
30
30
|
"dist/backend/templates/harness/coder-agent.js",
|
|
31
31
|
"dist/backend/templates/harness/reviewer-agent.js",
|
|
32
|
-
"dist/backend/templates/harness/
|
|
32
|
+
"dist/backend/templates/harness/gate-review.js",
|
|
33
33
|
"dist/shared/constants.js",
|
|
34
|
-
"dist/shared/types/
|
|
34
|
+
"dist/shared/types/gate-review.js",
|
|
35
35
|
"dist/shared/types/harness.js",
|
|
36
36
|
"dist/shared/validation/slug-check.js",
|
|
37
37
|
"dist/shared/validation/artifact-check.js",
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import { VcmError } from "../errors.js";
|
|
2
|
-
import { isCodexReviewGate } from "../services/codex-review-service.js";
|
|
3
|
-
export function registerCodexReviewRoutes(app, deps) {
|
|
4
|
-
app.get("/api/tasks/:taskSlug/codex-review", async (request) => {
|
|
5
|
-
const project = await requireCurrentProject(deps.projectService);
|
|
6
|
-
return deps.codexReviewService.getState(project.repoRoot, request.params.taskSlug);
|
|
7
|
-
});
|
|
8
|
-
app.put("/api/tasks/:taskSlug/codex-review/settings", async (request) => {
|
|
9
|
-
const project = await requireCurrentProject(deps.projectService);
|
|
10
|
-
return deps.codexReviewService.updateSettings(project.repoRoot, request.params.taskSlug, request.body);
|
|
11
|
-
});
|
|
12
|
-
app.post("/api/tasks/:taskSlug/codex-review/:gate/request", async (request) => {
|
|
13
|
-
const project = await requireCurrentProject(deps.projectService);
|
|
14
|
-
const gate = parseGate(request.params.gate);
|
|
15
|
-
return deps.codexReviewService.requestReviewGate(project.repoRoot, request.params.taskSlug, gate);
|
|
16
|
-
});
|
|
17
|
-
app.post("/api/tasks/:taskSlug/codex-review/:gate/retry", async (request) => {
|
|
18
|
-
const project = await requireCurrentProject(deps.projectService);
|
|
19
|
-
const gate = parseGate(request.params.gate);
|
|
20
|
-
return deps.codexReviewService.retryReviewGate(project.repoRoot, request.params.taskSlug, gate);
|
|
21
|
-
});
|
|
22
|
-
app.post("/api/tasks/:taskSlug/codex-review/:gate/skip", async (request) => {
|
|
23
|
-
const project = await requireCurrentProject(deps.projectService);
|
|
24
|
-
const gate = parseGate(request.params.gate);
|
|
25
|
-
return deps.codexReviewService.skipReviewGate(project.repoRoot, request.params.taskSlug, gate, request.body);
|
|
26
|
-
});
|
|
27
|
-
app.post("/api/tasks/:taskSlug/codex-review/:gate/override", async (request) => {
|
|
28
|
-
const project = await requireCurrentProject(deps.projectService);
|
|
29
|
-
const gate = parseGate(request.params.gate);
|
|
30
|
-
return deps.codexReviewService.overrideReviewGate(project.repoRoot, request.params.taskSlug, gate, request.body);
|
|
31
|
-
});
|
|
32
|
-
app.get("/api/tasks/:taskSlug/codex-review/:gate/report", async (request) => {
|
|
33
|
-
const project = await requireCurrentProject(deps.projectService);
|
|
34
|
-
const gate = parseGate(request.params.gate);
|
|
35
|
-
return deps.codexReviewService.readReport(project.repoRoot, request.params.taskSlug, gate);
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
function parseGate(gate) {
|
|
39
|
-
if (!isCodexReviewGate(gate)) {
|
|
40
|
-
throw new VcmError({
|
|
41
|
-
code: "UNKNOWN_CODEX_REVIEW_GATE",
|
|
42
|
-
message: `Unknown Codex review gate: ${gate}`,
|
|
43
|
-
statusCode: 400
|
|
44
|
-
});
|
|
45
|
-
}
|
|
46
|
-
return gate;
|
|
47
|
-
}
|
|
48
|
-
async function requireCurrentProject(projectService) {
|
|
49
|
-
const project = await projectService.getCurrentProject();
|
|
50
|
-
if (!project) {
|
|
51
|
-
throw new VcmError({
|
|
52
|
-
code: "PROJECT_NOT_CONNECTED",
|
|
53
|
-
message: "Connect a repository first.",
|
|
54
|
-
statusCode: 409
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
return project;
|
|
58
|
-
}
|