@osovv/vv-opencode 0.1.0 → 0.2.1

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 (44) hide show
  1. package/AGENTS.md +62 -50
  2. package/README.md +237 -20
  3. package/dist/commands/doctor.d.ts +1 -7
  4. package/dist/commands/doctor.js +3 -20
  5. package/dist/commands/doctor.js.map +1 -1
  6. package/dist/commands/guardian.js +1 -1
  7. package/dist/commands/guardian.js.map +1 -1
  8. package/dist/commands/install.d.ts +1 -7
  9. package/dist/commands/install.js +4 -16
  10. package/dist/commands/install.js.map +1 -1
  11. package/dist/commands/status.d.ts +1 -1
  12. package/dist/commands/status.js +2 -5
  13. package/dist/commands/status.js.map +1 -1
  14. package/dist/commands/sync.d.ts +1 -7
  15. package/dist/commands/sync.js +4 -15
  16. package/dist/commands/sync.js.map +1 -1
  17. package/dist/index.d.ts +1 -0
  18. package/dist/index.js +1 -0
  19. package/dist/index.js.map +1 -1
  20. package/dist/lib/opencode.d.ts +3 -18
  21. package/dist/lib/opencode.js +39 -111
  22. package/dist/lib/opencode.js.map +1 -1
  23. package/dist/lib/opencode.test.js +23 -6
  24. package/dist/lib/opencode.test.js.map +1 -1
  25. package/dist/lib/vvoc-paths.d.ts +6 -0
  26. package/dist/lib/vvoc-paths.js +25 -0
  27. package/dist/lib/vvoc-paths.js.map +1 -0
  28. package/dist/plugins/guardian.js +20 -21
  29. package/dist/plugins/guardian.js.map +1 -1
  30. package/dist/plugins/memory-store.d.ts +49 -0
  31. package/dist/plugins/memory-store.js +452 -0
  32. package/dist/plugins/memory-store.js.map +1 -0
  33. package/dist/plugins/memory.d.ts +2 -0
  34. package/dist/plugins/memory.js +323 -0
  35. package/dist/plugins/memory.js.map +1 -0
  36. package/dist/plugins/memory.test.d.ts +1 -0
  37. package/dist/plugins/memory.test.js +151 -0
  38. package/dist/plugins/memory.test.js.map +1 -0
  39. package/docs/development-plan.xml +100 -20
  40. package/docs/knowledge-graph.xml +30 -6
  41. package/docs/requirements.xml +30 -19
  42. package/docs/technology.xml +23 -14
  43. package/docs/verification-plan.xml +92 -25
  44. package/package.json +14 -2
@@ -1,19 +1,19 @@
1
- <VerificationPlan VERSION="0.2.0">
1
+ <VerificationPlan VERSION="0.3.0">
2
2
  <GlobalPolicy>
3
3
  <log-format>[service][function][block] message</log-format>
4
4
  <deterministic-first>true</deterministic-first>
5
- <module-level-focus>Fast deterministic checks for config mutation and rendering helpers.</module-level-focus>
6
- <wave-level-focus>Typecheck and test the merged CLI + helper surface after each coordinated change.</wave-level-focus>
7
- <phase-level-focus>Buildable package output plus stable command behavior for installation and sync workflows.</phase-level-focus>
5
+ <module-level-focus>Fast deterministic checks for vvoc config layout, Guardian config rendering, memory CRUD, and reviewer registration.</module-level-focus>
6
+ <wave-level-focus>Typecheck, lint, format-check, and test the merged CLI + plugin surface after each coordinated change.</wave-level-focus>
7
+ <phase-level-focus>Buildable package output plus stable command behavior for installation, Guardian review, and explicit memory workflows.</phase-level-focus>
8
8
  <redaction>Never log secrets, credentials, raw tokens, or high-risk payloads outside the existing Guardian truncation policy.</redaction>
9
9
  </GlobalPolicy>
10
10
 
11
11
  <CriticalFlows>
12
12
  <VF-PLUGIN-INSTALL NAME="PluginInstall" USE_CASES="UC-001" DATA_FLOW="DF-PLUGIN-INSTALL" PRIORITY="high">
13
- <scenario>User installs the package into a fresh or existing OpenCode config.</scenario>
14
- <expected-outcome>The package name is present in the resolved `plugin` array and OpenCode can later load the plugin from npm.</expected-outcome>
13
+ <scenario>User installs the package into a fresh global or project config root.</scenario>
14
+ <expected-outcome>The package name is present in the resolved OpenCode `plugin` array and Guardian config lives under the vvoc config root.</expected-outcome>
15
15
  <required-signals>
