vgxness 1.9.2 → 1.9.3

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 (39) hide show
  1. package/README.md +9 -4
  2. package/dist/agents/agent-resolver.js +33 -3
  3. package/dist/agents/canonical-agent-manifest.js +39 -18
  4. package/dist/agents/canonical-agent-projection.js +31 -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/memory-sdd-dispatcher.js +71 -5
  9. package/dist/cli/commands/status-dispatcher.js +130 -0
  10. package/dist/cli/commands/workflow-dispatcher.js +11 -5
  11. package/dist/cli/dispatcher.js +9 -1
  12. package/dist/cli/product-resume-renderer.js +32 -0
  13. package/dist/cli/product-status-renderer.js +74 -0
  14. package/dist/cli/sdd-renderer.js +80 -3
  15. package/dist/code/cli/code-command.js +7 -4
  16. package/dist/code/reporting/summary.js +4 -1
  17. package/dist/code/runtime/code-runtime.js +27 -4
  18. package/dist/code/runtime/sdd-context.js +18 -2
  19. package/dist/governance/governance-report-builder.js +18 -7
  20. package/dist/mcp/claude-code-agent-config.js +10 -4
  21. package/dist/mcp/control-plane.js +56 -0
  22. package/dist/mcp/provider-status.js +86 -81
  23. package/dist/mcp/schema.js +25 -7
  24. package/dist/mcp/stdio-server.js +4 -0
  25. package/dist/mcp/validation.js +39 -3
  26. package/dist/resume/product-resume.js +166 -0
  27. package/dist/runs/repositories/runs.js +12 -1
  28. package/dist/runs/run-service.js +62 -5
  29. package/dist/sdd/schema.js +8 -0
  30. package/dist/sdd/sdd-continuation-plan.js +81 -0
  31. package/dist/sdd/sdd-workflow-service.js +103 -16
  32. package/dist/skills/skill-resolver.js +21 -4
  33. package/dist/status/product-status.js +117 -0
  34. package/docs/architecture.md +1 -1
  35. package/docs/cli.md +33 -8
  36. package/docs/code-runtime.md +3 -0
  37. package/docs/glossary.md +1 -1
  38. package/docs/mcp.md +18 -4
  39. package/package.json +1 -1
@@ -1,3 +1,4 @@
1
+ import { normalizeSddPhaseInput } from '../sdd/schema.js';
1
2
  export class SkillResolver {
2
3
  skills;
3
4
  agents;
@@ -113,10 +114,13 @@ export class SkillResolver {
113
114
  targets.push({ targetType: agent.mode, targetKey: agent.name });
114
115
  targets.push({ targetType: agent.mode, targetKey: `${agent.project}/${agent.scope}/${agent.name}` });
115
116
  }
116
- if (input.workflow !== undefined && input.phase !== undefined)
117
- targets.push({ targetType: 'workflow-phase', targetKey: `${input.workflow}:${input.phase}` });
118
- if (input.phase !== undefined)
119
- targets.push({ targetType: 'workflow-phase', targetKey: input.phase });
117
+ const phases = phaseTargetKeys(input.workflow, input.phase);
118
+ if (input.workflow !== undefined) {
119
+ for (const phase of phases)
120
+ targets.push({ targetType: 'workflow-phase', targetKey: `${input.workflow}:${phase}` });
121
+ }
122
+ for (const phase of phases)
123
+ targets.push({ targetType: 'workflow-phase', targetKey: phase });
120
124
  if (input.providerAdapter !== undefined)
121
125
  targets.push({ targetType: 'provider-adapter', targetKey: input.providerAdapter });
122
126
  return dedupeTargets(targets);
@@ -212,6 +216,19 @@ function dedupeTargets(targets) {
212
216
  return true;
213
217
  });
214
218
  }
219
+ function phaseTargetKeys(workflow, phase) {
220
+ if (phase === undefined)
221
+ return [];
222
+ if (!isSddWorkflow(workflow))
223
+ return [phase];
224
+ const normalized = normalizeSddPhaseInput(phase);
225
+ if (normalized === 'apply-progress')
226
+ return ['apply-progress', 'apply'];
227
+ return normalized === undefined || normalized === phase ? [phase] : [normalized, phase];
228
+ }
229
+ function isSddWorkflow(workflow) {
230
+ return workflow?.trim().toLowerCase() === 'sdd';
231
+ }
215
232
  function stringMetadata(value) {
216
233
  return typeof value === 'string' && value.trim() ? value : undefined;
217
234
  }
