harness-everything 0.58.0 → 1.0.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 (53) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/.claude-plugin/plugin.json +1 -1
  3. package/AGENTS.md +8 -2
  4. package/CHANGELOG.md +24 -0
  5. package/README.md +4 -4
  6. package/benchmarks/results/live-host/opencode-2026-11-24-v2-lifecycle/README.md +40 -0
  7. package/benchmarks/results/live-host/opencode-2026-11-24-v2-lifecycle/edit-state-final.json +11 -0
  8. package/benchmarks/results/live-host/opencode-2026-11-24-v2-lifecycle/events-2026-11-24.jsonl +103 -0
  9. package/benchmarks/results/live-host/opencode-2026-11-24-v2-lifecycle/host-version.txt +3 -0
  10. package/benchmarks/results/live-host/opencode-2026-11-24-v2-lifecycle/live-event-trace-probe.js +11 -0
  11. package/benchmarks/results/live-host/opencode-2026-11-24-v2-lifecycle/plugin-load-lines.txt +2 -0
  12. package/benchmarks/results/live-host/opencode-2026-11-24-v2-lifecycle/reminder-excerpt.txt +1 -0
  13. package/ci/doc-capability-consistency.test.js +4 -2
  14. package/ci/lib/opencode-v2-driver.js +169 -0
  15. package/ci/mechanism-2n-opencode-plugin.test.js +387 -223
  16. package/ci/mechanism-2p-opencode-v2-entrypoint.test.js +24 -15
  17. package/ci/mechanism-2u-issue-42-regressions.test.js +41 -2
  18. package/ci/mechanism-2w-platform-compatibility.test.js +16 -3
  19. package/ci/mechanism-30-opencode-plugin-loadability.test.js +78 -45
  20. package/ci/mechanism-338-opencode-async.test.js +367 -194
  21. package/ci/mechanism-341-opencode-lane.test.js +143 -183
  22. package/ci/mechanism-39-opencode-verify-outcomes.test.js +118 -86
  23. package/ci/mechanism-394-ledger-match.test.js +105 -3
  24. package/ci/mechanism-394-opencode-ledger-lesson.test.js +46 -97
  25. package/ci/mechanism-397-opencode-observations.test.js +58 -47
  26. package/ci/mechanism-453-opencode-v2-driver.test.js +51 -0
  27. package/ci/mechanism-453-opencode-v2-only-events.test.js +241 -0
  28. package/ci/mechanism-516-agy-post-tool-exit.test.js +472 -0
  29. package/ci/mechanism-516-agy-stop-revision.test.js +215 -0
  30. package/ci/telemetry.test.js +31 -24
  31. package/docs/architecture.md +4 -2
  32. package/docs/platform-capabilities.md +60 -26
  33. package/docs/platform-compatibility.json +8 -6
  34. package/docs/system-one-observations.md +1 -1
  35. package/docs/telemetry.md +1 -1
  36. package/docs/troubleshooting.md +2 -2
  37. package/hooks/scripts/agy-post-tool.js +79 -16
  38. package/hooks/scripts/agy-stop.js +63 -10
  39. package/hooks/scripts/lib/ledger-match.js +132 -20
  40. package/hooks/scripts/state-persist.js +7 -1
  41. package/opencode-plugin/README.md +60 -66
  42. package/opencode-plugin/index.mjs +11 -13
  43. package/opencode-plugin/plugin.json +1 -1
  44. package/package.json +1 -1
  45. package/plugins/harness-everything/.antigravity-plugin/plugin.json +1 -1
  46. package/plugins/harness-everything/.codex-plugin/plugin.json +1 -1
  47. package/plugins/harness-everything/hooks/scripts/agy-post-tool.js +79 -16
  48. package/plugins/harness-everything/hooks/scripts/agy-stop.js +63 -10
  49. package/plugins/harness-everything/hooks/scripts/lib/ledger-match.js +132 -20
  50. package/plugins/harness-everything/hooks/scripts/state-persist.js +7 -1
  51. package/plugins/harness-everything/plugin.json +1 -1
  52. package/plugins/harness-everything/rules/AGENTS.md +8 -2
  53. package/sbom.cdx.json +12 -12