16
- <trace-sequence>resolvePaths -&gt; ensurePackageInstalled -&gt; status reports configured</trace-sequence>
16
+ <trace-sequence>resolvePaths -&gt; ensurePackageInstalled -&gt; installGuardianConfig -&gt; status reports configured</trace-sequence>
17
17
  </required-signals>
18
18
  </VF-PLUGIN-INSTALL>
19
19
  <VF-CONFIG-SYNC NAME="ManagedConfigSync" USE_CASES="UC-002" DATA_FLOW="DF-CONFIG-SYNC" PRIORITY="high">
@@ -23,7 +23,7 @@
23
23
  <trace-sequence>inspect managed file -&gt; parse current values -&gt; render canonical JSONC</trace-sequence>
24
24
  </required-signals>
25
25
  </VF-CONFIG-SYNC>
26
- <VF-GUARDIAN-REVIEW NAME="GuardianReview" USE_CASES="UC-003" DATA_FLOW="DF-GUARDIAN-REVIEW" PRIORITY="high">
26
+ <VF-GUARDIAN-REVIEW NAME="GuardianReview" USE_CASES="UC-001" DATA_FLOW="DF-GUARDIAN-REVIEW" PRIORITY="high">
27
27
  <scenario>OpenCode asks for a permission decision while Guardian is active.</scenario>
28
28
  <expected-outcome>Low-risk actions may be auto-approved and higher-risk actions fall back to manual approval.</expected-outcome>
29
29
  <required-signals>
@@ -31,20 +31,20 @@
31
31
  <log-marker>guardian review completed</log-marker>
32
32
  </required-signals>
33
33
  </VF-GUARDIAN-REVIEW>
34
- <VF-SAFE-UPDATES NAME="SafeUpdates" USE_CASES="UC-002" DATA_FLOW="DF-CONFIG-SYNC" PRIORITY="high">
35
- <scenario>User already owns a manually-maintained Guardian config file.</scenario>
36
- <expected-outcome>The CLI skips rewriting it unless force is explicit.</expected-outcome>
34
+ <VF-MEMORY-ACCESS NAME="MemoryAccess" USE_CASES="UC-003" DATA_FLOW="DF-MEMORY-ACCESS" PRIORITY="high">
35
+ <scenario>User stores and retrieves explicit memory across session, branch, project, and shared scopes.</scenario>
36
+ <expected-outcome>Entries are written to `.vvoc/memory`, later searchable, and never injected into prompts automatically, while the agent still receives a short system reminder to use memory tools proactively.</expected-outcome>
37
37
  <required-signals>
38
- <trace-sequence>detect unmanaged file -&gt; skip write</trace-sequence>
38
+ <trace-sequence>system reminder appended -&gt; loadMemoryRuntimeConfig -&gt; putMemory/listMemories/searchMemories -&gt; correct file layout</trace-sequence>
39
39
  </required-signals>
40
- </VF-SAFE-UPDATES>
41
- <VF-CROSS-DEVICE-SETUP NAME="CrossDeviceSetup" USE_CASES="UC-001, UC-002" DATA_FLOW="DF-PLUGIN-INSTALL" PRIORITY="high">
42
- <scenario>User repeats install or sync on another machine.</scenario>
43
- <expected-outcome>The same package and config layout can be recreated with predictable CLI output.</expected-outcome>
40
+ </VF-MEMORY-ACCESS>
41
+ <VF-MEMORY-REVIEW NAME="MemoryReview" USE_CASES="UC-004" DATA_FLOW="DF-MEMORY-REVIEW" PRIORITY="medium">
42
+ <scenario>User invokes `@memory-reviewer` to audit existing memory.</scenario>
43
+ <expected-outcome>The reviewer can inspect memory with read-only tools and returns a report without changing entries.</expected-outcome>
44
44
  <required-signals>
45
- <trace-sequence>install -&gt; status -&gt; doctor</trace-sequence>
45
+ <trace-sequence>plugin config registers memory-reviewer -&gt; reviewer uses memory_list/get/search only</trace-sequence>
46
46
  </required-signals>
47
- </VF-CROSS-DEVICE-SETUP>
47
+ </VF-MEMORY-REVIEW>
48
48
  </CriticalFlows>
49
49
 
50
50
  <ModuleVerification>
@@ -55,12 +55,14 @@
55
55
  <module-checks>
56
56
  <check-1>bun test src/lib/opencode.test.ts</check-1>
57
57
  <check-2>bun x tsc --noEmit</check-2>
58
+ <check-3>bun run lint</check-3>
59
+ <check-4>bun run fmt:check</check-4>
58
60
  </module-checks>
59
61
  <scenarios>
60
62
  <scenario-1 kind="success">Fresh install config renders with schema and plugin array.</scenario-1>
61
63
  <scenario-2 kind="success">Existing JSONC comments survive plugin insertion.</scenario-2>