@@ -0,0 +1,117 @@
1
+ import { basename, resolve } from 'node:path';
2
+ export function buildProductStatus(input) {
3
+ const project = resolveProject(input);
4
+ const baseSafety = [
5
+ 'Read-only cockpit: does not execute providers, edit files, write provider config, or mutate SDD artifacts.',
6
+ 'Human acceptance remains explicit; saved artifacts do not imply acceptance.',
7
+ ];
8
+ if (input.change === undefined) {
9
+ return {
10
+ version: 1,
11
+ kind: 'product-status',
12
+ project,
13
+ status: [`Project: ${project.value} (${project.source === 'flag' ? 'from --project' : 'inferred from cwd'})`, 'Change: not selected'],
14
+ blockers: ['No --change was provided, so VGXNESS cannot inspect SDD phase state yet.'],
15
+ next: ['Choose the active change id, then re-run status for the SDD cockpit view.'],
16
+ command: `vgxness status --project ${project.value} --change <change>`,
17
+ safety: ['Did not open the local memory store because no change was selected.', ...baseSafety],
18
+ };
19
+ }
20
+ if (input.databaseError !== undefined) {
21
+ return blockedStatus({
22
+ project,
23
+ change: input.change,
24
+ blocker: `Unable to read local memory store${input.databasePath === undefined ? '' : ` at ${input.databasePath}`}: ${input.databaseError}`,
25
+ next: 'Check --db, VGXNESS_DB_PATH, or run setup/status commands with the installed Bun runtime.',
26
+ command: `vgxness status --project ${project.value} --change ${input.change} --db <path>`,
27
+ safety: baseSafety,
28
+ });
29
+ }
30
+ if (input.sdd === undefined) {
31
+ return blockedStatus({
32
+ project,
33
+ change: input.change,
34
+ blocker: 'SDD cockpit service is not available for this status request.',
35
+ next: 'Use the installed CLI or provide a readable local memory store.',
36
+ command: `vgxness sdd cockpit --project ${project.value} --change ${input.change}`,
37
+ safety: baseSafety,
38
+ });
39
+ }
40
+ const cockpit = input.sdd.getCockpit({ project: project.value, change: input.change });
41
+ if (!cockpit.ok) {
42
+ return blockedStatus({
43
+ project,
44
+ change: input.change,
45
+ blocker: cockpit.error.message,
46
+ next: 'Review the project/change flags and local memory store, then re-run status.',
47
+ command: `vgxness sdd cockpit --project ${project.value} --change ${input.change}`,
48
+ safety: baseSafety,
49
+ });
50
+ }
51
+ const relatedRunContext = findRelatedRunContext({
52
+ project: project.value,
53
+ change: input.change,
54
+ ...(input.runs === undefined ? {} : { runs: input.runs }),
55
+ ...(input.explicitDatabasePath === undefined ? {} : { explicitDatabasePath: input.explicitDatabasePath }),
56
+ });
57
+ return fromSddCockpit(cockpit.value, project, baseSafety, relatedRunContext);
58
+ }
59
+ function resolveProject(input) {
60
+ if (input.project !== undefined && input.project.trim().length > 0)
61
+ return { value: input.project.trim(), source: 'flag' };
62
+ const directoryName = basename(resolve(input.cwd));
63
+ return { value: directoryName.length > 0 ? directoryName : 'unknown-project', source: 'cwd' };
64
+ }
65
+ function fromSddCockpit(cockpit, project, baseSafety, relatedRunContext) {
66
+ const nextLabel = cockpit.next.nextPhase === undefined ? cockpit.next.status : `${cockpit.next.status} / ${cockpit.next.nextPhase}`;
67
+ const command = cockpit.next.status === 'runnable' && cockpit.next.nextPhase !== undefined
68
+ ? `vgxness code sdd ${cockpit.change} ${cockpit.next.nextPhase} --project ${cockpit.project} --save-artifact`
69
+ : `vgxness sdd cockpit --project ${cockpit.project} --change ${cockpit.change} --json`;
70
+ return {
71
+ version: 1,
72
+ kind: 'product-status',
73
+ project,
74
+ change: cockpit.change,
75
+ status: [
76
+ `Project: ${cockpit.project}`,
77
+ `Change: ${cockpit.change}`,
78
+ `Next: ${nextLabel}`,
79
+ `Accepted: ${cockpit.acceptedCount}/${cockpit.phases.length}`,
80
+ `Legacy artifacts: ${cockpit.legacyCount}`,
81
+ ],
82
+ blockers: cockpit.aggregateBlockers.length === 0
83
+ ? ['none']
84
+ : cockpit.aggregateBlockers.map((blocker) => `${blocker.phase}: ${blocker.reason} at ${blocker.topicKey}${blocker.action === undefined ? '' : `; action=${blocker.action}`}`),
85
+ next: [cockpit.recommendedAction],
86
+ command,
87
+ sddNextStatus: cockpit.next.status,
88
+ ...(relatedRunContext === undefined ? {} : { relatedRunContext }),
89
+ safety: baseSafety,
90
+ };
91
+ }
92
+ function findRelatedRunContext(input) {
93
+ if (input.runs === undefined)
94
+ return undefined;
95
+ const relatedRun = input.runs.findRelatedInterruptedSddRun({ project: input.project, change: input.change });
96
+ if (!relatedRun.ok || relatedRun.value === undefined)
97
+ return undefined;
98
+ const dbFlag = input.explicitDatabasePath === undefined ? '' : ` --db ${input.explicitDatabasePath}`;
99
+ return {
100
+ ...relatedRun.value,
101
+ recommendation: 'Related interrupted run found by checkpoint changeId; inspect or resume it before starting duplicate SDD work. Advisory only.',
102
+ resumeCommand: `vgxness resume --project ${input.project} --run-id ${relatedRun.value.runId}${dbFlag}`,
103
+ };
104
+ }
105
+ function blockedStatus(input) {
106
+ return {
107
+ version: 1,
108
+ kind: 'product-status',
109
+ project: input.project,
110
+ change: input.change,
111
+ status: [`Project: ${input.project.value}`, `Change: ${input.change}`, 'Status: blocked'],
112
+ blockers: [input.blocker],
113
+ next: [input.next],
114
+ command: input.command,
115
+ safety: input.safety,
116
+ };
117
+ }
@@ -625,7 +625,7 @@ The code runtime layers a second, finer-grained decision on top of the policy ev
625
625
 
