@osovv/vv-opencode 0.1.0
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/AGENTS.md +164 -0
- package/README.md +43 -0
- package/dist/cli.d.ts +2 -0
- package/dist/cli.js +23 -0
- package/dist/cli.js.map +1 -0
- package/dist/commands/doctor.d.ts +19 -0
- package/dist/commands/doctor.js +70 -0
- package/dist/commands/doctor.js.map +1 -0
- package/dist/commands/guardian.d.ts +2 -0
- package/dist/commands/guardian.js +119 -0
- package/dist/commands/guardian.js.map +1 -0
- package/dist/commands/install.d.ts +28 -0
- package/dist/commands/install.js +59 -0
- package/dist/commands/install.js.map +1 -0
- package/dist/commands/status.d.ts +13 -0
- package/dist/commands/status.js +47 -0
- package/dist/commands/status.js.map +1 -0
- package/dist/commands/sync.d.ts +23 -0
- package/dist/commands/sync.js +49 -0
- package/dist/commands/sync.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -0
- package/dist/lib/opencode.d.ts +86 -0
- package/dist/lib/opencode.js +415 -0
- package/dist/lib/opencode.js.map +1 -0
- package/dist/lib/opencode.test.d.ts +1 -0
- package/dist/lib/opencode.test.js +47 -0
- package/dist/lib/opencode.test.js.map +1 -0
- package/dist/plugins/guardian.d.ts +2 -0
- package/dist/plugins/guardian.js +1135 -0
- package/dist/plugins/guardian.js.map +1 -0
- package/docs/development-plan.xml +155 -0
- package/docs/knowledge-graph.xml +42 -0
- package/docs/operational-packets.xml +106 -0
- package/docs/requirements.xml +66 -0
- package/docs/technology.xml +51 -0
- package/docs/verification-plan.xml +145 -0
- package/package.json +58 -0
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
<VerificationPlan VERSION="0.2.0">
|
|
2
|
+
<GlobalPolicy>
|
|
3
|
+
<log-format>[service][function][block] message</log-format>
|
|
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>
|
|
8
|
+
<redaction>Never log secrets, credentials, raw tokens, or high-risk payloads outside the existing Guardian truncation policy.</redaction>
|
|
9
|
+
</GlobalPolicy>
|
|
10
|
+
|
|
11
|
+
<CriticalFlows>
|
|
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>
|
|
15
|
+
<required-signals>
|
|
16
|
+
<trace-sequence>resolvePaths -> ensurePackageInstalled -> status reports configured</trace-sequence>
|
|
17
|
+
</required-signals>
|
|
18
|
+
</VF-PLUGIN-INSTALL>
|
|
19
|
+
<VF-CONFIG-SYNC NAME="ManagedConfigSync" USE_CASES="UC-002" DATA_FLOW="DF-CONFIG-SYNC" PRIORITY="high">
|
|
20
|
+
<scenario>User syncs a managed Guardian config after changing package versions or moving to another device.</scenario>
|
|
21
|
+
<expected-outcome>The managed file is rewritten canonically and current values survive the rewrite.</expected-outcome>
|
|
22
|
+
<required-signals>
|
|
23
|
+
<trace-sequence>inspect managed file -> parse current values -> render canonical JSONC</trace-sequence>
|
|
24
|
+
</required-signals>
|
|
25
|
+
</VF-CONFIG-SYNC>
|
|
26
|
+
<VF-GUARDIAN-REVIEW NAME="GuardianReview" USE_CASES="UC-003" DATA_FLOW="DF-GUARDIAN-REVIEW" PRIORITY="high">
|
|
27
|
+
<scenario>OpenCode asks for a permission decision while Guardian is active.</scenario>
|
|
28
|
+
<expected-outcome>Low-risk actions may be auto-approved and higher-risk actions fall back to manual approval.</expected-outcome>
|
|
29
|
+
<required-signals>
|
|
30
|
+
<log-marker>guardian review started</log-marker>
|
|
31
|
+
<log-marker>guardian review completed</log-marker>
|
|
32
|
+
</required-signals>
|
|
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>
|
|
37
|
+
<required-signals>
|
|
38
|
+
<trace-sequence>detect unmanaged file -> skip write</trace-sequence>
|
|
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>
|
|
44
|
+
<required-signals>
|
|
45
|
+
<trace-sequence>install -> status -> doctor</trace-sequence>
|
|
46
|
+
</required-signals>
|
|
47
|
+
</VF-CROSS-DEVICE-SETUP>
|
|
48
|
+
</CriticalFlows>
|
|
49
|
+
|
|
50
|
+
<ModuleVerification>
|
|
51
|
+
<V-M-CLI-CONFIG MODULE="M-CLI-CONFIG" PRIORITY="high">
|
|
52
|
+
<test-files>
|
|
53
|
+
<file>src/lib/opencode.test.ts</file>
|
|
54
|
+
</test-files>
|
|
55
|
+
<module-checks>
|
|
56
|
+
<check-1>bun test src/lib/opencode.test.ts</check-1>
|
|
57
|
+
<check-2>bun x tsc --noEmit</check-2>
|
|
58
|
+
</module-checks>
|
|
59
|
+
<scenarios>
|
|
60
|
+
<scenario-1 kind="success">Fresh install config renders with schema and plugin array.</scenario-1>
|
|
61
|
+
<scenario-2 kind="success">Existing JSONC comments survive plugin insertion.</scenario-2>
|
|
62
|
+
<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>
|
|
64
|
+
</scenarios>
|
|
65
|
+
<required-log-markers />
|
|
66
|
+
<required-trace-assertions>
|
|
67
|
+
<assertion-1>Sync must not overwrite unmanaged Guardian config without force.</assertion-1>
|
|
68
|
+
</required-trace-assertions>
|
|
69
|
+
<wave-follow-up>Smoke command output for `status` and `doctor` after build.</wave-follow-up>
|
|
70
|
+
<phase-follow-up>Extend tests to cover more path and scope permutations.</phase-follow-up>
|
|
71
|
+
</V-M-CLI-CONFIG>
|
|
72
|
+
|
|
73
|
+
<V-M-CLI-COMMANDS MODULE="M-CLI-COMMANDS" PRIORITY="medium">
|
|
74
|
+
<test-files>
|
|
75
|
+
<file>src/lib/opencode.test.ts</file>
|
|
76
|
+
</test-files>
|
|
77
|
+
<module-checks>
|
|
78
|
+
<check-1>bun run build</check-1>
|
|
79
|
+
<check-2>bun test</check-2>
|
|
80
|
+
</module-checks>
|
|
81
|
+
<scenarios>
|
|
82
|
+
<scenario-1 kind="success">CLI compiles and registers all planned top-level subcommands.</scenario-1>
|
|
83
|
+
<scenario-2 kind="success">`guardian config --print` emits valid JSONC content.</scenario-2>
|
|
84
|
+
</scenarios>
|
|
85
|
+
<required-log-markers />
|
|
86
|
+
<required-trace-assertions>
|
|
87
|
+
<assertion-1>Command handlers should delegate file mutation to helper utilities instead of duplicating filesystem logic.</assertion-1>
|
|
88
|
+
</required-trace-assertions>
|
|
89
|
+
<wave-follow-up>Verify `vvoc install`, `vvoc sync`, and `vvoc doctor` against a temp config directory.</wave-follow-up>
|
|
90
|
+
<phase-follow-up>Add command-level smoke tests once temp-dir fixtures are introduced.</phase-follow-up>
|
|
91
|
+
</V-M-CLI-COMMANDS>
|
|
92
|
+
|
|
93
|
+
<V-M-PLUGIN-GUARDIAN MODULE="M-PLUGIN-GUARDIAN" PRIORITY="high">
|
|
94
|
+
<test-files>
|
|
95
|
+
<file>typecheck-only in v1</file>
|
|
96
|
+
</test-files>
|
|
97
|
+
<module-checks>
|
|
98
|
+
<check-1>bun x tsc --noEmit</check-1>
|
|
99
|
+
</module-checks>
|
|
100
|
+
<scenarios>
|
|
101
|
+
<scenario-1 kind="success">Guardian plugin exports compile against current OpenCode plugin and SDK types.</scenario-1>
|
|
102
|
+
<scenario-2 kind="failure">Review failures fall back to manual approval instead of silently allowing.</scenario-2>
|
|
103
|
+
</scenarios>
|
|
104
|
+
<required-log-markers>
|
|
105
|
+
<marker-1>guardian plugin initialized</marker-1>
|
|
106
|
+
<marker-2>guardian review started</marker-2>
|
|
107
|
+
<marker-3>guardian review completed</marker-3>
|
|
108
|
+
</required-log-markers>
|
|
109
|
+
<required-trace-assertions>
|
|
110
|
+
<assertion-1>Auto-allow only occurs when Guardian returns a risk score below the configured threshold.</assertion-1>
|
|
111
|
+
</required-trace-assertions>
|
|
112
|
+
<wave-follow-up>Add isolated behavioral tests around assessment parsing and decision thresholds.</wave-follow-up>
|
|
113
|
+
<phase-follow-up>Consider extracting pure Guardian parsing helpers for direct unit coverage.</phase-follow-up>
|
|
114
|
+
</V-M-PLUGIN-GUARDIAN>
|
|
115
|
+
</ModuleVerification>
|
|
116
|
+
|
|
117
|
+
<PhaseGates>
|
|
118
|
+
<Gate-Phase-1 PHASE="Phase-1">
|
|
119
|
+
<goal>CLI foundation is buildable and the helper layer has deterministic checks.</goal>
|
|
120
|
+
<commands>
|
|
121
|
+
<command-1>bun x tsc --noEmit</command-1>
|
|
122
|
+
<command-2>bun test</command-2>
|
|
123
|
+
</commands>
|
|
124
|
+
<required-evidence>
|
|
125
|
+
<evidence-1>Config merge and Guardian config rendering are covered by module-local tests.</evidence-1>
|
|
126
|
+
</required-evidence>
|
|
127
|
+
</Gate-Phase-1>
|
|
128
|
+
<Gate-Phase-2 PHASE="Phase-2">
|
|
129
|
+
<goal>Guardian is packaged from the repo and exported without behavior drift.</goal>
|
|
130
|
+
<commands>
|
|
131
|
+
<command-1>bun run build</command-1>
|
|
132
|
+
<command-2>bun x tsc --noEmit</command-2>
|
|
133
|
+
</commands>
|
|
134
|
+
<required-evidence>
|
|
135
|
+
<evidence-1>`src/plugins/guardian.ts` is present and package root exports `GuardianPlugin`.</evidence-1>
|
|
136
|
+
</required-evidence>
|
|
137
|
+
</Gate-Phase-2>
|
|
138
|
+
</PhaseGates>
|
|
139
|
+
|
|
140
|
+
<FailurePackets>
|
|
141
|
+
<packet-template>
|
|
142
|
+
<expected-fields>scenario, expected-evidence, observed-evidence, first-divergent-block, next-action</expected-fields>
|
|
143
|
+
</packet-template>
|
|
144
|
+
</FailurePackets>
|
|
145
|
+
</VerificationPlan>
|
package/package.json
ADDED
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@osovv/vv-opencode",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Portable OpenCode workflow plugins and CLI tooling.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"publishConfig": {
|
|
8
|
+
"access": "public"
|
|
9
|
+
},
|
|
10
|
+
"keywords": [
|
|
11
|
+
"opencode",
|
|
12
|
+
"plugins",
|
|
13
|
+
"workflow",
|
|
14
|
+
"guardian",
|
|
15
|
+
"bun",
|
|
16
|
+
"citty"
|
|
17
|
+
],
|
|
18
|
+
"bin": {
|
|
19
|
+
"vvoc": "./dist/cli.js"
|
|
20
|
+
},
|
|
21
|
+
"files": [
|
|
22
|
+
"dist",
|
|
23
|
+
"README.md",
|
|
24
|
+
"AGENTS.md",
|
|
25
|
+
"docs"
|
|
26
|
+
],
|
|
27
|
+
"exports": {
|
|
28
|
+
".": {
|
|
29
|
+
"types": "./dist/index.d.ts",
|
|
30
|
+
"import": "./dist/index.js"
|
|
31
|
+
},
|
|
32
|
+
"./plugins/guardian": {
|
|
33
|
+
"types": "./dist/plugins/guardian.d.ts",
|
|
34
|
+
"import": "./dist/plugins/guardian.js"
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
"scripts": {
|
|
38
|
+
"build": "tsc -p tsconfig.json",
|
|
39
|
+
"typecheck": "tsc --noEmit -p tsconfig.json",
|
|
40
|
+
"test": "bun test",
|
|
41
|
+
"check": "bun run typecheck && bun test"
|
|
42
|
+
},
|
|
43
|
+
"dependencies": {
|
|
44
|
+
"@opencode-ai/plugin": "1.3.17",
|
|
45
|
+
"@opencode-ai/sdk": "1.3.17",
|
|
46
|
+
"citty": "0.2.2",
|
|
47
|
+
"jsonc-parser": "3.3.1"
|
|
48
|
+
},
|
|
49
|
+
"devDependencies": {
|
|
50
|
+
"@types/node": "22.13.9",
|
|
51
|
+
"bun-types": "1.3.11",
|
|
52
|
+
"typescript": "5.8.2"
|
|
53
|
+
},
|
|
54
|
+
"engines": {
|
|
55
|
+
"bun": ">=1.3.8"
|
|
56
|
+
},
|
|
57
|
+
"packageManager": "bun@1.3.8"
|
|
58
|
+
}
|