vgxness 1.5.0 → 1.5.2

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 +23 -2
  2. package/dist/agents/agent-seed-service.js +10 -0
  3. package/dist/agents/canonical-agent-manifest.js +177 -0
  4. package/dist/agents/canonical-agent-projection.js +146 -0
  5. package/dist/agents/renderers/claude-renderer.js +30 -52
  6. package/dist/cli/bun-bin.js +6 -0
  7. package/dist/cli/cli-help.js +3 -0
  8. package/dist/cli/commands/agent-skill-dispatcher.js +6 -5
  9. package/dist/cli/commands/mcp-dispatcher.js +65 -3
  10. package/dist/cli/index.js +1 -1
  11. package/dist/governance/governance-report-builder.js +45 -26
  12. package/dist/mcp/claude-code-agent-config.js +79 -0
  13. package/dist/mcp/claude-code-config.js +84 -0
  14. package/dist/mcp/client-install-claude-code-contract.js +86 -0
  15. package/dist/mcp/client-install-claude-code.js +85 -0
  16. package/dist/mcp/control-plane.js +2 -0
  17. package/dist/mcp/index.js +5 -0
  18. package/dist/mcp/opencode-default-agent-config.js +7 -113
  19. package/dist/mcp/provider-canonical-agent-manifest.js +39 -0
  20. package/dist/mcp/provider-change-plan.js +57 -1
  21. package/dist/mcp/provider-doctor.js +54 -0
  22. package/dist/mcp/provider-health-types.js +3 -1
  23. package/dist/mcp/provider-status.js +82 -2
  24. package/dist/mcp/schema.js +11 -2
  25. package/dist/mcp/stdio-server.js +2 -0
  26. package/dist/mcp/validation.js +23 -1
  27. package/dist/memory/memory-service.js +59 -0
  28. package/dist/memory/repositories/sessions.js +1 -1
  29. package/dist/sdd/sdd-workflow-service.js +129 -59
  30. package/dist/setup/providers/claude-setup-adapter.js +7 -4
  31. package/docs/architecture.md +54 -112
  32. package/docs/cli.md +53 -0
  33. package/docs/code-runtime.md +218 -0
  34. package/docs/contributing.md +120 -0
  35. package/docs/glossary.md +211 -0
  36. package/docs/mcp.md +144 -0
  37. package/docs/prd.md +23 -26
  38. package/docs/providers.md +123 -0
  39. package/docs/roadmap.md +88 -0
  40. package/docs/safety.md +147 -0
  41. package/docs/storage.md +93 -0
  42. package/package.json +1 -1
  43. package/docs/funcionamiento-del-sistema.md +0 -865
  44. package/docs/harness-gap-analysis.md +0 -243
  45. package/docs/vgxcode.md +0 -87
  46. package/docs/vgxness-code.md +0 -48