@@ -0,0 +1,215 @@
1
+ 'use strict';
2
+
3
+ const assert = require('assert');
4
+ const fs = require('fs');
5
+ const os = require('os');
6
+ const path = require('path');
7
+ const { spawnSync } = require('child_process');
8
+
9
+ const ROOT = path.resolve(__dirname, '..');
10
+ const PACKAGED_SCRIPTS = path.join(ROOT, 'plugins', 'harness-everything', 'hooks', 'scripts');
11
+ const TEMP_ROOT = fs.mkdtempSync(path.join(os.tmpdir(), 'harness-516-agy-stop-'));
12
+ const STATE_HOME = path.join(TEMP_ROOT, 'state-home');
13
+ const NO_GIT_PATH = path.join(TEMP_ROOT, 'no-git');
14
+ const originalStateHome = process.env.HARNESS_STATE_HOME;
15
+ fs.mkdirSync(STATE_HOME, { recursive: true });
16
+ fs.mkdirSync(NO_GIT_PATH, { recursive: true });
17
+ process.env.HARNESS_STATE_HOME = STATE_HOME;
18
+
19
+ const { getSessionDir } = require(path.join(PACKAGED_SCRIPTS, 'lib', 'harness-state'));
20
+ const realpath = fs.realpathSync.native || fs.realpathSync;
21
+
22
+ function run(script, payload, args = [], extraEnv = {}) {
23
+ const childEnv = { ...process.env, HARNESS_STATE_HOME: STATE_HOME, ...extraEnv };
24
+ delete childEnv.HARNESS_REQUIRE_VERIFICATION;
25
+ delete childEnv.HARNESS_DOC_RECONCILIATION_PILOT;
26
+ delete childEnv.HARNESS_WORKSPACE_ROOT;
27
+ const result = spawnSync(process.execPath, [path.join(PACKAGED_SCRIPTS, script), ...args], {
28
+ input: JSON.stringify(payload),
29
+ encoding: 'utf8',
30
+ env: childEnv,
31
+ timeout: 20000
32
+ });
33
+ assert.ifError(result.error);
34
+ assert.strictEqual(result.status, 0, `${script} failed: ${result.stderr}`);
35
+ return result.stdout.trim() ? JSON.parse(result.stdout.trim()) : null;
36
+ }
37
+
38
+ function git(root, args) {
39
+ const result = spawnSync('git', args, { cwd: root, encoding: 'utf8', timeout: 20000 });
40
+ assert.ifError(result.error);
41
+ assert.strictEqual(result.status, 0, `git ${args.join(' ')} failed: ${result.stderr}`);
42
+ return result.stdout.trim();
43
+ }
44
+
45
+ function makeWorkspace(name, withGit = true) {
46
+ const root = path.join(TEMP_ROOT, name);
47
+ fs.mkdirSync(root, { recursive: true });
48
+ if (withGit) {
49
+ git(root, ['init']);
50
+ git(root, ['config', 'user.name', 'Harness test']);
51
+ git(root, ['config', 'user.email', 'harness@example.test']);
52
+ fs.writeFileSync(path.join(root, 'tracked.txt'), 'baseline\n');
53
+ git(root, ['add', 'tracked.txt']);
54
+ git(root, ['commit', '-m', 'test baseline']);
55
+ }
56
+ return realpath(root);
57
+ }
58
+
59
+ function postTool(root, sessionId, toolCall, fields = {}) {
60
+ return run('agy-post-tool.js', {
61
+ conversationId: sessionId,
62
+ workspacePaths: [root],
63
+ toolCall,
64
+ ...fields
65
+ });
66
+ }
67
+
68
+ function writeFile(root, sessionId, target, content) {
69
+ fs.writeFileSync(target, content, 'utf8');
70
+ postTool(root, sessionId, { name: 'write_file', args: { Path: target, Content: content } });
71
+ }
72
+
73
+ function handoffPath(root, sessionId) {
74
+ return path.join(getSessionDir(root, sessionId), 'handoff-state.json');
75
+ }
76
+
77
+ function readHandoff(root, sessionId) {
78
+ return JSON.parse(fs.readFileSync(handoffPath(root, sessionId), 'utf8'));
79
+ }
80
+
81
+ function runUnknownCommand(root, sessionId, command = 'harness_unrecognized_command') {
82
+ const before = readHandoff(root, sessionId).lastEditAt || 0;
83
+ while (Date.now() <= before) {}
84
+ postTool(root, sessionId, {
85
+ name: 'run_command',
86
+ args: { CommandLine: command, Cwd: root }
87
+ });
88
+ const after = readHandoff(root, sessionId).lastEditAt || 0;
89
+ assert.ok(after > before, 'unrecognized run_command must preserve the existing AGY shell edit signal');
90
+ return after;
91
+ }
92
+
93
+ function stop(root, sessionId, extraEnv = {}) {
94
+ return run('agy-stop.js', {
95
+ conversationId: sessionId,
96
+ workspacePaths: [root],
97
+ terminationReason: 'NO_TOOL_CALL'
98
+ }, [], extraEnv);
99
+ }
100
+
101
+ function expectAllow(root, sessionId, message, extraEnv = {}) {
102
+ assert.deepStrictEqual(stop(root, sessionId, extraEnv), { decision: 'allow' }, message);
103
+ }
104
+
105
+ try {
106
+ const repo = makeWorkspace('git-workspace');
107
+ const session = 'p516-main';
108
+ const tracked = path.join(repo, 'tracked.txt');
109
+ assert.strictEqual(git(repo, ['status', '--porcelain']), '', 'the Git fixture starts clean');
110
+
111
+ // A direct in-workspace edit earns one continuation; shell timestamp churn
112
+ // during the same unresolved revision must not earn another.
113
+ writeFile(repo, session, tracked, 'direct edit\n');
114
+ assert.notStrictEqual(git(repo, ['status', '--porcelain']), '', 'the direct edit makes the Git fixture dirty');
115
+ assert.strictEqual(stop(repo, session).decision, 'continue', 'the first unresolved edit gets one continuation');
116
+ for (let i = 0; i < 3; i++) {
117
+ runUnknownCommand(repo, session);
118
+ expectAllow(repo, session, `shell timestamp churn ${i + 1} must not spend a second continuation`);
119
+ }
120
+
121
+ // A reason change from missing verification to a tool failure stays within
122
+ // the same revision and uses the already-spent continuation.
123
+ postTool(repo, session, {
124
+ name: 'run_command',
125
+ args: { CommandLine: 'harness_unrecognized_failure', Cwd: repo }
126
+ }, { error: 'command failed' });
127
+ expectAllow(repo, session, 'a failure reason transition in the same revision must not rearm the allowance');
128
+
129
+ // A proven verification resolves the episode. A later failure in the same
130
+ // content revision starts a fresh unresolved episode and gets one allowance.
131
+ postTool(repo, session, {
132
+ name: 'run_command',
133
+ args: { CommandLine: 'npm test', Cwd: repo }
134
+ }, { toolResponse: { exitCode: 0 } });
135
+ expectAllow(repo, session, 'proven verification resolves the prior episode');
136
+ postTool(repo, session, {
137
+ name: 'run_command',
138
+ args: { CommandLine: 'npm test', Cwd: repo }
139
+ }, { error: 'new failure after resolution' });
140
+ assert.strictEqual(stop(repo, session).decision, 'continue', 'a new unresolved episode after verification gets one continuation');
141
+ expectAllow(repo, session, 'the new episode is still bounded to one continuation');
142
+
143
+ // A real tracked-content edit made by a shell reopens one continuation even
144
+ // though state-persist also changes lastEditAt for the unrecognized command.
145
+ fs.writeFileSync(tracked, 'shell changed tracked bytes\n');
146
+ runUnknownCommand(repo, session);
147
+ assert.strictEqual(stop(repo, session).decision, 'continue', 'new tracked bytes rearm one continuation');
148
+ expectAllow(repo, session, 'the tracked-content revision is bounded to one continuation');
149
+
150
+ // Non-ignored untracked bytes are part of the same content identity. Staging
151
+ // and committing those exact bytes must not rearm the allowance.
152
+ const untracked = path.join(repo, 'shell-generated.txt');
153
+ fs.writeFileSync(untracked, 'untracked shell bytes\n');
154
+ runUnknownCommand(repo, session);
155
+ assert.strictEqual(stop(repo, session).decision, 'continue', 'new non-ignored untracked bytes rearm one continuation');
156
+ git(repo, ['add', 'tracked.txt', 'shell-generated.txt']);
157
+ git(repo, ['commit', '-m', 'record shell output']);
158
+ assert.strictEqual(git(repo, ['status', '--porcelain']), '', 'the Git fixture returns to clean after commit');
159
+ runUnknownCommand(repo, session, 'git add tracked.txt && git commit -m record');
160
+ expectAllow(repo, session, 'staging or committing the same bytes must not rearm the allowance');
161
+
162
+ // A missed content probe during a reason transition must preserve the last
163
+ // known digest so a real edit without a direct-write event still rearms once.
164
+ const probeMiss = makeWorkspace('probe-miss-workspace');
165
+ const probeMissSession = 'p516-probe-miss';
166
+ const probeMissTracked = path.join(probeMiss, 'tracked.txt');
167
+ writeFile(probeMiss, probeMissSession, probeMissTracked, 'direct edit\n');
168
+ assert.strictEqual(stop(probeMiss, probeMissSession).decision, 'continue', 'the probe-miss fixture spends its first allowance with a valid digest');
169
+ postTool(probeMiss, probeMissSession, {
170
+ name: 'run_command',
171
+ args: { CommandLine: 'harness_unrecognized_failure', Cwd: probeMiss }
172
+ }, { error: 'reason transition during probe miss' });
173
+ expectAllow(probeMiss, probeMissSession, 'a reason transition during a missed Git probe stays within the spent allowance', { PATH: NO_GIT_PATH });
174
+ fs.writeFileSync(probeMissTracked, 'new bytes without direct-write event\n');
175
+ assert.strictEqual(stop(probeMiss, probeMissSession).decision, 'continue', 'recovered Git detects changed bytes after the probe miss and rearms exactly once');
176
+ expectAllow(probeMiss, probeMissSession, 'the recovered content revision is still bounded to one continuation');
177
+
178
+ // The same reason transition on unchanged bytes remains allowed after Git returns.
179
+ const unchangedProbe = makeWorkspace('unchanged-probe-workspace');
180
+ const unchangedSession = 'p516-unchanged-probe';
181
+ writeFile(unchangedProbe, unchangedSession, path.join(unchangedProbe, 'tracked.txt'), 'direct edit\n');
182
+ assert.strictEqual(stop(unchangedProbe, unchangedSession).decision, 'continue', 'the unchanged-byte control spends one allowance with a valid digest');
183
+ postTool(unchangedProbe, unchangedSession, {
184
+ name: 'run_command',
185
+ args: { CommandLine: 'harness_unrecognized_failure', Cwd: unchangedProbe }
186
+ }, { error: 'same reason transition during probe miss' });
187
+ expectAllow(unchangedProbe, unchangedSession, 'the unchanged-byte reason transition is allowed while Git is unavailable', { PATH: NO_GIT_PATH });
188
+ expectAllow(unchangedProbe, unchangedSession, 'unchanged bytes remain allowed after Git returns');
189
+ expectAllow(unchangedProbe, unchangedSession, 'unchanged bytes do not gain verification credit or a new allowance');
190
+
191
+ // Non-Git workspaces fall back to the stable direct revision/session budget.
192
+ const plain = makeWorkspace('non-git-workspace', false);
193
+ const plainSession = 'p516-non-git';
194
+ writeFile(plain, plainSession, path.join(plain, 'edited.txt'), 'edit\n');
195
+ assert.strictEqual(stop(plain, plainSession).decision, 'continue', 'non-Git pending edit gets one continuation');
196
+ for (let i = 0; i < 2; i++) {
197
+ runUnknownCommand(plain, plainSession);
198
+ expectAllow(plain, plainSession, 'a failed workspace fingerprint probe must still be bounded');
199
+ }
200
+
201
+ // If the marker cannot be written safely, Stop must fail open rather than
202
+ // return continue without a durable cap.
203
+ const markerRoot = makeWorkspace('marker-failure-workspace', false);
204
+ const markerSession = 'p516-marker-failure';
205
+ writeFile(markerRoot, markerSession, path.join(markerRoot, 'edited.txt'), 'edit\n');
206
+ const stopStatePath = path.join(getSessionDir(markerRoot, markerSession), 'agy-stop-state.json');
207
+ fs.mkdirSync(stopStatePath);
208
+ expectAllow(markerRoot, markerSession, 'a marker write failure must allow stop');
209
+
210
+ console.log('AGY Stop revision allowance verified through packaged hooks.');
211
+ } finally {
212
+ if (originalStateHome === undefined) delete process.env.HARNESS_STATE_HOME;
213
+ else process.env.HARNESS_STATE_HOME = originalStateHome;
214
+ fs.rmSync(TEMP_ROOT, { recursive: true, force: true });
215
+ }
@@ -4,10 +4,10 @@
4
4
  const fs = require('fs');
