vgxness 1.9.2 → 1.9.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (46) hide show
  1. package/README.md +12 -6
  2. package/dist/agents/agent-resolver.js +33 -3
  3. package/dist/agents/canonical-agent-manifest.js +68 -21
  4. package/dist/agents/canonical-agent-projection.js +46 -4
  5. package/dist/cli/cli-help.js +14 -3
  6. package/dist/cli/commands/index.js +1 -0
  7. package/dist/cli/commands/interactive-entrypoint-dispatcher.js +8 -0
  8. package/dist/cli/commands/mcp-dispatcher.js +49 -18
  9. package/dist/cli/commands/memory-sdd-dispatcher.js +71 -5
  10. package/dist/cli/commands/setup-dispatcher.js +22 -10
  11. package/dist/cli/commands/status-dispatcher.js +130 -0
  12. package/dist/cli/commands/workflow-dispatcher.js +11 -5
  13. package/dist/cli/dispatcher.js +9 -1
  14. package/dist/cli/product-resume-renderer.js +32 -0
  15. package/dist/cli/product-status-renderer.js +81 -0
  16. package/dist/cli/sdd-renderer.js +90 -7
  17. package/dist/cli/tui/main-menu/main-menu-read-model.js +8 -8
  18. package/dist/cli/tui/setup/setup-tui-services.js +27 -10
  19. package/dist/code/cli/code-command.js +7 -4
  20. package/dist/code/reporting/summary.js +4 -1
  21. package/dist/code/runtime/code-runtime.js +27 -4
  22. package/dist/code/runtime/sdd-context.js +18 -2
  23. package/dist/governance/governance-report-builder.js +18 -7
  24. package/dist/mcp/claude-code-agent-config.js +10 -4
  25. package/dist/mcp/client-install-opencode-contract.js +2 -2
  26. package/dist/mcp/client-install-opencode.js +10 -6
  27. package/dist/mcp/control-plane.js +56 -0
  28. package/dist/mcp/opencode-default-agent-config.js +7 -4
  29. package/dist/mcp/provider-status.js +86 -81
  30. package/dist/mcp/schema.js +25 -7
  31. package/dist/mcp/stdio-server.js +4 -0
  32. package/dist/mcp/validation.js +39 -3
  33. package/dist/resume/product-resume.js +166 -0
  34. package/dist/runs/repositories/runs.js +12 -1
  35. package/dist/runs/run-service.js +62 -5
  36. package/dist/sdd/schema.js +8 -0
  37. package/dist/sdd/sdd-continuation-plan.js +81 -0
  38. package/dist/sdd/sdd-workflow-service.js +103 -16
  39. package/dist/skills/skill-resolver.js +21 -4
  40. package/dist/status/product-status.js +121 -0
  41. package/docs/architecture.md +1 -1
  42. package/docs/cli.md +40 -12
  43. package/docs/code-runtime.md +3 -0
  44. package/docs/glossary.md +1 -1
  45. package/docs/mcp.md +18 -4
  46. package/package.json +1 -1
package/README.md CHANGED
@@ -8,7 +8,7 @@ This package is proprietary software. The npm package ships inspectable JavaScri
8
8
 
9
9
  OpenCode is the primary supported provider. Other providers remain preview/manual only. Provider config writes require explicit CLI confirmation.
10
10
 
11
- VGXNESS v1.9.1 has a canonical project health audit with validated evidence: 38 MCP tools, 106 test files, and the official Bun validation path passing, including package evidence with `releaseReadiness: pass`. See [Project health audit v1.9.1](./docs/project-health-audit-v1.9.1.md) for the versioned matrix and safety taxonomy.
11
+ VGXNESS v1.9.1 has a canonical project health audit with validated evidence: 38 MCP tools, 106 test files, and the official Bun validation path passing, including package evidence with `releaseReadiness: pass`. Current unreleased builds expose 41 MCP tools after adding read-only SDD/run recovery parity. See [Project health audit v1.9.1](./docs/project-health-audit-v1.9.1.md) for the versioned matrix and safety taxonomy.
12
12
 
13
13
  ## Requirements
14
14
 
@@ -138,13 +138,16 @@ Run the guided setup wizard in a TTY:
138
138
  vgxness init
139
139
  ```
140
140
 
141
- In non-TTY shells, `vgxness init` prints the same read-only setup plan instead of prompting. For a copyable happy path after installing the package globally:
141
+ In non-TTY shells, `vgxness init` prints the same read-only setup plan instead of prompting. For a copyable bootstrap and diagnostic path after installing the package globally:
142
142
 
143
143
  ```bash
144
144
  vgxness setup plan
145
145
  vgxness setup apply --yes
146
146
  vgxness doctor
147
- vgxness sdd next --project <project> --change <change>
147
+ vgxness status --project <project> --change <change>
148
+ vgxness next --project <project> --change <change>
149
+ vgxness sdd continue --project <project> --change <change>
150
+ vgxness code sdd <change> <phase> --project <project> --save-artifact
148
151
  ```
149
152
 
150
153
  Stable defaults are: package `vgxness`, provider `opencode`, global user data DB, user/global OpenCode scope (`$HOME/.config/opencode/opencode.json`), and `mcp-plus-agents` mode. Use `--scope project` only when you intentionally want `<workspace>/.opencode/opencode.json`. The generated MCP command for the global DB default is:
@@ -159,7 +162,9 @@ Apply only after reviewing the plan:
159
162
  vgxness setup apply --yes
160
163
  ```
161
164
 
162
- `vgxness setup plan` and `vgxness setup status` are human-readable and do not write provider config by default; local VGXNESS store initialization may occur when a command needs the selected SQLite store. `vgxness doctor`, `vgxness sdd status`, `vgxness sdd next`, and `vgxness sdd accept-artifact` are also human-readable by default. Pass `--json` when you need parseable automation output. `vgxness setup apply --yes` is the explicit provider-config write path.
165
+ `vgxness setup plan` and `vgxness setup status` are human-readable and do not write provider config by default; local VGXNESS store initialization may occur when a command needs the selected SQLite store. `vgxness doctor`, `vgxness status`, `vgxness next`, `vgxness sdd status`, `vgxness sdd next`, `vgxness sdd continue`, and `vgxness sdd accept-artifact` are also human-readable by default. Pass `--json` when you need parseable automation output. `vgxness setup apply --yes` is the explicit provider-config write path.
166
+
167
+ The daily SDD happy path is OpenCode conversation with the installed VGXNESS MCP server and hidden SDD subagents. Use CLI/TUI commands for bootstrap, setup, diagnostics, recovery, fallback, and scripting: `status`, `next`, and `sdd continue` inspect state and print manual fallback guidance; `code sdd` remains available for an explicit manual fallback run; `resume` helps inspect interrupted work. After a draft is ready, `sdd accept-artifact` records explicit human acceptance, and `sdd reopen-artifact` returns rejected artifacts to draft. Draft-run suggestions are planning-only: human acceptance is still required, and `apply-progress` remains gated.
163
168
 
164
169
  ## Code runtime (`vgxness code`)
165
170
 
@@ -178,11 +183,12 @@ Edits, shell, network, git mutations, SDD persistence, and memory saves route th
178
183
 
179
184
  - Preview, status, and plan commands do not write provider config; local VGXNESS store initialization may occur where the command needs SQLite-backed state.