@@ -0,0 +1,120 @@
1
+ # Contributing
2
+
3
+ VGXNESS is an alpha local-first control plane. The repository follows a few rules that keep the product safe, predictable, and reviewable. This document is for humans and AI assistants who want to change the code, the docs, or both.
4
+
5
+ ## Repository layout
6
+
7
+ ```
8
+ src/
9
+ agents/ # agent + subagent registry, resolver, canonical manifest
10
+ cli/ # CLI dispatch, command modules, TUI, OpenTUI
11
+ code/ # native code runtime (vgxness code)
12
+ export/ # redaction and export helpers
13
+ governance/ # governance report builder, overlay fingerprint
14
+ harness/ # harness-side tool handlers
15
+ mcp/ # MCP server, schemas, control plane, doctor, OpenCode install
16
+ memory/ # memory service, SQLite database, migrations
17
+ orchestrator/ # natural-language planner (preview only)
18
+ payload/ # payload summary helpers
19
+ permissions/ # policy evaluator, schemas
20
+ providers/ # OpenCode provider adapter
21
+ runs/ # run lifecycle, execution planning, retry, snapshot export
22
+ sdd/ # SDD workflow service, schema, artifact portability
23
+ setup/ # setup defaults, plan, lifecycle, backup-rollback
24
+ skills/ # skill registry, resolver, payload, improvement proposals
25
+ verification/ # verification plan + report services
26
+ workflows/ # workflow registry, executor, allowlist adapter
27
+
28
+ test/ # node:test files mirroring src/ structure
29
+ seeds/ # shipped skill/agent seed assets
30
+ scripts/ # repo-level helper scripts
31
+ docs/ # human-facing documentation
32
+ ```
33
+
34
+ ## Runtime and toolchain
35
+
36
+ - Bun `>= 1.3.14` is the installed CLI/MCP runtime and the canonical CI verification path. It is also the only supported storage runtime (`bun:sqlite`).
37
+ - Node.js `>= 22` is development/build/test tooling for TypeScript, `node:test`, and selected helper scripts.
38
+ - TypeScript is ESM/NodeNext and strict, with `noUncheckedIndexedAccess` and `exactOptionalPropertyTypes`. Prefer explicit `undefined` over loose optional properties.
39
+ - Tests use the built-in `node:test` runner with `node:assert/strict`, not Jest/Vitest.
40
+
41
+ Install dependencies with `bun install --frozen-lockfile` when reproducing CI. When `package.json` dependency specifiers change, refresh and review `bun.lock` intentionally. Use `bun run check:bun-lock` to detect drift without mutating `node_modules`.
42
+
43
+ ## Verification order
44
+
45
+ CI runs the verification chain in this order:
46
+
47
+ ```bash
48
+ bun install --frozen-lockfile
49
+ bun run check:bun-lock
50
+ bun run verify:typecheck
51
+ bun run verify:test
52
+ bun run verify:test:bun-storage
53
+ bun run verify:bun-sqlite
54
+ bun run verify:package # which is bun run package:bun:evidence
55
+ bun run package:bun:evidence -- --require-pass
56
+ ```
57
+
58
+ The full chain is wrapped in `bun run verify`. For release-readiness, the package evidence run must pass explicitly with `--require-pass`.
59
+
60
+ `bun run verify:bun-sqlite` is the SQLite runtime release gate. It copies the source migrations into a temporary directory, applies them against a temporary database, and checks foreign keys, busy timeout, FTS/search, transaction rollback, integrity, and cleanup.
61
+
62
+ ## Product boundaries
63
+
64
+ VGXNESS is a local-first CLI/MCP control plane. The same domain services should back CLI, TUI, and MCP. Avoid reimplementing workflow, setup, or storage rules in only one surface.
65
+
66
+ The configurator/setup plane (rendering/installing provider config) is separate from the runtime control plane (executing SDD phases, recording runs, gating approvals). They are wired by services, not by side effects.
67
+
68
+ ## Safety conventions
69
+
70
+ These rules are non-negotiable. The harness is loaded with capability; do not remove these guards.
71
+
72
+ - Read-only/preview commands must stay non-mutating. Setup plans, MCP setup previews, OpenCode previews, workflow previews, and status views must not write provider config or call providers.
73
+ - Provider config writes require explicit consent (`--yes` or equivalent confirmed flow) plus backup/rollback behavior.
74
+ - Do not create or write `openspec/`. SDD artifacts are stored through the local SQLite artifact service under canonical topic keys `sdd/{change}/{phase}`.
75
+ - Human acceptance is distinct from artifact presence. Do not infer acceptance from generated content or saved drafts. The runtime rejects `acceptedBy.type !== 'human'`.
76
+ - Workspace boundary denials cannot be relaxed by agent or subagent overrides. The policy evaluator uses `realpathSync` to defeat symlink escapes.
77
+ - Secrets and external directory access deny by default. Redaction helpers in `src/code/reporting/redaction.ts` and `src/export/redaction.ts` are the only place secret-shaped values should be stripped.
78
+
79
+ ## Style
80
+
81
+ - TypeScript strict, ESM/NodeNext, `noUncheckedIndexedAccess`, `exactOptionalPropertyTypes`.
82
+ - Prefer explicit `undefined` over loose optional properties. Use the existing `MemoryResult<T>` / `MemoryResult<...>` style for fallible operations instead of throwing across module boundaries.
83
+ - Domain entities live in their module's `schema.ts`. Tool-facing payloads live in `src/mcp/schema.ts` (or a sibling) and are validated with `zod` before dispatch.
84
+ - Tests are colocated by module under `test/`. Use `node:test` and `node:assert/strict`. Each test file should set up its own `MemoryDatabase` (see existing files for the pattern).
85
+ - Public CLI/setup language is English unless existing docs explicitly say otherwise.
86
+
87
+ ## Doc-sync discipline
88
+
89
+ The docs are the user-facing contract. When the code drifts, the docs must catch up — not the other way around.
90
+
91
+ - When you add, rename, or remove an MCP tool, update `SUPPORTED_VGX_MCP_TOOL_NAMES` in `src/mcp/schema.ts` and the table in [MCP tools](./mcp.md). They must stay in sync.
92
+ - When you add a new CLI command, document it in [CLI reference](./cli.md).
93
+ - When you change a permission category, default, or phase mode, update [Safety model](./safety.md).
94
+ - When you add a migration, append it to the table in [Storage](./storage.md).
95
+ - When you add or change a provider, update [Providers](./providers.md) and the [Code runtime](./code-runtime.md) tool list.
96
+
97
+ ## Pull request process
98
+
99
+ VGXNESS is shipped as a proprietary package. The npm publication step is a separate, explicit, human-approved process. PRs that change published artifacts must:
100
+
101
+ 1. Run `bun run verify` locally and confirm all steps pass.
102
+ 2. Include or update tests for any behavioral change.
103
+ 3. Update docs that reference the changed surface.
104
+ 4. Not change the publication path. `npm publish`, `bun publish`, registry dry-runs, provenance upload, release creation, and dist-tag mutation are not part of normal PR flow.
105
+ 5. Not change `engines.bun` or remove the `bin`/`files` whitelist without a separate, documented decision.
106
+
107
+ PRs that touch safety gates, permission categories, default policies, the run lifecycle, or the SDD acceptance gate are reviewed by a maintainer who can answer "does this still match the safety model?" without consulting the diff. If you are unsure, open the PR as a draft and ask.
108
+
109
+ ## Commit conventions
110
+
111
+ - Conventional Commits (`feat:`, `fix:`, `chore:`, `docs:`, `refactor:`, `test:`, `build:`, `ci:`).
112
+ - No `Co-Authored-By` lines for AI assistants. Do not add AI attribution to commits.
113
+ - One logical change per commit. Squash fixups locally before pushing.
114
+
115
+ ## AI assistants in this repo
116
+
117
+ `AGENTS.md` at the repository root carries the working instructions for AI assistants. The two non-negotiables are:
118
+
119
+ - Do not write to `openspec/`.
120
+ - Do not infer SDD acceptance from generated content. The runtime will reject it, but the rejection costs a run.
@@ -0,0 +1,211 @@
1
+ # Glossary
2
+
3
+ Terms used across the VGXNESS docs and codebase. The product surface is small enough that most of these are first-class concepts in `src/` rather than incidental vocabulary.
4
+
5
+ ## Acceptance
6
+
7
+ A human-only action that records explicit approval of a SDD phase artifact. `vgxness_sdd_accept_artifact` requires `acceptedBy.type === 'human'`; the runtime rejects agent or anonymous acceptance. Acceptance is distinct from artifact presence — saving a draft never implies acceptance.
8
+
9
+ ## Adapter
10
+
11
+ A translator between VGXNESS's provider-neutral domain and a specific provider. The control plane uses renderers (OpenCode, JSON, Claude preview). The code runtime uses `CodeProviderAdapter` implementations (`openai-compatible`, `fake`).
12
+
13
+ ## Agent
14
+
15
+ A provider-neutral definition of who executes work. Carries role, instructions, capabilities, model preference, permissions, and compatible workflows. Subagents are specialized agents intended for delegated, scoped work with constrained tools.
16
+
17
+ ## Approval record
18
+
19
+ A first-class record linked to a permission-decision event. Created when a permission request resolves to `ask`; resolved once as `approved`, `rejected`, or `cancelled` with actor, reason, and timestamp. Approvals drive `resumeApprovedOperation(...)`.
20
+
21
+ ## Attempt
22
+
23
+ A reserved operation execution linked to an approval. Attempts transition through `reserved` → `succeeded` | `failed` | `abandoned`. Multiple ordered attempts are allowed per approval, but only one is `reserved` at a time.
24
+
25
+ ## Blockers (SDD cockpit)
26
+
27
+ Aggregated reasons a SDD phase is not ready. Kinds: `missing-topic-key`, `unaccepted-phase`, `legacy-artifact`, `readiness`. Surfaced through `vgxness_sdd_cockpit`.
28
+
29
+ ## Bun
30
+
31
+ The canonical installed CLI/MCP runtime and verification path. Required `>= 1.3.14`. The only supported storage runtime (via `bun:sqlite`).
32
+
33
+ ## Canonical agent manifest
34
+
35
+ The built-in, validated manifest that defines the manager agent and the SDD subagents (`vgxness-sdd-explore`, `vgxness-sdd-propose`, `vgxness-sdd-spec`, `vgxness-sdd-design`, `vgxness-sdd-tasks`, `vgxness-sdd-apply`, `vgxness-sdd-verify`, `vgxness-sdd-archive`, plus `init` and `onboard`). Lives in `src/agents/canonical-agent-manifest.ts`. `promptContractVersion` increments on breaking contract changes.
36
+
37
+ ## Change (SDD)
38
+
39
+ The unit of SDD work. Identified by a project-scoped `change` id. Artifacts are stored under canonical topic keys `sdd/{change}/{phase}`.
40
+
41
+ ## Checkpoint
42
+
43
+ A labeled, ordered JSON blob attached to a run that lets work resume. Append through `vgxness_run_checkpoint`. Checkpoints are part of the run; they are not the same as memory observations.
44
+
45
+ ## Cockpit
46
+
47
+ A read-only SDD aggregate view. `vgxness_sdd_cockpit` returns per-phase status, blockers, and a recommended next action. The TUI should eventually mirror this surface.
48
+
49
+ ## Code runtime
50
+
51
+ The native workspace runtime exposed through `vgxness code` (`inspect` / `plan` / `craft-preview` / `craft` / `sdd`). Provider-neutral; speaks to any OpenAI-compatible endpoint through `openai-compatible-provider-adapter.ts`.
52
+
53
+ ## Configurator plane
54
+
55
+ The part of VGXNESS that renders provider-specific artifacts (OpenCode config, agent JSON) without mutating the registry. Separate from the runtime control plane.
56
+
57
+ ## Control plane
58
+
59
+ The part of VGXNESS that owns workflow state, runs, approvals, checkpoints, and audit evidence. Exposed through CLI, TUI, and MCP.
60
+
61
+ ## Decision
62
+
63
+ A permission resolution: `allow`, `ask`, or `deny`. For SDD-phase gating the matrix uses four modes: `allow`, `audit`, `require-preflight`, `deny`.
64
+
65
+ ## Dry-run
66
+
67
+ A read-only preview. Setup plans, MCP setup previews, OpenCode previews, workflow previews, and status views are dry-runs by contract — they must not write provider config or call providers.
68
+
69
+ ## Eval target
70
+
71
+ A testable property of the harness. The 11 eval targets live in [Architecture](./architecture.md) and are covered by `node:test` files under `test/`.
72
+
73
+ ## Execution isolation plan
74
+
75
+ A planned strategy for executing a reserved operation: `workspace`, `git-worktree`, or `process-sandbox`. Produced by `planExecutionIsolation(...)`. The actual executor is still test-only in v1.5.1.
76
+
77
+ ## Governance report
78
+
79
+ A redacted, structured report over SDD state, runs, and approvals. Surfaced through `vgxness_governance_report`. Useful for review before promotion.
80
+
81
+ ## MCP
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).
84
+
85
+ ## Memory observation
86
+
87
+ A durable record in the SQLite store. Identified by `id`; upserted by `topicKey`. Types: `architecture`, `decision`, `bugfix`, `pattern`, `config`, `discovery`, `learning`, `preference`, `manual`. Project or personal scope.
88
+
89
+ ## Natural-language planner
90
+
91
+ The provider-agnostic front-door classifier for operator text. Maps an intent to exactly one preview flow: `direct`, `plan`, `sdd`, or `diagnose`. Non-executing by design.
92
+
93
+ ## OpenCode
94
+
95
+ The primary supported provider for the control plane. The configurator renders OpenCode MCP config and manager/SDD agent definitions. Claude Code is preview/manual only.
96
+
97
+ ## Operation attempt
98
+
99
+ See **Attempt**.
100
+
101
+ ## Payload mode
102
+
103
+ A knob that controls how much context a payload returns. `compact` (default for the manager) keeps tokens bounded; `verbose` returns the full content. Applies to `vgxness_agent_activate`, `vgxness_skill_payload`, `vgxness_sdd_get_artifact`, `vgxness_sdd_list_artifacts`, `vgxness_governance_report`.
104
+
105
+ ## Pending approval
106
+
107
+ An approval record that has not been resolved yet. Created when a permission request resolves to `ask`. Visible in the run details.
108
+
109
+ ## Permission
110
+
111
+ A category of action. Categories: `read`, `edit`, `implementation-edit`, `spec-write`, `design-write`, `task-write`, `shell`, `test-run`, `install`, `network`, `git`, `git-write`, `memory`, `memory-write`, `external-directory`, `provider-tool`, `secrets`. See [Safety model](./safety.md).
112
+
113
+ ## Phase (SDD)
114
+
115
+ A canonical stage in the SDD lifecycle: `explore`, `proposal`, `spec`, `design`, `tasks`, `apply-progress`, `verify`, `archive`. Each phase has prerequisites and an acceptance requirement.
116
+
117
+ ## Policy evaluator
118
+
119
+ The function that resolves a permission request. Returns `allow`, `ask`, or `deny` with a reason. Conservative defaults; workspace boundary denials cannot be relaxed by agent overrides.
120
+
121
+ ## Preflight
122
+
123
+ A permission decision plus execution isolation plan produced before a reserved operation. `vgxness_run_preflight` may create a pending approval when the decision is `ask`.
124
+
125
+ ## Project (scope)
126
+
127
+ One of two memory scopes. `project` is repo-specific; `personal` is user-global. Scopes live in the same database, separated by columns.
128
+
129
+ ## Provider adapter
130
+
131
+ See **Adapter**.
132
+
133
+ ## Readiness
134
+
135
+ Whether a SDD phase can advance. Combines prerequisite artifacts, human acceptance of prerequisites, and aggregate blockers. Surfaced through `vgxness_sdd_ready`, `vgxness_sdd_get_readiness`, and `vgxness_sdd_cockpit`.
136
+
137
+ ## Redaction
138
+
139
+ Stripping secret-shaped values before they leave the runtime. `redactSecrets`, `redactJson`, and `omitSensitiveCommandOutput` live in `src/code/reporting/redaction.ts` and `src/export/redaction.ts`.
140
+
141
+ ## Reserved attempt
142
+
143
+ An operation attempt in the `reserved` state. Exclusive per approval. Finalized to `succeeded` or `failed` after the executor returns; recovery-only `abandoned` for stuck attempts.
144
+
145
+ ## Retry policy
146
+
147
+ The policy that decides whether a new attempt is allowed after a prior one. `never`, `after-abandoned`, `after-failure`, `after-failure-or-abandoned`. Default is `never`. Evaluated by `vgxness_run_resume_gate`.
148
+
149
+ ## Run
150
+
151
+ The auditable unit of execution. Has 8 statuses: `created`, `planned`, `running`, `needs-human`, `completed`, `failed`, `blocked`, `cancelled`. Carries events, checkpoints, approvals, and operation attempts.
152
+
153
+ ## Run snapshot export
154
+
155
+ A versioned JSON package containing the full run, its events, checkpoints, approvals, and attempts. Useful for review and debugging. `RunSnapshotPackageV1`.
156
+
157
+ ## Scope
158
+
159
+ `project` or `personal`. Memory, agents, skills, and manager profile overlays all carry a scope.
160
+
161
+ ## SDD
162
+
163
+ Spec-Driven Development. The canonical workflow `explore → proposal → spec → design → tasks → apply-progress → verify → archive`. See [PRD](./prd.md) for the principles and [Architecture](./architecture.md) for the engine.
164
+
165
+ ## Session
166
+
167
+ A scoped record of work in progress. Started with `vgxness_session_start`, appended to with `vgxness_session_append_activity`, closed with `vgxness_session_close`. The latest restorable session is read through `vgxness_session_restore` or, more reliably, `vgxness_context_cockpit`.
168
+
169
+ ## Skill
170
+
171
+ A versioned, reusable knowledge/procedure that can be attached to an agent, workflow, phase, or provider adapter. Skill improvement proposals must be approved by a human before activation.
172
+
173
+ ## Skill improvement proposal
174
+
175
+ A reviewable, versioned change to a skill. Goes through `draft` → `submitted` → `approved`/`rejected`/`cancelled` → `applied`. Only `approved` proposals can be applied.
176
+
177
+ ## SddCockpitBlocker
178
+
179
+ A typed blocker surfaced by the SDD cockpit. Kinds: `missing-topic-key`, `unaccepted-phase`, `legacy-artifact`, `readiness`. See [Safety model](./safety.md) and [Architecture](./architecture.md).
180
+
181
+ ## SddPrerequisiteBlocker
182
+
183
+ A typed blocker for a missing or unaccepted prerequisite phase. Reasons: `missing`, `draft`, `legacy`, `rejected`, `superseded`.
184
+
185
+ ## Subagent
186
+
187
+ See **Agent**.
188
+
189
+ ## Topic key
190
+
191
+ The durable upsert key for memory observations and SDD artifacts. For SDD, the canonical form is `sdd/{change}/{phase}`.
192
+
193
+ ## Trace event
194
+
195
+ A structured event in a run's timeline. Kinds: `timeline`, `evidence`, `memory-operation`, `artifact-reference`, `tool-call`, `permission-decision`, `execution-plan`, `operation-execution`, `approval`, `verification`.
196
+
197
+ ## TUI
198
+
199
+ Terminal UI. OpenTUI (`@opentui/core`) is the framework for the main menu and setup screens.
200
+
201
+ ## Verification plan
202
+
203
+ A recommended set of verification steps for a change type. `vgxness_verification_plan` takes a `changeType` (`docs-only`, `test-only`, `cli`, `mcp`, `sdd-storage`, `provider-setup`, `package-release`, `workflow-runs`) and returns the recommended plan.
204
+
205
+ ## Worktree (planned)
206
+
207
+ A planned execution isolation strategy. `git-worktree` plans produce a plan to mutate inside an isolated worktree; the actual worktree creation is follow-up.
208
+
209
+ ## Workspace boundary
210
+
211
+ The set of paths inside `workspaceRoot`. The policy evaluator uses `realpathSync` to defeat symlink escapes and refuses to relax boundary denials.
package/docs/mcp.md ADDED
@@ -0,0 +1,144 @@
1
+ # MCP tools
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.
4
+
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
+
7
+ All tools:
8
+
9
+ - Are read-only or auditable on the VGXNESS side. The only state-mutating tools are the ones explicitly named `*_save`, `*_update`, `*_start`, `*_checkpoint`, `*_finalize`, `*_accept_artifact`, `*_set`, `*_append_activity`, `*_close`, `*_record_*`.
10
+ - Validate input with `zod` before dispatching to the service layer.
11
+ - Return either a typed result or a `VgxMcpError` with a `code` and `message`.
12
+ - Do not require the agent to import or instantiate anything; pass JSON, get JSON.
13
+
14
+ ## SDD workflow (10)
15
+
16
+ | Tool | Purpose | Required inputs | Notes |
17
+ |---|---|---|---|
18
+ | `vgxness_sdd_status` | Report per-phase artifact presence and the next ready missing phase. | `project`, `change` | |
19
+ | `vgxness_sdd_next` | Recommend the next phase decision for a change. | `project`, `change` | |
20
+ | `vgxness_sdd_ready` | Check whether a specific phase is ready. | `project`, `change`, `phase`; optional `runId`, `agentId` | Returns structured `SddReadiness` with `blockedPrerequisites`. |
21
+ | `vgxness_sdd_get_readiness` | Same as `ready` with explicit output shape. | same as `ready` | |
22
+ | `vgxness_sdd_save_artifact` | Persist phase content under canonical topic key `sdd/{change}/{phase}`. | `project`, `change`, `phase`, `content` | Saving does not imply acceptance. |
23
+ | `vgxness_sdd_accept_artifact` | Record explicit human acceptance for a phase. | `project`, `change`, `phase`, `acceptedBy` (`{type:"human", id, displayName?}`); optional `acceptedAt`, `note`, `notes`, `rationale`, `runId`, `agentId` | `acceptedBy.type` must be `"human"`. Runtime rejects agent or anonymous acceptance. |
24
+ | `vgxness_sdd_get_artifact` | Read one full artifact. | `project`, `change`, `phase`; optional `payloadMode` (`compact`/`verbose`) | |
25
+ | `vgxness_sdd_list_artifacts` | List all artifacts for a change in canonical phase order. | `project`, `change`; optional `payloadMode` | |
26
+ | `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`. |
27
+ | `vgxness_governance_report` | Build a redacted governance report for a project/change/run. | `project`; optional `change`, `runId`, `workflow`, `phase`, `agentId`, `agent` (with `id`, `name`, `mode`, `scope`), `payloadMode` | See [Safety model](./safety.md) for redaction rules. |
28
+
29
+ ## Memory (4)
30
+
31
+ | Tool | Purpose | Required inputs |
32
+ |---|---|---|
33
+ | `vgxness_memory_save` | Upsert memory observation. | `project`, `type` (`architecture`/`decision`/`bugfix`/`pattern`/`config`/`discovery`/`learning`/`preference`/`manual`), `title`, `content`; optional `scope` (`project`/`personal`), `topicKey` |
34
+ | `vgxness_memory_search` | FTS5 search over memory. | `limit` (1–100); optional `project`, `scope`, `type`, `topicKey`, `query` |
35
+ | `vgxness_memory_get` | Read one observation by id. | `id` |
36
+ | `vgxness_memory_update` | Patch an existing observation. | `id`; optional `type`, `title`, `content`, `topicKey` |
37
+
38
+ `topicKey` is the durable upsert key: re-saving with the same key updates the existing observation rather than creating a duplicate.
39
+
40
+ ## Sessions (5)
41
+
42
+ | Tool | Purpose | Required inputs | Notes |
43
+ |---|---|---|---|
44
+ | `vgxness_session_start` | Begin a session record. | `project`; optional `id`, `directory` | If `id` is omitted, the runtime generates one. |
45
+ | `vgxness_session_append_activity` | Append a structured event to a session. | `sessionId`, `actor`, `kind` (`prompt`/`tool_call`/`artifact`/`summary`/`error`), `payloadJson` | `payloadJson` is a stringified JSON value, validated before append. |
46
+ | `vgxness_session_close` | Close a session with a summary. | `sessionId`, `actor`, `summary` (non-empty, trimmed) | |
47
+ | `vgxness_session_restore` | Read the latest restorable session for a project/directory. | `project`; optional `directory` | One signal — not authoritative. Prefer `vgxness_context_cockpit`. |
48
+ | `vgxness_context_cockpit` | Read-only cockpit: recent sessions, bounded memory previews, last restorable session. | `project`; optional `directory`, `limit` | Does not trace, mutate state, run preflight, or write provider config. |
49
+
50
+ ## Agents, profile, skills (5)
51
+
52
+ | Tool | Purpose | Required inputs | Notes |
53
+ |---|---|---|---|
54
+ | `vgxness_agent_resolve` | Rank registered agents/subagents for a task. | `project`, `scope?`, `taskDescription` or `intent`; optional `desiredCapabilities`, `workflow`, `phase`, `providerAdapter`, `mode` (`agent`/`subagent`) | Deterministic rule-based ranking. No model call. |
55
+ | `vgxness_agent_activate` | Build an activation envelope for the resolved agent. | `project`, `agentId` or `name`; optional `scope`, `workflow`, `phase`, `providerAdapter`, `mode`, `workspaceRoot`, `maxSourceBytes`, `payloadMode` | Default `payloadMode` is `compact`. |
56
+ | `vgxness_manager_profile_get` | Read the manager profile overlay. | `project`; optional `scope`, `managerName` | |
57
+ | `vgxness_manager_profile_set` | Upsert a manager profile overlay. | input shape from `SaveManagerProfileOverlayInput` | Requires explicit human authorization in the harness prompt. |
58
+ | `vgxness_skill_payload` | Resolve and build a provider-agnostic skill injection payload. | `agentId`/`name`+`project`+`scope`, `workflow`, `phase`, `providerAdapter`; `workspaceRoot`; optional `maxSourceBytes`, `mode` | `mode` defaults to `compact`. See [Code runtime](./code-runtime.md) for how the runtime consumes this. |
59
+
60
+ ## OpenCode preview (2)
61
+
62
+ | Tool | Purpose | Required inputs | Notes |
63
+ |---|---|---|---|
64
+ | `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
+ | `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
+
67
+ ## Runs (8)
68
+
69
+ | Tool | Purpose | Required inputs | Notes |
70
+ |---|---|---|---|
71
+ | `vgxness_run_list` | List runs with filters. | `limit`; optional `project`, `status` (one of the 8 `RunStatus` values) | |
72
+ | `vgxness_run_get` | Read a run with `events`, `checkpoints`, `approvals`, `operationAttempts`. | `id` | |
73
+ | `vgxness_run_start` | Create a run record. | `CreateRunInput` shape | |
74
+ | `vgxness_run_checkpoint` | Append a resumable JSON state. | `AppendRunCheckpointInput` shape | |
75
+ | `vgxness_run_finalize` | Finalize a run with `outcome` and `outcomeReason`. | `FinalizeRunInput` shape | `outcome` must match a terminal `status`. Re-finalization is rejected. |
76
+ | `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. |
77
+ | `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
+ | `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
+
80
+ Run `status` accepts the full 8-state vocabulary: `created`, `planned`, `running`, `needs-human`, `completed`, `failed`, `blocked`, `cancelled`. `outcome` is one of `success`, `partial`, `failure`, `blocked`, `cancelled`.
81
+
82
+ ## Providers (3)
83
+
84
+ | Tool | Purpose | Required inputs | Notes |
85
+ |---|---|---|---|
86
+ | `vgxness_provider_status` | Report provider health for a project/scope. | `ProviderHealthInput` shape (project, scope, workspaceRoot, providerAdapter) | Read-only. |
87
+ | `vgxness_provider_doctor` | Run provider health checks with structured JSON output. | same as `status` | |
88
+ | `vgxness_provider_change_plan` | Compose a read-only provider config change plan. | `ProviderChangePlanInput` shape (`provider`: `opencode`/`claude`/`antigravity`/`custom`; `changeType`: `opencode-mcp-install`/`setup`/`install`/`config-preparation`; `workspaceRoot`; `payloadMode`) | Does not write provider config. See [Providers](./providers.md). |
89
+
90
+ ## Verification (1)
91
+
92
+ | Tool | Purpose | Required inputs |
93
+ |---|---|---|
94
+ | `vgxness_verification_plan` | Recommend a verification plan for a change type. | `changeType` (`docs-only`/`test-only`/`cli`/`mcp`/`sdd-storage`/`provider-setup`/`package-release`/`workflow-runs`) |
95
+
96
+ ## Usage patterns
97
+
98
+ Starting, resuming, and ending a session:
99
+
100
+ ```text
101
+ vgxness_session_start { project: "vgxness", directory: "/path" }
102
+ vgxness_session_append_activity { sessionId, actor, kind, payloadJson }
103
+ vgxness_session_close { sessionId, actor, summary }
104
+ ```
105
+
106
+ Inspecting SDD before doing any work:
107
+
108
+ ```text
109
+ vgxness_sdd_cockpit { project: "vgxness", change: "new-flow" }
110
+ vgxness_sdd_get_readiness { project: "vgxness", change: "new-flow", phase: "proposal" }
111
+ ```
112
+
113
+ The cockpit returns `aggregateBlockers`; if any are `unaccepted-phase`, the agent should not run the next phase until a human accepts the prerequisite.
114
+
115
+ Recording a phase with explicit human acceptance:
116
+
117
+ ```text
118
+ vgxness_sdd_save_artifact { project, change, phase: "proposal", content: "..." }
119
+ # human opens the harness and runs:
120
+ vgxness_sdd_accept_artifact { project, change, phase: "proposal", acceptedBy: { type: "human", id: "uziel" }, rationale: "Reviewed proposal." }
121
+ ```
122
+
123
+ Running a planned operation:
124
+
125
+ ```text
126
+ vgxness_run_start { project, userIntent, workflow: "sdd", phase: "apply-progress", selectedAgentId, providerAdapter, model }
127
+ vgxness_run_preflight { runId, category: "edit", operation: "apply_patch", workspaceRoot, targetPath, payload }
128
+ # if decision is "ask", wait for human approval; on approval, the harness resumes via run_resume_inspect + run_resume_gate.
129
+ vgxness_run_checkpoint { runId, label: "after-step-1", state: {...} }
130
+ vgxness_run_finalize { runId, outcome: "success", outcomeReason: "..." }
131
+ ```
132
+
133
+ ## Safety boundary
134
+
135
+ MCP tools do not:
136
+
137
+ - Write provider config (`.opencode/`, `.claude/`, `opencode.json`, `CLAUDE.md`).
138
+ - Execute providers (`opencode`, `claude`, etc.).
139
+ - Install global memory.
140
+ - Create `openspec/`.
141
+ - Bypass permission policy.
142
+ - Mutate other tools' state outside the VGXNESS SQLite store.
143
+
144
+ Tools that would normally mutate external state (provider install, shell, network) are split into a plan/preview step and an explicit `apply` step. The apply step requires an MCP-side `apply` flag or a separate `vgxness` CLI command (e.g. `vgxness setup apply --yes`).
package/docs/prd.md CHANGED
@@ -128,18 +128,7 @@ Minimum MCP capabilities:
128
128
 
129
129
  Candidate MCP tools:
130
130
 
131
- ```text
132
- vgxness_sdd_status
133
- vgxness_sdd_next
134
- vgxness_sdd_ready
135
- vgxness_sdd_save_artifact
136
- vgxness_run_start
137
- vgxness_run_checkpoint
138
- vgxness_run_request_approval
139
- vgxness_agent_resolve
140
- vgxness_skill_payload
141
- vgxness_profile_get
142
- ```
131
+ The current MCP surface covers SDD status and artifacts, memory read/write, sessions, agent resolution and activation, skill payload, OpenCode manager payload, run lifecycle (start, list, get, preflight, checkpoint, finalize, resume inspect, resume gate), provider status/doctor/change-plan, verification plan, governance report, and context cockpit. The full, current list lives in [MCP tools](./mcp.md) and in `SUPPORTED_VGX_MCP_TOOL_NAMES` (`src/mcp/schema.ts`); treat that array as the source of truth.
143
132
 
144
133
  #### CLI
145
134
 
@@ -213,8 +202,8 @@ The same flow must be available through CLI flags for automation and CI-friendly
213
202
 
214
203
  Initial integration targets:
215
204
 
216
- - OpenCode
217
- - Claude Code
205
+ - OpenCode — primary supported provider. The configurator plane renders OpenCode MCP config and manager/SDD agent definitions; the code runtime speaks to any OpenAI-compatible endpoint, including OpenCode's local bridge.
206
+ - Claude Code — preview/manual only as of v1.5.1. The canonical agent manifest declares Claude support as `preview` with an explicit reason: VGXNESS does not install Claude or write `.claude/` or `CLAUDE.md`. Owners of Claude-only workflows must run setup themselves.
218
207
 
219
208
  Pi/`gentle-pi` is a design reference and future adapter target, not part of the first integration target list unless the MVP scope is explicitly expanded.
220
209
 
@@ -358,15 +347,23 @@ The MVP is successful when an advanced individual developer can:
358
347
 
359
348
  ## Open questions
360
349
 
361
- - What is the first integration adapter: OpenCode or Claude Code?
362
- - Should memory storage be per-repo by default, with global memory in a user-level directory?
363
- - What config format should define agents/subagents?
364
- - What config format should define skills and skill versions?
365
- - Which skill improvement proposals should require approval versus automatic rejection?
366
- - Which commands form the first public CLI surface?
367
- - Which TUI framework should be used for the first implementation?
368
- - Should the MCP server run only over stdio for MVP, or also support local HTTP later?
369
- - What is the safest default install command and update channel?
370
- - What privacy/export guarantees are required before public release?
371
- - What is the first sandbox strategy: normal workspace, git worktree, or process/container isolation?
372
- - What trace format should be used for local inspection and future cloud sync?
350
+ Many of the early PRD questions are resolved in v1.5.1. Tracking them here keeps the historical record.
351
+
352
+ | Question | Resolved as of v1.5.1 |
353
+ |---|---|
354
+ | First integration adapter | OpenCode primary; Claude is preview/manual. |
355
+ | Memory storage scopes | Project memory and personal/global memory live in separate SQLite stores; `--db` flag and `VGXNESS_DB_PATH` env var override. |
356
+ | Agent config format | Provider-neutral schema in `src/agents/schema.ts`; canonical manifest with validation in `src/agents/canonical-agent-manifest.ts`. |
357
+ | Skill config format | Versioned skills with source metadata (`path`/`url`/`inline`); active version gating in `src/skills/skill-registry-service.ts`. |
358
+ | Skill improvement approval | All proposals require explicit human approval before activation; rejected/cancelled proposals cannot be applied. |
359
+ | First public CLI surface | `vgxness {init, setup, doctor, mcp, sdd, agents, skills, memory, runs, code, opencode}`. See [CLI reference](./cli.md). |
360
+ | First TUI framework | OpenTUI (`@opentui/core`) for the main menu and setup screens; legacy tui-kit screens still in tree for backwards compatibility. |
361
+ | MCP transport | Local stdio for MVP; HTTP deferred. |
362
+ | Default install command | `npm install -g vgxness` ships both `vgxness` and `vgx` bins; Bun 1.3.14+ is the canonical installed runtime. |
363
+ | Sandbox strategy | Planning-only in v1.5.1 (`src/runs/sandbox-worktree-planning.ts`); real sandbox/worktree execution is follow-up. Approval-gated edits/shell happen through the code runtime's executors. |
364
+
365
+ Still open:
366
+
367
+ - Privacy/export guarantees required before public release (depends on release scope).
368
+ - Distributed multi-worker execution model (post-MVP).
369
+ - Web/hosted console surface (post-MVP).