@osovv/vv-opencode 0.2.1 → 0.2.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.
- package/README.md +9 -2
- package/dist/commands/doctor.js +3 -0
- package/dist/commands/doctor.js.map +1 -1
- package/dist/commands/install.d.ts +5 -0
- package/dist/commands/install.js +15 -3
- package/dist/commands/install.js.map +1 -1
- package/dist/commands/status.js +3 -0
- package/dist/commands/status.js.map +1 -1
- package/dist/commands/sync.d.ts +1 -1
- package/dist/commands/sync.js +4 -2
- package/dist/commands/sync.js.map +1 -1
- package/dist/lib/opencode.d.ts +17 -0
- package/dist/lib/opencode.js +67 -0
- package/dist/lib/opencode.js.map +1 -1
- package/dist/lib/vvoc-paths.d.ts +3 -0
- package/dist/lib/vvoc-paths.js +24 -1
- package/dist/lib/vvoc-paths.js.map +1 -1
- package/dist/plugins/memory-store.d.ts +6 -0
- package/dist/plugins/memory-store.js +35 -15
- package/dist/plugins/memory-store.js.map +1 -1
- package/package.json +5 -5
- package/AGENTS.md +0 -176
- package/dist/lib/opencode.test.d.ts +0 -1
- package/dist/lib/opencode.test.js +0 -64
- package/dist/lib/opencode.test.js.map +0 -1
- package/dist/plugins/memory.test.d.ts +0 -1
- package/dist/plugins/memory.test.js +0 -151
- package/dist/plugins/memory.test.js.map +0 -1
- package/docs/development-plan.xml +0 -235
- package/docs/knowledge-graph.xml +0 -66
- package/docs/operational-packets.xml +0 -106
- package/docs/requirements.xml +0 -77
- package/docs/technology.xml +0 -60
- package/docs/verification-plan.xml +0 -212
|
@@ -1,235 +0,0 @@
|
|
|
1
|
-
<DevelopmentPlan VERSION="0.3.0">
|
|
2
|
-
<ArchitectureNotes>
|
|
3
|
-
<objective>Package portable OpenCode workflow plugins while keeping vvoc-owned config and memory data isolated from native OpenCode config.</objective>
|
|
4
|
-
<non-goal>Do not expand into a large monorepo or broad profile manager before plugin packaging, explicit memory, and vvoc config boundaries are stable.</non-goal>
|
|
5
|
-
<risk-1>Config file mutation must stay conservative because users may already have hand-maintained JSONC with comments.</risk-1>
|
|
6
|
-
<risk-2>The file-based memory store does full scans and should stay explicit, simple, and easy to reason about until scale requires indexing.</risk-2>
|
|
7
|
-
</ArchitectureNotes>
|
|
8
|
-
|
|
9
|
-
<Modules>
|
|
10
|
-
<M-CLI-CONFIG NAME="OpenCodeConfigTools" TYPE="UTILITY" LAYER="0" ORDER="1" STATUS="implemented">
|
|
11
|
-
<contract>
|
|
12
|
-
<purpose>Resolve OpenCode and vvoc config paths, edit JSONC safely, render managed Guardian config, and inspect installation state.</purpose>
|
|
13
|
-
<inputs>
|
|
14
|
-
<param name="scope" type="global | project" />
|
|
15
|
-
<param name="cwd" type="string" />
|
|
16
|
-
<param name="configDir" type="string | undefined" />
|
|
17
|
-
</inputs>
|
|
18
|
-
<outputs>
|
|
19
|
-
<param name="ResolvedPaths | WriteResult | InstallationInspection" type="object" />
|
|
20
|
-
</outputs>
|
|
21
|
-
<errors>
|
|
22
|
-
<error code="INVALID_JSONC" />
|
|
23
|
-
<error code="INVALID_GUARDIAN_CONFIG" />
|
|
24
|
-
</errors>
|
|
25
|
-
</contract>
|
|
26
|
-
<interface>
|
|
27
|
-
<export-resolvePaths PURPOSE="Resolve OpenCode config paths and vvoc-managed config paths for the selected scope." />
|
|
28
|
-
<export-ensurePackageInstalled PURPOSE="Ensure the npm package is registered in OpenCode config." />
|
|
29
|
-
<export-syncGuardianConfig PURPOSE="Rewrite managed Guardian config while preserving current values." />
|
|
30
|
-
</interface>
|
|
31
|
-
<depends>none</depends>
|
|
32
|
-
<target>
|
|
33
|
-
<source>src/lib/opencode.ts + src/lib/vvoc-paths.ts</source>
|
|
34
|
-
<tests>src/lib/opencode.test.ts</tests>
|
|
35
|
-
</target>
|
|
36
|
-
<observability>
|
|
37
|
-
<log-prefix>[OpenCodeConfigTools]</log-prefix>
|
|
38
|
-
<critical-block>BLOCK_SYNC_GUARDIAN_CONFIG</critical-block>
|
|
39
|
-
</observability>
|
|
40
|
-
<verification-ref>V-M-CLI-CONFIG</verification-ref>
|
|
41
|
-
<notes>
|
|
42
|
-
<note-1>Main config edits should preserve comments when only the plugin array changes.</note-1>
|
|
43
|
-
</notes>
|
|
44
|
-
</M-CLI-CONFIG>
|
|
45
|
-
|
|
46
|
-
<M-CLI-COMMANDS NAME="VVOCCommands" TYPE="ENTRY_POINT" LAYER="1" ORDER="1" STATUS="implemented">
|
|
47
|
-
<contract>
|
|
48
|
-
<purpose>Expose install, sync, status, doctor, and Guardian config subcommands through citty.</purpose>
|
|
49
|
-
<inputs>
|
|
50
|
-
<param name="argv" type="string[]" />
|
|
51
|
-
</inputs>
|
|
52
|
-
<outputs>
|
|
53
|
-
<param name="stdout/stderr" type="terminal output" />
|
|
54
|
-
</outputs>
|
|
55
|
-
<errors>
|
|
56
|
-
<error code="INVALID_ARGUMENT" />
|
|
57
|
-
</errors>
|
|
58
|
-
</contract>
|
|
59
|
-
<interface>
|
|
60
|
-
<export-install PURPOSE="Bootstrap plugin registration and optional Guardian config." />
|
|
61
|
-
<export-sync PURPOSE="Refresh managed vvoc config files." />
|
|
62
|
-
<export-doctor PURPOSE="Diagnose installation drift or invalid config." />
|
|
63
|
-
</interface>
|
|
64
|
-
<depends>M-CLI-CONFIG</depends>
|
|
65
|
-
<target>
|
|
66
|
-
<source>src/cli.ts + src/commands/*.ts</source>
|
|
67
|
-
<tests>src/lib/opencode.test.ts</tests>
|
|
68
|
-
</target>
|
|
69
|
-
<observability>
|
|
70
|
-
<log-prefix>[VVOC]</log-prefix>
|
|
71
|
-
<critical-block>BLOCK_APPLY_COMMAND</critical-block>
|
|
72
|
-
</observability>
|
|
73
|
-
<verification-ref>V-M-CLI-COMMANDS</verification-ref>
|
|
74
|
-
<notes>
|
|
75
|
-
<note-1>Commands should stay thin and delegate file logic to helper utilities.</note-1>
|
|
76
|
-
</notes>
|
|
77
|
-
</M-CLI-COMMANDS>
|
|
78
|
-
|
|
79
|
-
<M-PLUGIN-GUARDIAN NAME="GuardianPlugin" TYPE="INTEGRATION" LAYER="0" ORDER="2" STATUS="implemented">
|
|
80
|
-
<contract>
|
|
81
|
-
<purpose>Review OpenCode permission requests with a constrained Guardian agent and auto-allow only low-risk actions.</purpose>
|
|
82
|
-
<inputs>
|
|
83
|
-
<param name="PluginInput" type="@opencode-ai/plugin input" />
|
|
84
|
-
</inputs>
|
|
85
|
-
<outputs>
|
|
86
|
-
<param name="Hooks" type="OpenCode plugin hooks" />
|
|
87
|
-
</outputs>
|
|
88
|
-
<errors>
|
|
89
|
-
<error code="GUARDIAN_REVIEW_FAILED" />
|
|
90
|
-
<error code="PERMISSION_REPLY_FAILED" />
|
|
91
|
-
</errors>
|
|
92
|
-
</contract>
|
|
93
|
-
<interface>
|
|
94
|
-
<export-GuardianPlugin PURPOSE="Register Guardian hooks, config agent, and permission review flow." />
|
|
95
|
-
</interface>
|
|
96
|
-
<depends>M-CLI-CONFIG</depends>
|
|
97
|
-
<target>
|
|
98
|
-
<source>src/plugins/guardian.ts</source>
|
|
99
|
-
<tests>typecheck-only in v1</tests>
|
|
100
|
-
</target>
|
|
101
|
-
<observability>
|
|
102
|
-
<log-prefix>[guardian]</log-prefix>
|
|
103
|
-
<critical-block>BLOCK_REVIEW_PERMISSION</critical-block>
|
|
104
|
-
</observability>
|
|
105
|
-
<verification-ref>V-M-PLUGIN-GUARDIAN</verification-ref>
|
|
106
|
-
<notes>
|
|
107
|
-
<note-1>Guardian now reads vvoc-managed config from `.vvoc/` or `$XDG_CONFIG_HOME/vvoc/` only.</note-1>
|
|
108
|
-
</notes>
|
|
109
|
-
</M-PLUGIN-GUARDIAN>
|
|
110
|
-
|
|
111
|
-
<M-PLUGIN-MEMORY-STORE NAME="MemoryStore" TYPE="UTILITY" LAYER="0" ORDER="3" STATUS="implemented">
|
|
112
|
-
<contract>
|
|
113
|
-
<purpose>Persist explicit memory entries in `.vvoc/memory`, support scope-aware CRUD, and rank lexical search results.</purpose>
|
|
114
|
-
<inputs>
|
|
115
|
-
<param name="MemoryRuntimeConfig" type="object" />
|
|
116
|
-
<param name="MemoryEntry or query/filter inputs" type="object" />
|
|
117
|
-
</inputs>
|
|
118
|
-
<outputs>
|
|
119
|
-
<param name="MemoryEntry | MemoryEntry[] | MemoryRuntimeConfig" type="object" />
|
|
120
|
-
</outputs>
|
|
121
|
-
<errors>
|
|
122
|
-
<error code="INVALID_MEMORY_CONFIG" />
|
|
123
|
-
<error code="INVALID_MEMORY_TEXT" />
|
|
124
|
-
</errors>
|
|
125
|
-
</contract>
|
|
126
|
-
<interface>
|
|
127
|
-
<export-loadMemoryRuntimeConfig PURPOSE="Load vvoc memory settings from global and project config files." />
|
|
128
|
-
<export-putMemory PURPOSE="Create a scoped memory entry in `.vvoc/memory`." />
|
|
129
|
-
<export-searchMemories PURPOSE="Return ranked lexical matches across relevant memory scopes." />
|
|
130
|
-
</interface>
|
|
131
|
-
<depends>none</depends>
|
|
132
|
-
<target>
|
|
133
|
-
<source>src/plugins/memory-store.ts</source>
|
|
134
|
-
<tests>src/plugins/memory.test.ts</tests>
|
|
135
|
-
</target>
|
|
136
|
-
<observability>
|
|
137
|
-
<log-prefix>[memory-store]</log-prefix>
|
|
138
|
-
<critical-block>BLOCK_MEMORY_SEARCH</critical-block>
|
|
139
|
-
</observability>
|
|
140
|
-
<verification-ref>V-M-PLUGIN-MEMORY-STORE</verification-ref>
|
|
141
|
-
<notes>
|
|
142
|
-
<note-1>Memory remains explicit-only. The store must not inject entries into prompts or system context.</note-1>
|
|
143
|
-
</notes>
|
|
144
|
-
</M-PLUGIN-MEMORY-STORE>
|
|
145
|
-
|
|
146
|
-
<M-PLUGIN-MEMORY NAME="MemoryPlugin" TYPE="INTEGRATION" LAYER="0" ORDER="4" STATUS="implemented">
|
|
147
|
-
<contract>
|
|
148
|
-
<purpose>Add explicit memory tools to OpenCode, register a report-only `memory-reviewer` subagent, and inject a short system reminder that encourages proactive memory tool usage without loading stored entries.</purpose>
|
|
149
|
-
<inputs>
|
|
150
|
-
<param name="PluginInput" type="@opencode-ai/plugin input" />
|
|
151
|
-
</inputs>
|
|
152
|
-
<outputs>
|
|
153
|
-
<param name="Hooks" type="OpenCode plugin hooks with custom tools and config mutation" />
|
|
154
|
-
</outputs>
|
|
155
|
-
<errors>
|
|
156
|
-
<error code="MEMORY_DISABLED" />
|
|
157
|
-
<error code="MEMORY_NOT_FOUND" />
|
|
158
|
-
</errors>
|
|
159
|
-
</contract>
|
|
160
|
-
<interface>
|
|
161
|
-
<export-MemoryPlugin PURPOSE="Register explicit memory tools and the `memory-reviewer` subagent." />
|
|
162
|
-
</interface>
|
|
163
|
-
<depends>M-PLUGIN-MEMORY-STORE</depends>
|
|
164
|
-
<target>
|
|
165
|
-
<source>src/plugins/memory.ts</source>
|
|
166
|
-
<tests>src/plugins/memory.test.ts</tests>
|
|
167
|
-
</target>
|
|
168
|
-
<observability>
|
|
169
|
-
<log-prefix>[memory]</log-prefix>
|
|
170
|
-
<critical-block>BLOCK_REGISTER_MEMORY_TOOLS</critical-block>
|
|
171
|
-
</observability>
|
|
172
|
-
<verification-ref>V-M-PLUGIN-MEMORY</verification-ref>
|
|
173
|
-
<notes>
|
|
174
|
-
<note-1>The reviewer is implemented as a bundled subagent, and the main chat path receives only a short memory policy reminder instead of prompt-injected memory entries.</note-1>
|
|
175
|
-
</notes>
|
|
176
|
-
</M-PLUGIN-MEMORY>
|
|
177
|
-
</Modules>
|
|
178
|
-
|
|
179
|
-
<DataFlow>
|
|
180
|
-
<DF-PLUGIN-INSTALL NAME="PluginInstall" TRIGGER="vvoc install">
|
|
181
|
-
<step-1>Resolve scope-specific OpenCode config paths and vvoc config paths.</step-1>
|
|
182
|
-
<step-2>Ensure `@osovv/vv-opencode` exists in the OpenCode `plugin` array.</step-2>
|
|
183
|
-
<step-3>Create `guardian.jsonc` under the vvoc config root when it does not already exist.</step-3>
|
|
184
|
-
<evidence>`vvoc status`, parsed config content, and successful typecheck/build.</evidence>
|
|
185
|
-
</DF-PLUGIN-INSTALL>
|
|
186
|
-
<DF-CONFIG-SYNC NAME="ManagedConfigSync" TRIGGER="vvoc sync">
|
|
187
|
-
<step-1>Inspect whether Guardian config is CLI-managed.</step-1>
|
|
188
|
-
<step-2>Parse current Guardian values from JSONC.</step-2>
|
|
189
|
-
<step-3>Rewrite managed file canonically while preserving current values.</step-3>
|
|
190
|
-
<evidence>Stable rewritten `guardian.jsonc` and no overwrite of unmanaged files without force.</evidence>
|
|
191
|
-
</DF-CONFIG-SYNC>
|
|
192
|
-
<DF-GUARDIAN-REVIEW NAME="GuardianPermissionReview" TRIGGER="permission.asked event">
|
|
193
|
-
<step-1>Capture relevant tool and command intent for the session.</step-1>
|
|
194
|
-
<step-2>Build a bounded transcript and planned action prompt.</step-2>
|
|
195
|
-
<step-3>Run Guardian, interpret risk, and auto-reply only when below threshold.</step-3>
|
|
196
|
-
<evidence>Guardian logs, toasts, and permission reply behavior inside OpenCode.</evidence>
|
|
197
|
-
</DF-GUARDIAN-REVIEW>
|
|
198
|
-
<DF-MEMORY-ACCESS NAME="MemoryAccess" TRIGGER="memory_* tool call">
|
|
199
|
-
<step-0>Before model turns, the plugin appends a short system reminder that explicit memory tools exist, without injecting stored memory entries.</step-0>
|
|
200
|
-
<step-1>Load vvoc memory settings from `$XDG_CONFIG_HOME/vvoc/memory.jsonc` and project `.vvoc/memory.jsonc`.</step-1>
|
|
201
|
-
<step-2>Resolve relevant scopes from session id, git branch, project, or shared key.</step-2>
|
|
202
|
-
<step-3>Read or mutate entries under `.vvoc/memory/` using file-per-entry JSON records.</step-3>
|
|
203
|
-
<evidence>Correct file layout, deterministic CRUD/search behavior, and no automatic prompt injection.</evidence>
|
|
204
|
-
</DF-MEMORY-ACCESS>
|
|
205
|
-
<DF-MEMORY-REVIEW NAME="MemoryReview" TRIGGER="@memory-reviewer invocation">
|
|
206
|
-
<step-1>Register the reviewer subagent through plugin config mutation.</step-1>
|
|
207
|
-
<step-2>The reviewer inspects memory with `memory_list`, `memory_get`, and `memory_search` only.</step-2>
|
|
208
|
-
<step-3>The reviewer returns a keep/update/merge/delete report without modifying entries.</step-3>
|
|
209
|
-
<evidence>Bundled `memory-reviewer` agent with read-only memory tooling.</evidence>
|
|
210
|
-
</DF-MEMORY-REVIEW>
|
|
211
|
-
</DataFlow>
|
|
212
|
-
|
|
213
|
-
<ImplementationOrder>
|
|
214
|
-
<Phase-1 name="CLI Foundation" status="done">
|
|
215
|
-
<goal>Establish safe config mutation helpers and wire them into a usable Bun CLI.</goal>
|
|
216
|
-
<step-1 module="M-CLI-CONFIG" status="done" verification="V-M-CLI-CONFIG">Implement path resolution, JSONC edits, inspection, and Guardian template helpers.</step-1>
|
|
217
|
-
<step-2 module="M-CLI-COMMANDS" status="done" verification="V-M-CLI-COMMANDS">Expose install, sync, status, doctor, and Guardian config commands.</step-2>
|
|
218
|
-
</Phase-1>
|
|
219
|
-
<Phase-2 name="Guardian Packaging" status="done">
|
|
220
|
-
<goal>Move the existing standalone Guardian plugin into the repository and export it from the package.</goal>
|
|
221
|
-
<step-1 module="M-PLUGIN-GUARDIAN" status="done" verification="V-M-PLUGIN-GUARDIAN">Port Guardian and move runtime config to vvoc-owned paths.</step-1>
|
|
222
|
-
</Phase-2>
|
|
223
|
-
<Phase-3 name="Explicit Memory" status="done">
|
|
224
|
-
<goal>Add explicit persistent memory, store it in `.vvoc/memory`, and expose a report-only reviewer subagent.</goal>
|
|
225
|
-
<step-1 module="M-PLUGIN-MEMORY-STORE" status="done" verification="V-M-PLUGIN-MEMORY-STORE">Implement file-based scoped memory storage and lexical search.</step-1>
|
|
226
|
-
<step-2 module="M-PLUGIN-MEMORY" status="done" verification="V-M-PLUGIN-MEMORY">Register memory tools and the `memory-reviewer` subagent via OpenCode plugin hooks.</step-2>
|
|
227
|
-
</Phase-3>
|
|
228
|
-
</ImplementationOrder>
|
|
229
|
-
|
|
230
|
-
<ExecutionPolicy>
|
|
231
|
-
<default-profile>balanced</default-profile>
|
|
232
|
-
<controller-owns>docs/development-plan.xml, docs/knowledge-graph.xml, docs/verification-plan.xml</controller-owns>
|
|
233
|
-
<worker-owns>Only package source files, tests, and narrowly scoped documentation updates required by the approved module changes.</worker-owns>
|
|
234
|
-
</ExecutionPolicy>
|
|
235
|
-
</DevelopmentPlan>
|
package/docs/knowledge-graph.xml
DELETED
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
<KnowledgeGraph>
|
|
2
|
-
<Project NAME="@osovv/vv-opencode" VERSION="0.3.0">
|
|
3
|
-
<keywords>opencode, plugins, workflow</keywords>
|
|
4
|
-
<annotation>Portable OpenCode workflow package with plugins and a Bun CLI for install, sync, and cross-device setup.</annotation>
|
|
5
|
-
|
|
6
|
-
<M-CLI-CONFIG NAME="OpenCodeConfigTools" TYPE="UTILITY" STATUS="implemented">
|
|
7
|
-
<purpose>Path resolution, JSONC-aware config mutation, managed Guardian config rendering, and installation inspection with separated vvoc roots.</purpose>
|
|
8
|
-
<path>src/lib/opencode.ts + src/lib/vvoc-paths.ts</path>
|
|
9
|
-
<depends>none</depends>
|
|
10
|
-
<verification-ref>V-M-CLI-CONFIG</verification-ref>
|
|
11
|
-
<annotations>
|
|
12
|
-
<fn-resolvePaths PURPOSE="Resolve OpenCode config paths and vvoc-managed config paths for the selected scope." />
|
|
13
|
-
<fn-ensurePackageInstalled PURPOSE="Add the package name to the OpenCode plugin array if needed." />
|
|
14
|
-
<fn-syncGuardianConfig PURPOSE="Rewrite managed Guardian config while preserving current values." />
|
|
15
|
-
</annotations>
|
|
16
|
-
</M-CLI-CONFIG>
|
|
17
|
-
|
|
18
|
-
<M-CLI-COMMANDS NAME="VVOCCommands" TYPE="ENTRY_POINT" STATUS="implemented">
|
|
19
|
-
<purpose>Compose the `vvoc` CLI and expose install, sync, status, doctor, and Guardian config commands.</purpose>
|
|
20
|
-
<path>src/cli.ts + src/commands/*.ts</path>
|
|
21
|
-
<depends>M-CLI-CONFIG</depends>
|
|
22
|
-
<verification-ref>V-M-CLI-COMMANDS</verification-ref>
|
|
23
|
-
<annotations>
|
|
24
|
-
<export-install PURPOSE="Bootstrap package registration and optional Guardian config." />
|
|
25
|
-
<export-sync PURPOSE="Refresh managed vvoc config files." />
|
|
26
|
-
<export-guardian PURPOSE="Expose Guardian-specific helper commands." />
|
|
27
|
-
</annotations>
|
|
28
|
-
</M-CLI-COMMANDS>
|
|
29
|
-
|
|
30
|
-
<M-PLUGIN-GUARDIAN NAME="GuardianPlugin" TYPE="INTEGRATION" STATUS="implemented">
|
|
31
|
-
<purpose>Review OpenCode permission requests using a constrained Guardian agent and safe fallback behavior.</purpose>
|
|
32
|
-
<path>src/plugins/guardian.ts</path>
|
|
33
|
-
<depends>M-CLI-CONFIG</depends>
|
|
34
|
-
<verification-ref>V-M-PLUGIN-GUARDIAN</verification-ref>
|
|
35
|
-
<annotations>
|
|
36
|
-
<export-GuardianPlugin PURPOSE="Register Guardian hooks for config, events, tool intent capture, and permission review." />
|
|
37
|
-
</annotations>
|
|
38
|
-
</M-PLUGIN-GUARDIAN>
|
|
39
|
-
|
|
40
|
-
<M-PLUGIN-MEMORY-STORE NAME="MemoryStore" TYPE="UTILITY" STATUS="implemented">
|
|
41
|
-
<purpose>Store explicit memory under `.vvoc/memory`, resolve scopes, and provide lexical ranking for search.</purpose>
|
|
42
|
-
<path>src/plugins/memory-store.ts</path>
|
|
43
|
-
<depends>none</depends>
|
|
44
|
-
<verification-ref>V-M-PLUGIN-MEMORY-STORE</verification-ref>
|
|
45
|
-
<annotations>
|
|
46
|
-
<fn-loadMemoryRuntimeConfig PURPOSE="Load global and project vvoc memory settings." />
|
|
47
|
-
<fn-putMemory PURPOSE="Create a scoped memory entry in `.vvoc/memory`." />
|
|
48
|
-
<fn-searchMemories PURPOSE="Return ranked lexical matches across scoped entries." />
|
|
49
|
-
</annotations>
|
|
50
|
-
</M-PLUGIN-MEMORY-STORE>
|
|
51
|
-
|
|
52
|
-
<M-PLUGIN-MEMORY NAME="MemoryPlugin" TYPE="INTEGRATION" STATUS="implemented">
|
|
53
|
-
<purpose>Add explicit memory tools to OpenCode and register the `memory-reviewer` subagent.</purpose>
|
|
54
|
-
<path>src/plugins/memory.ts</path>
|
|
55
|
-
<depends>M-PLUGIN-MEMORY-STORE</depends>
|
|
56
|
-
<verification-ref>V-M-PLUGIN-MEMORY</verification-ref>
|
|
57
|
-
<annotations>
|
|
58
|
-
<export-MemoryPlugin PURPOSE="Register memory tools and the report-only reviewer subagent." />
|
|
59
|
-
</annotations>
|
|
60
|
-
</M-PLUGIN-MEMORY>
|
|
61
|
-
|
|
62
|
-
<CrossLink from="M-CLI-COMMANDS" to="M-CLI-CONFIG" relation="uses" />
|
|
63
|
-
<CrossLink from="M-PLUGIN-GUARDIAN" to="M-CLI-CONFIG" relation="uses" />
|
|
64
|
-
<CrossLink from="M-PLUGIN-MEMORY" to="M-PLUGIN-MEMORY-STORE" relation="uses" />
|
|
65
|
-
</Project>
|
|
66
|
-
</KnowledgeGraph>
|
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
<OperationalPackets VERSION="0.1.0">
|
|
2
|
-
<ExecutionPacketTemplate>
|
|
3
|
-
<ExecutionPacket>
|
|
4
|
-
<module-id>M-EXAMPLE</module-id>
|
|
5
|
-
<module-name>ExampleDomain</module-name>
|
|
6
|
-
<purpose>Implement the approved module without architectural drift.</purpose>
|
|
7
|
-
<write-scope>
|
|
8
|
-
<file-1>src/example/index.ts</file-1>
|
|
9
|
-
<file-2>src/example/index.test.ts</file-2>
|
|
10
|
-
</write-scope>
|
|
11
|
-
<contract-excerpt><![CDATA[
|
|
12
|
-
Planned module contract excerpt goes here.
|
|
13
|
-
]]></contract-excerpt>
|
|
14
|
-
<graph-entry-excerpt><![CDATA[
|
|
15
|
-
Knowledge graph entry excerpt goes here.
|
|
16
|
-
]]></graph-entry-excerpt>
|
|
17
|
-
<dependency-contract-summaries>
|
|
18
|
-
<dependency-1 module="M-LOGGER">Structured logger interface with stable marker fields.</dependency-1>
|
|
19
|
-
</dependency-contract-summaries>
|
|
20
|
-
<verification-excerpt><![CDATA[
|
|
21
|
-
Verification-plan excerpt goes here.
|
|
22
|
-
]]></verification-excerpt>
|
|
23
|
-
<expected-graph-delta-fields>
|
|
24
|
-
<field-1>imports</field-1>
|
|
25
|
-
<field-2>exports</field-2>
|
|
26
|
-
<field-3>annotations</field-3>
|
|
27
|
-
<field-4>CrossLinks</field-4>
|
|
28
|
-
</expected-graph-delta-fields>
|
|
29
|
-
<expected-verification-delta-fields>
|
|
30
|
-
<field-1>test-files</field-1>
|
|
31
|
-
<field-2>module-checks</field-2>
|
|
32
|
-
<field-3>required-log-markers</field-3>
|
|
33
|
-
<field-4>follow-up-checks</field-4>
|
|
34
|
-
</expected-verification-delta-fields>
|
|
35
|
-
<notes>
|
|
36
|
-
<note-1>Workers should only read more context when the packet is insufficient.</note-1>
|
|
37
|
-
</notes>
|
|
38
|
-
</ExecutionPacket>
|
|
39
|
-
</ExecutionPacketTemplate>
|
|
40
|
-
|
|
41
|
-
<GraphDeltaTemplate>
|
|
42
|
-
<GraphDelta module="M-EXAMPLE">
|
|
43
|
-
<imports-added>
|
|
44
|
-
<import-1>M-LOGGER</import-1>
|
|
45
|
-
</imports-added>
|
|
46
|
-
<imports-removed />
|
|
47
|
-
<exports-added>
|
|
48
|
-
<export-1>runExample</export-1>
|
|
49
|
-
</exports-added>
|
|
50
|
-
<exports-removed />
|
|
51
|
-
<annotations-added>
|
|
52
|
-
<annotation-1><fn-runExample PURPOSE="Execute the example flow" /></annotation-1>
|
|
53
|
-
</annotations-added>
|
|
54
|
-
<annotations-removed />
|
|
55
|
-
<cross-links-added>
|
|
56
|
-
<CrossLink from="M-EXAMPLE" to="M-LOGGER" relation="uses" />
|
|
57
|
-
</cross-links-added>
|
|
58
|
-
<cross-links-removed />
|
|
59
|
-
<notes>
|
|
60
|
-
<note-1>Only list graph facts that really changed in the code.</note-1>
|
|
61
|
-
</notes>
|
|
62
|
-
</GraphDelta>
|
|
63
|
-
</GraphDeltaTemplate>
|
|
64
|
-
|
|
65
|
-
<VerificationDeltaTemplate>
|
|
66
|
-
<VerificationDelta module="M-EXAMPLE">
|
|
67
|
-
<test-files-added>
|
|
68
|
-
<file-1>src/example/index.test.ts</file-1>
|
|
69
|
-
</test-files-added>
|
|
70
|
-
<test-files-removed />
|
|
71
|
-
<module-checks>
|
|
72
|
-
<command-1>bun test src/example/index.test.ts</command-1>
|
|
73
|
-
<command-2>bun x tsc --noEmit</command-2>
|
|
74
|
-
</module-checks>
|
|
75
|
-
<required-log-markers>
|
|
76
|
-
<marker-1>[ExampleDomain][runExample][BLOCK_EXECUTE_FLOW]</marker-1>
|
|
77
|
-
</required-log-markers>
|
|
78
|
-
<required-trace-assertions>
|
|
79
|
-
<assertion-1>Failure path must not emit BLOCK_PERSIST_RESULT.</assertion-1>
|
|
80
|
-
</required-trace-assertions>
|
|
81
|
-
<wave-follow-up>
|
|
82
|
-
<item-1>Run merged-surface integration check for the logger adapter.</item-1>
|
|
83
|
-
</wave-follow-up>
|
|
84
|
-
<phase-follow-up>
|
|
85
|
-
<item-1>Run the broader regression suite before marking the phase done.</item-1>
|
|
86
|
-
</phase-follow-up>
|
|
87
|
-
</VerificationDelta>
|
|
88
|
-
</VerificationDeltaTemplate>
|
|
89
|
-
|
|
90
|
-
<FailurePacketTemplate>
|
|
91
|
-
<FailurePacket>
|
|
92
|
-
<scenario>Primary success path fails on valid input.</scenario>
|
|
93
|
-
<contract-ref>M-EXAMPLE / V-M-EXAMPLE / scenario-1</contract-ref>
|
|
94
|
-
<expected-evidence>
|
|
95
|
-
<marker-1>[ExampleDomain][runExample][BLOCK_VALIDATE_INPUT]</marker-1>
|
|
96
|
-
<assertion-1>Expected return value should equal "ok".</assertion-1>
|
|
97
|
-
</expected-evidence>
|
|
98
|
-
<observed-evidence>
|
|
99
|
-
<log-1>[ExampleDomain][runExample][BLOCK_VALIDATE_INPUT] emitted</log-1>
|
|
100
|
-
<trace-1>BLOCK_VALIDATE_INPUT -> threw EXAMPLE_INVALID_STATE</trace-1>
|
|
101
|
-
</observed-evidence>
|
|
102
|
-
<first-divergent-block>BLOCK_VALIDATE_INPUT</first-divergent-block>
|
|
103
|
-
<suggested-next-action>Read the contract, inspect the divergent block, and apply the smallest safe fix.</suggested-next-action>
|
|
104
|
-
</FailurePacket>
|
|
105
|
-
</FailurePacketTemplate>
|
|
106
|
-
</OperationalPackets>
|
package/docs/requirements.xml
DELETED
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
<RequirementsAnalysis VERSION="0.3.0">
|
|
2
|
-
<Project>
|
|
3
|
-
<name>@osovv/vv-opencode</name>
|
|
4
|
-
<annotation>Portable OpenCode workflow package with plugins and a Bun CLI for install, sync, and cross-device setup.</annotation>
|
|
5
|
-
<keywords>opencode, plugins, workflow</keywords>
|
|
6
|
-
</Project>
|
|
7
|
-
|
|
8
|
-
<Actors>
|
|
9
|
-
<actor-User>Engineer who wants a portable OpenCode workflow across devices and repositories.</actor-User>
|
|
10
|
-
<actor-System>CLI and plugin runtime that install, sync, and execute the configured workflow safely.</actor-System>
|
|
11
|
-
</Actors>
|
|
12
|
-
|
|
13
|
-
<UseCases>
|
|
14
|
-
<UC-001>
|
|
15
|
-
<Actor>User</Actor>
|
|
16
|
-
<Action>Runs `vvoc install` for global or project scope.</Action>
|
|
17
|
-
<Goal>To register `@osovv/vv-opencode` in OpenCode config while keeping vvoc-managed config in `XDG_CONFIG_HOME/vvoc` or project-local `.vvoc/`.</Goal>
|
|
18
|
-
<Preconditions>Bun and OpenCode are available, and the target config locations are writable.</Preconditions>
|
|
19
|
-
<AcceptanceCriteria>The package name appears in the resolved OpenCode config and `guardian.jsonc` is created under the vvoc config root.</AcceptanceCriteria>
|
|
20
|
-
<Priority>high</Priority>
|
|
21
|
-
<RelatedFlows>DF-PLUGIN-INSTALL</RelatedFlows>
|
|
22
|
-
</UC-001>
|
|
23
|
-
<UC-002>
|
|
24
|
-
<Actor>User</Actor>
|
|
25
|
-
<Action>Runs `vvoc sync` on another machine or after package updates.</Action>
|
|
26
|
-
<Goal>To refresh managed vvoc-owned config files without clobbering manually-owned config.</Goal>
|
|
27
|
-
<Preconditions>The target config files already exist or can be created.</Preconditions>
|
|
28
|
-
<AcceptanceCriteria>Managed files are rewritten canonically and unmanaged files are skipped unless force is explicit.</AcceptanceCriteria>
|
|
29
|
-
<Priority>high</Priority>
|
|
30
|
-
<RelatedFlows>DF-CONFIG-SYNC</RelatedFlows>
|
|
31
|
-
</UC-002>
|
|
32
|
-
<UC-003>
|
|
33
|
-
<Actor>User</Actor>
|
|
34
|
-
<Action>Uses `memory_put`, `memory_search`, `memory_get`, `memory_update`, `memory_delete`, or `memory_list` inside OpenCode.</Action>
|
|
35
|
-
<Goal>To persist explicit durable context in `.vvoc/memory/` without automatic prompt injection.</Goal>
|
|
36
|
-
<Preconditions>The package is enabled in OpenCode and memory is not disabled in `memory.jsonc`.</Preconditions>
|
|
37
|
-
<AcceptanceCriteria>Memory entries are stored in the correct scope, searchable later, and never silently injected into prompts.</AcceptanceCriteria>
|
|
38
|
-
<Priority>high</Priority>
|
|
39
|
-
<RelatedFlows>DF-MEMORY-ACCESS</RelatedFlows>
|
|
40
|
-
</UC-003>
|
|
41
|
-
<UC-004>
|
|
42
|
-
<Actor>User</Actor>
|
|
43
|
-
<Action>Invokes the bundled `memory-reviewer` subagent.</Action>
|
|
44
|
-
<Goal>To audit stored memory and get keep/update/merge/delete suggestions without modifying entries.</Goal>
|
|
45
|
-
<Preconditions>The package is enabled in OpenCode and explicit memory exists in scope.</Preconditions>
|
|
46
|
-
<AcceptanceCriteria>The reviewer can only read memory tools and returns a report-only audit.</AcceptanceCriteria>
|
|
47
|
-
<Priority>medium</Priority>
|
|
48
|
-
<RelatedFlows>DF-MEMORY-REVIEW</RelatedFlows>
|
|
49
|
-
</UC-004>
|
|
50
|
-
</UseCases>
|
|
51
|
-
|
|
52
|
-
<NonGoals>
|
|
53
|
-
<item-1>No automatic memory injection into prompts.</item-1>
|
|
54
|
-
<item-2>No vector store, embeddings, or indexed retrieval in v1 memory.</item-2>
|
|
55
|
-
<item-3>No fallback compatibility with old `.opencode/guardian.jsonc` or `~/.config/opencode/guardian.jsonc` paths after the vvoc path migration.</item-3>
|
|
56
|
-
</NonGoals>
|
|
57
|
-
|
|
58
|
-
<Constraints>
|
|
59
|
-
<constraint-1>OpenCode config integration must follow documented global and project path conventions.</constraint-1>
|
|
60
|
-
<constraint-2>vvoc-managed config must live under `$XDG_CONFIG_HOME/vvoc/` or project-local `.vvoc/`.</constraint-2>
|
|
61
|
-
<constraint-3>Config writes must be idempotent and preserve existing JSONC comments in the main OpenCode config where practical.</constraint-3>
|
|
62
|
-
<constraint-4>Memory must stay explicit-only. Stored entries must not be injected into prompts automatically.</constraint-4>
|
|
63
|
-
<constraint-5>Generated Guardian config should be clearly marked as CLI-managed so sync can distinguish owned and non-owned files.</constraint-5>
|
|
64
|
-
</Constraints>
|
|
65
|
-
|
|
66
|
-
<Risks>
|
|
67
|
-
<risk-1>Repositories or machines may contain multiple config files (`.json` and `.jsonc`) that can drift from each other.</risk-1>
|
|
68
|
-
<risk-2>Unsafe rewrites of user-maintained config could damage trust in the CLI.</risk-2>
|
|
69
|
-
<risk-3>The file-based memory store performs full scans and may degrade as the number of entries grows.</risk-3>
|
|
70
|
-
<risk-4>Guardian and Memory depend on OpenCode plugin and SDK surface area that may evolve over time.</risk-4>
|
|
71
|
-
</Risks>
|
|
72
|
-
|
|
73
|
-
<OpenQuestions>
|
|
74
|
-
<question-1>Should future versions also manage OpenCode skills and agents as installable assets in addition to plugin config and vvoc-owned files?</question-1>
|
|
75
|
-
<question-2>Should memory eventually grow an index or vector-backed search layer once `.vvoc/memory` becomes large?</question-2>
|
|
76
|
-
</OpenQuestions>
|
|
77
|
-
</RequirementsAnalysis>
|
package/docs/technology.xml
DELETED
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
<TechnologyStack VERSION="0.3.0">
|
|
2
|
-
<Runtime>Bun 1.3.8</Runtime>
|
|
3
|
-
<Language>TypeScript 5.8.2</Language>
|
|
4
|
-
<Framework>citty 0.2.2</Framework>
|
|
5
|
-
|
|
6
|
-
<Dependencies>
|
|
7
|
-
<dep name="@opencode-ai/plugin" version="1.3.17" purpose="Type-safe OpenCode plugin API, hooks, and custom tool helper." />
|
|
8
|
-
<dep name="@opencode-ai/sdk" version="1.3.17" purpose="OpenCode client types and runtime interactions used by Guardian and plugin logging." />
|
|
9
|
-
<dep name="citty" version="0.2.2" purpose="CLI command tree and argument parsing for `vvoc`." />
|
|
10
|
-
<dep name="jsonc-parser" version="3.3.1" purpose="Safe JSONC-aware config parsing for vvoc-managed config files and OpenCode config edits." />
|
|
11
|
-
</Dependencies>
|
|
12
|
-
|
|
13
|
-
<VersionConstraints>
|
|
14
|
-
<constraint lib="bun" min="1.3.8" max="1.3.x" reason="The package and local verification target Bun-based runtime and test execution." />
|
|
15
|
-
<constraint lib="@opencode-ai/plugin" min="1.3.17" max="1.3.x" reason="Guardian and Memory depend on the current plugin hook and custom tool API shape." />
|
|
16
|
-
<constraint lib="@opencode-ai/sdk" min="1.3.17" max="1.3.x" reason="Guardian uses current SDK message, part, and client log types." />
|
|
17
|
-
</VersionConstraints>
|
|
18
|
-
|
|
19
|
-
<Tooling>
|
|
20
|
-
<tool name="package-manager" value="bun" version="1.3.8" />
|
|
21
|
-
<tool name="compiler" value="typescript" version="5.8.2" />
|
|
22
|
-
<tool name="linter" value="oxlint" version="1.58.0" />
|
|
23
|
-
<tool name="formatter" value="oxfmt" version="0.43.0" />
|
|
24
|
-
<tool name="git-hooks" value="lefthook" version="2.1.5" />
|
|
25
|
-
<tool name="test-runner" value="bun test" version="1.3.8" />
|
|
26
|
-
</Tooling>
|
|
27
|
-
|
|
28
|
-
<ConfigLayout>
|
|
29
|
-
<openCode>OpenCode config remains in `opencode.json(c)` or `$XDG_CONFIG_HOME/opencode/`.</openCode>
|
|
30
|
-
<vvoc>vvoc-managed config lives in `.vvoc/` or `$XDG_CONFIG_HOME/vvoc/`.</vvoc>
|
|
31
|
-
<memory>Persistent explicit memory is stored in project-local `.vvoc/memory/`.</memory>
|
|
32
|
-
</ConfigLayout>
|
|
33
|
-
|
|
34
|
-
<Testing>
|
|
35
|
-
<module-level>
|
|
36
|
-
<command>bun test src/lib/opencode.test.ts src/plugins/memory.test.ts</command>
|
|
37
|
-
<focus>Fast deterministic checks for config layout, Guardian config rendering, memory CRUD, and reviewer agent registration.</focus>
|
|
38
|
-
</module-level>
|
|
39
|
-
<wave-level>
|
|
40
|
-
<command>bun run check</command>
|
|
41
|
-
<focus>Checks merged CLI and plugin behavior with lint and format verification included.</focus>
|
|
42
|
-
</wave-level>
|
|
43
|
-
<phase-level>
|
|
44
|
-
<command>bun run check && bun run build</command>
|
|
45
|
-
<focus>Validates package output and regression-safe baseline behavior after quality gates pass.</focus>
|
|
46
|
-
</phase-level>
|
|
47
|
-
<mocking-policy>Prefer direct pure-function verification and fixture text over broad mocks.</mocking-policy>
|
|
48
|
-
</Testing>
|
|
49
|
-
|
|
50
|
-
<Observability>
|
|
51
|
-
<logger>OpenCode app log via `client.app.log()` plus Guardian best-effort debug file in `/tmp`.</logger>
|
|
52
|
-
<log-format>[service][function][block] message</log-format>
|
|
53
|
-
<required-fields>service, level, message, requestID, sessionID</required-fields>
|
|
54
|
-
<redaction>Never log secrets, credentials, or raw high-risk payloads beyond the existing Guardian truncation policy.</redaction>
|
|
55
|
-
</Observability>
|
|
56
|
-
|
|
57
|
-
<DeliveryShape>
|
|
58
|
-
<shape>One public npm package that exports `GuardianPlugin` and `MemoryPlugin`, plus a Bun CLI binary named `vvoc`.</shape>
|
|
59
|
-
</DeliveryShape>
|
|
60
|
-
</TechnologyStack>
|