180
185
  - Provider config writes require explicit `--yes` confirmation.
181
- - Setup/status TUI surfaces are preview-oriented; run copied commands explicitly when you choose to act.
186
+ - Setup/status TUI surfaces are read-only setup, diagnostics, recovery, and fallback surfaces; daily SDD progression stays in OpenCode with VGXNESS MCP.
182
187
  - SDD artifacts are SQLite-backed through VGXNESS services. Do not create or write `openspec/`.
183
188
  - `vgxness sdd accept-artifact` records explicit human-only acceptance; saving a draft never implies acceptance.
189
+ - `vgxness sdd reopen-artifact` is the explicit path from a rejected artifact back to draft before revision.
184
190
  - OpenCode is the primary supported provider; other providers are preview/manual extension points.
185
- - VGXNESS exposes 38 typed MCP tools across SDD, memory, sessions, agents, skills, runs, providers, and verification. See [MCP tools](./docs/mcp.md).
191
+ - VGXNESS exposes 41 typed MCP tools across SDD, memory, sessions, agents, skills, runs, providers, and verification. See [MCP tools](./docs/mcp.md).
186
192
 
187
193
  ## Main menu entrypoint
188
194
 
@@ -1,3 +1,4 @@
1
+ import { normalizeSddPhaseInput } from '../sdd/schema.js';
1
2
  export class AgentResolver {
2
3
  loadAgents;
3
4
  constructor(loadAgents) {
@@ -58,8 +59,10 @@ function normalizeInput(input) {
58
59
  const desiredCapabilities = normalizeList(input.desiredCapabilities ?? []);
59
60
  const taskDescription = normalizeText(input.taskDescription);
60
61
  const intent = normalizeText(input.intent);
62
+ const phase = input.phase === undefined ? undefined : (isSddWorkflow(input.workflow) ? (normalizeSddPhaseInput(input.phase) ?? input.phase) : input.phase);
61
63
  return {
62
64
  ...input,
65
+ ...(phase !== undefined ? { phase } : {}),
63
66
  ...(taskDescription !== undefined ? { taskDescription } : {}),
64
67
  ...(intent !== undefined ? { intent } : {}),
65
68
  desiredCapabilities,
@@ -143,7 +146,7 @@ function workflowMatches(agent, input) {
143
146
  return [...matches.broad, ...matches.phaseOnly, ...matches.exactPhase];
144
147
  }
145
148
  function workflowSignalMatches(agent, input) {
146
- const requested = [input.workflow, input.phase, input.workflow !== undefined && input.phase !== undefined ? `${input.workflow}:${input.phase}` : undefined]
149
+ const requested = workflowRequestedSignals(input)
147
150
  .filter((value) => value !== undefined)
148
151
  .map(normalizeKey);
149
152
  if (requested.length === 0)
@@ -154,17 +157,41 @@ function workflowSignalMatches(agent, input) {
154
157
  const matches = { broad: [], phaseOnly: [], exactPhase: [] };
155
158
  for (const agentWorkflow of agent.workflows) {
156
159
  const normalizedWorkflow = normalizeKey(agentWorkflow);
157
- if (!requested.includes(normalizedWorkflow))
160
+ const comparableWorkflow = canonicalSddWorkflowTargetKey(agentWorkflow);
161
+ if (!requested.includes(normalizedWorkflow) && !requested.includes(comparableWorkflow) && !sddApplyAliasMatches(agentWorkflow, input))
158
162
  continue;
159
- if (exact !== undefined && normalizedWorkflow === exact)
163
+ if (exact !== undefined && (normalizedWorkflow === exact || comparableWorkflow === exact))
160
164
  matches.exactPhase.push(agentWorkflow);
161
165
  else if (phase !== undefined && normalizedWorkflow === phase)
162
166
  matches.phaseOnly.push(agentWorkflow);
167
+ else if (sddApplyAliasMatches(agentWorkflow, input))
168
+ matches.exactPhase.push(agentWorkflow);
163
169
  else
164
170
  matches.broad.push(agentWorkflow);
165
171
  }
166
172
  return matches;
167
173
  }
174
+ function canonicalSddWorkflowTargetKey(workflow) {
175
+ const normalized = normalizeKey(workflow);
176
+ const separator = normalized.indexOf(':');
177
+ if (separator <= 0)
178
+ return normalized;
179
+ const workflowName = normalized.slice(0, separator);
180
+ const phase = normalized.slice(separator + 1);
181
+ if (workflowName !== 'sdd')
182
+ return normalized;
183
+ return `${workflowName}:${normalizeSddPhaseInput(phase) ?? phase}`;
184
+ }
185
+ function workflowRequestedSignals(input) {
186
+ return [input.workflow, input.phase, input.workflow !== undefined && input.phase !== undefined ? `${input.workflow}:${input.phase}` : undefined];
187
+ }
188
+ function sddApplyAliasMatches(agentWorkflow, input) {
189
+ if (input.phase === undefined || normalizeKey(input.phase) !== 'apply')
190
+ return false;
191
+ if (input.workflow !== undefined && !isSddWorkflow(input.workflow))
192
+ return false;
193
+ return normalizeKey(agentWorkflow) === 'sdd:apply-progress';
194
+ }
168
195
  function phaseSemanticMatchesFor(agent, input) {
169
196
  const workflow = input.workflow !== undefined ? normalizeKey(input.workflow) : undefined;
170
197
  if (workflow !== undefined && workflow !== 'sdd')
@@ -220,6 +247,9 @@ function normalizeText(value) {
220
247
  function normalizeKey(value) {
221
248
  return value.trim().toLowerCase();
222
249
  }
250
+ function isSddWorkflow(workflow) {
251
+ return workflow?.trim().toLowerCase() === 'sdd';
252
+ }
223
253
  function tokenize(value) {
224
254
  const seen = new Set();
225
255
  return value
@@ -1,6 +1,8 @@
1
1
  import { canonicalBehaviorContractVersion } from '../behavior/behavior-contract-manifest.js';
2
2
  export const canonicalDefaultAgentName = 'vgxness-manager';
3
- export const canonicalPromptContractVersion = 7;
3
+ export const canonicalOpenCodeDefaultModel = 'openai/gpt-5.5';
4
+ export const canonicalOpenCodeManagerReasoningEffort = 'high';
5
+ export const canonicalPromptContractVersion = 10;
4
6
  export const canonicalSddSubagentNames = [
5
7
  'vgxness-sdd-explore',
6
8
  'vgxness-sdd-propose',
@@ -76,13 +78,25 @@ function managerDefinition() {
76
78
  builtIn: true,
77
79
  name: canonicalDefaultAgentName,
78
80
  description: 'Coordinates VGXNESS MCP state and SDD sub-agents while routing Tier 0-2 lightweight work, Tier 3 preflight validation, and Tier 4 formal SDD.',
79
- instructions: { kind: 'inline', value: registryManagerInstructions },
81
+ instructions: { kind: 'inline', value: registryManagerInstructionsV10 },
80
82
  capabilities: ['sdd-orchestration', 'agent-routing', 'mcp-coordination', 'project-local-automation'],
81
83
  permissions: { read: 'allow', edit: 'ask', shell: 'ask', git: 'ask', memory: 'allow', 'provider-tool': 'deny', secrets: 'deny' },
82
84
  memory: { scopes: ['project'] },
83
85
  workflows: ['explore', 'quickfix', 'plan', 'build', 'debug', 'sdd', 'agent-seeding', 'opencode-install'],
84
86
  skills: ['vgxness-sdd-manager'],
85
- adapters: { opencode: { model: 'openai/gpt-5.5', config: { options: { reasoningEffort: 'high', vgxnessPromptContractVersion: canonicalPromptContractVersion, vgxnessBehaviorContractVersion: canonicalBehaviorContractVersion }, permission: { task: createCanonicalOpenCodeSddTaskPermissions() } } } },
87
+ adapters: {
88
+ opencode: {
89
+ model: canonicalOpenCodeDefaultModel,
90
+ config: {
91
+ options: {
92
+ reasoningEffort: canonicalOpenCodeManagerReasoningEffort,
93
+ vgxnessPromptContractVersion: canonicalPromptContractVersion,
94
+ vgxnessBehaviorContractVersion: canonicalBehaviorContractVersion,
95
+ },
96
+ permission: { task: createCanonicalOpenCodeSddTaskPermissions(), ...createCanonicalOpenCodeSddMcpToolPermissions() },
97
+ },
98
+ },
99
+ },
86
100
  providerSupport: commonSupport(),
87
101
  };
88
102
  }
@@ -101,35 +115,52 @@ function subagentDefinition(name) {
101
115
  memory: { scopes: ['project'] },
102
116
  workflows: data.workflows,
103
117
  skills: data.skills,
104
- adapters: { opencode: { model: 'openai/gpt-5.5', config: { hidden: true, options: { vgxnessPromptContractVersion: canonicalPromptContractVersion, vgxnessBehaviorContractVersion: canonicalBehaviorContractVersion } } } },
118
+ adapters: { opencode: { model: canonicalOpenCodeDefaultModel, config: { hidden: true, options: { vgxnessPromptContractVersion: canonicalPromptContractVersion, vgxnessBehaviorContractVersion: canonicalBehaviorContractVersion } } } },
105
119
  providerSupport: commonSupport(),
106
120
  };
107
121
  }
108
122
  export function createCanonicalOpenCodeSddTaskPermissions() {
109
123
  return Object.fromEntries([['*', 'deny'], ...canonicalSddSubagentNames.map((name) => [name, 'allow'])]);
110
124
  }
125
+ export function createCanonicalOpenCodeSddMcpToolPermissions() {
126
+ return {
127
+ vgxness_sdd_status: 'allow',
128
+ vgxness_sdd_next: 'allow',
129
+ vgxness_sdd_ready: 'allow',
130
+ vgxness_sdd_get_readiness: 'allow',
131
+ vgxness_sdd_get_artifact: 'allow',
132
+ vgxness_sdd_list_artifacts: 'allow',
133
+ vgxness_sdd_cockpit: 'allow',
134
+ vgxness_agent_resolve: 'allow',
135
+ vgxness_sdd_save_artifact: 'allow',
136
+ };
137
+ }
111
138
  export function createCanonicalOpenCodeSddSubagentPrompt(name) {
112
139
  const phase = name.replace('vgxness-sdd-', '');
113
140
  const common = `You are the VGXNESS SDD ${phase} executor, not the orchestrator. Do this phase's work yourself. Do NOT delegate, do NOT call task/delegate, and do NOT launch sub-agents. Use provided SDD artifacts, VGXNESS MCP state, and local repository evidence as needed. Retrieve full artifact content through MCP when the phase requires it; do not expect the manager to paste verbose artifacts into your prompt. Do not depend on external local skill files; this inline contract is sufficient. Preserve unrelated user work, keep output concise, and report evidence.`;
114
141
  const contract = subagentData[name].phaseContract;
115
142
  return `${common}\n\nPhase contract: ${contract}\n\nSDD governance v1: SDD artifact acceptance is human-only. Do not mark, describe, or persist generated phase output as accepted unless the user explicitly accepts it or an MCP acceptance record shows a human actor. Before advancing phases, use VGXNESS MCP readiness/status tools so draft, rejected, superseded, or legacy artifacts are not treated as accepted prerequisites. For risky VGX-managed side effects, use VGXNESS run preflight/reporting and include runId, phase, and agent context when available. OpenCode native/provider tools are audit-only and non-hard-blocking in governance v1; do not claim they are hard-blocked by OpenCode config.\n\nProvider-native daily progression: daily SDD progression happens inside OpenCode through conversation, VGXNESS MCP, and hidden SDD subagents. Do not instruct the user to run terminal SDD phase commands for normal daily flow. Return phase output, decisions, changed files, and evidence so the manager can persist artifacts and advance through MCP. Preserve confirmation/preflight requirements for apply, verify, init, archive, edits, shell, git, provider-tool, secrets, destructive, privileged, or ambiguous operations.`;
116
143
  }
144
+ /**
145
+ * Provider runtime prompt for generated provider managers.
146
+ * This feeds the OpenCode default config and Claude generated agent files; it is
147
+ * intentionally separate from registry/seed instructions below.
148
+ */
117
149
  export const canonicalOpenCodeManagerPrompt = `# VGXNESS Manager - compact SDD orchestrator
118
150
 
119
- Bind only to the primary \`vgxness-manager\` agent. Executor agents (for example \`vgxness-sdd-apply\`) use their own prompts.
151
+ Bind only to the primary \`vgxness-manager\` agent. Executor agents use their own prompts.
120
152
 
121
153
  ## Role
122
- Coordinate SDD; keep chat thin, use VGXNESS MCP as durable state, delegate to the smallest exact hidden SDD subagent, then synthesize evidence. Coach while coordinating: teach briefly, explain practical tradeoffs, stay realistic about risk/effort/unknowns, respectfully challenge weak assumptions, keep the user comfortable and in control, and avoid lectures or unnecessary verbosity.
154
+ Coordinate SDD; keep chat thin, use VGXNESS MCP as durable state, delegate to the smallest exact hidden SDD subagent, synthesize evidence. Coach while coordinating: teach briefly, explain practical tradeoffs, stay realistic about risk/effort/unknowns, respectfully challenge weak assumptions, keep the user comfortable and in control, avoid lectures or unnecessary verbosity.
123
155
 
124
156
  ## Non-negotiable governance
125
157
  - SDD artifact acceptance is human-only. Never infer or fabricate acceptance from generated output, subagent/model output, file presence, confidence, or legacy artifacts. Treat draft/rejected/superseded/stale/unaccepted artifacts as not accepted until a human acceptance record exists.
126
158
  - Before phase advancement, call readiness/status tools: \`vgxness_sdd_status\`/\`vgxness_sdd_next\` and \`vgxness_sdd_ready\` or \`vgxness_sdd_get_readiness\`.
127
159
  - 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 context when available. If approval/block is required, stop; do not invent approval.
128
- - Direct human acceptance of an exact SDD artifact via \`vgxness_sdd_accept_artifact\` is not a generic SDD write for manager routing: do not call \`vgxness_run_preflight\` solely for that acceptance when the user explicitly accepted the exact project/change/phase artifact, \`acceptedBy.type\` is \`"human"\`, \`acceptedBy.id\` is non-empty, and status/readiness confirms the artifact is eligible. This shortcut applies only to \`vgxness_sdd_accept_artifact\`, not \`vgxness_sdd_save_artifact\`, edits, shell/tests, git, provider config, memory writes, external paths, secrets, destructive/privileged/ambiguous operations.
160
+ - Direct human acceptance of an exact SDD artifact via \`vgxness_sdd_accept_artifact\` is not a generic SDD write for manager routing: do not call \`vgxness_run_preflight\` solely for that acceptance when the user explicitly accepted the exact project/change/phase artifact, \`acceptedBy.type\` is \`"human"\`, \`acceptedBy.id\` is non-empty, and status/readiness confirms the artifact is eligible. This shortcut applies only to \`vgxness_sdd_accept_artifact\` and the trusted draft autorun chain described below; it does not apply to edits, shell/tests, git, provider config, memory writes, external paths, secrets, destructive/privileged/ambiguous operations.
129
161
  - OpenCode native/provider tools are governance-v1 audit-only/non-hard-blocking. Report warnings; do not say native OpenCode tools are hard-blocked by config.
130
- - Do not mutate provider/global OpenCode config unless explicitly requested. Do not write to \`openspec/\`. Never revert/overwrite unrelated user work. Preserve \`permission.task\` deny-by-default with only exact known SDD subagents allowed.
131
- - Do not publish packages unless explicitly requested.
132
- - Do not change model or reasoning effort.
162
+ - Do not mutate provider/global OpenCode config. Do not write to \`openspec/\`. Do not publish packages unless explicitly requested. Never revert/overwrite unrelated user work. Preserve \`permission.task\` deny-by-default with only exact known SDD subagents allowed.
163
+ - Do not change provider model/reasoning config unless explicitly requested.
133
164
 
134
165
  ## Flexible governance routing
135
166
  Use the lightest safe path: Tier 0-2 direct; Tier 3 preflight/explicit validation; Tier 4 formal SDD for governance, permission model, SDD acceptance, architecture/security, or cross-surface behavior. Provider status/doctor/preview/handoff are read-only audit-only; provider config writes stay gated.
@@ -138,32 +169,48 @@ Use the lightest safe path: Tier 0-2 direct; Tier 3 preflight/explicit validatio
138
169
  Daily SDD happens inside OpenCode through conversation, VGXNESS MCP, and hidden SDD subagents. Do not tell users to run terminal SDD phase commands for normal flow. CLI is an escape hatch for bootstrap, doctor, recovery, setup gaps, or explicit request.
139
170
 
140
171
  ## MCP playbook
141
- - For starting, resuming, or recovering context: prefer \`vgxness_context_cockpit\` with project + workspace; treat \`vgxness_session_restore\` as one signal, not truth. For ending, pausing, handing off, or compacting: \`vgxness_session_close\` with current session id and actor \`manager\`; if no id, do not invent one and summarize.
142
- - SDD artifacts: list/read with \`vgxness_sdd_get_artifact\`/\`vgxness_sdd_list_artifacts\`; use \`payloadMode: "compact"\` by default so the primary context stays clean. Use verbose only when required, preferably inside the delegated phase subagent. Save with \`vgxness_sdd_save_artifact\` only after the appropriate flow. SDD artifacts are not generic memory.
143
- - Acceptance/readiness: check SDD status/readiness for the exact project/change/phase, confirm explicit human acceptance of that exact artifact, call \`vgxness_sdd_accept_artifact\` directly with audit context (\`acceptedBy.type: "human"\`, non-empty \`acceptedBy.id\`, runId, agentId, note/rationale when useful), then re-check status/readiness before reporting state. Do not add \`vgxness_run_preflight\` solely for that exact direct acceptance call. Ambiguous replies count only when tied to an immediate exact acceptance prompt. Use \`vgxness_governance_report\` for readiness, artifact states, preflight posture, and audit warnings before risky/ambiguous transitions and in apply/verify summaries.
172
+ - For starting, resuming, or recovering context: prefer \`vgxness_context_cockpit\`; treat \`vgxness_session_restore\` as one signal, not truth. For ending, pausing, handing off, or compacting: \`vgxness_session_close\` with current session id and actor \`manager\`; if no id, do not invent one and summarize.
173
+ - SDD artifacts: guide state with \`vgxness_sdd_next\`/\`vgxness_sdd_cockpit\`; list/read with \`vgxness_sdd_get_artifact\`/\`vgxness_sdd_list_artifacts\`; prefer \`payloadMode: "compact"\` so the primary context stays clean; use verbose only when required, preferably inside the delegated phase subagent. Save with \`vgxness_sdd_save_artifact\` only after the appropriate flow. Use \`vgxness_sdd_reopen_artifact\` only for rejected artifacts returning to draft, with explicit human actor/audit context. SDD artifacts are not generic memory.
174
+ - Trusted draft autorun: when the exact \`proposal\` artifact is already accepted, you may run exactly \`spec -> design -> tasks\` without extra human confirmation via exact hidden subagents and save drafts with \`vgxness_sdd_save_artifact\`. This is draft-only planning, not acceptance or completion. Do not use for explore/proposal/apply-progress/verify/archive, rejected/superseded artifacts, accepted overwrites, or risky side effects (provider config, edits, shell/tests, git, secrets, external/destructive/privileged/ambiguous). Re-check status/readiness before and after; generated spec/design drafts may feed downstream design/tasks but remain unaccepted.
175
+ - Acceptance/readiness: check SDD status/readiness for the exact project/change/phase, confirm explicit human acceptance of that exact artifact, call \`vgxness_sdd_accept_artifact\` directly with audit context (\`acceptedBy.type: "human"\`, non-empty \`acceptedBy.id\`, runId, agentId), then re-check status/readiness before reporting state. Do not add \`vgxness_run_preflight\` solely for that exact direct acceptance call. Ambiguous replies count only when tied to an immediate exact acceptance prompt. Use \`vgxness_governance_report\` for readiness, artifact states, preflight posture, and audit warnings.
144
176
  - Memory: call \`vgxness_memory_search\`/\`vgxness_memory_get\` for prior work or unclear context; call \`vgxness_memory_save\` for durable discoveries, decisions, bug fixes, config, patterns, or preferences; use \`vgxness_memory_update\` only to correct/evolve a known id. Do not duplicate full SDD artifacts as memory.
145
177
  - Agents/profile/payloads: resolve exact phase with \`vgxness_agent_resolve\`. \`vgxness_agent_activate\`, \`vgxness_opencode_manager_payload\`, and \`vgxness_skill_payload\` are preview context only; agent_activate does not execute a provider or write provider config. Use \`vgxness_manager_profile_get\` before behavior changes; \`vgxness_manager_profile_set\` requires explicit human authorization.
146
- - Runs: use \`vgxness_run_start\`/\`vgxness_run_list\`/\`vgxness_run_get\` for significant implementation/verification or multi-step delegated work; checkpoint with \`vgxness_run_checkpoint\`, preflight with \`vgxness_run_preflight\`, and close with \`vgxness_run_finalize\`.
147
- - Provider diagnostics: \`vgxness_provider_status\` and \`vgxness_provider_doctor\` are read-only reports.
178
+ - Runs/recovery: use \`vgxness_run_start\`/\`vgxness_run_list\`/\`vgxness_run_get\` for run work; checkpoint with \`vgxness_run_checkpoint\`, preflight with \`vgxness_run_preflight\`, and close with \`vgxness_run_finalize\`. Unknown runId: \`vgxness_run_resume_candidates\`. For interrupted runs, inspect with \`vgxness_run_resume_inspect\`, then call \`vgxness_run_resume_gate\` with approvalId from pendingApprovals/inspect before advice; never pass runId as approvalId
179
+ - Provider diagnostics: \`vgxness_provider_status\`/\`vgxness_provider_doctor\` are read-only reports.
148
180
 
149
181
  ## Minimum flows
150
182
  - Simple answer: inline; memory only for prior context; no run by default.
151
- - Proposal/spec/design/tasks: status/next -> readiness -> read prerequisites -> resolve exact subagent -> delegate -> persist by governance.
152
- - Apply/verify: require prerequisites -> read artifacts -> resolve exact subagent -> start/recover run -> preflight writes/shell/git/tests -> delegate -> checkpoint -> save output -> finalize when clear.
153
- - Config/provider/prompt change: inspect manager/profile or payload first; persistent changes require explicit human authorization.
183
+ - Proposal/spec/design/tasks: status/next -> readiness -> prerequisites -> exact subagent -> delegate -> persist by governance; if proposal is accepted, spec/design/tasks may run as the trusted draft autorun chain without extra confirmation, but drafts remain unaccepted.
184
+ - Apply/verify: require prerequisites -> artifacts -> exact subagent -> start/recover run -> preflight writes/shell/git/tests -> delegate -> checkpoint -> save -> finalize.
185
+ - Config/provider/prompt change: inspect manager/profile or payload first; persistent changes need explicit human authorization.
186
+ - 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; \`vgxness code sdd ... --draft-run\` is a planning-only path, never for apply-progress.
154
187
 
155
188
  ## Delegation thresholds
156
189
  Inline only small decisions, 1-3 file reads, status commands, and atomic one-file mechanical edits. Delegate broad exploration, substantial implementation, writes with analysis/new logic, and execution-heavy verification. Never delegate to unknown agents; use exact SDD phase mapping.
157
190
 
158
191
  ## Output
159
192
  Be concise: delegated work, results, files/decisions, evidence/tests, risks, next step.`;
160
- const registryManagerInstructions = 'You are the VGXNESS SDD coordinator, not a monolithic executor. 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. Use VGXNESS MCP as the durable control plane: restore session context with vgxness_session_restore before inferring start/resume state from chat, and close/pause/compact with vgxness_session_close using actor manager plus an actionable summary when a current session id exists. Check SDD status/next/ready, read prerequisites with sdd_get_artifact or sdd_list_artifacts, save accepted phase output with sdd_save_artifact, search/get/save/update memory only for reusable knowledge, resolve exact SDD subagents before substantial phase work, use runs/checkpoints/preflight/finalize for significant implementation or verification, and use vgxness_provider_status for configured/phase/next questions plus vgxness_provider_doctor for read-only OpenCode MCP/manager health. 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 phase subagents. 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. Delegate real SDD phase work to the smallest exact vgxness-sdd-* subagent allowed by permission.task, synthesize results, and persist artifacts/checkpoints. Do not perform substantial multi-file implementation inline. Do not mutate global/provider OpenCode config, install skills, publish packages, or write openspec/ unless explicitly authorized. Checked-in manager and subagent instructions are self-contained; external sdd-* skill files are optional registry assets, not requirements.';
193
+ /**
194
+ * Registry/seed instructions for the manager agent definition.
195
+ * These feed the canonical manifest, checked-in seed, boot upgrade, registry
196
+ * render baselines, and manager profile overlay baselines; they are
197
+ * intentionally distinct from the provider runtime prompt above.
198
+ */
199
+ const registryManagerInstructionsV10 = [
200
+ 'You are the VGXNESS SDD coordinator, not a monolithic executor. 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.',
201
+ 'Use VGXNESS MCP as the durable control plane: restore session context with vgxness_session_restore before inferring start/resume state from chat, and close/pause/compact with vgxness_session_close using actor manager plus an actionable summary when a current session id exists.',
202
+ '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; when proposal is accepted, spec/design/tasks may run sequentially as draft-only autorun without extra confirmation, while acceptance remains human-only. Search/get/save/update memory only for reusable knowledge, resolve exact SDD 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.',
203
+ '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 phase subagents.',
204
+ '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.',
205
+ '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, and vgxness code sdd ... --draft-run is planning-only.',
206
+ 'OpenCode native/provider tools are governance-v1 audit-only/non-hard-blocking; report warnings, never say they are hard-blocked by config.',
207
+ ].join(' ');
161
208
  const subagentData = {
162
209
  'vgxness-sdd-explore': { seedDescription: 'Investigates codebase context and identifies options before proposals.', 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.', capabilities: ['sdd-exploration', 'codebase-research', 'discovery'], permissions: { read: 'allow', edit: 'deny', shell: 'ask', git: 'deny', memory: 'allow', 'provider-tool': 'deny', secrets: 'deny' }, workflows: ['sdd:explore'], skills: ['vgxness-sdd-explore'], phaseContract: 'Investigate codebase context, constraints, options, and risks. Do not implement code changes. Return findings and recommended next artifacts.' },
163
210
  'vgxness-sdd-propose': { seedDescription: 'Creates focused change proposals from exploration findings.', 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.', capabilities: ['sdd-proposal', 'proposal-planning', 'scope-definition'], permissions: { read: 'allow', edit: 'deny', shell: 'deny', git: 'deny', memory: 'allow', 'provider-tool': 'deny', secrets: 'deny' }, workflows: ['sdd:proposal'], skills: ['vgxness-sdd-proposal'], phaseContract: 'Create or refine a focused SDD proposal from exploration evidence. Do not implement code changes. Include scope, tradeoffs, non-goals, and acceptance direction.' },
164
211
  'vgxness-sdd-spec': { seedDescription: 'Writes detailed requirements and acceptance criteria for SDD changes.', 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.', capabilities: ['sdd-specification', 'requirements', 'acceptance-criteria'], permissions: { read: 'allow', edit: 'deny', shell: 'deny', git: 'deny', memory: 'allow', 'provider-tool': 'deny', secrets: 'deny' }, workflows: ['sdd:spec'], skills: ['vgxness-sdd-spec'], phaseContract: 'Write requirements, acceptance criteria, edge cases, and out-of-scope items. Do not implement code changes.' },
165
- 'vgxness-sdd-design': { seedDescription: 'Creates technical design from approved specs and proposals.', 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.', capabilities: ['sdd-design', 'technical-design', 'architecture-planning'], permissions: { read: 'allow', edit: 'deny', shell: 'ask', git: 'deny', memory: 'allow', 'provider-tool': 'deny', secrets: 'deny' }, workflows: ['sdd:design'], skills: ['vgxness-sdd-design'], phaseContract: 'Create technical design grounded in the repository: affected modules, data shapes, safety, rollout, and verification. Do not implement code changes.' },
166
- 'vgxness-sdd-tasks': { seedDescription: 'Breaks specs and designs into implementation tasks.', seedInstructions: 'You are the tasks phase executor, not the orchestrator. Do not delegate. Break the SDD spec/design into small, ordered, testable implementation tasks. Do not implement code changes.', capabilities: ['sdd-tasks', 'task-breakdown', 'implementation-planning'], permissions: { read: 'allow', edit: 'deny', shell: 'deny', git: 'deny', memory: 'allow', 'provider-tool': 'deny', secrets: 'deny' }, workflows: ['sdd:tasks'], skills: ['vgxness-sdd-tasks'], phaseContract: 'Break approved spec/design into small ordered testable implementation tasks. Do not implement code changes.' },
212
+ 'vgxness-sdd-design': { seedDescription: 'Creates technical design from accepted proposals and accepted or trusted draft specs.', 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.', capabilities: ['sdd-design', 'technical-design', 'architecture-planning'], permissions: { read: 'allow', edit: 'deny', shell: 'ask', git: 'deny', memory: 'allow', 'provider-tool': 'deny', secrets: 'deny' }, workflows: ['sdd:design'], skills: ['vgxness-sdd-design'], 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.' },
213
+ 'vgxness-sdd-tasks': { seedDescription: 'Breaks accepted or trusted draft specs and designs into implementation tasks.', seedInstructions: 'You are the tasks phase executor, not the orchestrator. Do not delegate. Break the SDD spec/design into small, ordered, testable implementation tasks. Do not implement code changes.', capabilities: ['sdd-tasks', 'task-breakdown', 'implementation-planning'], permissions: { read: 'allow', edit: 'deny', shell: 'deny', git: 'deny', memory: 'allow', 'provider-tool': 'deny', secrets: 'deny' }, workflows: ['sdd:tasks'], skills: ['vgxness-sdd-tasks'], phaseContract: 'Break accepted or trusted draft spec/design into small ordered testable implementation tasks. Do not implement code changes.' },
167
214
  'vgxness-sdd-apply': { seedDescription: 'Implements code changes from SDD task definitions.', 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.', capabilities: ['sdd-apply', 'implementation', 'code-change'], permissions: { read: 'allow', edit: 'ask', shell: 'ask', git: 'ask', memory: 'allow', 'provider-tool': 'deny', secrets: 'deny' }, workflows: ['sdd:apply-progress'], skills: ['vgxness-sdd-apply'], 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.' },
168
215
  'vgxness-sdd-verify': { seedDescription: 'Validates implementation against specs, tasks, and evidence.', 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.', capabilities: ['sdd-verify', 'verification', 'test-review', 'risk-review'], permissions: { read: 'allow', edit: 'deny', shell: 'ask', git: 'deny', memory: 'allow', 'provider-tool': 'deny', secrets: 'deny' }, workflows: ['sdd:verify'], skills: ['vgxness-sdd-verify'], phaseContract: 'Validate implementation against SDD artifacts and task acceptance criteria. Prefer focused local tests and evidence review. Do not implement unrelated changes.' },
169
216
  'vgxness-sdd-archive': { seedDescription: 'Archives completed SDD change artifacts and outcomes.', 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.', capabilities: ['sdd-archive', 'artifact-archive', 'release-notes'], permissions: { read: 'allow', edit: 'ask', shell: 'deny', git: 'deny', memory: 'allow', 'provider-tool': 'deny', secrets: 'deny' }, workflows: ['sdd:archive'], skills: ['vgxness-sdd-archive'], phaseContract: 'Archive completed SDD outcome with summary, verification evidence, follow-ups, and residual risks. Confirm before any repository writes beyond the requested archive artifact.' },
@@ -1,4 +1,4 @@
1
- import { canonicalAgentManifest, canonicalDefaultAgentName, canonicalOpenCodeManagerPrompt, canonicalPromptContractVersion, canonicalSddSubagentNames, createCanonicalOpenCodeSddSubagentPrompt, createCanonicalOpenCodeSddTaskPermissions, validateCanonicalAgentManifest, } from './canonical-agent-manifest.js';
1
+ import { canonicalAgentManifest, canonicalDefaultAgentName, canonicalOpenCodeManagerReasoningEffort, canonicalOpenCodeManagerPrompt, canonicalPromptContractVersion, canonicalSddSubagentNames, createCanonicalOpenCodeSddSubagentPrompt, createCanonicalOpenCodeSddTaskPermissions, validateCanonicalAgentManifest, } from './canonical-agent-manifest.js';
2
2
  export function canonicalManifestValidationErrors(manifest = canonicalAgentManifest) {
3
3
  const validation = validateCanonicalAgentManifest(manifest);
4
4
  return validation.ok ? [] : validation.errors;
@@ -19,10 +19,10 @@ export function projectCanonicalAgentManifestToOpenCode(manifest = canonicalAgen
19
19
  description: 'VGXNESS SDD Manager - coordinates MCP state and SDD sub-agents, avoids inline execution when delegation is safer',
20
20
  mode: 'primary',
21
21
  ...(manager.adapters?.opencode?.model !== undefined ? { model: manager.adapters.opencode.model } : {}),
22
- options: { reasoningEffort: 'high', vgxnessPromptContractVersion: canonicalPromptContractVersion },
23
- permission: { task: createCanonicalOpenCodeSddTaskPermissions() },
22
+ options: { reasoningEffort: canonicalOpenCodeManagerReasoningEffort, vgxnessPromptContractVersion: canonicalPromptContractVersion },
23
+ permission: openCodePermissionsFor(manager, { task: createCanonicalOpenCodeSddTaskPermissions() }),
24
24
  prompt: canonicalOpenCodeManagerPrompt,
25
- reasoningEffort: 'high',
25
+ reasoningEffort: canonicalOpenCodeManagerReasoningEffort,
26
26
  tools: { bash: true, delegate: true, delegation_list: true, delegation_read: true, edit: true, read: true, write: true },
27
27
  variant: '',
28
28
  },
@@ -38,11 +38,27 @@ export function projectCanonicalAgentManifestToOpenCode(manifest = canonicalAgen
38
38
  ...(subagent.adapters?.opencode?.model !== undefined ? { model: subagent.adapters.opencode.model } : {}),
39
39
  options: { vgxnessPromptContractVersion: canonicalPromptContractVersion },
40
40
  prompt: createCanonicalOpenCodeSddSubagentPrompt(name),
41
+ permission: openCodePermissionsFor(subagent),
41
42
  tools: { bash: true, edit: true, read: true, write: true },
42
43
  };
43
44
  }
44
45
  return { defaultAgent: canonicalDefaultAgentName, agents };
45
46
  }
47
+ export function withEffectiveOpenCodeManagerInstructions(projection, instructions) {
48
+ const trimmed = instructions?.trim() ?? '';
49
+ if (trimmed === '')
50
+ return projection;
51
+ const manager = projection.agents[projection.defaultAgent];
52
+ if (manager === undefined)
53
+ return projection;
54
+ return {
55
+ defaultAgent: projection.defaultAgent,
56
+ agents: {
57
+ ...projection.agents,
58
+ [projection.defaultAgent]: { ...manager, prompt: trimmed },
59
+ },
60
+ };
61
+ }
46
62
  export function projectCanonicalAgentManifestToClaudeCode(manifest = canonicalAgentManifest) {
47
63
  assertValidCanonicalManifest(manifest);
48
64
  const manager = manifest.agents.find((agent) => agent.name === manifest.defaultAgentName && agent.mode === 'agent');
@@ -112,6 +128,32 @@ function assertValidCanonicalManifest(manifest) {
112
128
  if (errors.length > 0)
113
129
  throw new Error(`Invalid canonical agent manifest: ${errors.join('; ')}`);
114
130
  }
131
+ function openCodePermissionsFor(agent, additional = {}) {
132
+ const adapterPermission = asRecord(agent.adapters?.opencode?.config?.permission);
133
+ return { ...adapterPermission, ...additional, ...mapCanonicalPermissionsToOpenCode(agent.permissions) };
134
+ }
135
+ function mapCanonicalPermissionsToOpenCode(permissions) {
136
+ const mapped = {};
137
+ if (permissions === undefined)
138
+ return mapped;
139
+ for (const [canonical, openCode] of openCodePermissionMappings) {
140
+ const decision = permissions[canonical];
141
+ if (decision !== undefined)
142
+ mapped[openCode] = decision;
143
+ }
144
+ return mapped;
145
+ }
146
+ function asRecord(value) {
147
+ if (value === null || typeof value !== 'object' || Array.isArray(value))
148
+ return {};
149
+ return value;
150
+ }
151
+ const openCodePermissionMappings = [
152
+ ['read', 'read'],
153
+ ['edit', 'edit'],
154
+ ['shell', 'bash'],
155
+ ['external-directory', 'external_directory'],
156
+ ];
115
157
  function toSeedAgent(agent) {
116
158
  const seed = {
117
159
  name: agent.name,
@@ -6,6 +6,9 @@ Global flags:
6
6
  --version, -v Print the installed package version.
7
7
 
8
8
  Areas:
9
+ status [--project <name>] [--change <id>] [--db <path>] [--json]
10
+ next [--project <name>] [--change <id>] [--db <path>] [--json]
11
+ resume [--project <name>] [--run-id <id>] [--db <path>] [--json]
9
12
  init [--project <name>] [--provider opencode|claude|none] [--scope user|project] [--db global|project-local|custom|<path>] [--db-path <path>] [--mode mcp-only|mcp-plus-agents] [--json]
10
13
  setup plan [--project <name>] [--provider opencode|claude|none] [--scope user|project] [--db global|project-local|custom|<path>] [--db-path <path>] [--mode mcp-only|mcp-plus-agents] [--json]
11
14
  setup apply --yes [--project <name>] [--provider opencode|claude|none] [--scope user|project] [--db global|project-local|custom|<path>] [--db-path <path>] [--mode mcp-only|mcp-plus-agents]
@@ -16,6 +19,10 @@ Areas:
16
19
  verification plan --type docs-only|test-only|cli|mcp|sdd-storage|provider-setup|package-release|workflow-runs [--json]
17
20
  verification report save --project <name> --change <id> --file <report.json> [--db <path>] [--json]
18
21
  verification report get --project <name> --change <id> [--db <path>] [--json]
22
+ Status answers "where am I?" with the human front-door cockpit.
23
+ Next answers "what should I do now?" with a shorter next-action view.
24
+ Resume answers "how do I continue interrupted work?" with run inspection guidance.
25
+ Without --change or --run-id they stay orientation-only and do not open local memory; with --change or --run-id they read SQLite read-only. Pass --json for automation.
19
26
  Setup plan/init default to human-readable read-only output; pass --json for automation. Setup apply writes OpenCode config only with --yes and uses the global user DB plus mcp-plus-agents by default.
20
27
  Setup status defaults to human-readable read-only output; pass --json for automation. It never writes provider config or executes providers.
21
28
  Doctor defaults to human-readable output; pass --json for automation.
@@ -38,8 +45,8 @@ Areas:
38
45
  code plan "<task>" [--json|--events-jsonl] [--max-source-bytes <n>] [--provider fake|openai-compatible] [--model <id>] [--stream] [--transcript off|summary|full] [--memory off|ask|auto]
39
46
  code craft-preview "<task>" [--events-jsonl] [--provider fake|openai-compatible] [--model <id>] [--stream]
40
47
  code craft "<task>" [--json|--events-jsonl --approval-channel stdio] [--max-source-bytes <n>] [--provider fake|openai-compatible] [--model <id>] [--stream] [--approval-policy ask|allow|deny] [--verification none|suggest|run|repair] [--transcript off|summary|full] [--memory off|ask|auto]
41
- code sdd <change> <phase> [--json] [--save-artifact] [--provider fake|openai-compatible] [--model <id>] [--stream] [--verification none|suggest|run|repair] [--transcript off|summary|full] [--memory off|ask|auto]
42
- VGXNESS Code inspect and plan are native read-only repository flows. Craft is bounded edit-capable work with approval-gated edits and shell verification; craft JSONL approvals require explicit --approval-channel stdio. SDD mode follows phase-specific artifact boundaries and saves only with --save-artifact.
48
+ code sdd <change> <phase> [--json] [--save-artifact] [--draft-run] [--provider fake|openai-compatible] [--model <id>] [--stream] [--verification none|suggest|run|repair] [--transcript off|summary|full] [--memory off|ask|auto]
49
+ VGXNESS Code inspect and plan are native read-only repository flows. Craft is bounded edit-capable work with approval-gated edits and shell verification; craft JSONL approvals require explicit --approval-channel stdio. SDD mode follows phase-specific artifact boundaries and saves only with --save-artifact. --draft-run lets planning phases use draft prerequisites only; human acceptance is still required and apply-progress remains gated.
43
50
 
44
51
  orchestrator preview --project <name> --intent <text> [--change <id>] [--db <path>]
45
52
  Orchestrator preview classifies natural-language requests only; it never executes providers, edits files, records runs, or writes provider config.
@@ -103,16 +110,20 @@ Areas:
103
110
 
104
111
  sdd status --project <name> --change <id> [--json]
105
112
  sdd next --project <name> --change <id> [--json]
113
+ sdd continue --project <name> --change <id> [--db <path>] [--json]
106
114
  sdd cockpit --project <name> --change <id> [--json]
107
115
  sdd ready --project <name> --change <id> --phase <phase>
108
116
  sdd save-artifact --project <name> --change <id> --phase <phase> --content <text>
109
117
  sdd accept-artifact --project <name> --change <id> --phase <phase> --actor <human-id> [--display-name <name>] [--note <text>] [--accepted-at <iso>] [--json] [--db <path>]
118
+ sdd reopen-artifact --project <name> --change <id> --phase <phase> --actor <human-id> [--display-name <name>] [--note <text>] [--json] [--db <path>]
110
119
  sdd get-artifact --project <name> --change <id> --phase <phase> [--json] [--db <path>]
111
120
  sdd list-artifacts --project <name> --change <id> [--json] [--db <path>]
112
121
  SDD artifact reads use the selected local SQLite memory store via --db, VGXNESS_DB_PATH, or the global default.
113
- SDD status, next, get-artifact, and list-artifacts default to human-readable output; pass --json for existing automation shapes.
122
+ SDD status, next, continue, get-artifact, and list-artifacts default to human-readable output; pass --json for existing automation shapes.
123
+ SDD continue is a read-only continuation planner; it never executes providers, mutates artifacts, creates runs, writes provider config, or creates openspec/.
114
124
  SDD cockpit defaults to human-readable read-only output; pass --json for metadata-only artifact summaries.
115
125
  SDD accept-artifact records explicit human-only acceptance; save-artifact remains draft-only and never implies acceptance. --accepted-at requires a timezone and is normalized to UTC ISO. Human output is default; pass --json for content-free success output.
126
+ SDD reopen-artifact records explicit human-only reopening of rejected artifacts only, moving them back to draft so they can be edited and accepted again.
116
127
  sdd export --project <name> --change <id> [--file <package.json>]
117
128
  sdd import --project <name> --change <id> --file <package.json> [--write] [--overwrite]
118
129
 
@@ -3,6 +3,7 @@ export { runCodeCliCommand, runDefaultInteractiveEntrypoint } from './interactiv
3
3
  export { runDoctorAliasCommand, runMcpDoctorCommand, runMcpDoctorOpenCodeCommand, runMcpInstallCommand, runMcpSetupCommand } from './mcp-dispatcher.js';
4
4
  export { runMemoryCommand, runMemoryImportCommand, runOpenCodeCommand, runOrchestratorCommand, runSddCommand } from './memory-sdd-dispatcher.js';
5
5
  export { runApprovalsCommand, runPermissionsCommand, runRunsCommand } from './run-permission-dispatcher.js';
6
+ export { runProductNextCommand, runProductResumeCommand, runProductStatusCommand } from './status-dispatcher.js';
6
7
  export { applySetupPlanInput, collectRunDetails, collectRunInsights, createSetupLifecycleService, promptSetupWizard, readSetupStatus, runInitCommand, runSetupApplyCommand, runSetupBackupCommand, runSetupLifecycleCommand, runSetupPlanCommand, runSetupRollbackCommand, runSetupTuiCommand, setupMcpEvidence, setupPlanInputFromFlags, } from './setup-dispatcher.js';
7
8
  export { runWorkflowExecuteCommand, runWorkflowPreviewCommand, runWorkflowRunCommand } from './workflow-dispatcher.js';
8
9
  export { runVerificationPlanCommand, runVerificationReportCommand } from './verification-dispatcher.js';
@@ -69,6 +69,12 @@ export async function runCodeCliCommand(parsed, environment) {
69
69
  return usageFailure('--approval-channel stdio is supported only for code craft --events-jsonl');
70
70
  if (eventsJsonl && command !== 'inspect' && command !== 'plan' && command !== 'craft-preview' && approvalChannel.value !== 'stdio')
71
71
  return usageFailure('code craft --events-jsonl requires --approval-channel stdio; JSONL without approvals is currently supported only for read-only inspect, plan, and craft-preview');
72
+ const draftRunFlag = parsed.flags['draft-run'];
73
+ if (draftRunFlag !== undefined && command !== 'sdd')
74
+ return usageFailure('--draft-run is supported only for code sdd');
75
+ if (draftRunFlag !== undefined && draftRunFlag !== true)
76
+ return usageFailure('--draft-run does not accept a value; use --draft-run for code sdd draft mode');
77
+ const sddRuntimeMode = draftRunFlag === true ? 'draft-run' : undefined;
72
78
  const maxSourceBytes = optionalNumberFlag(parsed.flags, 'max-source-bytes');
73
79
  if (!maxSourceBytes.ok)
74
80
  return resultFailure(maxSourceBytes);
@@ -109,6 +115,7 @@ export async function runCodeCliCommand(parsed, environment) {
109
115
  ...(approvalPolicy.value === undefined ? {} : { approvalPolicy: approvalPolicy.value }),
110
116
  ...(verificationMode.value === undefined ? {} : { verificationMode: verificationMode.value }),
111
117
  ...(transcriptMode.value === undefined ? {} : { transcriptMode: transcriptMode.value }),
118
+ ...(sddRuntimeMode === undefined ? {} : { sddRuntimeMode }),
112
119
  });
113
120
  }
114
121
  const selectedDatabasePath = databasePathFor(parsed.flags, environment);
@@ -135,6 +142,7 @@ export async function runCodeCliCommand(parsed, environment) {
135
142
  env: environment.env,
136
143
  eventsJsonl,
137
144
  persistArtifact: parsed.flags['save-artifact'] === true || parsed.flags.persist === true,
145
+ ...(sddRuntimeMode === undefined ? {} : { sddRuntimeMode }),
138
146
  ...(maxSourceBytes.value !== undefined ? { maxSourceBytes: maxSourceBytes.value } : {}),
139
147
  ...(approvalPolicy.value === undefined ? {} : { approvalPolicy: approvalPolicy.value }),
140
148
  ...(verificationMode.value === undefined ? {} : { verificationMode: verificationMode.value }),
@@ -75,25 +75,56 @@ export function runMcpInstallCommand(parsed, environment) {
75
75
  }),
76
76
  });
77
77
  }
78
- const result = await installOpenCodeMcpClient({
79
- cwd: environment.cwd,
80
- databasePath: databasePath.value.path,
81
- databasePathSource: databasePath.value.source,
82
- scope: scope.value,
83
- env: environment.env,
84
- confirmed: parsed.flags.yes === true,
85
- mcpOnly,
86
- overwriteVgxness,
87
- });
88
- return result.status === 'installed'
89
- ? jsonResult({ ok: true, value: result })
90
- : resultFailure({
91
- ok: false,
92
- error: {
93
- code: 'validation_failed',
94
- message: `${result.reason}: ${result.message} Manual doctor command: ${result.manualTest.doctorCommand.join(' ')}`,
95
- },
78
+ if (parsed.flags.yes !== true) {
79
+ const result = await installOpenCodeMcpClient({
80
+ cwd: environment.cwd,
81
+ databasePath: databasePath.value.path,
82
+ databasePathSource: databasePath.value.source,
83
+ scope: scope.value,
84
+ env: environment.env,
85
+ confirmed: false,
86
+ mcpOnly,
87
+ overwriteVgxness,
96
88
  });
89
+ return result.status === 'installed'
90
+ ? jsonResult({ ok: true, value: result })
91
+ : resultFailure({
92
+ ok: false,
93
+ error: {
94
+ code: 'validation_failed',
95
+ message: `${result.reason}: ${result.message} Manual doctor command: ${result.manualTest.doctorCommand.join(' ')}`,
96
+ },
97
+ });
98
+ }
99
+ const opened = openCliDatabase(databasePath.value.path);
100
+ if (!opened.ok)
101
+ return resultFailure(opened);
102
+ try {
103
+ const effectiveManagerInstructions = computeEffectiveManagerInstructions(opened.value);
104
+ const result = await installOpenCodeMcpClient({
105
+ cwd: environment.cwd,
106
+ databasePath: databasePath.value.path,
107
+ databasePathSource: databasePath.value.source,
108
+ scope: scope.value,
109
+ env: environment.env,
110
+ confirmed: true,
111
+ mcpOnly,
112
+ overwriteVgxness,
113
+ ...(effectiveManagerInstructions === undefined ? {} : { effectiveManagerInstructions }),
114
+ });
115
+ return result.status === 'installed'
116
+ ? jsonResult({ ok: true, value: result })
117
+ : resultFailure({
118
+ ok: false,
119
+ error: {
120
+ code: 'validation_failed',
121
+ message: `${result.reason}: ${result.message} Manual doctor command: ${result.manualTest.doctorCommand.join(' ')}`,
122
+ },
123
+ });
124
+ }
125
+ finally {
126
+ opened.value.close();
127
+ }
97
128
  })();
98
129
  }
99
130
  function claudeInstallScopeFlag(flags) {