vibe-coding-master 0.7.46 → 0.7.48
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 +2 -2
- package/dist/backend/cli/install-vcm-harness.js +30 -0
- package/dist/backend/server.js +3 -1
- package/dist/backend/services/architect-restart-service.js +251 -78
- package/dist/backend/services/artifact-service.js +60 -131
- package/dist/backend/services/claude-hook-service.js +3 -0
- package/dist/backend/services/gate-review-service.js +42 -217
- package/dist/backend/services/harness-feedback-service.js +13 -24
- package/dist/backend/services/harness-service.js +16 -0
- package/dist/backend/services/managed-artifact-validation.js +403 -0
- package/dist/backend/services/message-service.js +13 -64
- package/dist/backend/services/runtime-recovery-service.js +1 -0
- package/dist/backend/services/task-close-service.js +3 -1
- package/dist/backend/templates/harness/architect-agent.js +18 -3
- package/dist/backend/templates/harness/architect-evidence-worker-agent.js +44 -0
- package/dist/backend/templates/harness/architect-scaffold-worker-agent.js +3 -1
- package/dist/backend/templates/harness/architect-validation-worker-agent.js +36 -0
- package/dist/backend/templates/harness/gate-review.js +13 -98
- package/dist/backend/templates/harness/vcm-report-harness-issue-skill.js +1 -1
- package/dist/backend/templates/harness/vcm-route-message-skill.js +2 -2
- package/dist/shared/validation/artifact-registry.js +68 -0
- package/package.json +1 -1
- package/scripts/harness-tools/vcm-artifact +1 -34
- package/scripts/harness-tools/vcm-subagent-guard +9 -4
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
export function renderArchitectEvidenceWorkerHarnessRules() {
|
|
2
|
+
return `
|
|
3
|
+
## VCM Architect Evidence Worker Rules
|
|
4
|
+
|
|
5
|
+
You are \`vcm-architect-evidence-worker\`, a foreground evidence-collection subagent invoked by Architect.
|
|
6
|
+
|
|
7
|
+
### Scope
|
|
8
|
+
|
|
9
|
+
- Investigate only the modules, files, documents, and questions assigned by Architect.
|
|
10
|
+
- Read the assigned implementation and supporting project artifacts in full where required by the assignment.
|
|
11
|
+
- Record repository facts with exact repo-relative file paths and symbol or section names.
|
|
12
|
+
- Separate verified facts, contradictions, and unresolved items.
|
|
13
|
+
- Do not design architecture, recommend implementation, decide scope, change contracts, edit project files, run validation, or communicate with project-manager or the user.
|
|
14
|
+
- Do not claim a complete semantic relationship from text matches. Architect owns LSP navigation and verification of definitions, references, callers, callees, implementations, public surfaces, and decision-bearing behavior paths.
|
|
15
|
+
|
|
16
|
+
### Evidence Output
|
|
17
|
+
|
|
18
|
+
- Write only the assigned report under \`.ai/vcm/architect-workers/evidence/\`.
|
|
19
|
+
- Keep the report concise and factual. Do not copy long source blocks when a path, symbol, and short fact are sufficient.
|
|
20
|
+
- Use this structure:
|
|
21
|
+
|
|
22
|
+
\`\`\`md
|
|
23
|
+
# Architect Evidence Worker: <worker-id>
|
|
24
|
+
|
|
25
|
+
## Assigned Scope
|
|
26
|
+
|
|
27
|
+
## Files And Documents Read
|
|
28
|
+
|
|
29
|
+
## Verified Facts
|
|
30
|
+
|
|
31
|
+
| Fact | Evidence |
|
|
32
|
+
| --- | --- |
|
|
33
|
+
|
|
34
|
+
## Observed Data And Lifecycle Paths
|
|
35
|
+
|
|
36
|
+
## Contradictions
|
|
37
|
+
|
|
38
|
+
## Unresolved Items
|
|
39
|
+
\`\`\`
|
|
40
|
+
|
|
41
|
+
- Return the report path and a one-paragraph completion summary to Architect.
|
|
42
|
+
- Do not invoke another subagent.
|
|
43
|
+
`;
|
|
44
|
+
}
|
|
@@ -8,6 +8,7 @@ You are \`vcm-architect-scaffold-worker\`, a foreground subagent invoked by Arch
|
|
|
8
8
|
|
|
9
9
|
- Execute only the scaffold work assigned by Architect from the current \`.ai/vcm/handoffs/architecture-plan.md\`.
|
|
10
10
|
- Create the declared files, callable surfaces, contract comments, placeholder bodies, configuration changes, and one \`VCM:CODE <ID>\` marker for every Scaffold Manifest item.
|
|
11
|
+
- Perform only mechanical text or configuration changes whose target and required result are explicitly fixed by the plan. Do not author architecture rationale, evidence, decisions, or durable architecture documentation.
|
|
11
12
|
- Do not change architecture decisions, accepted scope, ledger items, public contracts, or implementation boundaries.
|
|
12
13
|
- Do not implement business logic beyond the minimum compilable scaffold.
|
|
13
14
|
- Follow \`docs/CODING_STANDARDS.md\` for every code or test edit.
|
|
@@ -19,5 +20,6 @@ You are \`vcm-architect-scaffold-worker\`, a foreground subagent invoked by Arch
|
|
|
19
20
|
- Return the commit hash, changed files, ledger result, and exact check results to Architect.
|
|
20
21
|
- If the assigned scaffold cannot be completed, return the concrete failure evidence without changing the plan.
|
|
21
22
|
|
|
22
|
-
Architect reviews the worker's commit and remains responsible for the final scaffold, plan, and evidence
|
|
23
|
+
Architect reviews the worker's commit and remains responsible for the final scaffold, plan, and evidence.
|
|
24
|
+
Do not invoke another subagent.`;
|
|
23
25
|
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export function renderArchitectValidationWorkerHarnessRules() {
|
|
2
|
+
return `
|
|
3
|
+
## VCM Architect Validation Worker Rules
|
|
4
|
+
|
|
5
|
+
You are \`vcm-architect-validation-worker\`, a foreground command-execution subagent invoked by Architect.
|
|
6
|
+
|
|
7
|
+
### Scope
|
|
8
|
+
|
|
9
|
+
- Run only the exact commands, working directory, and validation targets assigned by Architect.
|
|
10
|
+
- Do not choose validation scope, design or modify tests, edit production code, change configuration, diagnose architecture, repair failures, or decide whether the task passes.
|
|
11
|
+
- Preserve each command's real exit code and output. Do not add wrappers, pipelines, retries, skips, or fallback commands unless Architect assigned them.
|
|
12
|
+
- Use \`.ai/tools/run-long-check\` and \`.ai/tools/watch-job\` when the assigned command requires supervised long-running execution. Remain in the foreground until every assigned command reaches a terminal result.
|
|
13
|
+
|
|
14
|
+
### Validation Output
|
|
15
|
+
|
|
16
|
+
- Write only the assigned report under \`.ai/vcm/architect-workers/validation/\`.
|
|
17
|
+
- Use this structure:
|
|
18
|
+
|
|
19
|
+
\`\`\`md
|
|
20
|
+
# Architect Validation Worker: <worker-id>
|
|
21
|
+
|
|
22
|
+
## Assigned Commands
|
|
23
|
+
|
|
24
|
+
| Command | Working Directory | Exit Code | Result | Evidence |
|
|
25
|
+
| --- | --- | --- | --- | --- |
|
|
26
|
+
|
|
27
|
+
## Failures
|
|
28
|
+
|
|
29
|
+
## Unavailable Checks
|
|
30
|
+
\`\`\`
|
|
31
|
+
|
|
32
|
+
- Record exact failure or unavailability evidence without interpreting architecture or selecting follow-up work.
|
|
33
|
+
- Return the report path and a one-paragraph completion summary to Architect.
|
|
34
|
+
- Do not invoke another subagent.
|
|
35
|
+
`;
|
|
36
|
+
}
|
|
@@ -1,4 +1,15 @@
|
|
|
1
1
|
import { renderRoleMemoryRules } from "./role-memory.js";
|
|
2
|
+
import { GATE_ANALYSIS_FIELDS, GATE_ANALYSIS_HEADINGS } from "../../services/managed-artifact-validation.js";
|
|
3
|
+
function renderGateAnalysisSections() {
|
|
4
|
+
return Object.keys(GATE_ANALYSIS_HEADINGS)
|
|
5
|
+
.map((gate) => [
|
|
6
|
+
`<!-- Include ${GATE_ANALYSIS_HEADINGS[gate]} only for ${gate} gate. -->`,
|
|
7
|
+
`## ${GATE_ANALYSIS_HEADINGS[gate]}`,
|
|
8
|
+
"",
|
|
9
|
+
...GATE_ANALYSIS_FIELDS[gate].map((field) => `- ${field}:`)
|
|
10
|
+
].join("\n"))
|
|
11
|
+
.join("\n\n");
|
|
12
|
+
}
|
|
2
13
|
export function renderReviewerAgentRules() {
|
|
3
14
|
return `## Role
|
|
4
15
|
|
|
@@ -362,56 +373,7 @@ Summary: <one or two sentences>
|
|
|
362
373
|
Use this findings structure:
|
|
363
374
|
|
|
364
375
|
\`\`\`md
|
|
365
|
-
|
|
366
|
-
## Architecture Analysis
|
|
367
|
-
|
|
368
|
-
- Evidence Read:
|
|
369
|
-
- Architecture Brief Fit:
|
|
370
|
-
- End-To-End Flow:
|
|
371
|
-
- Scope Fit:
|
|
372
|
-
- Code Reality:
|
|
373
|
-
- Invalidated Assumptions:
|
|
374
|
-
- Existing-Class Completeness:
|
|
375
|
-
- Ownership:
|
|
376
|
-
- Data Flow:
|
|
377
|
-
- Lifecycle:
|
|
378
|
-
- Invariants:
|
|
379
|
-
- Boundaries And Public Surface:
|
|
380
|
-
- Failure Model:
|
|
381
|
-
- Coder Readiness:
|
|
382
|
-
|
|
383
|
-
<!-- Include Validation Analysis only for validation-adequacy gate. -->
|
|
384
|
-
## Validation Analysis
|
|
385
|
-
|
|
386
|
-
- Evidence Read:
|
|
387
|
-
- Changed Behavior And Risk:
|
|
388
|
-
- Coverage Mapping:
|
|
389
|
-
- Baseline Coverage:
|
|
390
|
-
- L2 Integration Coverage:
|
|
391
|
-
- L3 Trigger Assessment:
|
|
392
|
-
- L3 End-To-End Coverage:
|
|
393
|
-
- Boundary And Failure Coverage:
|
|
394
|
-
- Public Contract Coverage:
|
|
395
|
-
- Test Integrity:
|
|
396
|
-
- Test Infrastructure:
|
|
397
|
-
- Skips And Gaps:
|
|
398
|
-
- User Approval And Gap Disposition:
|
|
399
|
-
- Validation Readiness:
|
|
400
|
-
|
|
401
|
-
<!-- Include Code Diff Analysis only for code-diff gate. -->
|
|
402
|
-
## Code Diff Analysis
|
|
403
|
-
|
|
404
|
-
- Commit Range And Sources:
|
|
405
|
-
- Evidence Read:
|
|
406
|
-
- Changed Files And Symbols:
|
|
407
|
-
- Changed Behavior:
|
|
408
|
-
- Source Evidence Fit:
|
|
409
|
-
- Callers And Public Surface:
|
|
410
|
-
- State Lifecycle And Failure Paths:
|
|
411
|
-
- Coding Standards:
|
|
412
|
-
- Baseline Test Integrity:
|
|
413
|
-
- Generated Context And Durable Docs:
|
|
414
|
-
- Code Readiness:
|
|
376
|
+
${renderGateAnalysisSections()}
|
|
415
377
|
|
|
416
378
|
## Findings
|
|
417
379
|
|
|
@@ -430,54 +392,7 @@ Use this findings structure:
|
|
|
430
392
|
If there are no findings, write:
|
|
431
393
|
|
|
432
394
|
\`\`\`md
|
|
433
|
-
|
|
434
|
-
## Architecture Analysis
|
|
435
|
-
|
|
436
|
-
- Evidence Read:
|
|
437
|
-
- Architecture Brief Fit:
|
|
438
|
-
- End-To-End Flow:
|
|
439
|
-
- Scope Fit:
|
|
440
|
-
- Code Reality:
|
|
441
|
-
- Ownership:
|
|
442
|
-
- Data Flow:
|
|
443
|
-
- Lifecycle:
|
|
444
|
-
- Invariants:
|
|
445
|
-
- Boundaries And Public Surface:
|
|
446
|
-
- Failure Model:
|
|
447
|
-
- Coder Readiness:
|
|
448
|
-
|
|
449
|
-
<!-- Include Validation Analysis only for validation-adequacy gate. -->
|
|
450
|
-
## Validation Analysis
|
|
451
|
-
|
|
452
|
-
- Evidence Read:
|
|
453
|
-
- Changed Behavior And Risk:
|
|
454
|
-
- Coverage Mapping:
|
|
455
|
-
- Baseline Coverage:
|
|
456
|
-
- L2 Integration Coverage:
|
|
457
|
-
- L3 Trigger Assessment:
|
|
458
|
-
- L3 End-To-End Coverage:
|
|
459
|
-
- Boundary And Failure Coverage:
|
|
460
|
-
- Public Contract Coverage:
|
|
461
|
-
- Test Integrity:
|
|
462
|
-
- Test Infrastructure:
|
|
463
|
-
- Skips And Gaps:
|
|
464
|
-
- User Approval And Gap Disposition:
|
|
465
|
-
- Validation Readiness:
|
|
466
|
-
|
|
467
|
-
<!-- Include Code Diff Analysis only for code-diff gate. -->
|
|
468
|
-
## Code Diff Analysis
|
|
469
|
-
|
|
470
|
-
- Commit Range And Sources:
|
|
471
|
-
- Evidence Read:
|
|
472
|
-
- Changed Files And Symbols:
|
|
473
|
-
- Changed Behavior:
|
|
474
|
-
- Source Evidence Fit:
|
|
475
|
-
- Callers And Public Surface:
|
|
476
|
-
- State Lifecycle And Failure Paths:
|
|
477
|
-
- Coding Standards:
|
|
478
|
-
- Baseline Test Integrity:
|
|
479
|
-
- Generated Context And Durable Docs:
|
|
480
|
-
- Code Readiness:
|
|
395
|
+
${renderGateAnalysisSections()}
|
|
481
396
|
|
|
482
397
|
## Findings
|
|
483
398
|
|
|
@@ -38,7 +38,7 @@ Use this structure:
|
|
|
38
38
|
- Evidence: <file paths, command names, logs, or repeated failure pattern>
|
|
39
39
|
- Suspected harness area: <skill, role definition, tool, routing, validation, bootstrap, or managed instruction>
|
|
40
40
|
- Impact: <who is affected and how>
|
|
41
|
-
- Urgency: low
|
|
41
|
+
- Urgency: low|medium|high
|
|
42
42
|
\`\`\`
|
|
43
43
|
|
|
44
44
|
## Constraints
|
|
@@ -119,8 +119,8 @@ Do not:
|
|
|
119
119
|
- wait for another role's answer
|
|
120
120
|
- paste directly into another role terminal
|
|
121
121
|
- use Claude Code Task/Subagent to replace VCM role routing. Coder workers and
|
|
122
|
-
Architect's foreground
|
|
123
|
-
not route-message delivery.
|
|
122
|
+
Architect's foreground evidence, scaffold, and validation workers are internal
|
|
123
|
+
role work, not route-message delivery.
|
|
124
124
|
|
|
125
125
|
VCM scans pending route files after the Stop hook and delivers later replies in a new turn.
|
|
126
126
|
|
|
@@ -214,7 +214,62 @@ export const ARTIFACT_DEFINITIONS = [
|
|
|
214
214
|
]
|
|
215
215
|
}
|
|
216
216
|
];
|
|
217
|
+
export const DYNAMIC_ARTIFACT_DEFINITIONS = [
|
|
218
|
+
{
|
|
219
|
+
kind: "route-message",
|
|
220
|
+
storage: "dynamic",
|
|
221
|
+
owner: ["project-manager", "architect", "coder", "tester"],
|
|
222
|
+
requiredHeadings: [],
|
|
223
|
+
allowedModes: ["final"]
|
|
224
|
+
},
|
|
225
|
+
{
|
|
226
|
+
kind: "coder-worker-report",
|
|
227
|
+
storage: "dynamic",
|
|
228
|
+
owner: "coder",
|
|
229
|
+
requiredHeadings: [
|
|
230
|
+
"Assigned Scope",
|
|
231
|
+
"Item Dispositions",
|
|
232
|
+
"Files Changed",
|
|
233
|
+
"Tests Added Or Updated",
|
|
234
|
+
"L0/L1 Checks",
|
|
235
|
+
"Commit",
|
|
236
|
+
"Skipped Assigned Checks",
|
|
237
|
+
"Objective Failures"
|
|
238
|
+
],
|
|
239
|
+
allowedModes: ["final"]
|
|
240
|
+
},
|
|
241
|
+
{
|
|
242
|
+
kind: "gate-review-report",
|
|
243
|
+
storage: "dynamic",
|
|
244
|
+
owner: "reviewer",
|
|
245
|
+
requiredHeadings: ["Findings"],
|
|
246
|
+
allowedModes: ["final"]
|
|
247
|
+
},
|
|
248
|
+
{
|
|
249
|
+
kind: "memory-proposal",
|
|
250
|
+
storage: "dynamic",
|
|
251
|
+
owner: ["project-manager", "architect", "coder", "tester", "reviewer"],
|
|
252
|
+
requiredHeadings: ["Add", "Update", "Remove"],
|
|
253
|
+
allowedModes: ["final"]
|
|
254
|
+
},
|
|
255
|
+
{
|
|
256
|
+
kind: "harness-feedback",
|
|
257
|
+
storage: "dynamic",
|
|
258
|
+
owner: ["project-manager", "architect", "coder", "tester", "reviewer"],
|
|
259
|
+
requiredHeadings: [],
|
|
260
|
+
allowedModes: ["final"]
|
|
261
|
+
}
|
|
262
|
+
];
|
|
263
|
+
export const MANAGED_ARTIFACT_DEFINITIONS = [
|
|
264
|
+
...ARTIFACT_DEFINITIONS.map((definition) => ({
|
|
265
|
+
...definition,
|
|
266
|
+
storage: "handoff",
|
|
267
|
+
allowedModes: definition.kind === "workflow-progress" ? ["final"] : ["draft", "final"]
|
|
268
|
+
})),
|
|
269
|
+
...DYNAMIC_ARTIFACT_DEFINITIONS
|
|
270
|
+
];
|
|
217
271
|
const DEFINITION_BY_KIND = new Map(ARTIFACT_DEFINITIONS.map((definition) => [definition.kind, definition]));
|
|
272
|
+
const MANAGED_DEFINITION_BY_KIND = new Map(MANAGED_ARTIFACT_DEFINITIONS.map((definition) => [definition.kind, definition]));
|
|
218
273
|
export function getArtifactDefinition(kind) {
|
|
219
274
|
const definition = DEFINITION_BY_KIND.get(kind);
|
|
220
275
|
if (!definition) {
|
|
@@ -225,3 +280,16 @@ export function getArtifactDefinition(kind) {
|
|
|
225
280
|
export function isArtifactKind(value) {
|
|
226
281
|
return DEFINITION_BY_KIND.has(value);
|
|
227
282
|
}
|
|
283
|
+
export function getManagedArtifactDefinition(kind) {
|
|
284
|
+
const definition = MANAGED_DEFINITION_BY_KIND.get(kind);
|
|
285
|
+
if (!definition) {
|
|
286
|
+
throw new Error(`Unknown managed artifact kind: ${kind}`);
|
|
287
|
+
}
|
|
288
|
+
return definition;
|
|
289
|
+
}
|
|
290
|
+
export function isDynamicArtifactKind(value) {
|
|
291
|
+
return DYNAMIC_ARTIFACT_DEFINITIONS.some((definition) => definition.kind === value);
|
|
292
|
+
}
|
|
293
|
+
export function isManagedArtifactKind(value) {
|
|
294
|
+
return MANAGED_DEFINITION_BY_KIND.has(value);
|
|
295
|
+
}
|
package/package.json
CHANGED
|
@@ -10,40 +10,11 @@ import urllib.error
|
|
|
10
10
|
import urllib.parse
|
|
11
11
|
import urllib.request
|
|
12
12
|
|
|
13
|
-
KINDS = (
|
|
14
|
-
"architecture-brief",
|
|
15
|
-
"architecture-evidence",
|
|
16
|
-
"planning-progress",
|
|
17
|
-
"architecture-plan",
|
|
18
|
-
"known-issues",
|
|
19
|
-
"coder-completion",
|
|
20
|
-
"architect-debug",
|
|
21
|
-
"architecture-diagnosis",
|
|
22
|
-
"test-report",
|
|
23
|
-
"docs-update-report",
|
|
24
|
-
"docs-sync-report",
|
|
25
|
-
"workflow-progress",
|
|
26
|
-
"final-acceptance",
|
|
27
|
-
"route-message",
|
|
28
|
-
"coder-worker-report",
|
|
29
|
-
"gate-review-report",
|
|
30
|
-
"memory-proposal",
|
|
31
|
-
"harness-feedback",
|
|
32
|
-
)
|
|
33
|
-
DYNAMIC_KINDS = {
|
|
34
|
-
"route-message",
|
|
35
|
-
"coder-worker-report",
|
|
36
|
-
"gate-review-report",
|
|
37
|
-
"memory-proposal",
|
|
38
|
-
"harness-feedback",
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
|
|
42
13
|
def parse_args() -> argparse.Namespace:
|
|
43
14
|
parser = argparse.ArgumentParser(
|
|
44
15
|
description="Validate and atomically write a VCM-managed artifact."
|
|
45
16
|
)
|
|
46
|
-
parser.add_argument("kind",
|
|
17
|
+
parser.add_argument("kind", help="VCM-managed artifact kind.")
|
|
47
18
|
parser.add_argument("--file", required=True, help="Candidate Markdown file.")
|
|
48
19
|
parser.add_argument("--mode", choices=("draft", "final"), default="final")
|
|
49
20
|
parser.add_argument(
|
|
@@ -89,10 +60,6 @@ def error_text(raw: str) -> str:
|
|
|
89
60
|
|
|
90
61
|
def main() -> int:
|
|
91
62
|
args = parse_args()
|
|
92
|
-
if args.kind in DYNAMIC_KINDS and not args.path:
|
|
93
|
-
fail(f"--path is required for {args.kind}.")
|
|
94
|
-
if args.kind not in DYNAMIC_KINDS and args.path:
|
|
95
|
-
fail(f"--path is not allowed for fixed artifact kind {args.kind}.")
|
|
96
63
|
|
|
97
64
|
candidate = Path(args.file).expanduser()
|
|
98
65
|
if not candidate.is_file():
|
|
@@ -7,8 +7,12 @@ import sys
|
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
ALLOWED_SUBAGENTS = {
|
|
10
|
-
"architect":
|
|
11
|
-
|
|
10
|
+
"architect": frozenset({
|
|
11
|
+
"vcm-architect-evidence-worker",
|
|
12
|
+
"vcm-architect-scaffold-worker",
|
|
13
|
+
"vcm-architect-validation-worker",
|
|
14
|
+
}),
|
|
15
|
+
"coder": frozenset({"vcm-coder-worker"}),
|
|
12
16
|
}
|
|
13
17
|
|
|
14
18
|
|
|
@@ -52,9 +56,10 @@ def main() -> None:
|
|
|
52
56
|
deny(f"VCM role `{role}` may not invoke subagents.")
|
|
53
57
|
return
|
|
54
58
|
|
|
55
|
-
if subagent_type
|
|
59
|
+
if subagent_type not in allowed:
|
|
56
60
|
requested = subagent_type if isinstance(subagent_type, str) and subagent_type else "<missing>"
|
|
57
|
-
|
|
61
|
+
allowed_names = ", ".join(f"`{name}`" for name in sorted(allowed))
|
|
62
|
+
deny(f"VCM role `{role}` may invoke only {allowed_names}, not `{requested}`.")
|
|
58
63
|
|
|
59
64
|
|
|
60
65
|
if __name__ == "__main__":
|