626
626
  CLI surface groups are documented in [CLI reference](./cli.md). The plural form is canonical — singular shortcuts are not added.
627
627
 
628
- MCP tools mirror the same core services for agent use. The full, current list of 38 tools is in [MCP tools](./mcp.md) and `SUPPORTED_VGX_MCP_TOOL_NAMES` (`src/mcp/schema.ts`); treat that array as the source of truth. The CLI and TUI are human/operator control surfaces. MCP is the agent-facing control surface. Provider integrations and the code runtime sit on the execution plane.
628
+ MCP tools mirror the same core services for agent use. The full, current list of 41 tools is in [MCP tools](./mcp.md) and `SUPPORTED_VGX_MCP_TOOL_NAMES` (`src/mcp/schema.ts`); treat that array as the source of truth. The CLI and TUI are human/operator control surfaces. MCP is the agent-facing control surface. Provider integrations and the code runtime sit on the execution plane.
629
629
 
630
630
  ## Evaluation strategy
631
631
 
package/docs/cli.md CHANGED
@@ -59,7 +59,9 @@ vgxness setup plan # human-readable, read-only plan
59
59
  vgxness setup status # human-readable, read-only setup status
60
60
  vgxness setup apply --yes # writes OpenCode config only after explicit consent
61
61
  vgxness doctor # human-readable readiness checks
62
- vgxness sdd next --project <project> --change <change>
62
+ vgxness status --project <project> --change <change>
63
+ vgxness next --project <project> --change <change>
64
+ vgxness resume --project <project> --run-id <id>
63
65
  vgxness setup rollback --backup <path>
