vgxness 1.20.13 → 1.20.15

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 (28) hide show
  1. package/README.md +2 -0
  2. package/dist/adapters/opencode/install/client-install-opencode-contract.js +4 -2
  3. package/dist/adapters/opencode/install/client-install-opencode.js +6 -2
  4. package/dist/application/agents/agent-resolver.js +9 -1
  5. package/dist/application/knowledge-workspace/canvas-renderer.js +36 -0
  6. package/dist/application/knowledge-workspace/filesystem-workspace-port.js +98 -0
  7. package/dist/application/knowledge-workspace/markdown-renderer.js +68 -0
  8. package/dist/application/knowledge-workspace/obsidian-export-service.js +157 -0
  9. package/dist/application/knowledge-workspace/obsidian-mcp-workspace-port.js +109 -0
  10. package/dist/application/knowledge-workspace/workspace-port.js +20 -0
  11. package/dist/application/provider-setup/provider-doctor.js +1 -1
  12. package/dist/domain/agents/canonical-agent-manifest.js +0 -1
  13. package/dist/domain/knowledge-workspace/schema.js +1 -0
  14. package/dist/interfaces/cli/cli-help.js +5 -1
  15. package/dist/interfaces/cli/commands/index.js +1 -0
  16. package/dist/interfaces/cli/commands/knowledge-workspace-dispatcher.js +252 -0
  17. package/dist/interfaces/cli/dispatcher.js +9 -1
  18. package/docs/architecture.md +1 -1
  19. package/docs/cli.md +13 -0
  20. package/docs/glossary.md +1 -1
  21. package/docs/knowledge-workspace.md +135 -0
  22. package/docs/obsidian-mcp.md +130 -0
  23. package/docs/sdd/sqlite-obsidian-knowledge-workflow/design.md +118 -0
  24. package/docs/sdd/sqlite-obsidian-knowledge-workflow/proposal.md +80 -0
  25. package/docs/sdd/sqlite-obsidian-knowledge-workflow/spec.md +88 -0
  26. package/docs/sdd/sqlite-obsidian-knowledge-workflow/tasks.md +70 -0
  27. package/docs/storage.md +2 -0
  28. package/package.json +1 -1
