vibe-coding-master 0.3.9 → 0.3.10
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 +19 -7
- package/dist/backend/gateway/gateway-settings-service.js +4 -3
- package/dist/backend/services/app-settings-service.js +2 -2
- package/dist/backend/vcm-data-dir.js +7 -0
- package/docs/codex-review-gates.md +2 -2
- package/docs/full-harness-baseline.md +1 -1
- package/docs/gateway-design.md +7 -4
- package/docs/product-design.md +10 -9
- package/docs/v0.2-implementation-plan.md +3 -3
- package/docs/vcm-cc-best-practices.md +3 -3
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -257,8 +257,8 @@ Gateway rules:
|
|
|
257
257
|
Gateway state is stored locally under:
|
|
258
258
|
|
|
259
259
|
```text
|
|
260
|
-
|
|
261
|
-
|
|
260
|
+
<vcmDataDir>/gateway/settings.json
|
|
261
|
+
<vcmDataDir>/gateway/audit.jsonl
|
|
262
262
|
```
|
|
263
263
|
|
|
264
264
|
### Bind Weixin
|
|
@@ -384,11 +384,13 @@ The task header does not include a manual `Refresh` button. Task status, role st
|
|
|
384
384
|
Translation settings are local and stored in:
|
|
385
385
|
|
|
386
386
|
```text
|
|
387
|
-
|
|
387
|
+
<vcmDataDir>/settings.json
|
|
388
388
|
```
|
|
389
389
|
|
|
390
390
|
The same file stores recent repository paths. The translation API key is stored locally under `translation.secrets.apiKey`; it is not written to the connected repository, `.ai/vcm/handoffs`, raw terminal logs, or git diffs.
|
|
391
391
|
|
|
392
|
+
VCM resolves `vcmDataDir` from `VCM_DATA_DIR`. If `VCM_DATA_DIR` is unset or empty, VCM uses `~/.vcm`. In Dev Containers, set `VCM_DATA_DIR=/workspace/.ai/vcm` through `containerEnv` so VCM app state survives container rebuilds.
|
|
393
|
+
|
|
392
394
|
The sidebar `Settings` section also stores the UI theme preference in this file. The default is `system`, which follows the OS/browser color-scheme preference; users can cycle between `System`, `Light`, and `Dark`.
|
|
393
395
|
|
|
394
396
|
The same sidebar also has a `Flow pause alert` toggle. It is on by default and controls the local alert that fires when VCM detects that the current role flow has stopped advancing. Short flows use a weak reminder: the soft two-note chime plays 3 times, 1.4 seconds apart. Flows lasting 2 minutes or longer use a strong reminder: VCM shows an alert dialog and repeats the chime until the user confirms it. The alert sound reuses one browser audio context so repeated reminders remain reliable in stricter browsers such as Safari. Safari users may still need to manually set `Safari > Website Settings > Auto-Play > Allow All Auto-Play`; Chrome is recommended for the most reliable alert sound behavior. The `Try alert` button always triggers the strong reminder for testing.
|
|
@@ -479,7 +481,7 @@ For `.gitignore`, VCM uses a gitignore-native managed block:
|
|
|
479
481
|
# VCM:END
|
|
480
482
|
```
|
|
481
483
|
|
|
482
|
-
`.ai/vcm/` is the active VCM local control area, and `.claude/worktrees/` is the Claude-compatible task worktree area. VCM keeps the task index in app-local project state under
|
|
484
|
+
`.ai/vcm/` is the active VCM local control area, and `.claude/worktrees/` is the Claude-compatible task worktree area. VCM keeps the task index in app-local project state under `<vcmDataDir>/projects/`; each task runtime repo keeps its own session, message, orchestration, and translation state.
|
|
483
485
|
|
|
484
486
|
VCM also JSON-merges `.claude/settings.json` to install Claude Code `PreToolUse`, `UserPromptSubmit`, `Stop`, and `PermissionRequest` hooks plus a managed `env.BASH_DEFAULT_TIMEOUT_MS` so foreground watch windows fit inside the Bash tool timeout. The hooks post directly to the local VCM backend, so roles do not need a VCM CLI command to confirm delivery or report turn completion. The `Stop` hook forwards the backend response to Claude Code, which lets VCM block turn-end while a validation job is still running. When Codex Review Gates are installed, VCM also writes `.ai/codex/.codex/config.toml` and `.ai/codex/.codex/hooks.json` so the embedded Codex Reviewer terminal can POST `UserPromptSubmit` and `Stop` events back to VCM.
|
|
485
487
|
|
|
@@ -606,8 +608,8 @@ Embedded terminal output is still written to raw role log files under `.ai/vcm/h
|
|
|
606
608
|
For a connected repository, VCM uses:
|
|
607
609
|
|
|
608
610
|
```text
|
|
609
|
-
|
|
610
|
-
|
|
611
|
+
<vcmDataDir>/projects/<project-id>/config.json
|
|
612
|
+
<vcmDataDir>/projects/<project-id>/tasks/<task>.json
|
|
611
613
|
<baseRepoRoot>/.claude/worktrees/<task>/
|
|
612
614
|
<taskRepoRoot>/.ai/vcm/sessions/<task>.json
|
|
613
615
|
<taskRepoRoot>/.ai/vcm/messages/<task>.jsonl
|
|
@@ -621,7 +623,17 @@ For a connected repository, VCM uses:
|
|
|
621
623
|
<taskRepoRoot>/.ai/vcm/handoffs/logs/{project-manager,architect,coder,reviewer}.log
|
|
622
624
|
```
|
|
623
625
|
|
|
624
|
-
The project config is stored under
|
|
626
|
+
The project config is stored under `vcmDataDir` so it is durable local app state. `vcmDataDir` is `VCM_DATA_DIR` when set, otherwise `~/.vcm`. For Dev Containers, prefer:
|
|
627
|
+
|
|
628
|
+
```json
|
|
629
|
+
{
|
|
630
|
+
"containerEnv": {
|
|
631
|
+
"VCM_DATA_DIR": "/workspace/.ai/vcm"
|
|
632
|
+
}
|
|
633
|
+
}
|
|
634
|
+
```
|
|
635
|
+
|
|
636
|
+
For worktree-backed tasks, `taskRepoRoot` is `<baseRepoRoot>/.claude/worktrees/<task>`; for inline tasks, `taskRepoRoot` is the connected base repo.
|
|
625
637
|
|
|
626
638
|
Because handoffs are scoped to `taskRepoRoot` without an extra task-name directory, VCM allows only one active inline task per connected repository. Use the default worktree mode for parallel tasks.
|
|
627
639
|
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import path from "node:path";
|
|
2
|
-
import {
|
|
2
|
+
import { resolveVcmDataDir } from "../vcm-data-dir.js";
|
|
3
3
|
const DEFAULT_BASE_URL = "https://ilinkai.weixin.qq.com";
|
|
4
4
|
const MAX_DEDUPE_IDS = 1000;
|
|
5
5
|
export function createGatewaySettingsService(deps) {
|
|
6
|
-
const
|
|
7
|
-
const
|
|
6
|
+
const dataDir = resolveVcmDataDir();
|
|
7
|
+
const settingsPath = deps.settingsPath ?? path.join(dataDir, "gateway", "settings.json");
|
|
8
|
+
const auditPath = deps.auditPath ?? path.join(dataDir, "gateway", "audit.jsonl");
|
|
8
9
|
const now = deps.now ?? (() => new Date().toISOString());
|
|
9
10
|
let cachedSettings = null;
|
|
10
11
|
async function loadSettings() {
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import path from "node:path";
|
|
2
|
-
import { homedir } from "node:os";
|
|
3
2
|
import { createHash } from "node:crypto";
|
|
4
3
|
import { VCM_ROLE_NAMES } from "../../shared/constants.js";
|
|
5
4
|
import { CODEX_REVIEW_GATES } from "../../shared/types/codex-review.js";
|
|
6
5
|
import { createDefaultLaunchTemplate } from "../../shared/types/app-settings.js";
|
|
7
6
|
import { CLAUDE_MODEL_OPTIONS, SESSION_EFFORT_OPTIONS } from "../../shared/types/session.js";
|
|
7
|
+
import { resolveVcmDataDir } from "../vcm-data-dir.js";
|
|
8
8
|
const MAX_RECENT_REPOSITORIES = 5;
|
|
9
9
|
export function createAppSettingsService(deps) {
|
|
10
|
-
const settingsPath = deps.settingsPath ?? path.join(
|
|
10
|
+
const settingsPath = deps.settingsPath ?? path.join(resolveVcmDataDir(), "settings.json");
|
|
11
11
|
const settingsRoot = path.dirname(settingsPath);
|
|
12
12
|
const projectIndexPath = path.join(settingsRoot, "projects", "index.json");
|
|
13
13
|
let cachedSettings = null;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import path from "node:path";
|
|
2
|
+
import { homedir } from "node:os";
|
|
3
|
+
export const VCM_DATA_DIR_ENV = "VCM_DATA_DIR";
|
|
4
|
+
export function resolveVcmDataDir(env = process.env) {
|
|
5
|
+
const configured = env[VCM_DATA_DIR_ENV]?.trim();
|
|
6
|
+
return configured ? path.resolve(configured) : path.join(homedir(), ".vcm");
|
|
7
|
+
}
|
|
@@ -306,7 +306,7 @@ Codex review outputs live under:
|
|
|
306
306
|
```
|
|
307
307
|
|
|
308
308
|
VCM stores Codex Review Gate switches outside the repository in the global
|
|
309
|
-
|
|
309
|
+
`<vcmDataDir>/settings.json` file as one VCM-wide selected gate list. The
|
|
310
310
|
project-local `.ai/codex/config.toml` must not store gate enablement, VCM must
|
|
311
311
|
not key these switches by project or task, and VCM must not create a separate
|
|
312
312
|
Codex review settings file for them.
|
|
@@ -491,7 +491,7 @@ connected active task and contains three independent toggles:
|
|
|
491
491
|
- Final Diff
|
|
492
492
|
|
|
493
493
|
All three toggles default to `off`. Turning on any gate writes the selected
|
|
494
|
-
global gate list to
|
|
494
|
+
global gate list to `<vcmDataDir>/settings.json`. Turning all gates off stores an
|
|
495
495
|
empty selected gate list. VCM then mirrors this global setting into the active
|
|
496
496
|
task's `.ai/vcm/codex-reviews/index.json` as runtime state for PM/tool
|
|
497
497
|
consumption.
|
|
@@ -157,7 +157,7 @@ durable docs, PR text, or commit history.
|
|
|
157
157
|
| Long-running jobs | `.ai/vcm/jobs/<job-id>/` | Runtime cleanup | Status and logs from `run-long-check` / `watch-job`. |
|
|
158
158
|
| Bootstrap session | `.ai/vcm/bootstrap/session.json` | Runtime cleanup | Last harness-bootstrap terminal metadata. |
|
|
159
159
|
| Bootstrap log | `.ai/vcm/bootstrap/bootstrap.log` | Runtime cleanup | Terminal log for the harness-bootstrap session. |
|
|
160
|
-
| App-local task records |
|
|
160
|
+
| App-local task records | `<vcmDataDir>/projects/<project-id>/tasks/<task-slug>.json` | Runtime cleanup | VCM UI/lifecycle subtask records outside the connected repo. |
|
|
161
161
|
|
|
162
162
|
Runtime state under `.ai/vcm/**` is excluded from manifest entries. The manifest
|
|
163
163
|
records `.ai/vcm/` only as a runtime root.
|
package/docs/gateway-design.md
CHANGED
|
@@ -491,10 +491,13 @@ Gateway state must live outside connected repositories.
|
|
|
491
491
|
Recommended files:
|
|
492
492
|
|
|
493
493
|
```text
|
|
494
|
-
|
|
495
|
-
|
|
494
|
+
<vcmDataDir>/gateway/settings.json
|
|
495
|
+
<vcmDataDir>/gateway/audit.jsonl
|
|
496
496
|
```
|
|
497
497
|
|
|
498
|
+
VCM resolves `vcmDataDir` from `VCM_DATA_DIR`; when it is unset or empty, VCM
|
|
499
|
+
uses `~/.vcm`.
|
|
500
|
+
|
|
498
501
|
Settings shape:
|
|
499
502
|
|
|
500
503
|
```json
|
|
@@ -631,7 +634,7 @@ The user should be able to:
|
|
|
631
634
|
- Add `src/backend/api/gateway-routes.ts`.
|
|
632
635
|
- Add desktop UI controls for enable/disable, translation, binding status, and
|
|
633
636
|
current project/task.
|
|
634
|
-
- Store settings under
|
|
637
|
+
- Store settings under `<vcmDataDir>/gateway/settings.json`.
|
|
635
638
|
|
|
636
639
|
Validation:
|
|
637
640
|
|
|
@@ -761,7 +764,7 @@ task. It should still avoid arbitrary terminal control, approve/reject gates,
|
|
|
761
764
|
role-specific start/stop controls, shell commands, and direct non-PM prompts.
|
|
762
765
|
|
|
763
766
|
The third risk is token and message leakage. Gateway credentials and audit logs
|
|
764
|
-
must stay under
|
|
767
|
+
must stay under `<vcmDataDir>/gateway`, with secrets redacted from logs and never
|
|
765
768
|
written into connected repositories.
|
|
766
769
|
|
|
767
770
|
The fourth risk is queueing. MVP should not queue multiple arbitrary user
|
package/docs/product-design.md
CHANGED
|
@@ -622,7 +622,7 @@ Translation is a local assistant layer beside the role terminal.
|
|
|
622
622
|
Settings are saved in:
|
|
623
623
|
|
|
624
624
|
```text
|
|
625
|
-
|
|
625
|
+
<vcmDataDir>/settings.json
|
|
626
626
|
```
|
|
627
627
|
|
|
628
628
|
The settings file stores:
|
|
@@ -765,7 +765,7 @@ implementation plan live in `docs/gateway-design.md`.
|
|
|
765
765
|
App-level settings:
|
|
766
766
|
|
|
767
767
|
```text
|
|
768
|
-
|
|
768
|
+
<vcmDataDir>/settings.json
|
|
769
769
|
```
|
|
770
770
|
|
|
771
771
|
Stored app-level settings include:
|
|
@@ -779,12 +779,13 @@ Stored app-level settings include:
|
|
|
779
779
|
Gateway state and audit logs:
|
|
780
780
|
|
|
781
781
|
```text
|
|
782
|
-
|
|
783
|
-
|
|
782
|
+
<vcmDataDir>/gateway/settings.json
|
|
783
|
+
<vcmDataDir>/gateway/audit.jsonl
|
|
784
784
|
```
|
|
785
785
|
|
|
786
786
|
Gateway credentials, iLink tokens, DM binding identity, cursors, context tokens,
|
|
787
|
-
and audit logs
|
|
787
|
+
and audit logs live under `vcmDataDir`. VCM resolves `vcmDataDir` from
|
|
788
|
+
`VCM_DATA_DIR`; if it is unset or empty, VCM uses `~/.vcm`.
|
|
788
789
|
|
|
789
790
|
Repository-level VCM state:
|
|
790
791
|
|
|
@@ -796,11 +797,11 @@ Repository-level VCM state:
|
|
|
796
797
|
Project config:
|
|
797
798
|
|
|
798
799
|
```text
|
|
799
|
-
|
|
800
|
-
|
|
800
|
+
<vcmDataDir>/projects/<project-id>/config.json
|
|
801
|
+
<vcmDataDir>/projects/index.json
|
|
801
802
|
```
|
|
802
803
|
|
|
803
|
-
The base repository's `.ai/vcm/` directory stores
|
|
804
|
+
The base repository's `.ai/vcm/` directory stores task-local runtime state, while `.claude/worktrees/` stores nested task worktrees. Long-lived project config is stored under `vcmDataDir`. In Dev Containers, set `VCM_DATA_DIR=/workspace/.ai/vcm` through `containerEnv` so VCM app state survives container rebuilds.
|
|
804
805
|
|
|
805
806
|
Task worktree local files:
|
|
806
807
|
|
|
@@ -858,7 +859,7 @@ VCM V1 is successful when:
|
|
|
858
859
|
- Auto orchestration switches to the target role tab when VCM records `dispatchingAt`, before VCM submits the route-file message.
|
|
859
860
|
- Auto orchestration treats `UserPromptSubmit` as the reliable acceptance confirmation; if confirmation does not arrive, backend PTY retries Enter and records a message `failureReason` after retry exhaustion.
|
|
860
861
|
- Round completion detection waits for the final role in a chained conversation and can alert with prompt plus sound.
|
|
861
|
-
- Translation settings save to
|
|
862
|
+
- Translation settings save to `<vcmDataDir>/settings.json`.
|
|
862
863
|
- Translation reads Claude transcript JSONL reliably after start, resume, and restart.
|
|
863
864
|
- Gateway can bind one Weixin DM identity to the desktop VCM instance, send
|
|
864
865
|
translated plain text to PM, and push translated PM replies back to Weixin.
|
|
@@ -91,8 +91,8 @@ src/backend/api/gateway-routes.ts
|
|
|
91
91
|
Gateway settings and secrets must live in app-local state:
|
|
92
92
|
|
|
93
93
|
```text
|
|
94
|
-
|
|
95
|
-
|
|
94
|
+
<vcmDataDir>/gateway/settings.json
|
|
95
|
+
<vcmDataDir>/gateway/audit.jsonl
|
|
96
96
|
```
|
|
97
97
|
|
|
98
98
|
Gateway credentials must never be written to a connected repository, terminal
|
|
@@ -347,7 +347,7 @@ during task cleanup after useful facts are promoted.
|
|
|
347
347
|
Task records live outside connected repos:
|
|
348
348
|
|
|
349
349
|
```text
|
|
350
|
-
|
|
350
|
+
<vcmDataDir>/projects/<project-id>/tasks/<task-slug>.json
|
|
351
351
|
```
|
|
352
352
|
|
|
353
353
|
Routine completed task plans should not be archived under
|
|
@@ -178,7 +178,7 @@ Current runtime files and directories:
|
|
|
178
178
|
App-local VCM task records live outside the connected repository:
|
|
179
179
|
|
|
180
180
|
```text
|
|
181
|
-
|
|
181
|
+
<vcmDataDir>/projects/<project-id>/tasks/<task-slug>.json
|
|
182
182
|
```
|
|
183
183
|
|
|
184
184
|
Runtime state is deleted during task cleanup after useful facts are promoted to
|
|
@@ -492,13 +492,13 @@ Gateway product rules:
|
|
|
492
492
|
Gateway settings and secrets live in app-local state:
|
|
493
493
|
|
|
494
494
|
```text
|
|
495
|
-
|
|
495
|
+
<vcmDataDir>/gateway/settings.json
|
|
496
496
|
```
|
|
497
497
|
|
|
498
498
|
Gateway audit logs live outside connected repositories:
|
|
499
499
|
|
|
500
500
|
```text
|
|
501
|
-
|
|
501
|
+
<vcmDataDir>/gateway/audit.jsonl
|
|
502
502
|
```
|
|
503
503
|
|
|
504
504
|
Rules:
|