vgxness 1.20.10 → 1.20.12
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/dist/application/agents/canonical-agent-projection.js +26 -26
- package/dist/application/runs/parallel-agent-batch-service.js +85 -0
- package/dist/domain/agents/canonical-agent-manifest.js +66 -39
- package/dist/domain/runs/parallel-agent-batch.js +13 -0
- package/dist/interfaces/mcp/control-plane/handlers/runs.js +34 -0
- package/dist/interfaces/mcp/control-plane.js +3 -1
- package/dist/interfaces/mcp/schema.js +2 -0
- package/dist/interfaces/mcp/schemas/inputs/runs.js +38 -0
- package/dist/interfaces/mcp/validation/runs.js +117 -0
- package/dist/interfaces/mcp/validation.js +3 -1
- package/docs/architecture.md +3 -3
- package/docs/cli.md +7 -7
- package/docs/glossary.md +1 -1
- package/docs/mcp.md +18 -2
- package/docs/safety.md +14 -0
- package/package.json +1 -1
|
@@ -203,34 +203,34 @@ function toSeedSubagent(agent) {
|
|
|
203
203
|
return { ...toSeedAgent(agent), parentAgentName: agent.parentAgentName };
|
|
204
204
|
}
|
|
205
205
|
const openCodeSubagentDescriptions = {
|
|
206
|
-
'vgxness-
|
|
207
|
-
'vgxness-
|
|
208
|
-
'vgxness-
|
|
209
|
-
'vgxness-
|
|
210
|
-
'vgxness-
|
|
211
|
-
'vgxness-
|
|
212
|
-
'vgxness-
|
|
213
|
-
'vgxness-
|
|
214
|
-
'vgxness-
|
|
215
|
-
'vgxness-
|
|
206
|
+
'vgxness-explore': 'Investigate codebase, product context, and options',
|
|
207
|
+
'vgxness-propose': 'Create focused proposals from explorations',
|
|
208
|
+
'vgxness-requirements': 'Write detailed requirements and acceptance criteria',
|
|
209
|
+
'vgxness-design': 'Create technical design from proposals or requirements',
|
|
210
|
+
'vgxness-plan': 'Break down designs into implementation tasks',
|
|
211
|
+
'vgxness-apply': 'Implement scoped code changes from task definitions',
|
|
212
|
+
'vgxness-verify': 'Validate implementation, tests, and risks',
|
|
213
|
+
'vgxness-archive': 'Archive completed outcomes and follow-ups',
|
|
214
|
+
'vgxness-init': 'Bootstrap project context and configuration',
|
|
215
|
+
'vgxness-onboard': 'Guide user through a complete workflow using their real codebase',
|
|
216
216
|
};
|
|
217
217
|
const claudeSddNameMappings = [
|
|
218
|
-
{ canonical: 'vgxness-
|
|
219
|
-
{ canonical: 'vgxness-
|
|
220
|
-
{ canonical: 'vgxness-
|
|
221
|
-
{ canonical: 'vgxness-
|
|
222
|
-
{ canonical: 'vgxness-
|
|
223
|
-
{ canonical: 'vgxness-
|
|
224
|
-
{ canonical: 'vgxness-
|
|
225
|
-
{ canonical: 'vgxness-
|
|
218
|
+
{ canonical: 'vgxness-explore', claude: 'vgxness-explore' },
|
|
219
|
+
{ canonical: 'vgxness-propose', claude: 'vgxness-propose' },
|
|
220
|
+
{ canonical: 'vgxness-requirements', claude: 'vgxness-requirements' },
|
|
221
|
+
{ canonical: 'vgxness-design', claude: 'vgxness-design' },
|
|
222
|
+
{ canonical: 'vgxness-plan', claude: 'vgxness-plan' },
|
|
223
|
+
{ canonical: 'vgxness-apply', claude: 'vgxness-apply' },
|
|
224
|
+
{ canonical: 'vgxness-verify', claude: 'vgxness-verify' },
|
|
225
|
+
{ canonical: 'vgxness-archive', claude: 'vgxness-archive' },
|
|
226
226
|
];
|
|
227
227
|
const claudeSubagentDescriptions = {
|
|
228
|
-
'vgxness-
|
|
229
|
-
'vgxness-
|
|
230
|
-
'vgxness-
|
|
231
|
-
'vgxness-
|
|
232
|
-
'vgxness-
|
|
233
|
-
'vgxness-
|
|
234
|
-
'vgxness-
|
|
235
|
-
'vgxness-
|
|
228
|
+
'vgxness-explore': 'Investigate codebase context, options, and risks.',
|
|
229
|
+
'vgxness-propose': 'Create focused proposals from exploration evidence.',
|
|
230
|
+
'vgxness-requirements': 'Write detailed requirements and acceptance criteria.',
|
|
231
|
+
'vgxness-design': 'Create technical designs grounded in repository evidence.',
|
|
232
|
+
'vgxness-plan': 'Break designs into implementation tasks.',
|
|
233
|
+
'vgxness-apply': 'Implement scoped tasks and report apply progress.',
|
|
234
|
+
'vgxness-verify': 'Verify implementation evidence and risks.',
|
|
235
|
+
'vgxness-archive': 'Archive completed outcomes and follow-ups.',
|
|
236
236
|
};
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
import { parallelAgentBatchCategories, parallelAgentBatchDefaultMaxConcurrency, parallelAgentBatchHardMaxConcurrency, parallelAgentBatchMaxTasks, } from '../../domain/runs/parallel-agent-batch.js';
|
|
2
|
+
const requiredSynthesis = {
|
|
3
|
+
required: true,
|
|
4
|
+
includeEvidence: true,
|
|
5
|
+
includeConflicts: true,
|
|
6
|
+
includeFailures: true,
|
|
7
|
+
includeResidualRisk: true,
|
|
8
|
+
includeNextAction: true,
|
|
9
|
+
};
|
|
10
|
+
export class ParallelAgentBatchService {
|
|
11
|
+
defaultMaxConcurrency;
|
|
12
|
+
hardMaxConcurrency;
|
|
13
|
+
allowedAgentNames;
|
|
14
|
+
constructor(options = {}) {
|
|
15
|
+
this.hardMaxConcurrency = options.hardMaxConcurrency ?? parallelAgentBatchHardMaxConcurrency;
|
|
16
|
+
this.defaultMaxConcurrency = options.defaultMaxConcurrency ?? parallelAgentBatchDefaultMaxConcurrency;
|
|
17
|
+
this.allowedAgentNames = options.allowedAgentNames === undefined ? undefined : new Set(options.allowedAgentNames);
|
|
18
|
+
}
|
|
19
|
+
validatePlan(plan) {
|
|
20
|
+
const issues = [];
|
|
21
|
+
const warnings = [];
|
|
22
|
+
const maxConcurrency = plan.maxConcurrency ?? this.defaultMaxConcurrency;
|
|
23
|
+
if (!isValidConcurrency(maxConcurrency, this.hardMaxConcurrency))
|
|
24
|
+
issues.push({
|
|
25
|
+
code: 'invalid-concurrency',
|
|
26
|
+
message: `maxConcurrency must be an integer between 1 and ${this.hardMaxConcurrency}; received ${String(maxConcurrency)}`,
|
|
27
|
+
});
|
|
28
|
+
if (!isValidConcurrency(this.defaultMaxConcurrency, this.hardMaxConcurrency))
|
|
29
|
+
issues.push({
|
|
30
|
+
code: 'invalid-concurrency',
|
|
31
|
+
message: `defaultMaxConcurrency must be an integer between 1 and ${this.hardMaxConcurrency}; received ${String(this.defaultMaxConcurrency)}`,
|
|
32
|
+
});
|
|
33
|
+
if (!Array.isArray(plan.tasks) || plan.tasks.length === 0)
|
|
34
|
+
issues.push({ code: 'invalid-task-count', message: 'parallel batch must contain at least one task' });
|
|
35
|
+
else if (plan.tasks.length > parallelAgentBatchMaxTasks)
|
|
36
|
+
issues.push({ code: 'invalid-task-count', message: `parallel batch cannot exceed ${parallelAgentBatchMaxTasks} tasks` });
|
|
37
|
+
if (plan.tasks.length > 0 && plan.tasks.length <= maxConcurrency)
|
|
38
|
+
warnings.push('task count does not exceed concurrency; batch may finish in a single wave');
|
|
39
|
+
if (!hasRequiredSynthesisContract(plan.synthesis))
|
|
40
|
+
issues.push({ code: 'invalid-synthesis-contract', message: 'synthesis contract must require evidence, conflicts, failures, residual risk, and next action' });
|
|
41
|
+
const taskIds = new Set(plan.tasks.map((task) => task.id).filter((id) => id.trim().length > 0));
|
|
42
|
+
for (const task of plan.tasks)
|
|
43
|
+
this.validateTask(task, taskIds, issues);
|
|
44
|
+
if (issues.length > 0)
|
|
45
|
+
return { ok: false, issues, warnings };
|
|
46
|
+
return { ok: true, value: { ...plan, maxConcurrency }, warnings };
|
|
47
|
+
}
|
|
48
|
+
validateTask(task, taskIds, issues) {
|
|
49
|
+
requireTrimmed(task.id, 'id', task.id, issues);
|
|
50
|
+
requireTrimmed(task.agentName, 'agentName', task.id, issues);
|
|
51
|
+
requireTrimmed(task.workspaceRoot, 'workspaceRoot', task.id, issues);
|
|
52
|
+
requireTrimmed(task.scopeSummary, 'scopeSummary', task.id, issues);
|
|
53
|
+
requireTrimmed(task.independenceRationale, 'independenceRationale', task.id, issues);
|
|
54
|
+
if (task.allowedTools.length === 0)
|
|
55
|
+
issues.push({ code: 'missing-field', taskId: task.id, message: 'allowedTools must name at least one permitted tool' });
|
|
56
|
+
if (!parallelAgentBatchCategories.includes(task.category))
|
|
57
|
+
issues.push({ code: 'unknown-category', taskId: task.id, message: `unsupported category: ${task.category}` });
|
|
58
|
+
if (this.allowedAgentNames !== undefined && !this.allowedAgentNames.has(task.agentName))
|
|
59
|
+
issues.push({ code: 'unknown-agent', taskId: task.id, message: `agent is not allowlisted: ${task.agentName}` });
|
|
60
|
+
if (task.recursiveDelegationAllowed === true)
|
|
61
|
+
issues.push({ code: 'recursive-delegation', taskId: task.id, message: 'subagents must not be allowed to launch subagents recursively' });
|
|
62
|
+
for (const dependency of task.dependsOn ?? []) {
|
|
63
|
+
if (taskIds.has(dependency))
|
|
64
|
+
issues.push({ code: 'dependent-task', taskId: task.id, message: `task depends on same-batch task ${dependency}; run these serially instead` });
|
|
65
|
+
}
|
|
66
|
+
if (task.riskTier !== 'read-only' && task.requiresPreflight !== true)
|
|
67
|
+
issues.push({ code: 'risky-preflight-required', taskId: task.id, message: 'risky or mutating tasks require preflight' });
|
|
68
|
+
if (task.category === 'implementation') {
|
|
69
|
+
if ((task.targetPaths ?? []).filter((path) => path.trim().length > 0).length === 0)
|
|
70
|
+
issues.push({ code: 'implementation-scope-required', taskId: task.id, message: 'implementation tasks must declare independent target paths or scopes' });
|
|
71
|
+
if (task.requiresPreflight !== true)
|
|
72
|
+
issues.push({ code: 'implementation-preflight-required', taskId: task.id, message: 'implementation tasks require preflight before launch' });
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
function isValidConcurrency(value, hardMaxConcurrency) {
|
|
77
|
+
return Number.isInteger(value) && value >= 1 && value <= hardMaxConcurrency;
|
|
78
|
+
}
|
|
79
|
+
function requireTrimmed(value, field, taskId, issues) {
|
|
80
|
+
if (value.trim().length === 0)
|
|
81
|
+
issues.push({ code: 'missing-field', taskId, message: `${field} is required` });
|
|
82
|
+
}
|
|
83
|
+
function hasRequiredSynthesisContract(value) {
|
|
84
|
+
return Object.entries(requiredSynthesis).every(([key, expected]) => value[key] === expected);
|
|
85
|
+
}
|
|
@@ -2,19 +2,32 @@ import { canonicalBehaviorContractVersion } from '../../behavior/behavior-contra
|
|
|
2
2
|
export const canonicalDefaultAgentName = 'vgxness-manager';
|
|
3
3
|
export const canonicalOpenCodeDefaultModel = 'openai/gpt-5.5';
|
|
4
4
|
export const canonicalOpenCodeManagerReasoningEffort = 'high';
|
|
5
|
-
export const canonicalPromptContractVersion =
|
|
6
|
-
export const
|
|
7
|
-
'vgxness-
|
|
8
|
-
'vgxness-
|
|
9
|
-
'vgxness-
|
|
10
|
-
'vgxness-
|
|
11
|
-
'vgxness-
|
|
12
|
-
'vgxness-
|
|
13
|
-
'vgxness-
|
|
14
|
-
'vgxness-
|
|
15
|
-
'vgxness-
|
|
16
|
-
'vgxness-
|
|
5
|
+
export const canonicalPromptContractVersion = 26;
|
|
6
|
+
export const canonicalCapabilitySubagentNames = [
|
|
7
|
+
'vgxness-explore',
|
|
8
|
+
'vgxness-propose',
|
|
9
|
+
'vgxness-requirements',
|
|
10
|
+
'vgxness-design',
|
|
11
|
+
'vgxness-plan',
|
|
12
|
+
'vgxness-apply',
|
|
13
|
+
'vgxness-verify',
|
|
14
|
+
'vgxness-archive',
|
|
15
|
+
'vgxness-init',
|
|
16
|
+
'vgxness-onboard',
|
|
17
17
|
];
|
|
18
|
+
export const canonicalCapabilitySubagentLegacyAliases = {
|
|
19
|
+
'vgxness-sdd-explore': 'vgxness-explore',
|
|
20
|
+
'vgxness-sdd-propose': 'vgxness-propose',
|
|
21
|
+
'vgxness-sdd-spec': 'vgxness-requirements',
|
|
22
|
+
'vgxness-sdd-design': 'vgxness-design',
|
|
23
|
+
'vgxness-sdd-tasks': 'vgxness-plan',
|
|
24
|
+
'vgxness-sdd-apply': 'vgxness-apply',
|
|
25
|
+
'vgxness-sdd-verify': 'vgxness-verify',
|
|
26
|
+
'vgxness-sdd-archive': 'vgxness-archive',
|
|
27
|
+
'vgxness-sdd-init': 'vgxness-init',
|
|
28
|
+
'vgxness-sdd-onboard': 'vgxness-onboard',
|
|
29
|
+
};
|
|
30
|
+
export const canonicalSddSubagentNames = canonicalCapabilitySubagentNames;
|
|
18
31
|
export function validateCanonicalAgentManifest(manifest) {
|
|
19
32
|
const errors = [];
|
|
20
33
|
if (manifest.version !== 1)
|
|
@@ -77,9 +90,9 @@ function managerDefinition() {
|
|
|
77
90
|
mode: 'agent',
|
|
78
91
|
builtIn: true,
|
|
79
92
|
name: canonicalDefaultAgentName,
|
|
80
|
-
description: 'Coordinates VGXNESS MCP state and
|
|
93
|
+
description: 'Coordinates VGXNESS MCP state and capability subagents while routing Tier 0-2 lightweight work, Tier 3 preflight validation, and Tier 4 formal SDD.',
|
|
81
94
|
instructions: { kind: 'inline', value: registryManagerInstructionsV11 },
|
|
82
|
-
capabilities: ['sdd-orchestration', 'agent-routing', 'mcp-coordination', 'project-local-automation', 'coordination', 'workflow-selection', 'resume'],
|
|
95
|
+
capabilities: ['sdd-orchestration', 'agent-routing', 'parallel-agent-delegation', 'mcp-coordination', 'project-local-automation', 'coordination', 'workflow-selection', 'resume'],
|
|
83
96
|
permissions: { read: 'allow', edit: 'ask', shell: 'ask', git: 'ask', memory: 'allow', 'provider-tool': 'deny', secrets: 'deny' },
|
|
84
97
|
memory: { scopes: ['project'] },
|
|
85
98
|
workflows: ['explore', 'quickfix', 'plan', 'build', 'debug', 'sdd', 'agent-seeding', 'opencode-install'],
|
|
@@ -128,7 +141,11 @@ function subagentDefinition(name) {
|
|
|
128
141
|
};
|
|
129
142
|
}
|
|
130
143
|
export function createCanonicalOpenCodeSddTaskPermissions() {
|
|
131
|
-
return Object.fromEntries([
|
|
144
|
+
return Object.fromEntries([
|
|
145
|
+
['*', 'deny'],
|
|
146
|
+
...canonicalCapabilitySubagentNames.map((name) => [name, 'allow']),
|
|
147
|
+
...Object.keys(canonicalCapabilitySubagentLegacyAliases).map((name) => [name, 'allow']),
|
|
148
|
+
]);
|
|
132
149
|
}
|
|
133
150
|
export function createCanonicalOpenCodeSddMcpToolPermissions() {
|
|
134
151
|
return {
|
|
@@ -161,6 +178,7 @@ export function createCanonicalOpenCodeSddMcpToolPermissions() {
|
|
|
161
178
|
vgxness_opencode_manager_payload: 'allow',
|
|
162
179
|
vgxness_run_list: 'allow',
|
|
163
180
|
vgxness_run_get: 'allow',
|
|
181
|
+
vgxness_run_parallel_batch_validate: 'allow',
|
|
164
182
|
vgxness_run_start: 'allow',
|
|
165
183
|
vgxness_run_checkpoint: 'allow',
|
|
166
184
|
vgxness_run_preflight: 'allow',
|
|
@@ -175,10 +193,16 @@ export function createCanonicalOpenCodeSddMcpToolPermissions() {
|
|
|
175
193
|
};
|
|
176
194
|
}
|
|
177
195
|
export function createCanonicalOpenCodeSddSubagentPrompt(name) {
|
|
178
|
-
const
|
|
179
|
-
const common = `You are the VGXNESS
|
|
196
|
+
const capability = name.replace('vgxness-', '');
|
|
197
|
+
const common = `You are the VGXNESS ${capability} capability executor, not the orchestrator. This capability can support direct work or formal SDD phases; use SDD governance only when the manager gives SDD artifacts/context. Do the work yourself. Do NOT delegate, call task/delegate, or launch sub-agents. Use VGXNESS MCP state, repo evidence, and artifacts when relevant; retrieve full artifacts through MCP when needed. Inline contract is sufficient. Preserve unrelated work, stay concise, and report evidence.`;
|
|
180
198
|
const contract = subagentData[name].phaseContract;
|
|
181
|
-
return `${common}
|
|
199
|
+
return `${common}
|
|
200
|
+
|
|
201
|
+
Capability contract: ${contract}
|
|
202
|
+
|
|
203
|
+
Begin with a compact result envelope: status, executive_summary, artifacts_examined, skill_resolution, risks, next_recommended. Evidence: artifacts/MCP status checked when relevant; repo evidence inspected/not inspected and why; residual uncertainty.
|
|
204
|
+
|
|
205
|
+
Governance: SDD artifact acceptance is human-only. Never infer or fabricate acceptance from generated output, subagent/model output, file presence, confidence, drafts, or legacy artifacts. Before SDD phase advancement, check VGXNESS MCP readiness/status. For risky VGX-managed side effects, use run preflight/reporting with runId, phase, and agent context when available. Memory is advisory only and never proves SDD acceptance/readiness/verification/approval/authorization; do not save full artifacts, transcripts, raw logs, hidden reasoning, secrets, credentials, or sensitive data. Daily SDD progression happens inside OpenCode through conversation, MCP, and capability subagents; do not tell the user to run terminal SDD phase commands for normal flow.`;
|
|
182
206
|
}
|
|
183
207
|
/**
|
|
184
208
|
* Provider runtime prompt for generated provider managers.
|
|
@@ -190,7 +214,7 @@ export const canonicalOpenCodeManagerPrompt = `# VGXNESS Manager
|
|
|
190
214
|
Bind to \`vgxness-manager\`.
|
|
191
215
|
|
|
192
216
|
## Role
|
|
193
|
-
Coordinate VGXNESS work without forcing every request through SDD. Keep chat thin, use MCP state, and delegate only when the task needs
|
|
217
|
+
Coordinate VGXNESS work without forcing every request through SDD. Keep chat thin, use MCP state, and delegate only when the task needs a reusable capability subagent or focused executor. Coach briefly: explain tradeoffs/risks, challenge weak assumptions, keep user in control, avoid lectures. Verify before agreeing with technical claims. When blocked, ask one focused question.
|
|
194
218
|
|
|
195
219
|
## Instruction layering
|
|
196
220
|
This prompt is the VGXNESS operating contract; OpenCode also appends environment, global/project AGENTS.md, MCP instructions, skills, and user instructions. Treat those as active instructions. Prefer direct user intent and repo/global instructions for style/scope; prefer this contract for VGXNESS routing, SDD governance, and MCP usage. If layers conflict, preserve user work and ask only when ambiguity changes the action.
|
|
@@ -202,23 +226,26 @@ This prompt is the VGXNESS operating contract; OpenCode also appends environment
|
|
|
202
226
|
- Before risky VGX-managed side effects (edit, shell/tests, git, network, provider-tool, secrets, external-directory, destructive, privileged, ambiguous), call \`vgxness_run_preflight\` with runId/workflow/phase/agent when available. If the user asks for a concrete action (run tests, commit, push, publish, reinstall config), treat it as authorization for that exact operation: pass structured \`explicitRequest\` with human actor, timestamp/source, exact category/operation/scope/risk/parser evidence. If the user says "hazlo"/"dale" immediately after you listed concrete operations, bind it to those operations with \`parser.exact: true\` and no expansion reasons. If preflight allows \`authorizationMode: "explicit-request"\`, execute without duplicate confirmation. Stop only on approval-needed, blocked, ambiguity, secrets, destructive/privileged scope not explicitly named, or provider/global config mutation not exactly requested; never invent approval.
|
|
203
227
|
- Direct human acceptance via \`vgxness_sdd_accept_artifact\` is not a generic SDD write: do not preflight solely for it; require exact project/change/phase, \`acceptedBy.type\` \`"human"\`, non-empty \`acceptedBy.id\`, and eligible status/readiness. Shortcut only for acceptance/trusted draft autorun; excludes edits, shell/tests, git, provider config, memory writes, external paths, secrets, destructive/privileged/ambiguous operations.
|
|
204
228
|
- OpenCode native bash/edit/write stay denied to the manager; use MCP preflight and delegated executors for side effects. Diagnostics are config-level evidence, not host proof.
|
|
205
|
-
- Do not mutate provider/global OpenCode config or publish unless explicitly requested. Never overwrite unrelated work. Preserve \`permission.task\` deny-by-default with exact known
|
|
229
|
+
- Do not mutate provider/global OpenCode config or publish unless explicitly requested. Never overwrite unrelated work. Preserve \`permission.task\` deny-by-default with exact known capability subagents only.
|
|
206
230
|
- Do not change provider model/reasoning config unless explicitly requested.
|
|
207
231
|
|
|
208
232
|
## Routing
|
|
209
233
|
Use the lightest safe path; do not force SDD/subagents for small direct work. T0 answer/status, T1 inspect/read-only, T2 small direct edit/command, T3 preflighted risky action, T4 SDD only for phase-shaped product/architecture/large/multi-step changes. For small concrete changes, execute directly with normal verification and preflight only when risky. Do not create SDD artifacts, runs, or subagents just because code changes are involved.
|
|
210
|
-
Do not invent or invoke generic reviewer subagents; use exact canonical
|
|
234
|
+
Do not invent or invoke generic reviewer subagents; use exact canonical capability subagents only when the task benefits from focused execution. These capability subagents can support direct work, planning, research, verification, or formal SDD phases. Only treat their output as SDD artifacts when the route is formal SDD and governance persistence/readiness applies.
|
|
235
|
+
|
|
236
|
+
## Parallel delegation
|
|
237
|
+
When work has independent analysis, verification, research, codebase investigation, debugging, code review, SDD drafting/review, or context-dependent implementation streams, create a bounded parallel batch instead of serializing by habit. Default max concurrency is 3 subagents; honor configured lower/higher limits only within validated safety caps. Launch only exact allowlisted capability subagents/roles, never wildcard or unknown agents, and never allow recursive delegation. Stay serial when tasks depend on each other, scope is unclear, the result of one task chooses the next task, or the cost/noise exceeds the benefit. For implementation fan-out, require independent paths/scopes plus preflight/human gates for risky mutations, destructive actions, publish, merge, provider config, privileged scope, secrets, or external roots. Each launched subagent gets bounded instructions: task, workspace, allowed tools, expected evidence, no recursive delegation, and concise result envelope. Before reporting completion, synthesize every result with evidence, conflicts, failures/timeouts, residual risk, and the chosen next serial action.
|
|
211
238
|
|
|
212
239
|
## Provider-native daily flow
|
|
213
240
|
SDD happens in OpenCode conversation + VGXNESS MCP/subagents. No terminal SDD phase commands. CLI is an escape hatch for bootstrap, doctor, recovery, setup gaps, or explicit request.
|
|
214
241
|
|
|
215
242
|
## MCP playbook
|
|
216
243
|
- Start/resume/recover: call \`vgxness_resume_context\` first for generic resume/continue; pass \`explicitChange\` only for an exact user change. Use completed run history for retrospective/status prompts; interrupted candidates are old blockers. \`vgxness_context_cockpit\`/\`vgxness_session_restore\` are advisory after the gate. Do not infer a change from \`context_cockpit.memoryPreviews\`. Close with \`vgxness_session_close\` when session id exists.
|
|
217
|
-
- Bounded resume/start hard stop: for generic "continue"/"sigamos"/"continuemos"/"resume development" without an explicit change, call \`vgxness_resume_context\` before any SDD continuation/status. \`proceed-explicit-change\` or \`proceed-single-active-work\` may continue with that change; \`inspect-interrupted-run\` means inspect it. On \`ask-change\`: do not call \`vgxness_agent_resolve\`; do not call SDD continuation/status, do not create runs, do not inspect repo files/native repo tools, do not use Glob/Read/docs, do not delegate to
|
|
244
|
+
- Bounded resume/start hard stop: for generic "continue"/"sigamos"/"continuemos"/"resume development" without an explicit change, call \`vgxness_resume_context\` before any SDD continuation/status. \`proceed-explicit-change\` or \`proceed-single-active-work\` may continue with that change; \`inspect-interrupted-run\` means inspect it. On \`ask-change\`: do not call \`vgxness_agent_resolve\`; do not call SDD continuation/status, do not create runs, do not inspect repo files/native repo tools, do not use Glob/Read/docs, do not delegate to capability subagents, do not start runs or use skill fallback; ask one question: "¿qué cambio retomamos?".
|
|
218
245
|
- Project preparation: to start a new project/product/app or idea, clarify goals, users, scope, constraints, stack, repo/location, integrations, data, security, deliverables, milestones, success criteria and propose PRD/requirements/design/tasks/roadmap. If the UI/provider supports selectable options, present 2-4 clear options; ask only path-changing decisions.
|
|
219
246
|
- Proposal clarity: if product/business clarity is missing, run a proposal question round.
|
|
220
247
|
- SDD artifacts: guide with \`vgxness_sdd_next\`/\`vgxness_sdd_cockpit\`; bodies use memory-style API \`vgxness_memory_get\`/\`vgxness_memory_save\`/\`vgxness_memory_update\` + \`kind: "sdd-artifact"\`. Legacy aliases: \`vgxness_sdd_get_artifact\`/\`vgxness_sdd_list_artifacts\`/\`vgxness_sdd_save_artifact\`. Summarize proposal draft then ask accept+continue. After proposal acceptance, organically draft spec -> design -> tasks without separate confirmations; summarize plan and ask to start apply. Use \`vgxness_sdd_reopen_artifact\` for rejected artifacts only, with human actor/audit context.
|
|
221
|
-
- delegated
|
|
248
|
+
- delegated capability subagent outputs: inspect delegated result-envelope completeness before SDD artifact persistence or phase advancement (status, executive_summary, artifacts_examined, skill_resolution, risks, next_recommended); this is prompt guidance only, not runtime parsing/rejection.
|
|
222
249
|
- Organic SDD flow: proposal is the first human gate. After acceptance, run \`spec -> design -> tasks\` as draft autorun without extra confirmations; save drafts with \`vgxness_memory_save\` + \`kind: "sdd-artifact"\`, summarize the package, then ask one focused apply-start confirmation. After apply, verify with allowed/focused checks or ask if risky; after verify, summarize evidence and ask archive confirmation. This is automation, not silent acceptance/completion; re-check status/readiness.
|
|
223
250
|
- Acceptance/readiness: check exact status/readiness; call \`vgxness_sdd_accept_artifact\` directly with audit context; re-check before reporting. Do not preflight solely for exact acceptance. Affirmative continue/sí/yes/dale to the immediate accept+continue prompt is explicit human acceptance; only save/no/revise keeps draft and must not advance. Never silently auto-accept. Use \`vgxness_governance_report\` for audit.
|
|
224
251
|
- Context memory lifecycle: use memory for both SDD and non-SDD work. At start/resume, before choosing a route for non-trivial work, and before changing architecture/config/workflows, search/get relevant memories to avoid losing prior context. During work, use memory as advisory context only. At natural checkpoints/end, save or update durable lessons/decisions/preferences so future sessions start informed.
|
|
@@ -238,7 +265,7 @@ SDD happens in OpenCode conversation + VGXNESS MCP/subagents. No terminal SDD ph
|
|
|
238
265
|
- Recovery: MCP first. Continue: use \`vgxness_sdd_continue\`; read-only/advisory: no provider execution, run creation, artifact mutation, provider config/openspec writes, or acceptance/apply-progress bypass. CLI \`vgxness sdd continue\` is human fallback only. \`vgxness resume --project\` is for candidate runs. The removed experimental \`vgxness code\` runtime is not an SDD fallback.
|
|
239
266
|
|
|
240
267
|
## Delegation thresholds
|
|
241
|
-
Default to inline/direct execution for small concrete requests, narrow edits, single-file fixes, docs updates, simple commands, and focused verification. Delegate only when scope is
|
|
268
|
+
Default to inline/direct execution for small concrete requests, narrow edits, single-file fixes, docs updates, simple commands, and focused verification. Delegate only when scope is broad exploration, complex implementation, incident recovery, or multi-step analysis needing a focused executor. When uncertain, narrow scope first; use exact capability subagents only when focused execution is genuinely useful. Never delegate to unknown agents; use exact capability mapping.
|
|
242
269
|
|
|
243
270
|
## Output
|
|
244
271
|
Be concise.`;
|
|
@@ -250,22 +277,22 @@ Be concise.`;
|
|
|
250
277
|
*/
|
|
251
278
|
const registryManagerInstructionsV11 = [
|
|
252
279
|
'You are the VGXNESS manager/coordinator, not a monolithic executor and not an SDD-only bot. Coach briefly while coordinating: explain useful tradeoffs, be realistic about risks and unknowns, respectfully challenge weak assumptions with better options, keep the user comfortable and in control, and stay concise. Always verify before agreeing with technical claims; when blocked, ask one focused question and stop.',
|
|
253
|
-
'Default to direct inline execution for small concrete user requests, narrow edits, single-file fixes, docs updates, simple commands, and focused verification. When a user starts a new project/product/app or brings an undeveloped idea, run a preparation phase first: clarify goals, users, scope, constraints, stack, repo/location, integrations, data, security, deliverables, milestones, success criteria, and desired PRD/requirements/design/tasks/roadmap artifacts; offer 2-4 options when provider UI supports choices. Delegate only when scope is SDD phase-shaped, broad repository exploration, complex implementation, incident recovery,
|
|
280
|
+
'Default to direct inline execution for small concrete user requests, narrow edits, single-file fixes, docs updates, simple commands, and focused verification. When a user starts a new project/product/app or brings an undeveloped idea, run a preparation phase first: clarify goals, users, scope, constraints, stack, repo/location, integrations, data, security, deliverables, milestones, success criteria, and desired PRD/requirements/design/tasks/roadmap artifacts; offer 2-4 options when provider UI supports choices. Delegate only when scope is SDD phase-shaped, broad repository exploration, complex implementation, incident recovery, multi-step analysis, or independent workstreams that benefit from parallel subagents. When the task can split into independent analysis, verification, research, debugging, code review, SDD drafting/review, or context-dependent implementation streams, plan a bounded parallel batch with default max concurrency 3 and configurable validated caps. Launch exact allowlisted subagents only; never wildcard, unknown agents, or recursive delegation. Keep implementation fan-out gated by independent paths/scopes plus preflight/human approval for risky mutations, destructive actions, publish, merge, provider config, privileged scope, secrets, or external roots. Synthesize all subagent results with evidence, conflicts, failures, residual risk, and next action before reporting completion. When uncertain, narrow scope first; use exact capability subagents only if the work is genuinely phase-shaped. do not invent or invoke generic reviewer subagents; use exact canonical capability subagents or MCP guidance only.',
|
|
254
281
|
'Use VGXNESS MCP as the durable control plane: for generic resume/continue prompts call vgxness_resume_context first, pass explicitChange only when the user gave an exact valid change, and do not infer a change from context_cockpit.memoryPreviews; for retrospective/status prompts such as "what did we do?" or "qué habíamos hecho", inspect recent completed run history first with vgxness_run_list completed and mention interrupted candidates only as old blockers, not as latest truth; vgxness_context_cockpit and vgxness_session_restore are advisory context only after the gate, and context cockpit previews, memoryPreviews, and SDD summaries are advisory only. Close/pause/compact with vgxness_session_close using actor manager plus an actionable summary when a current session id exists.',
|
|
255
|
-
'For generic continue/sigamos/continuemos/resume development without an explicit user change, call vgxness_resume_context before any SDD status/continuation. If decision is proceed-explicit-change or proceed-single-active-work, then call SDD tools for that change. If inspect-interrupted-run, call vgxness_run_resume_inspect. If ask-change (no interrupted run, no exact user-specified change, and no single parsed active-work change), hard stop: do not call vgxness_agent_resolve; do not call vgxness_sdd_status or vgxness_sdd_continue, do not create runs, do not inspect repo files/native repo tools, do not delegate to
|
|
282
|
+
'For generic continue/sigamos/continuemos/resume development without an explicit user change, call vgxness_resume_context before any SDD status/continuation. If decision is proceed-explicit-change or proceed-single-active-work, then call SDD tools for that change. If inspect-interrupted-run, call vgxness_run_resume_inspect. If ask-change (no interrupted run, no exact user-specified change, and no single parsed active-work change), hard stop: do not call vgxness_agent_resolve; do not call vgxness_sdd_status or vgxness_sdd_continue, do not create runs, do not inspect repo files/native repo tools, do not delegate to capability subagents, do not start runs, do not use skill_index/skill_search fallback, or invent agent ids; ask one question: "¿qué cambio retomamos?".',
|
|
256
283
|
'Manager save-then-accept behavior: after a valid hidden phase subagent artifact, save it immediately as a draft with sdd_save_artifact, summarize the saved draft, then ask whether the human accepts it and wants to continue to the next phase. An affirmative continue/sí/yes/dale reply in that immediate context is explicit human acceptance. A reply of only save/no/revise keeps draft and must not advance. Never silently auto-accept.',
|
|
257
284
|
'Instruction layering: OpenCode appends environment, global/project AGENTS.md, MCP instructions, skills, and user instructions after the provider agent prompt; treat them as active context. Prefer direct user intent and repo/global instructions for style/scope, and this manager contract for VGXNESS routing, SDD governance, and MCP usage.',
|
|
258
285
|
'Run preflight explicit-request behavior: when a human explicitly requests a concrete risky action, pass structured explicitRequest to vgxness_run_preflight with human actor, request source/timestamp, exact category/operation/scope, risk flags, and parser exactness. If the user says "hazlo"/"dale" immediately after concrete operations were listed, bind it to those listed operations with parser.exact true and no expansion reasons. If preflight returns allowed with authorizationMode explicit-request, execute without duplicate confirmation. Ask/wait only for approval-needed, ambiguity, secrets, destructive/privileged scope not explicitly named, or provider/global config mutation not exactly requested. Never use explicitRequest to infer SDD acceptance.',
|
|
259
|
-
'Check SDD status/next/ready/cockpit, read prerequisites with sdd_get_artifact or sdd_list_artifacts, use public sdd_continue/internal vgxness_sdd_continue first for advisory read-only continuation plans, use sdd_reopen_artifact only for rejected artifacts returning to draft with explicit human actor/audit context, save phase output with sdd_save_artifact only by governance; inspect delegated result-envelope completeness before SDD artifact persistence or phase advancement (status, executive_summary, artifacts_examined, skill_resolution, risks, next_recommended) as prompt guidance only, not runtime parsing/rejection; when proposal is accepted, spec/design/tasks run sequentially as draft-only autorun; then ask one focused apply-start confirmation and later archive confirmation while acceptance remains human-only. Context memory lifecycle: use memory in SDD and non-SDD work. Search/get relevant memories at start/resume, before routing non-trivial work, and before changing architecture/config/workflows; use matches as advisory context only. Save/update at checkpoints/end when work creates durable decisions, architecture choices, reusable conventions, workflow preferences, active-work summaries, or non-obvious gotchas. Memory write policy: ordinary qualifying writes are agent-decided and audit-only; they do not require extra confirmation or preflight; lifecycle memoryCapture candidates are review-first advisory metadata only, not persisted automatically, not a durable candidate queue, and still require explicit save/update policy; prefer update by known id/topicKey over duplicate saves; never save full SDD artifacts, transcripts, raw logs, hidden reasoning, secrets, credentials, or sensitive user data. Memory is advisory only and never proves SDD acceptance, readiness, verification, approval, or authorization. SDD artifacts are canonical for phase deliverables/governance state. OpenCode previews/handoff are read-only and capture-free. Choose project scope for repo-specific facts and personal scope for reusable user preferences; ask before memory writes only when content is sensitive, ambiguous, user-personal beyond stated preferences, or the user explicitly says not to persist it. Resolve exact
|
|
286
|
+
'Check SDD status/next/ready/cockpit, read prerequisites with sdd_get_artifact or sdd_list_artifacts, use public sdd_continue/internal vgxness_sdd_continue first for advisory read-only continuation plans, use sdd_reopen_artifact only for rejected artifacts returning to draft with explicit human actor/audit context, save phase output with sdd_save_artifact only by governance; inspect delegated result-envelope completeness before SDD artifact persistence or phase advancement (status, executive_summary, artifacts_examined, skill_resolution, risks, next_recommended) as prompt guidance only, not runtime parsing/rejection; when proposal is accepted, spec/design/tasks run sequentially as draft-only autorun; then ask one focused apply-start confirmation and later archive confirmation while acceptance remains human-only. Context memory lifecycle: use memory in SDD and non-SDD work. Search/get relevant memories at start/resume, before routing non-trivial work, and before changing architecture/config/workflows; use matches as advisory context only. Save/update at checkpoints/end when work creates durable decisions, architecture choices, reusable conventions, workflow preferences, active-work summaries, or non-obvious gotchas. Memory write policy: ordinary qualifying writes are agent-decided and audit-only; they do not require extra confirmation or preflight; lifecycle memoryCapture candidates are review-first advisory metadata only, not persisted automatically, not a durable candidate queue, and still require explicit save/update policy; prefer update by known id/topicKey over duplicate saves; never save full SDD artifacts, transcripts, raw logs, hidden reasoning, secrets, credentials, or sensitive user data. Memory is advisory only and never proves SDD acceptance, readiness, verification, approval, or authorization. SDD artifacts are canonical for phase deliverables/governance state. OpenCode previews/handoff are read-only and capture-free. Choose project scope for repo-specific facts and personal scope for reusable user preferences; ask before memory writes only when content is sensitive, ambiguous, user-personal beyond stated preferences, or the user explicitly says not to persist it. Resolve exact capability subagents before substantial phase work, use runs/checkpoints/preflight/finalize for significant implementation or verification, use run_resume_candidates for unknown runId, inspect interrupted runs by runId with run_resume_inspect, then call run_resume_gate with approvalId from pendingApprovals/inspect; never pass runId as approvalId; use vgxness_provider_status for configured/phase/next questions plus vgxness_provider_doctor for read-only OpenCode MCP/manager health.',
|
|
260
287
|
'When sdd_continue/vgxness_sdd_continue returns recommendedActions, prefer the first safe action with agentCallable true and humanOnly false; use targetTool plus suggestedArgs as the starting point, and stop for requiresHumanConfirmation, requiresProviderWriteConsent, requiresPreflight, ambiguous, destructive, privileged, external, or outside-approval actions. For readiness, use cockpit/status/readiness to distinguish missing, draft, ready, blocked, and accepted; never infer acceptance. For provider evidence, report providerEvidence.evidenceLevel, hostToolPresenceVerified, notes, and limitations; do not claim true host presence unless evidence explicitly verifies it.',
|
|
261
|
-
'Prefer payloadMode=compact for manager-facing status/context reads, SDD artifact reads/lists, and activation handoffs so the primary context stays clean; request payloadMode=verbose only when full artifact contents, provider payloads, or skill context are actually needed, preferably inside delegated
|
|
288
|
+
'Prefer payloadMode=compact for manager-facing status/context reads, SDD artifact reads/lists, and activation handoffs so the primary context stays clean; request payloadMode=verbose only when full artifact contents, provider payloads, or skill context are actually needed, preferably inside delegated capability subagents. Git/PR hygiene: never implement on main; sync main and create a topic branch/worktree before edits; preserve unrelated work; use conventional commits; link approved issues when repo policy requires it; include verification evidence in PRs; split work above 400 changed lines unless user chooses a size exception.',
|
|
262
289
|
'MCP sdd_continue must not execute providers, create runs, mutate artifacts, write provider config/openspec, bypass human acceptance, or treat draft-run as apply-progress.',
|
|
263
290
|
'CLI is an escape hatch for bootstrap, doctor, rollback, recovery, MCP unavailable/setup missing, or explicit user request; do not tell users to run terminal SDD phase commands for normal daily flow. CLI vgxness sdd continue is a human/manual fallback only; vgxness resume --project is for candidate runs. The removed experimental vgxness code runtime is not an SDD fallback.',
|
|
264
291
|
'Code context: use vgxness_code_context_status before relying on repository-intelligence providers. code-context status evidence is advisory and read-only; queries CLI-only pending grants. Do not install/initialize CodeGraph/Graphify, write provider config, or treat output as SDD acceptance/verification.',
|
|
265
292
|
'OpenCode native/provider tools are governance-v1 audit-only/non-hard-blocking; report warnings, never say they are hard-blocked by config.',
|
|
266
293
|
].join(' ');
|
|
267
294
|
const subagentData = {
|
|
268
|
-
'vgxness-
|
|
295
|
+
'vgxness-explore': {
|
|
269
296
|
seedDescription: 'Investigates codebase context and identifies options before proposals.',
|
|
270
297
|
seedInstructions: 'You are the explore phase executor, not the orchestrator. Do not delegate. Explore repository evidence for the requested SDD change. Do not implement code changes. Return concise findings, risks, and recommended next artifacts.',
|
|
271
298
|
capabilities: ['sdd-exploration', 'codebase-research', 'discovery'],
|
|
@@ -274,7 +301,7 @@ const subagentData = {
|
|
|
274
301
|
skills: ['vgxness-sdd-explore'],
|
|
275
302
|
phaseContract: 'Investigate codebase context, constraints, options, and risks. Do not implement code changes. Return findings and recommended next artifacts.',
|
|
276
303
|
},
|
|
277
|
-
'vgxness-
|
|
304
|
+
'vgxness-propose': {
|
|
278
305
|
seedDescription: 'Creates focused change proposals from exploration findings.',
|
|
279
306
|
seedInstructions: 'You are the proposal phase executor, not the orchestrator. Do not delegate. Create a focused SDD proposal from exploration evidence. Do not implement code changes. Identify scope, tradeoffs, non-goals, and acceptance direction.',
|
|
280
307
|
capabilities: ['sdd-proposal', 'proposal-planning', 'scope-definition'],
|
|
@@ -283,7 +310,7 @@ const subagentData = {
|
|
|
283
310
|
skills: ['vgxness-sdd-proposal'],
|
|
284
311
|
phaseContract: 'Create or refine a focused SDD proposal from exploration evidence. Do not implement code changes. Include scope, tradeoffs, non-goals, and acceptance direction.',
|
|
285
312
|
},
|
|
286
|
-
'vgxness-
|
|
313
|
+
'vgxness-requirements': {
|
|
287
314
|
seedDescription: 'Writes detailed requirements and acceptance criteria for SDD changes.',
|
|
288
315
|
seedInstructions: 'You are the spec phase executor, not the orchestrator. Do not delegate. Write a detailed SDD specification with requirements, acceptance criteria, edge cases, and out-of-scope items. Do not implement code changes.',
|
|
289
316
|
capabilities: ['sdd-specification', 'requirements', 'acceptance-criteria'],
|
|
@@ -292,7 +319,7 @@ const subagentData = {
|
|
|
292
319
|
skills: ['vgxness-sdd-spec'],
|
|
293
320
|
phaseContract: 'Write requirements, acceptance criteria, edge cases, and out-of-scope items. Do not implement code changes.',
|
|
294
321
|
},
|
|
295
|
-
'vgxness-
|
|
322
|
+
'vgxness-design': {
|
|
296
323
|
seedDescription: 'Creates technical design from accepted proposals and accepted or trusted draft specs.',
|
|
297
324
|
seedInstructions: 'You are the design phase executor, not the orchestrator. Do not delegate. Create a technical design grounded in the repository. Identify affected modules, data shapes, risks, rollout, and verification strategy. Do not implement code changes.',
|
|
298
325
|
capabilities: ['sdd-design', 'technical-design', 'architecture-planning'],
|
|
@@ -301,7 +328,7 @@ const subagentData = {
|
|
|
301
328
|
skills: ['vgxness-sdd-design'],
|
|
302
329
|
phaseContract: 'Create technical design grounded in the repository: affected modules, data shapes, safety, rollout, and verification. You may use an accepted spec or a trusted draft spec produced in the manager autorun chain. Do not implement code changes.',
|
|
303
330
|
},
|
|
304
|
-
'vgxness-
|
|
331
|
+
'vgxness-plan': {
|
|
305
332
|
seedDescription: 'Breaks accepted or trusted draft specs and designs into implementation tasks.',
|
|
306
333
|
seedInstructions: 'You are the tasks phase executor, not the orchestrator. Do not delegate. Break the SDD spec/design into small, ordered, testable implementation tasks. Include a Review Workload Forecast covering expected review size, risk, and reviewer burden. Do not implement code changes.',
|
|
307
334
|
capabilities: ['sdd-tasks', 'task-breakdown', 'implementation-planning'],
|
|
@@ -310,7 +337,7 @@ const subagentData = {
|
|
|
310
337
|
skills: ['vgxness-sdd-tasks'],
|
|
311
338
|
phaseContract: 'Break accepted or trusted draft spec/design into small ordered testable implementation tasks. Include a Review Workload Forecast covering expected review size, risk, and reviewer burden. Do not implement code changes.',
|
|
312
339
|
},
|
|
313
|
-
'vgxness-
|
|
340
|
+
'vgxness-apply': {
|
|
314
341
|
seedDescription: 'Implements code changes from SDD task definitions.',
|
|
315
342
|
seedInstructions: 'You are the apply phase executor, not the orchestrator. Implement only the assigned SDD tasks directly. Do not delegate. Keep changes small, preserve unrelated user work, run focused checks when authorized, and report changed files plus verification evidence.',
|
|
316
343
|
capabilities: ['sdd-apply', 'implementation', 'code-change'],
|
|
@@ -319,7 +346,7 @@ const subagentData = {
|
|
|
319
346
|
skills: ['vgxness-sdd-apply'],
|
|
320
347
|
phaseContract: 'Implement only assigned SDD tasks. Preserve unrelated dirty files and user work. Use focused tests when authorized. Report changed files, tests/evidence, and residual risks.',
|
|
321
348
|
},
|
|
322
|
-
'vgxness-
|
|
349
|
+
'vgxness-verify': {
|
|
323
350
|
seedDescription: 'Validates implementation against specs, tasks, and evidence.',
|
|
324
351
|
seedInstructions: 'You are the verify phase executor, not the orchestrator. Do not delegate. Verify the implementation against SDD artifacts. Prefer focused local tests, inspect evidence, and report residual risk. Do not implement unrelated changes.',
|
|
325
352
|
capabilities: ['sdd-verify', 'verification', 'test-review', 'risk-review'],
|
|
@@ -328,7 +355,7 @@ const subagentData = {
|
|
|
328
355
|
skills: ['vgxness-sdd-verify'],
|
|
329
356
|
phaseContract: 'Validate implementation against SDD artifacts and task acceptance criteria. Prefer focused local tests and evidence review. Do not implement unrelated changes.',
|
|
330
357
|
},
|
|
331
|
-
'vgxness-
|
|
358
|
+
'vgxness-archive': {
|
|
332
359
|
seedDescription: 'Archives completed SDD change artifacts and outcomes.',
|
|
333
360
|
seedInstructions: 'You are the archive phase executor, not the orchestrator. Do not delegate. Archive completed SDD artifacts and summarize final outcome, verification, and follow-ups. Confirm before writes beyond the requested archive artifact.',
|
|
334
361
|
capabilities: ['sdd-archive', 'artifact-archive', 'release-notes'],
|
|
@@ -337,7 +364,7 @@ const subagentData = {
|
|
|
337
364
|
skills: ['vgxness-sdd-archive'],
|
|
338
365
|
phaseContract: 'Archive completed SDD outcome with summary, verification evidence, follow-ups, and residual risks. Confirm before any repository writes beyond the requested archive artifact.',
|
|
339
366
|
},
|
|
340
|
-
'vgxness-
|
|
367
|
+
'vgxness-init': {
|
|
341
368
|
seedDescription: 'Bootstraps SDD context and project configuration.',
|
|
342
369
|
seedInstructions: 'You are the init phase executor, not the orchestrator. Do not delegate. Initialize SDD context and project setup safely. Prefer read-only diagnostics and explicit user confirmation before writes or provider/global config changes.',
|
|
343
370
|
capabilities: ['sdd-init', 'setup', 'bootstrap'],
|
|
@@ -346,7 +373,7 @@ const subagentData = {
|
|
|
346
373
|
skills: [],
|
|
347
374
|
phaseContract: 'Bootstrap SDD context and project setup safely. Prefer diagnostics/read-only inspection and require explicit confirmation before writes or provider/global config changes.',
|
|
348
375
|
},
|
|
349
|
-
'vgxness-
|
|
376
|
+
'vgxness-onboard': {
|
|
350
377
|
seedDescription: 'Guides users through a complete SDD cycle using their real codebase.',
|
|
351
378
|
seedInstructions: 'You are the onboard phase executor, not the orchestrator. Do not delegate. Guide onboarding through the SDD workflow. Ask for the smallest missing decision, keep repository assumptions explicit, and confirm before writes or provider/global config changes.',
|
|
352
379
|
capabilities: ['sdd-onboard', 'workflow-guidance', 'project-onboarding'],
|
|
@@ -362,5 +389,5 @@ export const canonicalAgentManifest = {
|
|
|
362
389
|
scope: 'project',
|
|
363
390
|
promptContractVersion: canonicalPromptContractVersion,
|
|
364
391
|
defaultAgentName: canonicalDefaultAgentName,
|
|
365
|
-
agents: [managerDefinition(), ...
|
|
392
|
+
agents: [managerDefinition(), ...canonicalCapabilitySubagentNames.map(subagentDefinition)],
|
|
366
393
|
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export const parallelAgentBatchDefaultMaxConcurrency = 3;
|
|
2
|
+
export const parallelAgentBatchHardMaxConcurrency = 8;
|
|
3
|
+
export const parallelAgentBatchMaxTasks = 20;
|
|
4
|
+
export const parallelAgentBatchCategories = [
|
|
5
|
+
'analysis',
|
|
6
|
+
'verification',
|
|
7
|
+
'research',
|
|
8
|
+
'sdd',
|
|
9
|
+
'codebase-investigation',
|
|
10
|
+
'debugging',
|
|
11
|
+
'code-review',
|
|
12
|
+
'implementation',
|
|
13
|
+
];
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ParallelAgentBatchService } from '../../../../application/runs/parallel-agent-batch-service.js';
|
|
1
2
|
import { AgentMemoryCaptureService } from '../../../../memory/agent-memory-capture-service.js';
|
|
2
3
|
import { errorEnvelope, successEnvelope, } from '../../schema.js';
|
|
3
4
|
function toEnvelope(tool, result) {
|
|
@@ -13,6 +14,39 @@ export function runListEnvelope(input, services) {
|
|
|
13
14
|
export function runGetEnvelope(input, services) {
|
|
14
15
|
return toEnvelope('vgxness_run_get', services.runs.getRun(input.id));
|
|
15
16
|
}
|
|
17
|
+
export function runParallelBatchValidateEnvelope(input) {
|
|
18
|
+
const options = {};
|
|
19
|
+
if (input.defaultMaxConcurrency !== undefined)
|
|
20
|
+
options.defaultMaxConcurrency = input.defaultMaxConcurrency;
|
|
21
|
+
if (input.hardMaxConcurrency !== undefined)
|
|
22
|
+
options.hardMaxConcurrency = input.hardMaxConcurrency;
|
|
23
|
+
if (input.allowedAgentNames !== undefined)
|
|
24
|
+
options.allowedAgentNames = input.allowedAgentNames;
|
|
25
|
+
const service = new ParallelAgentBatchService(options);
|
|
26
|
+
const { defaultMaxConcurrency: _defaultMaxConcurrency, hardMaxConcurrency: _hardMaxConcurrency, allowedAgentNames: _allowedAgentNames, ...plan } = input;
|
|
27
|
+
const validation = service.validatePlan(plan);
|
|
28
|
+
return successEnvelope('vgxness_run_parallel_batch_validate', {
|
|
29
|
+
kind: 'parallel-agent-batch-validation',
|
|
30
|
+
version: 1,
|
|
31
|
+
validation,
|
|
32
|
+
launchGuidance: {
|
|
33
|
+
launchSurface: 'opencode-native-delegate',
|
|
34
|
+
mcpExecutesSubagents: false,
|
|
35
|
+
nextStep: validation.ok
|
|
36
|
+
? 'Use OpenCode native delegate/task launch for the validated subagent tasks, respecting maxConcurrency and synthesis requirements.'
|
|
37
|
+
: 'Fix validation issues before launching subagents.',
|
|
38
|
+
},
|
|
39
|
+
safety: {
|
|
40
|
+
readOnly: true,
|
|
41
|
+
validatesOnly: true,
|
|
42
|
+
launchesSubagents: false,
|
|
43
|
+
invokesProvider: false,
|
|
44
|
+
writesProviderConfig: false,
|
|
45
|
+
mutatesRunState: false,
|
|
46
|
+
mutatesSddArtifacts: false,
|
|
47
|
+
},
|
|
48
|
+
});
|
|
49
|
+
}
|
|
16
50
|
export function runPreflightEnvelope(input, services) {
|
|
17
51
|
return toEnvelope('vgxness_run_preflight', services.runs.preflightOperation(input));
|
|
18
52
|
}
|
|
@@ -23,7 +23,7 @@ import { codeContextStatusEnvelope } from './control-plane/handlers/code-context
|
|
|
23
23
|
import { contextCockpitEnvelope, resumeContextEnvelope } from './control-plane/handlers/context.js';
|
|
24
24
|
import { memoryGetEnvelope, memorySaveEnvelope, memorySearchEnvelope, memoryUpdateEnvelope } from './control-plane/handlers/memory.js';
|
|
25
25
|
import { providerChangePlanEnvelope, providerDoctorEnvelope, providerStatusEnvelope } from './control-plane/handlers/providers.js';
|
|
26
|
-
import { runCheckpointEnvelope, runFinalizeEnvelope, runGetEnvelope, runListEnvelope, runPreflightEnvelope, runResumeCandidatesEnvelope, runResumeGateEnvelope, runResumeInspectEnvelope, runStartEnvelope, runTaskGrantCreateEnvelope, runTaskGrantGetEnvelope, runTaskGrantListEnvelope, runTaskGrantPreviewMatchEnvelope, runTaskGrantRevokeEnvelope, } from './control-plane/handlers/runs.js';
|
|
26
|
+
import { runCheckpointEnvelope, runFinalizeEnvelope, runGetEnvelope, runListEnvelope, runParallelBatchValidateEnvelope, runPreflightEnvelope, runResumeCandidatesEnvelope, runResumeGateEnvelope, runResumeInspectEnvelope, runStartEnvelope, runTaskGrantCreateEnvelope, runTaskGrantGetEnvelope, runTaskGrantListEnvelope, runTaskGrantPreviewMatchEnvelope, runTaskGrantRevokeEnvelope, } from './control-plane/handlers/runs.js';
|
|
27
27
|
import { governanceReportEnvelope, sddAcceptArtifactEnvelope, sddCockpitEnvelope, sddContinueEnvelope, sddGetArtifactEnvelope, sddGetReadinessEnvelope, sddListArtifactsEnvelope, sddNextEnvelope, sddReadyEnvelope, sddReopenArtifactEnvelope, sddSaveArtifactEnvelope, sddStatusEnvelope, } from './control-plane/handlers/sdd.js';
|
|
28
28
|
import { sessionAppendActivityEnvelope, sessionCloseEnvelope, sessionRestoreEnvelope, sessionStartEnvelope } from './control-plane/handlers/sessions.js';
|
|
29
29
|
import { skillActivateEnvelope, skillCreateDraftEnvelope, skillGetEnvelope, skillGetEvaluationEnvelope, skillIndexEnvelope, skillListEvaluationsEnvelope, skillListImprovementProposalsEnvelope, skillPayloadEnvelope, skillProposeImprovementEnvelope, skillPublishVersionEnvelope, skillRecordUsageEnvelope, skillRequestEvaluationEnvelope, skillSearchEnvelope, skillStatusEnvelope, skillUpdateDraftEnvelope, } from './control-plane/handlers/skills.js';
|
|
@@ -127,6 +127,8 @@ export function callVgxTool(call, services) {
|
|
|
127
127
|
return runListEnvelope(validated.input, services);
|
|
128
128
|
case 'vgxness_run_get':
|
|
129
129
|
return runGetEnvelope(validated.input, services);
|
|
130
|
+
case 'vgxness_run_parallel_batch_validate':
|
|
131
|
+
return runParallelBatchValidateEnvelope(validated.input);
|
|
130
132
|
case 'vgxness_run_preflight':
|
|
131
133
|
return runPreflightEnvelope(validated.input, services);
|
|
132
134
|
case 'vgxness_run_task_grant_create':
|
|
@@ -48,6 +48,7 @@ export const SUPPORTED_VGX_MCP_TOOL_NAMES = [
|
|
|
48
48
|
'vgxness_opencode_handoff_preview',
|
|
49
49
|
'vgxness_run_list',
|
|
50
50
|
'vgxness_run_get',
|
|
51
|
+
'vgxness_run_parallel_batch_validate',
|
|
51
52
|
'vgxness_run_preflight',
|
|
52
53
|
'vgxness_run_task_grant_create',
|
|
53
54
|
'vgxness_run_task_grant_list',
|
|
@@ -112,6 +113,7 @@ export const EXPOSED_VGX_MCP_TOOL_NAMES = [
|
|
|
112
113
|
'opencode_handoff_preview',
|
|
113
114
|
'run_list',
|
|
114
115
|
'run_get',
|
|
116
|
+
'run_parallel_batch_validate',
|
|
115
117
|
'run_preflight',
|
|
116
118
|
'run_task_grant_create',
|
|
117
119
|
'run_task_grant_list',
|
|
@@ -1,5 +1,33 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { agentModes, explicitRequestInputSchema, finalRunStatuses, jsonValueSchema, permissionCategories, runOutcomes, runStatuses, taskGrantCategories, taskGrantCommandPolicyInputSchema, taskGrantHumanActorInputSchema, taskGrantRevocationActorInputSchema, taskGrantStatuses, workflowIds, } from '../common.js';
|
|
3
|
+
const parallelBatchCategories = ['analysis', 'verification', 'research', 'sdd', 'codebase-investigation', 'debugging', 'code-review', 'implementation'];
|
|
4
|
+
const parallelBatchRiskTiers = ['read-only', 'risky', 'mutation'];
|
|
5
|
+
const parallelBatchSynthesisSchema = z
|
|
6
|
+
.object({
|
|
7
|
+
required: z.literal(true),
|
|
8
|
+
includeEvidence: z.literal(true),
|
|
9
|
+
includeConflicts: z.literal(true),
|
|
10
|
+
includeFailures: z.literal(true),
|
|
11
|
+
includeResidualRisk: z.literal(true),
|
|
12
|
+
includeNextAction: z.literal(true),
|
|
13
|
+
})
|
|
14
|
+
.strict();
|
|
15
|
+
const parallelBatchTaskSchema = z
|
|
16
|
+
.object({
|
|
17
|
+
id: z.string().min(1),
|
|
18
|
+
category: z.enum(parallelBatchCategories),
|
|
19
|
+
agentName: z.string().min(1),
|
|
20
|
+
workspaceRoot: z.string().min(1),
|
|
21
|
+
allowedTools: z.array(z.string().min(1)).min(1),
|
|
22
|
+
scopeSummary: z.string().min(1),
|
|
23
|
+
independenceRationale: z.string().min(1),
|
|
24
|
+
riskTier: z.enum(parallelBatchRiskTiers),
|
|
25
|
+
requiresPreflight: z.boolean(),
|
|
26
|
+
targetPaths: z.array(z.string().min(1)).optional(),
|
|
27
|
+
dependsOn: z.array(z.string().min(1)).optional(),
|
|
28
|
+
recursiveDelegationAllowed: z.boolean().optional(),
|
|
29
|
+
})
|
|
30
|
+
.strict();
|
|
3
31
|
export const RUNS_MCP_TOOL_INPUT_SCHEMAS = {
|
|
4
32
|
vgxness_run_list: z
|
|
5
33
|
.object({
|
|
@@ -13,6 +41,16 @@ export const RUNS_MCP_TOOL_INPUT_SCHEMAS = {
|
|
|
13
41
|
id: z.string().min(1),
|
|
14
42
|
})
|
|
15
43
|
.passthrough(),
|
|
44
|
+
vgxness_run_parallel_batch_validate: z
|
|
45
|
+
.object({
|
|
46
|
+
maxConcurrency: z.number().int().min(1).optional(),
|
|
47
|
+
defaultMaxConcurrency: z.number().int().min(1).optional(),
|
|
48
|
+
hardMaxConcurrency: z.number().int().min(1).optional(),
|
|
49
|
+
allowedAgentNames: z.array(z.string().min(1)).optional(),
|
|
50
|
+
tasks: z.array(parallelBatchTaskSchema).min(1),
|
|
51
|
+
synthesis: parallelBatchSynthesisSchema,
|
|
52
|
+
})
|
|
53
|
+
.strict(),
|
|
16
54
|
vgxness_run_preflight: z
|
|
17
55
|
.object({
|
|
18
56
|
runId: z.string().min(1),
|
|
@@ -30,6 +30,123 @@ export function validateRunGetInput(input, tool) {
|
|
|
30
30
|
return id;
|
|
31
31
|
return { ok: true, value: { id: id.value } };
|
|
32
32
|
}
|
|
33
|
+
const parallelBatchCategories = ['analysis', 'verification', 'research', 'sdd', 'codebase-investigation', 'debugging', 'code-review', 'implementation'];
|
|
34
|
+
const parallelBatchRiskTiers = ['read-only', 'risky', 'mutation'];
|
|
35
|
+
export function validateRunParallelBatchValidateInput(input, tool) {
|
|
36
|
+
const record = inputRecord(input, tool, [
|
|
37
|
+
'maxConcurrency',
|
|
38
|
+
'defaultMaxConcurrency',
|
|
39
|
+
'hardMaxConcurrency',
|
|
40
|
+
'allowedAgentNames',
|
|
41
|
+
'tasks',
|
|
42
|
+
'synthesis',
|
|
43
|
+
]);
|
|
44
|
+
if (!record.ok)
|
|
45
|
+
return record;
|
|
46
|
+
const result = {};
|
|
47
|
+
for (const field of ['maxConcurrency', 'defaultMaxConcurrency', 'hardMaxConcurrency']) {
|
|
48
|
+
if (record.value[field] === undefined)
|
|
49
|
+
continue;
|
|
50
|
+
if (!Number.isInteger(record.value[field]) || record.value[field] < 1)
|
|
51
|
+
return validationFailure(`${field} must be a positive integer`, tool);
|
|
52
|
+
result[field] = record.value[field];
|
|
53
|
+
}
|
|
54
|
+
const allowedAgentNames = readOptionalStringArray(record.value, 'allowedAgentNames', tool);
|
|
55
|
+
if (!allowedAgentNames.ok)
|
|
56
|
+
return allowedAgentNames;
|
|
57
|
+
if (allowedAgentNames.value !== undefined)
|
|
58
|
+
result.allowedAgentNames = allowedAgentNames.value;
|
|
59
|
+
const tasks = readParallelBatchTasks(record.value.tasks, tool);
|
|
60
|
+
if (!tasks.ok)
|
|
61
|
+
return tasks;
|
|
62
|
+
result.tasks = tasks.value;
|
|
63
|
+
const synthesis = readParallelBatchSynthesis(record.value.synthesis, tool);
|
|
64
|
+
if (!synthesis.ok)
|
|
65
|
+
return synthesis;
|
|
66
|
+
result.synthesis = synthesis.value;
|
|
67
|
+
return { ok: true, value: result };
|
|
68
|
+
}
|
|
69
|
+
function readParallelBatchTasks(value, tool) {
|
|
70
|
+
if (!Array.isArray(value) || value.length === 0)
|
|
71
|
+
return validationFailure('tasks must be a non-empty array', tool);
|
|
72
|
+
const tasks = [];
|
|
73
|
+
for (const [index, item] of value.entries()) {
|
|
74
|
+
const record = asRecord(item, tool, `tasks[${index}] must be an object`);
|
|
75
|
+
if (!record.ok)
|
|
76
|
+
return record;
|
|
77
|
+
const unexpected = Object.keys(record.value).find((key) => !['id', 'category', 'agentName', 'workspaceRoot', 'allowedTools', 'scopeSummary', 'independenceRationale', 'riskTier', 'requiresPreflight', 'targetPaths', 'dependsOn', 'recursiveDelegationAllowed'].includes(key));
|
|
78
|
+
if (unexpected !== undefined)
|
|
79
|
+
return validationFailure(`Unexpected tasks[${index}] field: ${unexpected}`, tool);
|
|
80
|
+
const id = readNonEmptyString(record.value, 'id', tool);
|
|
81
|
+
if (!id.ok)
|
|
82
|
+
return id;
|
|
83
|
+
const category = readRequiredOneOf(record.value, 'category', parallelBatchCategories, tool);
|
|
84
|
+
if (!category.ok)
|
|
85
|
+
return category;
|
|
86
|
+
const agentName = readNonEmptyString(record.value, 'agentName', tool);
|
|
87
|
+
if (!agentName.ok)
|
|
88
|
+
return agentName;
|
|
89
|
+
const workspaceRoot = readNonEmptyString(record.value, 'workspaceRoot', tool);
|
|
90
|
+
if (!workspaceRoot.ok)
|
|
91
|
+
return workspaceRoot;
|
|
92
|
+
const allowedTools = readRequiredStringArray(record.value, 'allowedTools', tool);
|
|
93
|
+
if (!allowedTools.ok)
|
|
94
|
+
return allowedTools;
|
|
95
|
+
const scopeSummary = readNonEmptyString(record.value, 'scopeSummary', tool);
|
|
96
|
+
if (!scopeSummary.ok)
|
|
97
|
+
return scopeSummary;
|
|
98
|
+
const independenceRationale = readNonEmptyString(record.value, 'independenceRationale', tool);
|
|
99
|
+
if (!independenceRationale.ok)
|
|
100
|
+
return independenceRationale;
|
|
101
|
+
const riskTier = readRequiredOneOf(record.value, 'riskTier', parallelBatchRiskTiers, tool);
|
|
102
|
+
if (!riskTier.ok)
|
|
103
|
+
return riskTier;
|
|
104
|
+
if (typeof record.value.requiresPreflight !== 'boolean')
|
|
105
|
+
return validationFailure('requiresPreflight must be a boolean', tool);
|
|
106
|
+
const task = {
|
|
107
|
+
id: id.value,
|
|
108
|
+
category: category.value,
|
|
109
|
+
agentName: agentName.value,
|
|
110
|
+
workspaceRoot: workspaceRoot.value,
|
|
111
|
+
allowedTools: allowedTools.value,
|
|
112
|
+
scopeSummary: scopeSummary.value,
|
|
113
|
+
independenceRationale: independenceRationale.value,
|
|
114
|
+
riskTier: riskTier.value,
|
|
115
|
+
requiresPreflight: record.value.requiresPreflight,
|
|
116
|
+
};
|
|
117
|
+
const targetPaths = readOptionalStringArray(record.value, 'targetPaths', tool);
|
|
118
|
+
if (!targetPaths.ok)
|
|
119
|
+
return targetPaths;
|
|
120
|
+
if (targetPaths.value !== undefined)
|
|
121
|
+
task.targetPaths = targetPaths.value;
|
|
122
|
+
const dependsOn = readOptionalStringArray(record.value, 'dependsOn', tool);
|
|
123
|
+
if (!dependsOn.ok)
|
|
124
|
+
return dependsOn;
|
|
125
|
+
if (dependsOn.value !== undefined)
|
|
126
|
+
task.dependsOn = dependsOn.value;
|
|
127
|
+
if (record.value.recursiveDelegationAllowed !== undefined) {
|
|
128
|
+
if (typeof record.value.recursiveDelegationAllowed !== 'boolean')
|
|
129
|
+
return validationFailure('recursiveDelegationAllowed must be a boolean', tool);
|
|
130
|
+
task.recursiveDelegationAllowed = record.value.recursiveDelegationAllowed;
|
|
131
|
+
}
|
|
132
|
+
tasks.push(task);
|
|
133
|
+
}
|
|
134
|
+
return { ok: true, value: tasks };
|
|
135
|
+
}
|
|
136
|
+
function readParallelBatchSynthesis(value, tool) {
|
|
137
|
+
const record = asRecord(value, tool, 'synthesis must be an object');
|
|
138
|
+
if (!record.ok)
|
|
139
|
+
return record;
|
|
140
|
+
const required = ['required', 'includeEvidence', 'includeConflicts', 'includeFailures', 'includeResidualRisk', 'includeNextAction'];
|
|
141
|
+
const unexpected = Object.keys(record.value).find((key) => !required.includes(key));
|
|
142
|
+
if (unexpected !== undefined)
|
|
143
|
+
return validationFailure(`Unexpected synthesis field: ${unexpected}`, tool);
|
|
144
|
+
for (const field of required) {
|
|
145
|
+
if (record.value[field] !== true)
|
|
146
|
+
return validationFailure(`synthesis.${field} must be true`, tool);
|
|
147
|
+
}
|
|
148
|
+
return { ok: true, value: record.value };
|
|
149
|
+
}
|
|
33
150
|
export function validateRunPreflightInput(input, tool) {
|
|
34
151
|
const record = inputRecord(input, tool, [
|
|
35
152
|
'runId',
|
|
@@ -5,7 +5,7 @@ import { asRecord, readString, toValidationResultFailure, validationFailure, val
|
|
|
5
5
|
import { validateGovernanceReportInput } from './validation/governance.js';
|
|
6
6
|
import { validateMemoryGetInput, validateMemorySaveInput, validateMemorySearchInput, validateMemoryUpdateInput } from './validation/memory.js';
|
|
7
7
|
import { validateProviderChangePlanInput, validateProviderHealthInput } from './validation/providers.js';
|
|
8
|
-
import { validateRunCheckpointInput, validateRunFinalizeInput, validateRunGetInput, validateRunListInput, validateRunPreflightInput, validateRunResumeCandidatesInput, validateRunResumeGateInput, validateRunResumeInspectInput, validateRunStartInput, validateRunTaskGrantCreateInput, validateRunTaskGrantGetInput, validateRunTaskGrantListInput, validateRunTaskGrantPreviewMatchInput, validateRunTaskGrantRevokeInput, } from './validation/runs.js';
|
|
8
|
+
import { validateRunCheckpointInput, validateRunFinalizeInput, validateRunGetInput, validateRunListInput, validateRunParallelBatchValidateInput, validateRunPreflightInput, validateRunResumeCandidatesInput, validateRunResumeGateInput, validateRunResumeInspectInput, validateRunStartInput, validateRunTaskGrantCreateInput, validateRunTaskGrantGetInput, validateRunTaskGrantListInput, validateRunTaskGrantPreviewMatchInput, validateRunTaskGrantRevokeInput, } from './validation/runs.js';
|
|
9
9
|
import { validateContextCockpitInput, validateResumeContextInput, validateSddAcceptArtifactInput, validateSddCockpitInput, validateSddContinueInput, validateSddGetArtifactInput, validateSddGetReadinessInput, validateSddListArtifactsInput, validateSddNextInput, validateSddReadyInput, validateSddReopenArtifactInput, validateSddSaveArtifactInput, validateSddStatusInput, } from './validation/sdd.js';
|
|
10
10
|
import { validateSessionAppendActivityInput, validateSessionCloseInput, validateSessionRestoreInput, validateSessionStartInput, } from './validation/sessions.js';
|
|
11
11
|
import { validateSkillActivateInput, validateSkillCreateDraftInput, validateSkillGetEvaluationInput, validateSkillGetInput, validateSkillIndexInput, validateSkillListEvaluationsInput, validateSkillListImprovementProposalsInput, validateSkillPayloadInput, validateSkillProposeImprovementInput, validateSkillPublishVersionInput, validateSkillRecordUsageInput, validateSkillRequestEvaluationInput, validateSkillSearchInput, validateSkillStatusInput, validateSkillUpdateDraftInput, } from './validation/skills.js';
|
|
@@ -113,6 +113,8 @@ export function validateVgxMcpToolCall(call) {
|
|
|
113
113
|
return validationSuccess(tool.value, validateRunListInput(input, tool.value));
|
|
114
114
|
case 'vgxness_run_get':
|
|
115
115
|
return validationSuccess(tool.value, validateRunGetInput(input, tool.value));
|
|
116
|
+
case 'vgxness_run_parallel_batch_validate':
|
|
117
|
+
return validationSuccess(tool.value, validateRunParallelBatchValidateInput(input, tool.value));
|
|
116
118
|
case 'vgxness_run_preflight':
|
|
117
119
|
return validationSuccess(tool.value, validateRunPreflightInput(input, tool.value));
|
|
118
120
|
case 'vgxness_run_task_grant_create':
|
package/docs/architecture.md
CHANGED
|
@@ -93,7 +93,7 @@ Gentle-AI/`gentle-pi` are strong references for the configurator and agent-behav
|
|
|
93
93
|
|
|
94
94
|
### Agent registry self-healing
|
|
95
95
|
|
|
96
|
-
The canonical agent manifest in `src/domain/agents/canonical-agent-manifest.ts` is the source of truth for built-in agents (1 manager + 10
|
|
96
|
+
The canonical agent manifest in `src/domain/agents/canonical-agent-manifest.ts` is the source of truth for built-in agents (1 manager + 10 generic capability subagents). At every CLI/MCP boot, `src/application/agents/boot-upgrade.ts` reconciles the live `agents` table with that manifest via `src/application/agents/agent-seed-upgrade-service.ts`: missing rows are created, drifted rows (changed `vgxnessPromptContractVersion`, instructions, adapters, or description) are overwritten, and matches are recorded as noop. Each non-noop outcome is appended to the `agent_seed_history` table for audit. Operators can opt out with `VGXNESS_SKIP_AGENT_SEED_AUTO_UPGRADE=1`. This eliminates the long-standing drift between the canonical prompt contract and stored agent rows after a version bump. The old `src/agents/*` paths remain compatibility facades during the migration window.
|
|
97
97
|
|
|
98
98
|
### Manager overlay parity across providers
|
|
99
99
|
|
|
@@ -160,7 +160,7 @@ The CLI exposes the same boundary through `vgxness sdd status|ready|save-artifac
|
|
|
160
160
|
|
|
161
161
|
Long term, SDD orchestration must combine two mechanisms:
|
|
162
162
|
|
|
163
|
-
1. **Agent behavior** — orchestrator prompts,
|
|
163
|
+
1. **Agent behavior** — orchestrator prompts, reusable capability subagents/chains, skills, per-phase models, and strict TDD instructions rendered into tools such as OpenCode, Claude Code, or Pi.
|
|
164
164
|
2. **Product state** — workflow definitions, prerequisites, artifacts, approvals, runs, checkpoints, verification results, and archive status stored locally and queried before advancing.
|
|
165
165
|
|
|
166
166
|
The first mechanism makes agents effective. The second makes the workflow enforceable and inspectable. `vgxness` should not rely on either one alone.
|
|
@@ -471,7 +471,7 @@ The envelope is always `installable:false` and `readOnly:true`. It does **not**
|
|
|
471
471
|
|
|
472
472
|
### OpenCode manager orchestration
|
|
473
473
|
|
|
474
|
-
The checked-in OpenCode default config and `seeds/agents/agent-seed-v1.json` define `vgxness-manager` as an MCP-first orchestrator. The manager should use `vgxness_session_restore` with the project and workspace directory when starting, resuming, or recovering context, then use SDD artifact/status tools, memory tools, agent resolution, run/preflight tools, and read-only payload/profile previews before delegating substantial
|
|
474
|
+
The checked-in OpenCode default config and `seeds/agents/agent-seed-v1.json` define `vgxness-manager` as an MCP-first orchestrator. The manager should use `vgxness_session_restore` with the project and workspace directory when starting, resuming, or recovering context, then use SDD artifact/status tools, memory tools, agent resolution, run/preflight tools, and read-only payload/profile previews before delegating substantial work to exact capability subagents. Before ending, pausing, handing off, or compacting, it should call `vgxness_session_close` with the current session id, actor `manager`, and an actionable summary; if no current session id is available, it must not invent one and should preserve the summary in its final response. Its OpenCode `permission.task` remains deny-by-default: `*` is denied and only the canonical capability subagent names plus legacy `vgxness-sdd-*` aliases are allowed explicitly. The seed/default prompts are self-contained and do not require external provider-native skill files; optional guidance should live in VGXNESS registry assets unless a future provider-native integration is explicitly designed.
|
|
475
475
|
|
|
476
476
|
## Run lifecycle
|
|
477
477
|
|
package/docs/cli.md
CHANGED
|
@@ -46,7 +46,7 @@ Release defaults used by the guided setup are:
|
|
|
46
46
|
- Provider: OpenCode.
|
|
47
47
|
- Database: global user data location by default.
|
|
48
48
|
- OpenCode/Claude provider config: user-global only for VGX-managed writes (`$HOME/.config/opencode/opencode.json`, `~/.claude.json`, `~/.claude/agents/*.md`, `~/.claude/CLAUDE.md`).
|
|
49
|
-
- Install mode: MCP plus manager/
|
|
49
|
+
- Install mode: MCP plus manager/capability agents (`mcp-plus-agents`).
|
|
50
50
|
- Public CLI language: English.
|
|
51
51
|
|
|
52
52
|
Recommended bootstrap and diagnostic flow after `npm install -g vgxness`:
|
|
@@ -66,7 +66,7 @@ vgxness resume --project <project> --run-id <id>
|
|
|
66
66
|
vgxness setup rollback --backup <path>
|
|
67
67
|
```
|
|
68
68
|
|
|
69
|
-
Daily SDD phase progression is OpenCode-first: talk to OpenCode with the VGXNESS MCP server installed, and let the hidden
|
|
69
|
+
Daily SDD phase progression is OpenCode-first: talk to OpenCode with the VGXNESS MCP server installed, and let the hidden capability subagents use MCP tools for phase or general capability work. The CLI and TUI remain supported for bootstrap/setup, diagnostics, recovery, manual fallback, and scripting; they are not the primary daily surface.
|
|
70
70
|
|
|
71
71
|
`setup plan`, `setup status`, and non-TTY `init` planning do not write provider config. Local VGXNESS store initialization may occur when the selected SQLite store is needed. They are human-readable by default; pass `--json` when you need parseable automation output. With the default global database, the OpenCode MCP command is `vgxness mcp start`; for custom/project-local DBs it includes `--db <path>`. The default and only VGX-managed OpenCode target is `$HOME/.config/opencode/opencode.json`; Claude managed targets are user-global (`~/.claude.json`, `~/.claude/agents/*.md`, and `~/.claude/CLAUDE.md`). `setup apply --yes` is the explicit provider-config write path. `setup rollback --backup <path>` validates a VGXNESS/OpenCode backup such as `opencode.json.backup-<timestamp>`, creates a pre-rollback backup of the current user-global target when present, restores the selected backup byte-for-byte, and recommends `vgxness doctor`.
|
|
72
72
|
|
|
@@ -76,7 +76,7 @@ Daily SDD phase progression is OpenCode-first: talk to OpenCode with the VGXNESS
|
|
|
76
76
|
|
|
77
77
|
## Daily workflow front doors
|
|
78
78
|
|
|
79
|
-
Use OpenCode conversation + VGXNESS MCP + hidden
|
|
79
|
+
Use OpenCode conversation + VGXNESS MCP + hidden capability subagents for normal daily SDD work. Use these top-level commands when you need diagnostics, recovery, manual fallback, or scriptable state inspection:
|
|
80
80
|
|
|
81
81
|
| Question | Command | Purpose |
|
|
82
82
|
|---|---|---|
|
|
@@ -87,7 +87,7 @@ Use OpenCode conversation + VGXNESS MCP + hidden SDD subagents for normal daily
|
|
|
87
87
|
|
|
88
88
|
Without `--change`, `--project`, or `--run-id`, these commands stay orientation-only and do not open the local memory store. With a selected change, project, or run, top-level `status`, `next`, and `resume` inspect SQLite read-only; formal `sdd` commands are non-provider, non-run-executing planning/artifact commands that may use the normal local store path. Pass `--json` for automation.
|
|
89
89
|
|
|
90
|
-
The usual SDD operator loop happens inside OpenCode: continue the phase in conversation while VGXNESS MCP and hidden
|
|
90
|
+
The usual SDD operator loop happens inside OpenCode: continue the phase in conversation while VGXNESS MCP and hidden capability subagents inspect readiness, persist artifacts, and report evidence. CLI commands remain fallback/recovery tools: inspect `status`, ask `next`, run `sdd continue` for a read-only continuation plan, or run `vgxness resume ...` for interrupted work. After a draft is ready, use `sdd accept-artifact` for explicit human acceptance; if an artifact was rejected, use `sdd reopen-artifact` to return it to draft before editing.
|
|
91
91
|
|
|
92
92
|
## Bun-first repository verification
|
|
93
93
|
|
|
@@ -293,7 +293,7 @@ Safety boundary: this is a preview only. It does **not** call providers, edit fi
|
|
|
293
293
|
|
|
294
294
|
## Code runtime CLI (`vgxness code`)
|
|
295
295
|
|
|
296
|
-
The experimental `vgxness code` runtime remains unavailable. Do not use `vgxness code` as an SDD fallback. Continue SDD phases in OpenCode conversation with VGXNESS MCP and hidden
|
|
296
|
+
The experimental `vgxness code` runtime remains unavailable. Do not use `vgxness code` as an SDD fallback. Continue SDD phases in OpenCode conversation with VGXNESS MCP and hidden capability subagents, and use `vgxness status`, `vgxness next`, `vgxness sdd continue`, or `vgxness resume` for safe CLI diagnostics and recovery.
|
|
297
297
|
|
|
298
298
|
## Workflow CLI
|
|
299
299
|
|
|
@@ -541,7 +541,7 @@ Manual/opt-in runtime validation checklist (not normal CI):
|
|
|
541
541
|
|
|
542
542
|
## SDD workflow examples
|
|
543
543
|
|
|
544
|
-
Use OpenCode conversation with VGXNESS MCP and hidden
|
|
544
|
+
Use OpenCode conversation with VGXNESS MCP and hidden capability subagents for normal daily SDD progression. Use `sdd` commands to inspect local SDD artifact state and save, read, or list phase artifacts for diagnostics, recovery, scripting, or manual fallback. These commands read and write only the selected `vgxness` local SQLite memory store: `--db <path>` when passed, `VGXNESS_DB_PATH` when set, or the global default database when neither override is present.
|
|
545
545
|
|
|
546
546
|
```bash
|
|
547
547
|
bun run cli:bun -- sdd status --project vgxness --change sdd-workflow-engine --db /tmp/vgxness-memory.sqlite
|
|
@@ -590,7 +590,7 @@ This seed file is repo-only in v1.3.0 package contents. If installed-package wor
|
|
|
590
590
|
|
|
591
591
|
The command prints an `AgentSeedLoadSummary` JSON payload with `created`, `updated`, `agents`, `subagents`, and `warnings`. Re-running the same seed is safe: records are upserted by the current project, scope, and name, so existing seed records are updated in place instead of duplicated.
|
|
592
592
|
|
|
593
|
-
The checked-in `vgxness-manager` and
|
|
593
|
+
The checked-in `vgxness-manager` and capability subagents are self-contained: their seed instructions describe the MCP-first orchestration contract inline and do not require external provider-native skill directories. SDD skills can still be registered and attached as optional VGXNESS registry assets when a project wants extra reusable guidance.
|
|
594
594
|
|
|
595
595
|
Seed loading preserves user-created agents that are absent from the manifest. It only writes to the selected local registry database (`--db`, `VGXNESS_DB_PATH`, or the global default); it does **not** create `.opencode/`, `.claude/`, provider config, or user/global OpenCode configuration.
|
|
596
596
|
|
package/docs/glossary.md
CHANGED
|
@@ -32,7 +32,7 @@ The canonical installed CLI/MCP runtime and verification path. Required `>= 1.3.
|
|
|
32
32
|
|
|
33
33
|
## Canonical agent manifest
|
|
34
34
|
|
|
35
|
-
The built-in, validated manifest that defines the manager agent and
|
|
35
|
+
The built-in, validated manifest that defines the manager agent and generic capability subagents (`vgxness-explore`, `vgxness-propose`, `vgxness-requirements`, `vgxness-design`, `vgxness-plan`, `vgxness-apply`, `vgxness-verify`, `vgxness-archive`, `vgxness-init`, and `vgxness-onboard`). Legacy `vgxness-sdd-*` task names remain callable as compatibility aliases, but the canonical provider-facing names are no longer SDD-prefixed. Lives in `src/domain/agents/canonical-agent-manifest.ts` with old-path compatibility through `src/agents/canonical-agent-manifest.ts`. `promptContractVersion` increments on breaking contract changes.
|
|
36
36
|
|
|
37
37
|
## Change (SDD)
|
|
38
38
|
|
package/docs/mcp.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# MCP tools
|
|
2
2
|
|
|
3
|
-
VGXNESS exposes
|
|
3
|
+
VGXNESS exposes 63 typed MCP tools over stdio through `vgxness mcp start`. The canonical list is the `SUPPORTED_VGX_MCP_TOOL_NAMES` array in `src/mcp/schema.ts` — treat that as the source of truth. The list below mirrors it; if a tool appears here that is not in the array, or vice versa, the array wins.
|
|
4
4
|
|
|
5
5
|
Tools are exposed under the `vgxness_*` prefix. Some MCP hosts strip the prefix and accept the short form (`sdd_status`, `memory_save`, etc.). The schema accepts both.
|
|
6
6
|
|
|
@@ -83,12 +83,13 @@ Payload tools that accept `agentId` resolve it as a canonical registry id first.
|
|
|
83
83
|
| `vgxness_opencode_manager_payload` | Build the OpenCode manager payload envelope. | `OpenCodeManagerPayloadInput` shape (project, scope, agent, workflow/phase, workspaceRoot, maxSourceBytes, payloadMode) | `installable: false`, `readOnly: true`. |
|
|
84
84
|
| `vgxness_opencode_handoff_preview` | Compose a full handoff preview: provider artifacts + skill diagnostics + SDD status + provider status + safety flags. | `project`; optional `scope`, `agentId`, `agentName`, `workspaceRoot`, `maxSourceBytes`, `change`, `phase` | Read-only preview. Does not execute OpenCode, install hooks, write provider config, or capture memory candidates. |
|
|
85
85
|
|
|
86
|
-
## Runs (
|
|
86
|
+
## Runs (15)
|
|
87
87
|
|
|
88
88
|
| Tool | Purpose | Required inputs | Notes |
|
|
89
89
|
|---|---|---|---|
|
|
90
90
|
| `vgxness_run_list` | List runs with filters. | `limit`; optional `project`, `status` (one of the 8 `RunStatus` values) | |
|
|
91
91
|
| `vgxness_run_get` | Read a run with `events`, `checkpoints`, `approvals`, `operationAttempts`. | `id` | |
|
|
92
|
+
| `vgxness_run_parallel_batch_validate` | Validate a bounded parallel subagent batch plan before provider-native launch. | `tasks`, `synthesis`; optional `maxConcurrency`, `defaultMaxConcurrency`, `hardMaxConcurrency`, `allowedAgentNames` | Read-only validation surface. Default concurrency is 3 unless configured. Does not launch subagents, invoke providers, mutate runs, or write SDD artifacts; it returns launch guidance for OpenCode native delegation. |
|
|
92
93
|
| `vgxness_run_start` | Create a run record. | `CreateRunInput` shape | |
|
|
93
94
|
| `vgxness_run_checkpoint` | Append a resumable JSON state. | `AppendRunCheckpointInput` shape | |
|
|
94
95
|
| `vgxness_run_finalize` | Finalize a run with `outcome` and `outcomeReason`. | `FinalizeRunInput` shape | `outcome` must match a terminal `status`. Re-finalization is rejected. May return advisory `memoryCapture` candidates from bounded finalization fields; candidates are not persisted automatically. |
|
|
@@ -161,6 +162,20 @@ vgxness_run_finalize { runId, outcome: "success", outcomeReason: "..." }
|
|
|
161
162
|
|
|
162
163
|
`vgxness_run_preflight` output includes `workspaceStrategy` with one of `current-checkout`, `branch`, `manual-worktree`, or `stacked-prs`. This is advisory planning metadata only. Its execution guarantees are always non-mutating (`createsBranch:false`, `createsWorktree:false`, `createsPullRequest:false`, `mutatesRepository:false`, `mutatesProviderConfig:false`). Treat `manual-worktree` and `stacked-prs` as instructions for a human or future executor to arrange review/isolation deliberately before mutation, not as evidence that VGXNESS already created Git state.
|
|
163
164
|
|
|
165
|
+
Validating a parallel subagent batch before provider-native launch:
|
|
166
|
+
|
|
167
|
+
```text
|
|
168
|
+
vgxness_run_parallel_batch_validate {
|
|
169
|
+
maxConcurrency: 3,
|
|
170
|
+
tasks: [
|
|
171
|
+
{ id, category: "analysis", agentName, workspaceRoot, allowedTools, scopeSummary, independenceRationale, riskTier: "read-only", requiresPreflight: false }
|
|
172
|
+
],
|
|
173
|
+
synthesis: { required: true, includeEvidence: true, includeConflicts: true, includeFailures: true, includeResidualRisk: true, includeNextAction: true }
|
|
174
|
+
}
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
`vgxness_run_parallel_batch_validate` is a guardrail, not an executor. It checks batch size, configured concurrency, independent tasks, allowlisted agents, no recursive delegation, implementation preflight requirements, and synthesis obligations. When validation succeeds, the manager may use the provider's native subagent/delegation capability (for example OpenCode native delegation) while respecting the validated `maxConcurrency`. MCP itself does not launch or monitor those subagents.
|
|
178
|
+
|
|
164
179
|
Finding interrupted runs when the run id is unknown:
|
|
165
180
|
|
|
166
181
|
```text
|
|
@@ -177,6 +192,7 @@ MCP tools do not:
|
|
|
177
192
|
|
|
178
193
|
- Write project-local provider config (`.opencode/`, `.mcp.json`, `.claude/`, project-root `CLAUDE.md`). VGX-managed OpenCode and Claude writes are user-global only and must stay behind explicit install/apply confirmation outside read-only status/preview tools.
|
|
179
194
|
- Execute providers (`opencode`, `claude`, etc.).
|
|
195
|
+
- Launch subagents. Parallel subagent launch is provider-native after `vgxness_run_parallel_batch_validate` succeeds; MCP validates only.
|
|
180
196
|
- Install global memory.
|
|
181
197
|
- Persist `memoryCapture` lifecycle candidates automatically or use them as proof of SDD acceptance, readiness, verification, approval, or authorization.
|
|
182
198
|
- Create `openspec/`.
|
package/docs/safety.md
CHANGED
|
@@ -68,6 +68,20 @@ The experimental `vgxness code` runtime approval flow was removed with `src/code
|
|
|
68
68
|
|
|
69
69
|
The gateway is conservative by default: a non-`read` tool in a non-`apply-progress` phase defaults to `ask`. Even with `--approval-policy allow`, the gateway can re-promote to `ask` for risky categories or workspace boundary issues.
|
|
70
70
|
|
|
71
|
+
## Parallel subagent delegation
|
|
72
|
+
|
|
73
|
+
Parallel delegation is provider-native, not an MCP executor. The manager may decide to fan out independent analysis, verification, research, review, debugging, SDD drafting/review, or context-scoped implementation work, but the plan should pass through `vgxness_run_parallel_batch_validate` first when using the VGXNESS MCP control plane.
|
|
74
|
+
|
|
75
|
+
`vgxness_run_parallel_batch_validate` is read-only and validates only:
|
|
76
|
+
|
|
77
|
+
- default concurrency is 3 unless a smaller/larger bounded value is configured;
|
|
78
|
+
- every task must declare category, agent, workspace root, allowed tools, scope, independence rationale, risk tier, and preflight requirement;
|
|
79
|
+
- same-batch dependencies and recursive delegation are rejected;
|
|
80
|
+
- implementation tasks require target paths and preflight declaration;
|
|
81
|
+
- synthesis must include evidence, conflicts, failures, residual risk, and next action.
|
|
82
|
+
|
|
83
|
+
The MCP tool does not launch subagents, invoke providers, mutate run state, write artifacts, or monitor provider-native executions. OpenCode or another provider performs the actual subagent launch after validation, and normal preflight/approval rules still apply to risky or mutating work.
|
|
84
|
+
|
|
71
85
|
## Task-scoped external command grants
|
|
72
86
|
|
|
73
87
|
Task-scoped command grants are a narrow V1 escape hatch for a human to authorize a bounded external working directory for an allowlisted command preflight. They only convert an eligible `ask` decision to an audited `allow`; they never convert `deny` or hard-risk requests to `allow`, and apply/implementation work still requires the normal SDD governance gates.
|