@@ -0,0 +1,118 @@
1
+ # Design: SQLite + Obsidian MCP Knowledge Workflow
2
+
3
+ ## Technical Approach
4
+
5
+ Introduce a knowledge workspace layer that projects existing VGXNESS SQLite/repository state into Obsidian through a small port. The port has an Obsidian MCP adapter as the preferred implementation and a filesystem adapter for tests/offline fallback. SQLite remains the source of truth for operational state.
6
+
7
+ ## Architecture Decisions
8
+
9
+ ### Decision: SQLite remains authoritative
10
+
11
+ **Choice:** Keep memory, SDD artifacts, acceptance, runs, traces, checkpoints, and approvals in SQLite.
12
+
13
+ **Alternatives considered:** Use Obsidian Markdown as the primary memory store; use bidirectional Obsidian/SQLite sync from the start.
14
+
15
+ **Rationale:** Agent memory and SDD governance require structured queries, revisions, topic keys, readiness checks, and safe transactional state. Obsidian is excellent for human review, but not for authoritative runtime state.
16
+
17
+ ### Decision: Obsidian MCP is the preferred workspace transport
18
+
19
+ **Choice:** Use an Obsidian MCP server for note read/write/search/patch operations.
20
+
21
+ **Alternatives considered:** Direct filesystem writes only; implementing a VGXNESS-specific Obsidian plugin.
22
+
23
+ **Rationale:** MCP gives agents a standard, inspectable transport and supports structured note operations such as patching, frontmatter management, tags, and open-in-UI without coupling VGXNESS directly to Obsidian internals.
24
+
25
+ ### Decision: Hide server-specific details behind a port
26
+
27
+ **Choice:** Add a `KnowledgeWorkspacePort` seam before product services depend on Obsidian operations.
28
+
29
+ **Alternatives considered:** Call a specific MCP package directly throughout exporters.
30
+
31
+ **Rationale:** Community MCP servers can change. A port keeps VGXNESS code testable and allows a filesystem adapter for deterministic tests.
32
+
33
+ ### Decision: Do not mirror Obsidian tools in VGXNESS MCP
34
+
35
+ **Choice:** Keep detailed note operations in the external Obsidian MCP server and add at most one grouped VGXNESS sync tool later.
36
+
37
+ **Rationale:** The product direction is to minimize MCP/tool sprawl. VGXNESS should orchestrate product-level workflows; Obsidian MCP should own vault-level operations.
38
+
39
+ ## Data Flow
40
+
41
+ ```text
42
+ SQLite/repo docs
43
+ -> projection query/read services
44
+ -> Markdown/Canvas renderers
45
+ -> KnowledgeWorkspacePort
46
+ -> ObsidianMcpWorkspacePort
47
+ -> FilesystemWorkspacePort (fallback/tests)
48
+ -> Obsidian vault / VGXNESS/
49
+ ```
50
+
51
+ ## Planned File Changes
52
+
53
+ | File | Action | Description |
54
+ |---|---|---|
55
+ | `docs/knowledge-workspace.md` | Create | Canonical product boundary and workflow. |
56
+ | `docs/obsidian-mcp.md` | Create | Setup and safety docs for Obsidian MCP. |
57
+ | `src/domain/knowledge-workspace/schema.ts` | Create | Domain types for status, notes, writes, export kinds, and workspace mode. |
58
+ | `src/application/knowledge-workspace/markdown-renderer.ts` | Create | Pure Markdown rendering for docs, memory summaries, and SDD boards. |
59
+ | `src/application/knowledge-workspace/canvas-renderer.ts` | Create | Deterministic Obsidian Canvas JSON rendering. |
60
+ | `src/application/knowledge-workspace/workspace-port.ts` | Create | Transport-agnostic workspace interface. |
61
+ | `src/application/knowledge-workspace/obsidian-mcp-workspace-port.ts` | Create | Adapter mapping workspace operations to Obsidian MCP tool calls. |
62
+ | `src/application/knowledge-workspace/filesystem-workspace-port.ts` | Create | Explicit fallback/test adapter with matching safety semantics. |
63
+ | `src/application/knowledge-workspace/obsidian-export-service.ts` | Create | Orchestrates docs/memory/SDD exports through the workspace port. |
64
+ | `src/interfaces/cli/commands/knowledge-workspace-dispatcher.ts` | Create | Grouped `vgxness knowledge status|init|export` commands. |
65
+
66
+ ## Interface Sketch
67
+
68
+ ```ts
69
+ export interface KnowledgeWorkspacePort {
70
+ status(): Promise<KnowledgeWorkspaceStatus>;
71
+ listNotes(input: { pathPrefix: string; recursive?: boolean }): Promise<KnowledgeWorkspaceNoteRef[]>;
72
+ getNote(input: { path: string }): Promise<KnowledgeWorkspaceNote>;
73
+ writeGeneratedNote(input: { path: string; content: string; overwriteGeneratedOnly: boolean }): Promise<KnowledgeWorkspaceWriteResult>;
74
+ patchNote(input: { path: string; section: string; operation: 'append' | 'prepend' | 'replace'; content: string }): Promise<KnowledgeWorkspaceWriteResult>;
75
+ openInUi?(input: { path: string }): Promise<void>;
76
+ }
77
+ ```
78
+
79
+ CLI shape:
80
+
81
+ ```bash
82
+ vgxness knowledge status --workspace obsidian-mcp --project vgxness
83
+ vgxness knowledge init --workspace obsidian-mcp --project vgxness
84
+ vgxness knowledge export --workspace obsidian-mcp --project vgxness --kind all
85
+ vgxness knowledge export --workspace filesystem --vault <path> --project vgxness --kind all
86
+ ```
87
+
88
+ ## Testing Strategy
89
+
90
+ | Layer | What to Test | Approach |
91
+ |---|---|---|
92
+ | Renderers | Stable Markdown/Canvas output | Pure unit tests with fixed inputs. |
93
+ | Port adapters | Correct safety and call mapping | Mock Obsidian MCP client tests; temp-dir filesystem tests. |
94
+ | Export service | Generated markers, no curated overwrite, correct targets | Unit tests with fake workspace port. |
95
+ | SQLite projections | No raw traces/transcripts, no trace writes from read-only export | Temp SQLite tests. |
96
+ | CLI | Status non-mutating, init/export dispatch | Node test runner with temp DB and fake workspace. |
97
+ | Real integration | Obsidian MCP smoke | Opt-in test gated by `VGXNESS_OBSIDIAN_MCP_SMOKE=1`. |
98
+
99
+ ## Migration / Rollout
100
+
101
+ No SQLite migration is required for the docs-first slice. Later code slices add new services and CLI commands without changing existing memory tables unless a future import/sync feature needs metadata.
102
+
103
+ Roll out in slices:
104
+
105
+ 1. Docs and SDD artifacts.
106
+ 2. Pure renderers.
107
+ 3. Workspace port/adapters.
108
+ 4. Export service for docs.
109
+ 5. SQLite-backed memory and SDD projections.
110
+ 6. CLI commands.
111
+ 7. Optional grouped VGXNESS MCP sync tool.
112
+
113
+ ## Open Questions
114
+
115
+ - Should VGXNESS connect to Obsidian MCP directly from its own runtime, or first rely on the agent host's MCP configuration?
116
+ - Should the `VGXNESS/` folder name be configurable?
117
+ - Should full memory export ever be allowed behind an explicit flag, or should summaries be the permanent limit?
118
+ - Should archived SDD projections read from SQLite only, repo `docs/sdd/archive`, or both?
@@ -0,0 +1,80 @@
1
+ # Proposal: SQLite + Obsidian MCP Knowledge Workflow
2
+
3
+ ## Intent
4
+
5
+ Establish a durable VGXNESS knowledge workflow where SQLite remains the operational source of truth for agents and SDD governance, while Obsidian becomes a human-facing workspace reached through Obsidian MCP for documentation, research, boards, and canvas projections.
6
+
7
+ ## Scope
8
+
9
+ ### In Scope
10
+
11
+ - Document the source-of-truth boundary between SQLite, Obsidian, Obsidian MCP, and repository docs.
12
+ - Document Obsidian MCP setup, required Obsidian Local REST API configuration, and safety defaults.
13
+ - Define a future `KnowledgeWorkspacePort` seam with Obsidian MCP as the preferred adapter and filesystem as a fallback/test adapter.
14
+ - Plan CLI-level `knowledge` operations for status/init/export without adding many narrow VGXNESS MCP tools.
15
+ - Keep generated Obsidian notes clearly marked as projections.
16
+
17
+ ### Out of Scope
18
+
19
+ - Bidirectional sync from Obsidian back into SQLite.
20
+ - Treating Obsidian notes as SDD artifact acceptance, verification, authorization, or governance state.
21
+ - Mirroring every Obsidian MCP tool inside the VGXNESS MCP server.
22
+ - Enabling Obsidian command-palette execution or destructive vault operations.
23
+ - Cloud sync, shared vault operations, or team collaboration semantics.
24
+
25
+ ## Capabilities
26
+
27
+ ### New Capabilities
28
+
29
+ - Knowledge workspace documentation explaining SQLite vs. Obsidian responsibilities.
30
+ - Obsidian MCP setup guidance for human-facing workspace projections.
31
+ - Planned workspace adapter seam for generated Markdown/Canvas exports.
32
+
33
+ ### Modified Capabilities
34
+
35
+ - Storage documentation clarifies that SQLite remains authoritative even when Obsidian projections exist.
36
+ - Product documentation links to the knowledge workspace model.
37
+
38
+ ## Approach
39
+
40
+ Start with a docs and SDD slice, then implement the workflow in reviewable work units:
41
+
42
+ 1. Document the working model and Obsidian MCP setup.
43
+ 2. Add pure Markdown/Canvas renderers.
44
+ 3. Add `KnowledgeWorkspacePort` with Obsidian MCP and filesystem adapters.
45
+ 4. Export repo docs, memory summaries, and SDD board/artifact projections through that port.
46
+ 5. Add a grouped `vgxness knowledge` CLI surface.
47
+ 6. Add one VGXNESS MCP sync operation only if real agent workflows require it.
48
+
49
+ ## Affected Areas
50
+
51
+ | Area | Impact | Description |
52
+ |---|---|---|
53
+ | `docs/knowledge-workspace.md` | New | Canonical SQLite/Obsidian boundary and workflow rules. |
54
+ | `docs/obsidian-mcp.md` | New | Obsidian MCP setup and safety guidance. |
55
+ | `docs/storage.md` | Modified | Clarifies Obsidian projections do not replace SQLite state. |
56
+ | `README.md` | Modified | Links to knowledge workspace docs. |
57
+ | `src/application/knowledge-workspace/*` | Future | Workspace port, renderers, and exporters. |
58
+ | `src/interfaces/cli/commands/*` | Future | Grouped `knowledge` command surface. |
59
+
60
+ ## Risks
61
+
62
+ | Risk | Likelihood | Mitigation |
63
+ |---|---:|---|
64
+ | Users confuse Obsidian boards with SDD governance | Medium | Generated files carry source-of-truth notices; docs state SQLite governs acceptance/readiness. |
65
+ | Tool sprawl | Medium | Use external Obsidian MCP for vault operations and at most one grouped VGXNESS sync tool later. |
66
+ | Sensitive memory export | Medium | Export summaries/previews by default; never export traces, raw transcripts, provider config, or secrets. |
67
+ | Accidental overwrite of curated notes | Medium | Overwrite only generated notes carrying `generated_by: vgxness`. |
68
+ | Obsidian MCP dependency instability | Medium | Hide server-specific details behind a workspace port and keep filesystem fallback for tests/offline export. |
69
+
70
+ ## Rollback Plan
71
+
72
+ Revert the documentation, SDD artifacts, and any later `knowledge-workspace` code. Since SQLite remains authoritative and Obsidian exports are projections, rollback does not require data migration. Generated Obsidian notes can be removed from the vault manually if desired.
73
+
74
+ ## Success Criteria
75
+
76
+ - [ ] Documentation clearly states SQLite is authoritative and Obsidian is a projection workspace.
77
+ - [ ] Obsidian MCP setup is documented with safe defaults and path allowlists.
78
+ - [ ] A future implementation path exists for a workspace port and grouped CLI surface.
79
+ - [ ] No design requires Obsidian files to prove SDD acceptance, verification, or authorization.
80
+ - [ ] No design requires mirroring all Obsidian MCP tools into VGXNESS MCP.
@@ -0,0 +1,88 @@
1
+ # Spec: SQLite + Obsidian MCP Knowledge Workflow
2
+
3
+ ## Requirements
4
+
5
+ ### Requirement 1: SQLite authority is preserved
6
+
7
+ VGXNESS SHALL keep SQLite as the authoritative store for operational memory, SDD artifacts, artifact acceptance, run history, traces, checkpoints, approvals, and workflow governance.
8
+
9
+ #### Scenario: Generated Obsidian board exists
10
+
11
+ - **Given** an Obsidian SDD board has been generated for a change
12
+ - **When** VGXNESS checks SDD readiness or acceptance
13
+ - **Then** it SHALL read SQLite-backed VGXNESS state
14
+ - **And** it SHALL NOT infer readiness or acceptance from the Obsidian board file
15
+
16
+ ### Requirement 2: Obsidian is a human-facing projection workspace
17
+
18
+ VGXNESS SHALL treat Obsidian notes, boards, and canvas files as human-facing projections unless an explicit future import flow says otherwise.
19
+
20
+ #### Scenario: Human edits a generated note
21
+
22
+ - **Given** a generated note contains `generated_by: vgxness`
23
+ - **When** VGXNESS exports the same projection again
24
+ - **Then** VGXNESS MAY overwrite the generated note
25
+ - **And** the generated note SHALL disclose that manual edits may be overwritten
26
+
27
+ #### Scenario: Human creates a curated note
28
+
29
+ - **Given** a note does not contain `generated_by: vgxness`
30
+ - **When** VGXNESS exports generated projections
31
+ - **Then** VGXNESS SHALL NOT overwrite that note by default
32
+
33
+ ### Requirement 3: Obsidian MCP is the preferred vault transport
34
+
35
+ VGXNESS SHOULD use an Obsidian MCP adapter as the preferred write/search/read transport for the knowledge workspace.
36
+
37
+ #### Scenario: Obsidian MCP is configured
38
+
39
+ - **Given** Obsidian MCP is reachable and configured for the target vault
40
+ - **When** `vgxness knowledge export --workspace obsidian-mcp --kind docs` runs
41
+ - **Then** VGXNESS SHALL write generated documentation through the workspace port backed by Obsidian MCP
42
+ - **And** it SHALL return note paths that were created or updated
43
+
44
+ #### Scenario: Obsidian MCP is unavailable
45
+
46
+ - **Given** Obsidian MCP is not configured or unreachable
47
+ - **When** a knowledge command needs Obsidian MCP
48
+ - **Then** VGXNESS SHALL report an actionable configuration error
49
+ - **And** it SHALL NOT silently fall back to writing arbitrary filesystem paths unless `--workspace filesystem --vault <path>` is explicitly selected
50
+
51
+ ### Requirement 4: Path and command safety are enforced
52
+
53
+ VGXNESS SHALL constrain generated Obsidian operations to the configured VGXNESS workspace folder.
54
+
55
+ #### Scenario: Path allowlist is configured
56
+
57
+ - **Given** the Obsidian MCP server supports path allowlists
58
+ - **When** VGXNESS documents or installs recommended configuration
59
+ - **Then** it SHALL scope reads and writes to `VGXNESS`
60
+ - **And** it SHALL keep Obsidian command execution disabled by default
61
+
62
+ #### Scenario: Export tries to escape workspace
63
+
64
+ - **Given** an export target path resolves outside `VGXNESS/`
65
+ - **When** VGXNESS prepares the write
66
+ - **Then** it SHALL reject the operation before writing
67
+
68
+ ### Requirement 5: Memory exports are summarized and safe by default
69
+
70
+ VGXNESS SHALL export memory summaries or previews by default, not raw sensitive operational records.
71
+
72
+ #### Scenario: Memory summary export
73
+
74
+ - **Given** project memory observations exist in SQLite
75
+ - **When** VGXNESS exports `--kind memory`
76
+ - **Then** the Obsidian projection SHALL include compact fields such as title, type, scope, topic key, updated time, and preview
77
+ - **And** it SHALL NOT include raw traces, full transcripts, provider config, secrets, or hidden reasoning
78
+
79
+ ### Requirement 6: VGXNESS avoids MCP tool sprawl
80
+
81
+ VGXNESS SHALL NOT mirror all Obsidian MCP note tools into its own MCP server.
82
+
83
+ #### Scenario: Agent needs a high-level sync
84
+
85
+ - **Given** agent workflows need to trigger a knowledge workspace sync from VGXNESS MCP
86
+ - **When** VGXNESS adds an MCP tool
87
+ - **Then** it SHALL add one grouped operation such as `knowledge_workspace_sync`
88
+ - **And** it SHALL NOT add one VGXNESS MCP tool per Obsidian note operation
@@ -0,0 +1,70 @@
1
+ # Tasks: SQLite + Obsidian MCP Knowledge Workflow
2
+
3
+ ## Review Workload Forecast
4
+
5
+ | Item | Value |
6
+ |---|---|
7
+ | Expected total change | Large, multi-slice |
8
+ | 400-line budget risk | High |
9
+ | Chained PRs recommended | Yes |
10
+ | Decision needed before apply | No — use reviewable work-unit slices |
11
+ | Chain strategy | feature-branch-chain or stacked-to-main; first slice may target main independently |
12
+
13
+ ## Phase 1: Documentation and SDD foundation
14
+
15
+ - [x] 1.1 Create SDD proposal/spec/design/tasks for the SQLite + Obsidian MCP knowledge workflow.
16
+ - [x] 1.2 Create `docs/knowledge-workspace.md` documenting the SQLite/Obsidian source-of-truth boundary.
17
+ - [x] 1.3 Create `docs/obsidian-mcp.md` documenting Obsidian MCP setup, safety defaults, and VGXNESS integration boundaries.
18
+ - [x] 1.4 Update `docs/storage.md` to clarify Obsidian projections do not replace SQLite state.
19
+ - [x] 1.5 Link the new docs from `README.md`.
20
+
21
+ ## Phase 2: Pure rendering layer
22
+
23
+ - [x] 2.1 Add knowledge workspace domain types.
24
+ - [x] 2.2 Add Markdown renderer tests for memory summaries and SDD board output.
25
+ - [x] 2.3 Implement Markdown renderers.
26
+ - [x] 2.4 Add Obsidian Canvas renderer tests.
27
+ - [x] 2.5 Implement deterministic Canvas renderer.
28
+
29
+ ## Phase 3: Workspace port and adapters
30
+
31
+ - [x] 3.1 Define `KnowledgeWorkspacePort` and shared result types.
32
+ - [x] 3.2 Add mock/client contract tests for Obsidian MCP write/get/search/patch mapping.
33
+ - [x] 3.3 Implement `ObsidianMcpWorkspacePort` behind the port.
34
+ - [x] 3.4 Add filesystem fallback adapter tests with path escape and generated-marker cases.
35
+ - [x] 3.5 Implement `FilesystemWorkspacePort` for tests/offline fallback.
36
+
37
+ ## Phase 4: Export service
38
+
39
+ - [x] 4.1 Add export service tests for generated markers and curated-note overwrite protection.
40
+ - [x] 4.2 Implement docs export through the workspace port.
41
+ - [x] 4.3 Add memory summary export tests using safe previews.
42
+ - [x] 4.4 Implement memory summary export without raw traces/transcripts.
43
+ - [x] 4.5 Add SDD board/artifact projection tests.
44
+ - [x] 4.6 Implement SDD board/artifact projection export.
45
+
46
+ ## Phase 5: CLI surface
47
+
48
+ - [x] 5.1 Add CLI parser/dispatcher tests for `vgxness knowledge status|init|export`.
49
+ - [x] 5.2 Implement grouped `knowledge` command dispatcher.
50
+ - [x] 5.3 Document CLI usage in `docs/cli.md` and `docs/knowledge-workspace.md`.
51
+ - [x] 5.4 Add optional real Obsidian MCP smoke test guidance/gate.
52
+
53
+ ## Phase 6: Optional VGXNESS MCP sync tool
54
+
55
+ - [x] 6.1 Re-evaluate whether a VGXNESS MCP `knowledge_workspace_sync` tool is needed.
56
+ - [x] 6.2 Not needed in this slice: the grouped `knowledge` CLI plus external Obsidian MCP keeps detailed note operations outside VGXNESS and avoids adding a preview-only MCP wrapper.
57
+ - [x] 6.3 Not applicable until a real host-MCP bridge exists; current validation is covered by export service and CLI tests.
58
+
59
+ ## Verification
60
+
61
+ Each implementation slice should run the narrowest relevant test first, then the standard VGXNESS gates before PR:
62
+
63
+ ```bash
64
+ bun run verify:typecheck
65
+ bun run verify:test
66
+ bun run verify:bun-sqlite
67
+ bun run package:bun:evidence
68
+ ```
69
+
70
+ Docs-only slices may run `bun run verify:typecheck` and any docs tests if present, then broader gates as time allows.
package/docs/storage.md CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  VGXNESS keeps all durable state in local SQLite. There is no required cloud account, no remote sync in the current local-first design, and no implicit sharing between scopes. Project data and personal/global data must not be collapsed into one scope.
4
4
 
5
+ Human-facing knowledge workspace projections may be written to Obsidian through the [Obsidian MCP integration](./obsidian-mcp.md), but those notes, boards, and canvas files are not authoritative state. SQLite remains the source of truth for operational memory, SDD artifacts, acceptance, runs, traces, approvals, and workflow governance. See [Knowledge Workspace](./knowledge-workspace.md) for the source-of-truth boundary.
6
+
5
7
  ## Database location
6
8
 
7
9
  The default is a per-user global database. The path is resolved by `resolveMemoryDatabasePath(...)` in `src/memory/storage-paths.ts` with this precedence:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vgxness",
3
- "version": "1.20.13",
3
+ "version": "1.20.15",
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": {