62
64
  <scenario-3 kind="success">Guardian config round-trips explicit override values.</scenario-3>
63
- <scenario-4 kind="failure">Invalid plugin array or invalid Guardian config shape fails loudly.</scenario-4>
65
+ <scenario-4 kind="success">Global path resolution separates `opencode/` and `vvoc/` roots.</scenario-4>
64
66
  </scenarios>
65
67
  <required-log-markers />
66
68
  <required-trace-assertions>
@@ -75,8 +77,10 @@
75
77
  <file>src/lib/opencode.test.ts</file>
76
78
  </test-files>
77
79
  <module-checks>
78
- <check-1>bun run build</check-1>
79
- <check-2>bun test</check-2>
80
+ <check-1>bun run lint</check-1>
81
+ <check-2>bun run fmt:check</check-2>
82
+ <check-3>bun run build</check-3>
83
+ <check-4>bun test</check-4>
80
84
  </module-checks>
81
85
  <scenarios>
82
86
  <scenario-1 kind="success">CLI compiles and registers all planned top-level subcommands.</scenario-1>
@@ -86,7 +90,7 @@
86
90
  <required-trace-assertions>
87
91
  <assertion-1>Command handlers should delegate file mutation to helper utilities instead of duplicating filesystem logic.</assertion-1>
88
92
  </required-trace-assertions>
89
- <wave-follow-up>Verify `vvoc install`, `vvoc sync`, and `vvoc doctor` against a temp config directory.</wave-follow-up>
93
+ <wave-follow-up>Verify `vvoc install`, `vvoc sync`, and `vvoc doctor` against a temp config home.</wave-follow-up>
90
94
  <phase-follow-up>Add command-level smoke tests once temp-dir fixtures are introduced.</phase-follow-up>
91
95
  </V-M-CLI-COMMANDS>
92
96
 
@@ -112,6 +116,52 @@
112
116
  <wave-follow-up>Add isolated behavioral tests around assessment parsing and decision thresholds.</wave-follow-up>
113
117
  <phase-follow-up>Consider extracting pure Guardian parsing helpers for direct unit coverage.</phase-follow-up>
114
118
  </V-M-PLUGIN-GUARDIAN>
119
+
120
+ <V-M-PLUGIN-MEMORY-STORE MODULE="M-PLUGIN-MEMORY-STORE" PRIORITY="high">
121
+ <test-files>
122
+ <file>src/plugins/memory.test.ts</file>
123
+ </test-files>
124
+ <module-checks>
125
+ <check-1>bun test src/plugins/memory.test.ts</check-1>
126
+ <check-2>bun x tsc --noEmit</check-2>
127
+ </module-checks>
128
+ <scenarios>
129
+ <scenario-1 kind="success">Scoped memory entries are stored in the expected `.vvoc/memory` layout.</scenario-1>
130
+ <scenario-2 kind="success">Search returns the best lexical match in the requested scope.</scenario-2>
131
+ <scenario-3 kind="success">Update and delete preserve store consistency and clean empty directories.</scenario-3>
132
+ </scenarios>
133
+ <required-log-markers />
134
+ <required-trace-assertions>
135
+ <assertion-1>Memory stays explicit-only and no store operation injects entries into prompts automatically.</assertion-1>
136
+ </required-trace-assertions>
137
+ <wave-follow-up>Watch performance if the number of JSON entries grows significantly.</wave-follow-up>
138
+ <phase-follow-up>Consider indexing only when the simple file scan becomes a measured problem.</phase-follow-up>
139
+ </V-M-PLUGIN-MEMORY-STORE>
140
+
141
+ <V-M-PLUGIN-MEMORY MODULE="M-PLUGIN-MEMORY" PRIORITY="high">
142
+ <test-files>
143
+ <file>src/plugins/memory.test.ts</file>
144
+ </test-files>
145
+ <module-checks>
146
+ <check-1>bun test src/plugins/memory.test.ts</check-1>
147
+ <check-2>bun x tsc --noEmit</check-2>
148
+ </module-checks>
149
+ <scenarios>
150
+ <scenario-1 kind="success">MemoryPlugin registers all six memory tools.</scenario-1>
151
+ <scenario-2 kind="success">Plugin config registers the `memory-reviewer` subagent.</scenario-2>
152
+ <scenario-3 kind="success">Plugin appends a short system instruction encouraging proactive memory tool usage without injecting stored entries.</scenario-3>
153
+ <scenario-4 kind="failure">Disabled memory config blocks tool use instead of pretending memory exists.</scenario-4>
154
+ </scenarios>
155
+ <required-log-markers>
156
+ <marker-1>memory plugin initialized</marker-1>
157
+ </required-log-markers>
158
+ <required-trace-assertions>
159
+ <assertion-1>The reviewer agent must not have write/delete memory tools enabled.</assertion-1>
160
+ <assertion-2>The system reminder must not include stored memory entries or imply that memory is already loaded.</assertion-2>
161
+ </required-trace-assertions>
162
+ <wave-follow-up>Consider adding a smoke test around custom tool execution in a live OpenCode session.</wave-follow-up>
163
+ <phase-follow-up>Add coverage for memory config warnings and disabled mode if the config surface grows.</phase-follow-up>
164
+ </V-M-PLUGIN-MEMORY>
115
165
  </ModuleVerification>