64
66
  ```
65
67
 
@@ -67,6 +69,21 @@ vgxness setup rollback --backup <path>
67
69
 
68
70
  `vgxness init` prompts in English when stdin/stdout are TTYs: project name, DB location, provider, OpenCode scope, install mode, then shows the plan and asks `Apply this setup? Type "yes" to continue:`. Any answer other than `yes` exits successfully without writes. In CI/non-TTY without `--yes`, `init` returns the read-only plan and never waits for input. `vgxness doctor`, `vgxness sdd status`, `vgxness sdd next`, `vgxness sdd get-artifact`, and `vgxness sdd list-artifacts` are also human-readable by default; use `--json` for scripts.
69
71
 
72
+ ## Daily workflow front doors
73
+
74
+ Use these top-level commands before dropping into lower-level SDD or run inspection commands:
75
+
76
+ | Question | Command | Purpose |
77
+ |---|---|---|
78
+ | Where am I? | `vgxness status --project <project> --change <change>` | Shows the SDD cockpit state, blockers, next recommendation, and safety notes. |
79
+ | What should I do now? | `vgxness next --project <project> --change <change>` | Narrows the cockpit to the next action and why it is safe or blocked. |
80
+ | How do I continue a change? | `vgxness sdd continue --project <project> --change <change>` | Builds a read-only continuation plan for the selected SDD change. |
81
+ | How do I continue interrupted work? | `vgxness resume --project <project> [--run-id <id>]` | Lists or inspects interrupted runs and suggests manual continuation commands without retrying anything. |
82
+
83
+ 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.
84
+
85
+ The usual SDD operator loop is: inspect `status`, ask `next`, run `sdd continue` for the copyable continuation plan, then either run `vgxness code sdd ...` for phase work or `vgxness resume ...` for an interrupted run. After a draft is ready, use `sdd accept-artifact` for explicit human acceptance; if an artifact was rejected, use `sdd reopen-artifact` before revising it. Related interrupted run hints in `status`, `next`, and `sdd continue` are advisory only; they help avoid duplicate work but do not retry or execute runs.
86
+
70
87
  ## Bun-first repository verification
71
88
 
72
89
  VGXNESS uses Bun as the canonical installed runtime and verification path for repository development and CI. Node.js `>=22` remains development/build/test tooling for TypeScript, `node:test`, and helper scripts. npm package consumer metadata remains supported, but the product runtime engine is `engines.bun`.
@@ -226,7 +243,9 @@ For scriptable status, use explicit read-only commands:
226
243
 
227
244
  ```bash
228
245
  bun run cli:bun -- setup status --project vgxness
229
- bun run cli:bun -- sdd status --project vgxness --change my-change
246
+ bun run cli:bun -- status --project vgxness --change my-change
247
+ bun run cli:bun -- next --project vgxness --change my-change
248
+ bun run cli:bun -- resume --project vgxness --run-id <id>
230
249
  ```
231
250
 
232
251
  Provider support shown in the Installation surface is:
@@ -283,7 +302,7 @@ vgxness code inspect "<question>" \
283
302
  --memory off|ask|auto
284
303
  ```
285
304
 
286
- SDD-aware mode is exposed through `vgxness code sdd <change> <phase>`; pass `--save-artifact` only when persistence is intended, and pass `--change-id`/`--phase` to scope work. Read-only phases stay artifact-oriented; `apply-progress` may expose edit and shell tools; `verify` may expose verification shell tools.
305
+ SDD-aware mode is exposed through `vgxness code sdd <change> <phase>`; pass `--save-artifact` only when persistence is intended, and pass `--change-id`/`--phase` to scope work. Read-only phases stay artifact-oriented; `apply-progress` may expose edit and shell tools; `verify` may expose verification shell tools. `--draft-run` lets planning phases use draft prerequisites for planning only; human acceptance is still required, and `apply-progress` remains gated. `apply` is accepted as a user-facing alias for `apply-progress`.
287
306
 
288
307
  Useful events-only output for piping into the OpenTUI shell or your own tooling:
289
308
 
@@ -433,7 +452,7 @@ A rejected approval is recorded in the run audit trail and prevents the matching
433
452
 
434
453
  ### SDD workflow commands vs formal SDD commands
435
454
 
436
- `sdd preview`, `sdd run`, and `sdd execute` are workflow commands and use the three-mode workflow contract above. `sdd status`, `sdd ready`, `sdd save-artifact`, `sdd accept-artifact`, `sdd get-artifact`, `sdd list-artifacts`, and `sdd next` are formal SDD artifact/status commands. Formal SDD commands read or write SDD artifact state in the selected local SQLite store; they do not execute providers or continue workflow runs.
455
+ `sdd preview`, `sdd run`, and `sdd execute` are workflow commands and use the three-mode workflow contract above. `sdd status`, `sdd ready`, `sdd continue`, `sdd save-artifact`, `sdd accept-artifact`, `sdd reopen-artifact`, `sdd get-artifact`, `sdd list-artifacts`, and `sdd next` are formal SDD artifact/status commands. Formal SDD commands read or write SDD artifact state in the selected local SQLite store; they do not execute providers or retry workflow runs. `sdd continue` is read-only and returns a continuation plan; it does not create runs, mutate artifacts, or call providers.
437
456
 