5
5
  const os = require('os');
6
6
  const path = require('path');
7
- const { pathToFileURL } = require('url');
8
7
  const { spawnSync } = require('child_process');
9
8
 
10
9
  const ROOT = path.resolve(__dirname, '..');
10
+ const { createV2Driver } = require(path.join(ROOT, 'ci/lib/opencode-v2-driver'));
11
11
  const telemetry = require(path.join(ROOT, 'hooks/scripts/lib/telemetry.js'));
12
12
  const { buildReport } = require(path.join(ROOT, 'telemetry/scripts/report.js'));
13
13
  const { runBenchmark } = require(path.join(ROOT, 'telemetry/scripts/benchmark.js'));
@@ -154,30 +154,37 @@ async function main() {
154
154
  check(disabled.ok === true && disabled.disabled === true && fs.statSync(file).size === beforeDisabled, 'telemetry can be locally disabled without task failure');
155
155
  process.env.HARNESS_TELEMETRY = 'local';
156
156
 
157
- // OpenCode: use the real plugin hooks. No extra process is spawned for
157
+ // OpenCode: use the real V2 plugin hooks. No extra process is spawned for
158
158
  // per-tool timing; before/after timestamps live inside the plugin process.
159
- const skillDir = path.join(workspace, '.claude', 'skills', 'tdd');
160
- fs.mkdirSync(skillDir, { recursive: true });
161
- fs.writeFileSync(path.join(skillDir, 'SKILL.md'), '---\nname: tdd\nmetadata:\n version: 9.9.9\n---\n', 'utf8');
162
- const pluginUrl = pathToFileURL(path.join(ROOT, 'opencode-plugin', 'index.mjs')).href + `?telemetry=${Date.now()}`;
163
- const { HarnessEnforcement } = await import(pluginUrl);
164
- const hooks = await HarnessEnforcement({
165
- directory: workspace,
166
- client: { session: { prompt: async () => {} } },
167
- });
168
- await hooks['tool.execute.before']({ tool: 'skill', sessionID: 'oc-session', callID: 'oc-skill-1', args: { name: 'tdd', secret } }, {});
169
- await hooks['tool.execute.after']({ tool: 'skill', sessionID: 'oc-session', callID: 'oc-skill-1', args: { name: 'tdd' } }, {});
170
- await hooks['tool.execute.before']({ tool: 'bash', sessionID: 'oc-session', callID: 'oc-tool-1', args: { command: secret } }, {});
171
- await new Promise(resolve => setTimeout(resolve, 2));
172
- await hooks['tool.execute.after']({ tool: 'bash', sessionID: 'oc-session', callID: 'oc-tool-1', args: { command: secret } }, {});
173
- await hooks.event({ event: { type: 'session.idle', properties: { sessionID: 'oc-session' } } });
174
-
175
- const allEvents = telemetry.readEvents(file);
176
- const ocEvents = allEvents.filter(event => event.host === 'opencode');
177
- check(ocEvents.some(event => event.event === 'skill.invoke') && ocEvents.some(event => event.event === 'skill.complete'), 'real OpenCode plugin emits skill invocation and turn-boundary completion events');
178
- check(ocEvents.some(event => event.event === 'tool.observed' && Number.isFinite(event.timing.attributedToolDurationMs)), 'OpenCode adapter measures in-process tool duration while skill is active');
179
- check(ocEvents.some(event => event.skillVersion === '9.9.9'), 'OpenCode adapter records locally resolved skill version without storing skill-file path');
180
- check(!fs.readFileSync(file, 'utf8').includes(secret), 'OpenCode telemetry also excludes raw tool arguments');
159
+ const d = await createV2Driver();
160
+ try {
161
+ const skillDir = path.join(d.workspace, '.claude', 'skills', 'tdd');
162
+ fs.mkdirSync(skillDir, { recursive: true });
163
+ fs.writeFileSync(path.join(skillDir, 'SKILL.md'), '---\nname: tdd\nmetadata:\n version: 9.9.9\n---\n', 'utf8');
164
+
165
+ const ocFile = telemetry.telemetryFile(d.workspace, { cwd: d.workspace });
166
+ const beforeHook = d.toolHook('execute.before');
167
+ const afterHook = d.toolHook('execute.after');
168
+ await beforeHook({ tool: 'skill', sessionID: 'oc-session', agent: 'main', messageID: 'oc-msg-1', id: 'oc-skill-1', input: { name: 'tdd', secret } });
169
+ await afterHook({ tool: 'skill', sessionID: 'oc-session', agent: 'main', messageID: 'oc-msg-1', id: 'oc-skill-1', input: { name: 'tdd' }, status: 'completed', result: {} });
170
+ await beforeHook({ tool: 'bash', sessionID: 'oc-session', agent: 'main', messageID: 'oc-msg-2', id: 'oc-tool-1', input: { command: secret } });
171
+ await afterHook({ tool: 'bash', sessionID: 'oc-session', agent: 'main', messageID: 'oc-msg-2', id: 'oc-tool-1', input: { command: secret }, status: 'completed', result: { output: secret } });
172
+ d.emit('session.execution.succeeded', 'oc-session');
173
+
174
+ await d.waitFor(
175
+ () => telemetry.readEvents(ocFile).some(event => event.host === 'opencode' && event.event === 'skill.complete'),
176
+ { label: 'OpenCode skill.complete telemetry event' }
177
+ );
178
+
179
+ const allEvents = telemetry.readEvents(ocFile);
180
+ const ocEvents = allEvents.filter(event => event.host === 'opencode');
181
+ check(ocEvents.some(event => event.event === 'skill.invoke') && ocEvents.some(event => event.event === 'skill.complete'), 'real OpenCode plugin emits skill invocation and turn-boundary completion events');
182
+ check(ocEvents.some(event => event.event === 'tool.observed' && Number.isFinite(event.timing.attributedToolDurationMs)), 'OpenCode adapter measures in-process tool duration while skill is active');
183
+ check(ocEvents.some(event => event.skillVersion === '9.9.9'), 'OpenCode adapter records locally resolved skill version without storing skill-file path');
184
+ check(!fs.readFileSync(ocFile, 'utf8').includes(secret), 'OpenCode telemetry also excludes raw tool arguments');
185
+ } finally {
186
+ await d.teardown();
187
+ }
181
188
 
182
189
  const benchmark = runBenchmark(120);
183
190
  check(Number.isFinite(benchmark.p50Ms) && Number.isFinite(benchmark.p95Ms) && benchmark.count === 120, 'instrumentation benchmark measures local append overhead');
@@ -136,9 +136,11 @@ The installer configures native lifecycle hooks and project skills.
136
136
 
137
137
  Cognitive workflow contracts (boundary/depth/scope/commit/workflow guards) are made observable, not hard-enforced — [#190](https://github.com/dyphn1/Harness-everything/issues/190) downgraded their `exit(2)` blocking to reminders. `action-gate.js` remains the explicit user/host permission and dangerous-action safety boundary. The former Rule-of-3 counter and forced zoom-out path are retired under [#394](https://github.com/dyphn1/Harness-everything/issues/394).
138
138
 
139
- ### OpenCode — plugin enforcement, scoped live verification
139
+ ### OpenCode — V2 plugin API, scoped live verification
140
140
 
141
- The retained [OpenCode evidence](../benchmarks/results/live-host/opencode-2026-09-16/README.md) supports **project-scope `.js` loading and edit/verification state on OpenCode 1.18.31 (macOS)**. The final snapshot is **post-reset**. The old hard-lock was an **interactive observation** with **no retained blocked-tool trace**; reflection was **operator-seeded** and then agent-rewritten. The former third-failure reflection and hard-lock paths are retired under [#394](https://github.com/dyphn1/Harness-everything/issues/394); the snapshot does not establish current host behavior. Global scope, npm-package installation, and other OpenCode versions remain unverified.
141
+ Harness supports the **OpenCode V2 plugin API only**; OpenCode 1.x / V1 is unsupported (#453). Tested V2 live observations cover one isolated `2.1.4` (macOS 26.6.2) [V2 lifecycle trace](../benchmarks/results/live-host/opencode-2026-11-24-v2-lifecycle/README.md) (V2 default-export load, V2 tool hooks, V2 event envelope + `session.execution.succeeded`, and completion → verification → reminder delivery on a long-lived server; standalone `opencode run` exits before verification finishes), alongside `2.1.3` macOS server-log load-only and `2.1.4` macOS limited [session workspace trace](../benchmarks/results/live-host/opencode-2026-11-15-workspace/README.md); router/context injection, observations, ledger lessons, session create/delete reset, cancellation, and a validated minimum patch version remain unverified.
142
+
143
+ **Historical / unsupported V1 evidence:** the retained [OpenCode evidence](../benchmarks/results/live-host/opencode-2026-09-16/README.md) documents **project-scope `.js` loading and edit/verification state on OpenCode 1.18.31 (macOS)**. It is preserved as historical/unsupported evidence only and does not establish current V2 capability. The final snapshot is **post-reset**. The old hard-lock was an **interactive observation** with **no retained blocked-tool trace**; reflection was **operator-seeded** and then agent-rewritten. The former third-failure reflection and hard-lock paths are retired under [#394](https://github.com/dyphn1/Harness-everything/issues/394); the snapshot does not establish current host behavior. Global scope, npm-package installation, and other OpenCode versions remain unverified.
142
144
 
143
145
  This evidence predates #190 and does not establish behavioral effectiveness of the current contract-first lifecycle.
144
146
 
@@ -15,7 +15,7 @@ Statuses are intentionally explicit:
15
15
  - `Unsupported`: official host documentation explicitly rules out the capability.
16
16
  - `Unknown`: the capability or its current host behavior was not established.
17
17
 
18
- Codex, Antigravity (AGY), and OpenCode are `Partial` in `liveHostVerification`. The Codex artifact verifies user-hook compatibility capture for two consecutive turns on one Windows Codex CLI host; native plugin-hook mounting and other host/version combinations remain unverified. The AGY artifact covers global Desktop App `2.34.0` and `agy` CLI `1.5.15` (macOS) for plugin loading/validation and lifecycle hooks under host-limited `PostToolUse` shell outcomes; IDE write tools, live `exitCode: 0` shell verification credit, live `model_stop`, and full project-scope isolation remain unverified. OpenCode's retained evidence supports project-scope `.js` loading and edit/verification state on OpenCode 1.18.31 (macOS), not durable hard enforcement. No fresh artifacts exist yet for the other surfaces, managed-workspace import, or public OpenAI approval.
18
+ Codex, Antigravity (AGY), and OpenCode are `Partial` in `liveHostVerification`. The Codex artifact verifies user-hook compatibility capture for two consecutive turns on one Windows Codex CLI host; native plugin-hook mounting and other host/version combinations remain unverified. The AGY artifact covers global Desktop App `2.34.0` and `agy` CLI `1.5.15` (macOS) for plugin loading/validation and lifecycle hooks under host-limited `PostToolUse` shell outcomes; IDE write tools, live `exitCode: 0` shell verification credit, live `model_stop`, and full project-scope isolation remain unverified. OpenCode supports the **V2 plugin API only** (OpenCode 1.x / V1 is unsupported): V2 live evidence covers one isolated `2.1.4` (macOS 26.6.2) long-lived server lifecycle trace (V2 default-export load, V2 tool hooks, V2 event envelope + `session.execution.succeeded`, and completion → verification → reminder delivery; standalone `opencode run` exits before verification finishes), alongside earlier `2.1.3` macOS server-log load-only and `2.1.4` macOS workspace traces; router/context injection, observation recording, ledger lessons, session create/delete reset, cancellation, global scope, npm-package install, and other versions/OSes remain unverified, while the retained OpenCode 1.18.31 (macOS) project-scope `.js` loading and edit/verification state artifact is historical/unsupported V1 evidence only. No fresh artifacts exist yet for the other surfaces, managed-workspace import, or public OpenAI approval.
19
19
 
20
20
  ### Codex PR metadata action-gate boundary
21
21
 
@@ -66,7 +66,7 @@ Source and packaged plugin self-evolve entrypoints use installation-relative can
66
66
 
67
67
  ### Error-ledger lesson injection (mechanism only, #394)
68
68
 
69
- A shared matcher (`hooks/scripts/lib/ledger-match.js`) selects workspace ledger lessons whose `match` rules fit a direct `git commit` action (optionally after `-C`, `-c`, `--git-dir=`, `--work-tree=`, `--no-pager` or `-P`; compound and wrapped commands stay silent, #502) or its commitlint failure; rules are read from the generated index row and checked against the record's frontmatter binding, and the host carriers add the record's Cue and Lesson as model context: Claude Code `PreToolUse` and `PostToolUseFailure` (`hooks/scripts/ledger-lesson.js`), Codex `PreToolUse` and `PostToolUse` with outcome classification (`hooks/scripts/codex-ledger-lesson.js`, packaged and user-hook compatibility paths), and OpenCode V2 tool `execute.before/after` selection delivered through the next `context` hook, i.e. after the action. The OpenCode V1 adapter does not register `experimental.chat.system.transform` (`output.system`). V1 lesson delivery is `UNCHECKED`. Delivery is bounded, deduplicated per session and phase, fail-open, and never changes a tool result or permission. Deterministic mechanism tests cover all three carriers. [Claude Code live evidence](../benchmarks/results/live-host/claude-2026-11-21-ledger-lesson/README.md) (2.1.330, one run) shows both contexts in the model request that follows the commit, so the action lesson arrives after the first attempt. Codex and OpenCode live receipt remain `UNCHECKED`.
69
+ A shared matcher (`hooks/scripts/lib/ledger-match.js`) selects workspace ledger lessons whose `match` rules fit a direct `git commit` action (optionally after `-C`, `-c`, `--git-dir=`, `--work-tree=`, `--no-pager` or `-P`; compound and wrapped commands stay silent, #502) or its commitlint failure; rules are read from the generated index row and checked against the record's frontmatter binding, and the host carriers add the record's Cue and Lesson as model context: Claude Code `PreToolUse` and `PostToolUseFailure` (`hooks/scripts/ledger-lesson.js`), Codex `PreToolUse` and `PostToolUse` with outcome classification (`hooks/scripts/codex-ledger-lesson.js`, packaged and user-hook compatibility paths), and OpenCode V2 tool `execute.before/after` selection delivered through the next `context` hook, i.e. after the action. OpenCode 1.x / V1 is unsupported; lesson delivery targets the OpenCode V2 plugin API only. Delivery is bounded, deduplicated per session and phase, fail-open, and never changes a tool result or permission. Deterministic mechanism tests cover all three carriers. [Claude Code live evidence](../benchmarks/results/live-host/claude-2026-11-21-ledger-lesson/README.md) (2.1.330, one run) shows both contexts in the model request that follows the commit, so the action lesson arrives after the first attempt. Codex and OpenCode live receipt remain `UNCHECKED`.
70
70
 
71
71
  ## Current capability summary
72
72
 
@@ -76,7 +76,7 @@ A shared matcher (`hooks/scripts/lib/ledger-match.js`) selects workspace ledger
76
76
  | Antigravity (AGY) | `Supported` | `Partial` (`Mechanism verified`; global Desktop App `2.34.0` load and `agy` CLI `1.5.15` `validate`/`list --json` live-verified on macOS; `validate --strict` fails on 2 multi-host warnings; temp `.agents/plugins/` hook discovery observed via `agy --print`) | `Partial`: `Mechanism verified` for all adapters; Desktop App `2.34.0` + CLI `1.5.15` (macOS) live-verified `SessionStart`, `PreInvocation` dedup, `PreToolUse` (`write_file`/`run_command`), `PostToolUse` edit tracking, and `Stop` (`NO_TOOL_CALL`); `PostToolUse` omits `exitCode`/`error` on shell non-zero exit (`1`) on both `2.34.0` and CLI `1.5.15`, so unknown shell outcomes grant no verification credit (`exitCode === 0` required); IDE write tools (`write_to_file`/`replace_file_content`/`multi_replace_file_content`) and live `model_stop` remain mechanism-only | `.agents/plugins/harness-everything/`, `.agents/rules/AGENTS.md` | `~/.gemini/config/plugins/harness-everything/` | [Mechanism evidence](../benchmarks/results/live-host/agy-2026-11-22/README.md) + [partial live-host evidence](../benchmarks/results/live-host/agy-2026-11-23/README.md) (Antigravity 2.0 Desktop App `2.34.0` + `agy` CLI `1.5.15`, macOS); `/hooks` TUI view, full project-scope `harness-everything` isolation, IDE write tools, live shell `exitCode: 0` verification credit, and live `Stop` `model_stop` remain open in issue #514. |
77
77
  | ChatGPT / OpenAI Plugin | `Unknown` for a repository-local standalone path | `Mechanism verified` | `Partial`: local Work/Codex hooks are separate from ordinary Chat | Managed workspace marketplace | Not established | The public Skills-only bundle is mechanically reproducible; import, approval, and live behavior remain `Unknown`. |
78
78
  | Claude Code | `Supported` | `Supported` | `Mechanism verified` for Harness configuration | `.claude/skills/` | `~/.claude/skills/` | Native Claude surfaces and the state-specific plugin sync command are mechanically checked; fresh-host execution is not preserved here. |
79
- | OpenCode | `Supported` | `Partial` live-host loading for the project-scope, `.js`-filename install path on OpenCode 1.18.31 (macOS); router injection and observation capture are mechanism-tested on V2 | `Partial` live-host evidence for project-scope `.js` loading and edit/verification state; new prompt/context hooks have mechanism evidence only | `.opencode/skills/`, `.agents/skills/`, `.opencode/plugins/` | `~/.config/opencode/skills/`, `~/.agents/skills/`, `~/.config/opencode/plugins/` | [Retained evidence](../benchmarks/results/live-host/opencode-2026-09-16/README.md): loading and state effects verified in one host session; final snapshot post-reset; hard lock only an interactive observation, with no retained blocked-tool trace, and a post-reset final snapshot; reflection operator-seeded, then agent-rewritten; no raw transcript or behavioral-effectiveness claim. `.mjs` auto-discovery broken (issue #127); global scope, npm-package installation, and other host versions remain unverified; V2 default-export load verified live on OpenCode 2.1.3 (macOS, 2026-10-23, server-log evidence only). A separate [OpenCode 2.1.4/macOS session workspace trace](../benchmarks/results/live-host/opencode-2026-11-15-workspace/README.md) observed `ctx.session.get({sessionID})` returning `location.directory` for two sessions, both matching setup; it did not exercise a mismatch or fire the V2 hooks. Prompt/system injection and observation capture remain mechanism evidence only; no live-host behavior claim is made. |
79
+ | OpenCode | `Supported` | `Partial` (V2 plugin API only; OpenCode 1.x / V1 unsupported; V2 default-export load verified live on OpenCode 2.1.3 macOS via server-log only and in the 2.1.4 macOS 26.6.2 V2 lifecycle trace, plus a 2.1.4 macOS workspace trace; router injection and observation capture are mechanism-tested on V2) | `Partial` (V2 default-export load, V2 tool hooks, V2 event envelope + `session.execution.succeeded`, and completion → verification → reminder delivery on a long-lived server are live-observed on one OpenCode 2.1.4 macOS 26.6.2 run; router/context injection, observations, ledger lessons, session create/delete reset, and cancellation remain mechanism-verified only; retained 1.18.31 project-scope `.js` loading and edit/verification state artifact is historical/unsupported V1 evidence) | `.opencode/skills/`, `.agents/skills/`, `.opencode/plugins/` | `~/.config/opencode/skills/`, `~/.agents/skills/`, `~/.config/opencode/plugins/` | **V2-only support boundary (#453):** OpenCode V2 plugin API family only (OpenCode 1.x / V1 unsupported; no validated minimum patch version claimed). Tested V2 live observations: an isolated [OpenCode 2.1.4/macOS 26.6.2 V2 lifecycle trace](../benchmarks/results/live-host/opencode-2026-11-24-v2-lifecycle/README.md) (one host/version/run establishing V2 default-export load, V2 tool hooks, V2 event envelope + `session.execution.succeeded` completion, and completion → verification → reminder delivery on a long-lived server; `opencode run --standalone` exits before verification finishes), V2 default-export load on OpenCode 2.1.3 (macOS, 2026-10-23, server-log evidence only), and a separate [OpenCode 2.1.4/macOS session workspace trace](../benchmarks/results/live-host/opencode-2026-11-15-workspace/README.md) observing `ctx.session.get({sessionID})` returning `location.directory` for two sessions matching setup (no mismatch test or V2 hook fire). Router/context injection, observation recording, ledger lessons, session create/delete reset, cancellation, and workspace mismatch handling remain mechanism evidence only. [Retained historical/unsupported V1 evidence](../benchmarks/results/live-host/opencode-2026-09-16/README.md) (OpenCode 1.18.31, macOS) documents project-scope `.js` loading and edit/verification state in one V1 host session, with a post-reset final snapshot, hard lock only an interactive observation with no retained blocked-tool trace, and operator-seeded then agent-rewritten reflection; it is preserved as historical/unsupported evidence only and does not establish current V2 support. `.mjs` auto-discovery is silently ignored (issue #127); global scope, npm-package installation, and other host versions remain unverified. |
80
80
  | GitHub Copilot agent surfaces | `Supported` | `Unknown` for a Harness-specific plugin install | `Unknown` | `.github/skills/`, `.agents/skills/`, repository instructions | `~/.copilot/skills/`, `~/.agents/skills/` | GitHub Agent Skills paths and installer behavior are checked; no live Copilot session or plugin install is preserved. |
81
81
  | Cursor | `Supported` | `Mechanism verified` for the portable package shape | `Unknown` for Harness | `.cursor/skills/`, `.agents/skills/` | `~/.cursor/skills/`, `~/.agents/skills/` | Official paths and package shape are checked; Cursor plugin loading and hooks remain unverified. |
82
82
  | Continue.dev | `Unknown` for standalone `SKILL.md` discovery | `Unknown` | `Unknown` | `.continue/rules/` is documented; `.continue/skills/` is only an installer candidate | `~/.continue/skills/` is only an installer candidate | The reviewed official docs establish rules, not an Agent Skills host contract. |
@@ -192,29 +192,63 @@ The general installer merges shared files only through Harness-owned markers and
192
192
 
193
193
  ## OpenCode boundary
194
194
 
195
- The OpenCode adapter targets the V2 plugin contract: it default-exports
196
- `{ id: "harness.enforcement", setup(ctx) }` that registers
197
- `ctx.session.hook("prompt|context")`, `ctx.tool.hook("execute.before|after")`,
198
- and `ctx.event.subscribe()` through the OpenCode 2 plugin context, and keeps the V1-shaped `HarnessEnforcement` factory
199
- for OpenCode 1.x hosts. OpenCode 2 rejects named-export-only plugins with
200
- `Plugin must export a default definition with an id and an effect or setup
201
- function`; that failure (observed on OpenCode 2.1.3, macOS) and the recovery
202
- after the V2 entrypoint were verified live on one host, with retained evidence
203
- in the OpenCode server log only (loading succeeded after a plugin-file
204
- reload; no hook-fire artifact). A separate OpenCode 2.1.4/macOS trace observed
205
- that `ctx.session.get({sessionID})` returns `location.directory` for two
206
- sessions whose directories matched setup; it establishes field availability,
207
- not mismatch handling or V2 hook behavior ([trace notes](../benchmarks/results/live-host/opencode-2026-11-15-workspace/README.md)). The adapter itself has deterministic mechanism
208
- coverage (`ci/mechanism-2n-opencode-plugin.test.js`, V1 shapes;
209
- `ci/mechanism-2p-opencode-v2-entrypoint.test.js`, V2 lifecycle shapes;
210
- `ci/mechanism-397-opencode-observations.test.js`, router injection, fail-open
211
- router diagnostics on launch or runtime failure, turn capture,
212
- malformed-label export counts and opt-out). The injection/capture path has
213
- mechanism evidence only; no live-host hook-fire or mismatch-handling artifact
214
- exists. Retained
215
- evidence supports project-scope `.js` loading and edit/verification state on
216
- OpenCode 1.18.31 (macOS): [live-host evidence](../benchmarks/results/live-host/opencode-2026-09-16/README.md). The
217
- retained snapshot predates #190 and remains historical evidence only. The forced Rule-of-3 reflection gate has since been retired; current package and mechanism checks cover that retirement, but no post-retirement live-host run is preserved. The old reflection was operator-seeded, then agent-rewritten, so it proves no behavioral effect. `.mjs` auto-discovery is broken on this host version (issue #127). npm-package installation and behavioral V2-hook fire remain unverified.
195
+ Harness supports the **OpenCode V2 plugin API only**; OpenCode 1.x / V1 is
196
+ unsupported (#453). The plugin module (`opencode-plugin/index.mjs`, installed
197
+ under a `.js` filename) default-exports `{ id: "harness.enforcement", setup(ctx) }`
198
+ as its only public surface and registers `ctx.session.hook("prompt|context")`,
199
+ `ctx.tool.hook("execute.before|after")`, and `ctx.event.subscribe()` through
200
+ the OpenCode V2 plugin context, backed by a private internal enforcement core.
201
+ No public V1 factory export, V1-only event fallback (such as host
202
+ `session.idle` or legacy top-level/nested session-id fallbacks), V1 hook
203
+ registration, or compatibility mode is supported; reintroducing V1 support
204
+ requires an explicit owner-approved support-contract change. OpenCode V2
205
+ rejects named-export-only plugins with `Plugin must export a default definition
206
+ with an id and an effect or setup function`.
207
+
208
+ The supported boundary is the **V2 API family**; exact tested versions are
209
+ recorded separately rather than claiming a validated minimum patch version or
210
+ coverage of every V2 release:
211
+
212
+ - **OpenCode 2.1.3 (macOS, 2026-10-23):** server-log load-only evidence showing
213
+ the named-export failure and recovery after switching to the V2 default
214
+ export (no hook-fire artifact).
215
+ - **OpenCode 2.1.4 (macOS, 2026-11-15):** a separate [workspace trace](../benchmarks/results/live-host/opencode-2026-11-15-workspace/README.md)
216
+ observing `ctx.session.get({sessionID})` returning `location.directory` for
217
+ two sessions whose directories matched setup; it establishes field
218
+ availability only, not mismatch handling or V2 hook behavior.
219
+ - **OpenCode 2.1.4 (macOS 26.6.2, 2026-11-24):** an isolated [V2 lifecycle trace](../benchmarks/results/live-host/opencode-2026-11-24-v2-lifecycle/README.md)
220
+ (one host/version/run on a long-lived `opencode serve` + `opencode run --server`)
221
+ establishing V2 default-export loading, V2 tool hooks (`tool.execute.before/after`),
222
+ the V2 event envelope (`{id, created, type, durable, data}`) and
223
+ `session.execution.succeeded` completion type, and completion → verification →
224
+ reminder delivery. Standalone `opencode run --standalone` shuts down before
225
+ verification finishes. Not exercised: router/context injection, observation
226
+ recording, ledger lessons, session create/delete reset, cancellation, global
227
+ scope, npm-package install, other OpenCode versions, and Windows/Linux.
228
+
229
+ These observations establish bounded V2 lifecycle coverage on one macOS host,
230
+ not full V2 lifecycle verification across all hooks or platforms. The adapter
231
+ has deterministic V2 mechanism coverage (`ci/mechanism-2n-opencode-plugin.test.js`,
232
+ V2 edit/verification/reminder/state shapes;
233
+ `ci/mechanism-2p-opencode-v2-entrypoint.test.js`, V2-only export contract and
234
+ lifecycle shapes; `ci/mechanism-397-opencode-observations.test.js`, router
235
+ injection, fail-open router diagnostics on launch or runtime failure, turn
236
+ capture, malformed-label export counts, and opt-out). Prompt/context injection,
237
+ observation capture, ledger lessons, session create/delete reset, cancellation,
238
+ and workspace mismatch handling remain mechanism evidence only.
239
+
240
+ **Historical / unsupported V1 evidence:** retained evidence from the retired V1
241
+ era documents project-scope `.js` loading and edit/verification state on
242
+ OpenCode 1.18.31 (macOS): [live-host evidence](../benchmarks/results/live-host/opencode-2026-09-16/README.md).
243
+ That snapshot predates #190 and #453 and is preserved as historical/unsupported
244
+ evidence only — never promote it to current V2 capability evidence. Its final
245
+ snapshot is post-reset, the old hard lock was only an interactive observation
246
+ with no retained blocked-tool trace, and the old reflection was operator-seeded
247
+ then agent-rewritten (so it proves no behavioral effect). The forced Rule-of-3
248
+ reflection gate has since been retired; current package and mechanism checks
249
+ cover that retirement, with no post-retirement live-host run preserved. `.mjs`
250
+ auto-discovery is silently ignored (issue #127). Global scope, npm-package
251
+ installation, and other OpenCode versions remain unverified.
218
252
 
219
253
  The plugin verification runner uses asynchronous child processes with a shared
220
254
  sequence budget and bounded streamed diagnostics. Deterministic mechanism
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "format": "harness-platform-compatibility-v1",
3
- "last_reviewed": "2026-11-23",
3
+ "last_reviewed": "2026-11-24",
4
4
  "status_vocabulary": {
5
5
  "Supported": "An official or native mechanism exists and the Harness behavior is verified.",
6
6
  "Mechanism verified": "Harness package, adapter, or installer checks pass, but a real host run is not confirmed.",
@@ -179,19 +179,21 @@
179
179
  "name": "OpenCode",
180
180
  "official_sources": [
181
181
  "https://opencode.ai/docs/skills",
182
- "https://opencode.ai/docs/plugins/"
182
+ "https://opencode.ai/docs/plugins/",
183
+ "https://opencode.ai/docs/build/plugins/server/",
184
+ "https://opencode.ai/docs/build/plugins/migrate-v1/"
183
185
  ],
184
186
  "capabilities": {
185
187
  "standaloneSkills": {"status": "Supported", "paths": {"project": [".opencode/skills", ".agents/skills", ".claude/skills"], "global": ["~/.config/opencode/skills", "~/.agents/skills", "~/.claude/skills"]}},
186
- "pluginSupport": {"status": "Partial", "paths": {"project": [".opencode/plugins"], "global": ["~/.config/opencode/plugins"]}, "notes": "Live verified scoped: project-scope install of the plugin copied under a .js filename loads on OpenCode 1.18.31 (macOS) and edit/verification state effects are retained (benchmarks/results/live-host/opencode-2026-09-16/README.md). The host discovery silently ignores .mjs install names (issue #127). Global scope and npm-package installation remain mechanism-only."},
188
+ "pluginSupport": {"status": "Partial", "paths": {"project": [".opencode/plugins"], "global": ["~/.config/opencode/plugins"]}, "notes": "OpenCode V2 plugin API only; OpenCode 1.x / V1 is unsupported (#453). Default export ({ id, setup(ctx) }) is the only public surface. Tested V2 live observations: OpenCode 2.1.4 (macOS 26.6.2, isolated V2 lifecycle trace at benchmarks/results/live-host/opencode-2026-11-24-v2-lifecycle/README.md establishing V2 default-export load, tool hooks, event envelope + session.execution.succeeded, and completion -> verification -> reminder delivery on a long-lived server), OpenCode 2.1.3 (macOS, server-log load-only), and OpenCode 2.1.4 (macOS, limited session workspace trace); no validated minimum patch version is claimed. Install under a .js filename because .mjs install names are silently ignored (issue #127). Retained OpenCode 1.18.31 (macOS) evidence (benchmarks/results/live-host/opencode-2026-09-16/README.md) is historical/unsupported V1 evidence only. Global scope, npm-package installation, and other host versions remain unverified."},
187
189
  "bundledSkills": {"status": "Partial", "notes": "Harness provides a standalone enforcement module; it is not an OpenCode bundled-skill package."},
188
- "hooksLifecycle": {"status": "Partial", "notes": "Historical live-host evidence covers project-scope .js loading and edit/verification state (including then-active breaker failure recording) on OpenCode 1.18.31 (macOS). That snapshot predates the Rule-of-3 retirement; current retirement coverage is package/mechanism evidence only, with no post-retirement live-host trace. Hard lock was only an interactive observation with no retained blocked-tool trace and the final snapshot is post-reset (benchmarks/results/live-host/opencode-2026-09-16/README.md). Global scope, npm-package installation, and other host versions remain mechanism-tested."},
189
- "projectScope": {"status": "Partial", "paths": {"skills": [".opencode/skills", ".agents/skills"], "plugins": [".opencode/plugins"]}, "notes": "Plugin loading at project scope and edit/verification state are live-verified via the retained host session artifact; standalone skill discovery remains path-contract verified."},
190
+ "hooksLifecycle": {"status": "Partial", "notes": "OpenCode V2 plugin API only (OpenCode 1.x / V1 unsupported). An isolated OpenCode 2.1.4 (macOS 26.6.2) V2 lifecycle trace (benchmarks/results/live-host/opencode-2026-11-24-v2-lifecycle/README.md) establishes V2 default-export load, V2 tool hooks (tool.execute.before/after), the V2 event envelope + session.execution.succeeded completion, and completion -> verification -> reminder delivery on a long-lived server (standalone opencode run exits before verification finishes). Router/context injection, observation recording, ledger lessons, session create/delete reset, and cancellation were not exercised live and remain mechanism-verified only; OpenCode 2.1.3 evidence is load-only and the 2026-11-15 OpenCode 2.1.4 workspace trace did not fire V2 hooks. Retained historical/unsupported V1 evidence (benchmarks/results/live-host/opencode-2026-09-16/README.md) covers project-scope .js loading and edit/verification state on OpenCode 1.18.31 (macOS) from a post-reset snapshot predating Rule-of-3 retirement (hard lock was only an interactive observation with no retained blocked-tool trace; reflection was operator-seeded) and does not establish current V2 capability. Global scope, npm-package installation, and other host versions remain unverified."},
191
+ "projectScope": {"status": "Partial", "paths": {"skills": [".opencode/skills", ".agents/skills"], "plugins": [".opencode/plugins"]}, "notes": "Project-scope V2 default-export load, tool hooks, session.execution.succeeded completion, and completion -> verification -> reminder delivery on a long-lived server were observed on one OpenCode 2.1.4 (macOS 26.6.2) run (benchmarks/results/live-host/opencode-2026-11-24-v2-lifecycle/README.md), alongside OpenCode 2.1.3 (macOS) server-log load and 2.1.4 (macOS) workspace field availability; router/context injection, observations, ledger lessons, session create/delete reset, and cancellation remain unverified live. Standalone skill discovery remains path-contract verified. Retained OpenCode 1.18.31 (macOS) artifact is historical/unsupported V1 evidence only."},
190
192
  "globalScope": {"status": "Mechanism verified", "paths": {"skills": ["~/.config/opencode/skills", "~/.agents/skills"], "plugins": ["~/.config/opencode/plugins"]}},
191
193
  "installUninstallSymmetry": {"status": "Unknown", "notes": "The adapter is manually copied; Harness does not own an OpenCode install/uninstall flow."},
192
194
  "assetsReferences": {"status": "Mechanism verified", "notes": "The adapter is self-contained and skill references are separately checked."},
193
195
  "updateSync": {"status": "Unknown", "notes": "No live OpenCode refresh or npm plugin update is preserved."},
194
- "liveHostVerification": {"status": "Partial", "evidence": "benchmarks/results/live-host/opencode-2026-09-16/README.md", "notes": "Retained historical evidence supports project-scope .js plugin loading and edit/verification state on OpenCode 1.18.31 (macOS), not durable hard enforcement: final snapshot is post-reset (hardLock: false), hard lock only an interactive observation with no retained blocked-tool trace, reflection was operator-seeded, and agent-controlled state deletion reset the former breaker. The snapshot predates the Rule-of-3 retirement and does not establish current post-retirement behavior; current coverage is package/mechanism evidence only, with no retained live-host trace. Global scope, npm-package installation, and other host versions remain unverified."}
196
+ "liveHostVerification": {"status": "Partial", "evidence": "benchmarks/results/live-host/opencode-2026-11-24-v2-lifecycle/README.md", "notes": "OpenCode V2 plugin API only; OpenCode 1.x / V1 is unsupported (#453). Tested V2 live evidence: one isolated OpenCode 2.1.4 (macOS 26.6.2) V2 lifecycle trace at benchmarks/results/live-host/opencode-2026-11-24-v2-lifecycle/README.md (V2 default-export load, V2 tool hooks, V2 event envelope + session.execution.succeeded completion, and completion -> verification -> reminder delivery on a long-lived server; standalone opencode run exits before verification finishes; router/context injection, observation recording, ledger lessons, session create/delete reset, and cancellation not exercised), OpenCode 2.1.3 (macOS, server-log load-only), and OpenCode 2.1.4 (macOS, limited session workspace trace at benchmarks/results/live-host/opencode-2026-11-15-workspace/README.md); no validated minimum patch version is claimed. The retained historical artifact at benchmarks/results/live-host/opencode-2026-09-16/README.md is historical/unsupported V1 evidence documenting project-scope .js loading and edit/verification state on OpenCode 1.18.31 (macOS), not current V2 capability or durable hard enforcement: final snapshot is post-reset (hardLock: false), hard lock was only an interactive observation with no retained blocked-tool trace, reflection was operator-seeded, and agent-controlled state deletion reset the former breaker before Rule-of-3 retirement. Global scope, npm-package installation, and other host versions remain unverified."}
195
197
  }
196
198
  },
197
199
  {
@@ -174,7 +174,7 @@ warning sign. The review page samples the turns where they differ.
174
174
  cannot read Codex trust state.
175
175
  - The final message comes from the rollout's `task_complete` event.
176
176
  - Fresh live-host verification on Windows (Codex CLI 0.162.1, 2026-10-13) exercised the user-hook compatibility fallback: only the `UserPromptSubmit` and `Stop` observation hooks were individually reviewed/trusted. Two consecutive real turns produced `host: "codex"` records with distinct current `turn_id` values and their respective valid self-reports. The sanitized record excerpt and scope limits are preserved in [Codex live-host evidence](../benchmarks/results/live-host/codex-2026-10-13/README.md). This does not verify native plugin-bundled hooks, other lifecycle events, or tool behavior capture.
177
- - **OpenCode 2.x:** the plugin's documented `prompt` hook captures the original user text and runs the canonical kernel router; its `context` hook adds that router output, including the exact label instruction, to primary model requests. OpenCode tool events and `session.idle` feed the shared observation library, which reads the current turn's final assistant text through the session context API. `HARNESS_OBSERVATIONS=off` disables capture while routing injection remains active. Deterministic mechanism tests cover injection, turn recording, malformed labels, and opt-out; there is no retained live-host artifact for these hooks yet.
177
+ - **OpenCode V2 (V2-only; 1.x / V1 unsupported):** the plugin's documented `prompt` hook captures the original user text and runs the canonical kernel router; its `context` hook adds that router output, including the exact label instruction, to primary model requests. OpenCode V2 tool events and `session.execution.succeeded` feed the shared observation library, which reads the current turn's final assistant text through the session context API. `HARNESS_OBSERVATIONS=off` disables capture while routing injection remains active. Deterministic mechanism tests cover injection, turn recording, malformed labels, and opt-out; there is no retained live-host artifact for these hooks yet.
178
178
  - The OpenCode exporter reports malformed `label-invalid` and `label-unparseable` records by host in `malformedLabelsByHost`; missing labels remain a separate reason and count.
179
179
  - The final message must belong to the current turn. A transcript scan
180
180
  stops at the start of the current turn (Codex `task_started` or a user
package/docs/telemetry.md CHANGED
@@ -40,7 +40,7 @@ When a host does not expose a reliable duration, the value remains `null`; Harne
40
40
  | Host | Adapter | Evidence boundary |
41
41
  | --- | --- | --- |
42
42
  | Claude Code | Narrow `Skill` Pre/Post hooks + Stop; existing `state-persist` observes host-reported tool duration | Mechanism covered in CI; live certification remains #82 |
43
- | OpenCode | Existing single-process plugin records skill before/after, measures tool elapsed in-process, closes on `session.idle` | Mechanism covered in CI; retained live support remains bounded by #37/#82 |
43
+ | OpenCode | Existing single-process V2 plugin records skill before/after, measures tool elapsed in-process, closes on `session.execution.succeeded` (V2-only; 1.x / V1 unsupported) | Mechanism covered in CI; retained live support remains bounded by #37/#82/#453 |
44
44
  | Codex | OpenAI package includes the same narrow Skill/Stop adapter | **Mechanism only** while plugin hook mounting/attribution is blocked by #122; no live claim |
45
45
 
46
46
  Telemetry failure is always fail-open and cannot block a task.
@@ -237,9 +237,9 @@ Do not troubleshoot a missing `SessionStart` or `UserPromptSubmit` hook in the p
237
237
 
238
238
  ### OpenCode plugin implementation works in tests but host loading is uncertain
239
239
 
240
- **Symptom:** Source/mechanism tests pass, but there is no evidence that a real OpenCode session loaded and fired the plugin.
240
+ **Symptom:** Source/mechanism tests pass, but there is no evidence that a real OpenCode V2 session loaded and fired the plugin.
241
241
 
242
- **Interpretation:** The current repository claim is intentionally **mechanism-tested, live loading unverified**. Check [`../opencode-plugin/README.md`](../opencode-plugin/README.md) and run the OpenCode mechanism coverage. Do not promote a source-level pass into a live-host pass without a real session artifact.
242
+ **Interpretation:** Harness targets the **OpenCode V2 plugin API only** (OpenCode 1.x / V1 is unsupported, #453). Live V2 evidence is bounded to one isolated OpenCode 2.1.4 (macOS 26.6.2) long-lived server trace ([V2 lifecycle trace](../benchmarks/results/live-host/opencode-2026-11-24-v2-lifecycle/README.md): V2 default-export load, tool hooks, `session.execution.succeeded`, and completion → verification → reminder delivery; standalone `opencode run` exits before verification finishes), plus 2.1.3 load-only and 2.1.4 workspace traces; router/context injection, observations, ledger lessons, session create/delete reset, cancellation, global scope, npm-package install, and other versions/OSes remain **mechanism-tested, live unverified**, and the retained 1.18.31 artifact is historical/unsupported V1 evidence only. Check [`../opencode-plugin/README.md`](../opencode-plugin/README.md) and run the OpenCode mechanism coverage. Do not promote a source-level pass or historical V1 artifact into a V2 live-host pass without a real V2 session artifact.
243
243
 
244
244
  ## Performance Issues
245
245