116
166
 
117
167
  <PhaseGates>
@@ -119,7 +169,9 @@
119
169
  <goal>CLI foundation is buildable and the helper layer has deterministic checks.</goal>
120
170
  <commands>
121
171
  <command-1>bun x tsc --noEmit</command-1>
122
- <command-2>bun test</command-2>
172
+ <command-2>bun run lint</command-2>
173
+ <command-3>bun run fmt:check</command-3>
174
+ <command-4>bun test</command-4>
123
175
  </commands>
124
176
  <required-evidence>
125
177
  <evidence-1>Config merge and Guardian config rendering are covered by module-local tests.</evidence-1>
@@ -128,13 +180,28 @@
128
180
  <Gate-Phase-2 PHASE="Phase-2">
129
181
  <goal>Guardian is packaged from the repo and exported without behavior drift.</goal>
130
182
  <commands>
131
- <command-1>bun run build</command-1>
132
- <command-2>bun x tsc --noEmit</command-2>
183
+ <command-1>bun x tsc --noEmit</command-1>
184
+ <command-2>bun run lint</command-2>
185
+ <command-3>bun run fmt:check</command-3>
186
+ <command-4>bun run build</command-4>
133
187
  </commands>
134
188
  <required-evidence>
135
189
  <evidence-1>`src/plugins/guardian.ts` is present and package root exports `GuardianPlugin`.</evidence-1>
136
190
  </required-evidence>
137
191
  </Gate-Phase-2>
192
+ <Gate-Phase-3 PHASE="Phase-3">
193
+ <goal>Explicit memory is packaged from the repo and stored under `.vvoc/memory` with a report-only reviewer agent.</goal>
194
+ <commands>
195
+ <command-1>bun x tsc --noEmit</command-1>
196
+ <command-2>bun run lint</command-2>
197
+ <command-3>bun run fmt:check</command-3>
198
+ <command-4>bun test</command-4>
199
+ <command-5>bun run build</command-5>
200
+ </commands>
201
+ <required-evidence>
202
+ <evidence-1>`src/plugins/memory.ts` and `src/plugins/memory-store.ts` are present and package root exports `MemoryPlugin`.</evidence-1>
203
+ </required-evidence>
204
+ </Gate-Phase-3>
138
205
  </PhaseGates>
139
206
 
140
207
  <FailurePackets>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@osovv/vv-opencode",
3
- "version": "0.1.0",
3
+ "version": "0.2.1",
4
4
  "description": "Portable OpenCode workflow plugins and CLI tooling.",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -12,6 +12,7 @@
12
12
  "plugins",
13
13
  "workflow",
14
14
  "guardian",
15
+ "memory",
15
16
  "bun",
16
17
  "citty"
17
18
  ],
@@ -32,13 +33,21 @@
32
33
  "./plugins/guardian": {
33
34
  "types": "./dist/plugins/guardian.d.ts",
34
35
  "import": "./dist/plugins/guardian.js"
36
+ },
37
+ "./plugins/memory": {
38
+ "types": "./dist/plugins/memory.d.ts",
39
+ "import": "./dist/plugins/memory.js"
35
40
  }
36
41
  },
37
42
  "scripts": {
38
43
  "build": "tsc -p tsconfig.json",
39
44
  "typecheck": "tsc --noEmit -p tsconfig.json",
45
+ "lint": "oxlint --deny warnings src",
46
+ "fmt": "oxfmt --write src",
47
+ "fmt:check": "oxfmt --check src",
40
48
  "test": "bun test",
41
- "check": "bun run typecheck && bun test"
49
+ "check": "bun run typecheck && bun run lint && bun run fmt:check && bun test",
50
+ "prepare": "lefthook install --force"
42
51
  },
43
52
  "dependencies": {
44
53
  "@opencode-ai/plugin": "1.3.17",
@@ -49,6 +58,9 @@
49
58
  "devDependencies": {
50
59
  "@types/node": "22.13.9",
51
60
  "bun-types": "1.3.11",
61
+ "lefthook": "2.1.5",
62
+ "oxfmt": "0.43.0",
63
+ "oxlint": "1.58.0",
52
64
  "typescript": "5.8.2"
53
65
  },
54
66
  "engines": {