438
457
  ## MCP setup preview and doctor
439
458
 
@@ -549,18 +568,24 @@ Use `sdd` commands to inspect local SDD artifact state and save, read, or list p
549
568
  bun run cli:bun -- sdd status --project vgxness --change sdd-workflow-engine --db /tmp/vgxness-memory.sqlite
550
569
  bun run cli:bun -- sdd ready --project vgxness --change sdd-workflow-engine --phase spec --db /tmp/vgxness-memory.sqlite
551
570
  bun run cli:bun -- sdd save-artifact --project vgxness --change sdd-workflow-engine --phase proposal --content "# Proposal" --db /tmp/vgxness-memory.sqlite
571
+ bun run cli:bun -- sdd continue --project vgxness --change sdd-workflow-engine --db /tmp/vgxness-memory.sqlite
572
+ bun run cli:bun -- code sdd sdd-workflow-engine spec --project vgxness --draft-run --save-artifact --db /tmp/vgxness-memory.sqlite
552
573
  bun run cli:bun -- sdd accept-artifact --project vgxness --change sdd-workflow-engine --phase proposal --actor user --note "Approved for spec" --db /tmp/vgxness-memory.sqlite
574
+ bun run cli:bun -- resume --project vgxness --db /tmp/vgxness-memory.sqlite
553
575
  bun run cli:bun -- sdd get-artifact --project vgxness --change sdd-workflow-engine --phase proposal --db /tmp/vgxness-memory.sqlite
554
576
  bun run cli:bun -- sdd list-artifacts --project vgxness --change sdd-workflow-engine --db /tmp/vgxness-memory.sqlite
555
577
  bun run cli:bun -- sdd next --project vgxness --change sdd-workflow-engine --db /tmp/vgxness-memory.sqlite
578
+ bun run cli:bun -- sdd reopen-artifact --project vgxness --change sdd-workflow-engine --phase design --actor user --note "Revise rejected design" --db /tmp/vgxness-memory.sqlite
556
579
  VGXNESS_DB_PATH=/tmp/vgxness-memory.sqlite bun run cli:bun -- sdd list-artifacts --project vgxness --change sdd-workflow-engine
557
580
  ```
558
581
 
559
- Current phases are `explore`, `proposal`, `spec`, `design`, `tasks`, `apply-progress`, `verify`, and `archive`. Each artifact is stored under `sdd/{change}/{phase}` in the local SQLite memory store. `sdd status` reports which phase artifacts are present and the next ready missing phase. `sdd next` reports the next SDD action for a project/change. `sdd status`, `sdd next`, `sdd get-artifact`, and `sdd list-artifacts` are human-readable by default; pass `--json` for automation/stable structured output. `sdd ready` reports satisfied prerequisites and missing artifact topic keys for one phase. `sdd get-artifact` shows artifact metadata and then full content after `--- Content ---`; `sdd list-artifacts` shows one compact row for every canonical SDD phase in phase order and does not print full artifact content.
582
+ Current canonical phases are `explore`, `proposal`, `spec`, `design`, `tasks`, `apply-progress`, `verify`, and `archive`. `apply` is accepted as a user-facing input alias, but artifacts, topic keys, readiness/status/cockpit JSON, and internal metadata continue to use canonical `apply-progress`. Each artifact is stored under `sdd/{change}/{phase}` in the local SQLite memory store. `sdd status` reports which phase artifacts are present, blocker-specific next actions, and related interrupted run hints when available. `sdd next` reports the next SDD action for a project/change. `sdd continue` turns that state into a read-only continuation plan, including draft-run suggestions for planning phases and related interrupted run context when a matching stopped run exists. `sdd status`, `sdd next`, `sdd continue`, `sdd get-artifact`, and `sdd list-artifacts` are human-readable by default; pass `--json` for automation/stable structured output. `sdd ready` reports satisfied prerequisites and missing artifact topic keys for one phase. `sdd get-artifact` shows artifact metadata and then full content after `--- Content ---`; `sdd list-artifacts` shows one compact row for every canonical SDD phase in phase order and does not print full artifact content.
583
+
584
+ `sdd accept-artifact` records explicit human-only acceptance of an existing artifact through the same SDD workflow service used by MCP. It requires `--project`, `--change`, `--phase`, and `--actor`; `--display-name` defaults to the actor id. `--accepted-at` is optional, but when supplied it must be an ISO date-time with an explicit timezone (`Z` or offset) and is normalized to UTC `toISOString()` output. The default output is a human-readable confirmation with a JSON hint; `--json` returns a content-free success object with project/change/phase/topic key/artifact id/status/acceptedBy/acceptedAt and optional note. `save-artifact` creates or updates draft content only and does not imply acceptance. `sdd reopen-artifact` moves a rejected artifact back to draft after an explicit human decision, so the artifact can be revised and accepted again.
560
585
 
561
- `sdd accept-artifact` records explicit human-only acceptance of an existing artifact through the same SDD workflow service used by MCP. It requires `--project`, `--change`, `--phase`, and `--actor`; `--display-name` defaults to the actor id. `--accepted-at` is optional, but when supplied it must be an ISO date-time with an explicit timezone (`Z` or offset) and is normalized to UTC `toISOString()` output. The default output is a human-readable confirmation with a JSON hint; `--json` returns a content-free success object with project/change/phase/topic key/artifact id/status/acceptedBy/acceptedAt and optional note. `save-artifact` creates or updates draft content only and does not imply acceptance.
586
+ Use `resume --project <project>` when you do not know the run id. It lists recent interrupted candidates for that project from the selected database. Use `resume --project <project> --run-id <id>` to inspect one candidate; this is still read-only and advisory.
562
587
 
563
- The SDD CLI is status/persistence only. It does **not** execute providers, continue workflows, create `openspec/`, or write `.opencode/`, `.claude/`, or user/global provider config.
588
+ The SDD CLI is status, planning, and artifact persistence only. It does **not** execute providers, retry workflow runs, create `openspec/`, or write `.opencode/`, `.claude/`, or user/global provider config.
564
589
 
565
590
  ## Agent resolution
566
591
 
@@ -953,7 +978,7 @@ For more on schema, scopes, and lifecycle, see [Storage](./storage.md).
953
978
 
954
979
  - [Architecture](./architecture.md) — current-state architecture and core domain model.
955
980
  - [Code runtime](./code-runtime.md) — `vgxness code` modes, tools, providers, and approval flow.
956
- - [MCP tools](./mcp.md) — full reference for the 38 MCP tools exposed to agents.
981
+ - [MCP tools](./mcp.md) — full reference for the 41 MCP tools exposed to agents.
957
982
  - [Safety model](./safety.md) — permission categories, approval flow, redactors, and runtime gates.
958
983
  - [Storage](./storage.md) — SQLite schema, scopes, and lifecycle.
959
984
  - [Providers](./providers.md) — adapter contract and how to add a new provider.
@@ -35,6 +35,7 @@ Common flags across modes:
35
35
  | Flag | Effect |
36
36
  |---|---|
37
37
  | `--save-artifact` | Persist the phase artifact when explicit persistence is intended. |
38
+ | `--draft-run` | Let planning phases use draft prerequisites for planning only; human acceptance is still required and `apply-progress` remains gated. |
38
39
  | `--change-id <id>` | Override change id. |
39
40
  | `--approval-policy`, `--approval-channel`, `--memory` | Same as the other modes. |
40
41
 
@@ -172,6 +173,8 @@ Prompts, reports, checkpoints, transcripts, and memory saves redact secret-like
172
173
 
173
174
  `vgxness code sdd <change> <phase>` loads existing artifacts for the requested change/phase and exposes phase-appropriate tools. Non-implementation phases stay read/artifact oriented. `apply-progress` may expose edit and shell tools. `verify` may expose verification shell tools. Artifact saves require explicit `--save-artifact` (or the equivalent runtime flag); passing it is the only way persistence is triggered.
174
175
 
176
+ Use `vgxness sdd continue --project <project> --change <change>` first when you want the read-only continuation plan. It may suggest `vgxness code sdd ... --draft-run --save-artifact` for planning phases when draft prerequisites exist. `--draft-run` does not accept a value, does not weaken human acceptance, and does not unblock `apply-progress`; it only lets planning phases produce or revise draft artifacts before a human accepts them.
177
+
175
178
  ## Project detection
176
179
 
177
180
  `detectProject()` (in `src/code/runtime/project-detection.ts`) reports repository root, stack hints, config files, and verification presets such as `npm run typecheck` or `npm run test` when package scripts exist. The fake provider is deterministic for local tests.
package/docs/glossary.md CHANGED
@@ -80,7 +80,7 @@ A redacted, structured report over SDD state, runs, and approvals. Surfaced thro
80
80
 
81
81
  ## MCP
82
82
 
83
- Model Context Protocol. The agent-facing transport. VGXNESS exposes 38 typed tools over stdio through `vgxness mcp start`. The tool list lives in `SUPPORTED_VGX_MCP_TOOL_NAMES` (`src/mcp/schema.ts`) and is documented in [MCP tools](./mcp.md).
83
+ Model Context Protocol. The agent-facing transport. VGXNESS exposes 41 typed tools over stdio through `vgxness mcp start`. The tool list lives in `SUPPORTED_VGX_MCP_TOOL_NAMES` (`src/mcp/schema.ts`) and is documented in [MCP tools](./mcp.md).
84
84
 
85
85
  ## Memory observation
86
86
 
package/docs/mcp.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # MCP tools
2
2
 
3
- VGXNESS exposes 38 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.
3
+ VGXNESS exposes 41 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
 
@@ -11,16 +11,18 @@ All tools:
11
11
  - Return either a typed result or a `VgxMcpError` with a `code` and `message`.
12
12
  - Do not require the agent to import or instantiate anything; pass JSON, get JSON.
13
13
 
14
- ## SDD workflow (10)
14
+ ## SDD workflow (12)
15
15
 
16
16
  | Tool | Purpose | Required inputs | Notes |
17
17
  |---|---|---|---|
18
18
  | `vgxness_sdd_status` | Report per-phase artifact presence and the next ready missing phase. | `project`, `change` | |
19
19
  | `vgxness_sdd_next` | Recommend the next phase decision for a change. | `project`, `change` | |
20
+ | `vgxness_sdd_continue` | Build a read-only continuation plan for a blocked or interrupted SDD change. | `project`, `change`; optional `payloadMode` (`compact`/`verbose`) | Complements `vgxness_sdd_next` and `vgxness_sdd_cockpit` with copyable next steps. Does not mutate artifacts or runs, execute providers, write provider config, create `openspec/`, or bypass human acceptance. |
20
21
  | `vgxness_sdd_ready` | Check whether a specific phase is ready. | `project`, `change`, `phase`; optional `runId`, `agentId` | Returns structured `SddReadiness` with `blockedPrerequisites`. |
21
22
  | `vgxness_sdd_get_readiness` | Same as `ready` with explicit output shape. | same as `ready` | |
22
23
  | `vgxness_sdd_save_artifact` | Persist phase content under canonical topic key `sdd/{change}/{phase}`. | `project`, `change`, `phase`, `content` | Saving does not imply acceptance. |
23
24
  | `vgxness_sdd_accept_artifact` | Record explicit human acceptance for a phase. | `project`, `change`, `phase`, `acceptedBy` (`{type:"human", id, displayName?}`); optional `acceptedAt`, `note`, `runId`, `agentId` | `acceptedBy.type` must be `"human"`. Runtime rejects agent or anonymous acceptance. Only `note` is accepted; `notes` and `rationale` are rejected as unexpected fields. |
25
+ | `vgxness_sdd_reopen_artifact` | Move a rejected artifact back to draft for revision. | `project`, `change`, `phase`, `reopenedBy` (`{type:"human", id, displayName?}`); optional `reopenedAt`, `note`, `runId`, `agentId` | Human-only recovery path. Does not imply acceptance or bypass downstream gates. |
24
26
  | `vgxness_sdd_get_artifact` | Read one full artifact. | `project`, `change`, `phase`; optional `payloadMode` (`compact`/`verbose`) | |
25
27
  | `vgxness_sdd_list_artifacts` | List all artifacts for a change in canonical phase order. | `project`, `change`; optional `payloadMode` | |
26
28
  | `vgxness_sdd_cockpit` | Aggregate per-phase status, blockers, and recommended next action. | `project`, `change` | Returns `SddCockpit` with `aggregateBlockers` of kinds `missing-topic-key`, `unaccepted-phase`, `legacy-artifact`, `readiness`. |
@@ -64,7 +66,7 @@ All tools:
64
66
  | `vgxness_opencode_manager_payload` | Build the OpenCode manager payload envelope. | `OpenCodeManagerPayloadInput` shape (project, scope, agent, workflow/phase, workspaceRoot, maxSourceBytes, payloadMode) | `installable: false`, `readOnly: true`. |
65
67
  | `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, or write provider config. |
66
68
 
67
- ## Runs (8)
69
+ ## Runs (9)
68
70
 
69
71
  | Tool | Purpose | Required inputs | Notes |
70
72
  |---|---|---|---|
@@ -74,6 +76,7 @@ All tools:
74
76
  | `vgxness_run_checkpoint` | Append a resumable JSON state. | `AppendRunCheckpointInput` shape | |
75
77
  | `vgxness_run_finalize` | Finalize a run with `outcome` and `outcomeReason`. | `FinalizeRunInput` shape | `outcome` must match a terminal `status`. Re-finalization is rejected. |
76
78
  | `vgxness_run_preflight` | Run policy evaluation and return the decision + planned execution isolation strategy. | `PreflightRunOperationInput` shape | May create a pending approval when the decision is `ask`. Does not invoke an executor. |
79
+ | `vgxness_run_resume_candidates` | List recent interrupted runs for a project when the run id is unknown. | `project`; optional `limit` (1-100, default 5) | Returns failed, blocked, and needs-human candidates with `inspectInput` for `run_resume_inspect`. Does not retry, resume, mutate runs, create sandboxes/worktrees, invoke providers, or write artifacts/config. |
77
80
  | `vgxness_run_resume_inspect` | Plan-only resume advisory. | `runId` | Returns `RunResumeOrchestrationPlan` with blockers and `nextAction` (`resolve-approval`/`inspect-run`/`retry-check`/`manual-recovery`/`no-action`). |
78
81
  | `vgxness_run_resume_gate` | Evaluate retry policy for an approval without executing. | `approvalId`; optional `policy` | Default policy is `never`. See [Safety model](./safety.md) for the policy table. |
79
82
 
@@ -107,10 +110,11 @@ Inspecting SDD before doing any work:
107
110
 
108
111
  ```text
109
112
  vgxness_sdd_cockpit { project: "vgxness", change: "new-flow" }
113
+ vgxness_sdd_continue { project: "vgxness", change: "new-flow" }
110
114
  vgxness_sdd_get_readiness { project: "vgxness", change: "new-flow", phase: "proposal" }
111
115
  ```
112
116
 
113
- The cockpit returns `aggregateBlockers`; if any are `unaccepted-phase`, the agent should not run the next phase until a human accepts the prerequisite.
117
+ The cockpit returns `aggregateBlockers`; if any are `unaccepted-phase`, the agent should not run the next phase until a human accepts the prerequisite. `vgxness_sdd_continue` uses the same SDD state to explain how to continue; it is advisory only.
114
118
 
115
119
  Recording a phase with explicit human acceptance:
116
120
 
@@ -130,6 +134,16 @@ vgxness_run_checkpoint { runId, label: "after-step-1", state: {...} }
130
134
  vgxness_run_finalize { runId, outcome: "success", outcomeReason: "..." }
131
135
  ```
132
136
 
137
+ Finding interrupted runs when the run id is unknown:
138
+
139
+ ```text
140
+ vgxness_run_resume_candidates { project: "vgxness", limit: 5 }
141
+ vgxness_run_resume_inspect { runId }
142
+ vgxness_run_resume_gate { approvalId, policy }
143
+ ```
144
+
145
+ `vgxness_run_resume_candidates` is discovery only. It points to `run_resume_inspect` for a selected candidate and does not admit a retry or resume execution; `run_resume_gate` remains the advisory retry-policy check for a known approval id.
146
+
133
147
  ## Safety boundary
134
148
 
135
149
  MCP tools do not:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vgxness",
3
- "version": "1.9.2",
3
+ "version": "1.9.3",
4
4
  "description": "CLI and MCP control plane for guided AI-agent workflows, SDD, memory, and OpenCode setup.",
5
5
  "license": "SEE LICENSE IN LICENSE",
6
6
  "repository": {