harness-everything 1.0.1 → 1.1.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.
- package/.claude-plugin/marketplace.json +1 -1
- package/.claude-plugin/plugin.json +1 -1
- package/CHANGELOG.md +22 -0
- package/benchmarks/results/live-host/agy-2026-11-25/README.md +32 -0
- package/ci/mechanism-394-ledger-match.test.js +219 -0
- package/ci/mechanism-496-claude-capture.test.js +342 -0
- package/ci/mechanism-496-codex-capture.test.js +508 -0
- package/ci/mechanism-496-local-error-cli-edges.test.js +234 -0
- package/ci/mechanism-496-local-error-cli.test.js +517 -0
- package/ci/mechanism-496-local-error-store.test.js +731 -0
- package/ci/mechanism-496-opencode-capture.test.js +483 -0
- package/ci/mechanism-496-review-fixes.test.js +278 -0
- package/ci/mechanism-516-windows-verify-and-shell.test.js +328 -0
- package/docs/platform-capabilities.md +2 -2
- package/docs/platform-compatibility.json +2 -2
- package/hooks/scripts/codex-ledger-lesson.js +103 -27
- package/hooks/scripts/ledger-lesson.js +94 -23
- package/hooks/scripts/lib/ledger-match.js +39 -3
- package/hooks/scripts/lib/local-error-source.js +127 -0
- package/hooks/scripts/lib/local-errors.js +597 -0
- package/hooks/scripts/lib/observations.js +1 -1
- package/hooks/scripts/lib/workflow-isolation.js +1 -1
- package/opencode-plugin/index.mjs +86 -1
- package/opencode-plugin/plugin.json +1 -1
- package/package.json +2 -1
- package/plugins/harness-everything/.antigravity-plugin/plugin.json +1 -1
- package/plugins/harness-everything/.codex-plugin/plugin.json +1 -1
- package/plugins/harness-everything/hooks/scripts/codex-ledger-lesson.js +103 -27
- package/plugins/harness-everything/hooks/scripts/ledger-lesson.js +94 -23
- package/plugins/harness-everything/hooks/scripts/lib/ledger-match.js +39 -3
- package/plugins/harness-everything/hooks/scripts/lib/local-error-source.js +127 -0
- package/plugins/harness-everything/hooks/scripts/lib/local-errors.js +597 -0
- package/plugins/harness-everything/hooks/scripts/lib/observations.js +1 -1
- package/plugins/harness-everything/hooks/scripts/lib/workflow-isolation.js +1 -1
- package/plugins/harness-everything/plugin.json +1 -1
- package/plugins/harness-everything/scripts/lib/verification-contract.js +68 -12
- package/sbom.cdx.json +7 -7
- package/scripts/errors-local.js +357 -0
- package/scripts/lib/verification-contract.js +68 -12
|
@@ -0,0 +1,278 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
'use strict';
|
|
3
|
+
|
|
4
|
+
const assert = require('node:assert/strict');
|
|
5
|
+
const fs = require('node:fs');
|
|
6
|
+
const os = require('node:os');
|
|
7
|
+
const path = require('node:path');
|
|
8
|
+
const { execFileSync, spawnSync } = require('node:child_process');
|
|
9
|
+
|
|
10
|
+
const ROOT = path.resolve(__dirname, '..');
|
|
11
|
+
const CLI = path.join(ROOT, 'scripts', 'errors-local.js');
|
|
12
|
+
const localErrors = require(path.join(ROOT, 'hooks', 'scripts', 'lib', 'local-errors.js'));
|
|
13
|
+
const { createProvisionalSource } = require(path.join(ROOT, 'hooks', 'scripts', 'lib', 'local-error-source.js'));
|
|
14
|
+
const { matchLedgerLessons } = require(path.join(ROOT, 'hooks', 'scripts', 'lib', 'ledger-match.js'));
|
|
15
|
+
|
|
16
|
+
let failures = 0;
|
|
17
|
+
const sandboxes = [];
|
|
18
|
+
|
|
19
|
+
function test(name, fn) {
|
|
20
|
+
try {
|
|
21
|
+
fn();
|
|
22
|
+
console.log(` PASS ${name}`);
|
|
23
|
+
} catch (error) {
|
|
24
|
+
failures += 1;
|
|
25
|
+
console.error(` FAIL ${name}\n ${error.stack.split('\n').slice(0, 5).join('\n ')}`);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
function canonicalDir(dir) {
|
|
30
|
+
return fs.realpathSync.native ? fs.realpathSync.native(dir) : fs.realpathSync(dir);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function makeSandbox() {
|
|
34
|
+
const dir = canonicalDir(fs.mkdtempSync(path.join(os.tmpdir(), 'local-err-review-')));
|
|
35
|
+
sandboxes.push(dir);
|
|
36
|
+
const home = path.join(dir, 'home');
|
|
37
|
+
const store = path.join(dir, 'observations');
|
|
38
|
+
const stateHome = path.join(dir, 'state-home');
|
|
39
|
+
const repo = path.join(dir, 'repo');
|
|
40
|
+
const matcherState = path.join(dir, 'matcher-state');
|
|
41
|
+
for (const p of [home, store, stateHome, repo, matcherState]) {
|
|
42
|
+
fs.mkdirSync(p, { recursive: true });
|
|
43
|
+
}
|
|
44
|
+
execFileSync('git', ['init', '-q', repo]);
|
|
45
|
+
const env = {
|
|
46
|
+
...process.env,
|
|
47
|
+
HOME: home,
|
|
48
|
+
USERPROFILE: home,
|
|
49
|
+
HARNESS_OBSERVATIONS_DIR: store,
|
|
50
|
+
HARNESS_STATE_HOME: stateHome,
|
|
51
|
+
};
|
|
52
|
+
delete env.HARNESS_OBSERVATIONS;
|
|
53
|
+
delete env.HARNESS_SYSTEM_ONE_MODE;
|
|
54
|
+
delete env.HARNESS_WORKSPACE_ROOT;
|
|
55
|
+
delete env.CLAUDE_PROJECT_DIR;
|
|
56
|
+
delete env.CODEX_PROJECT_DIR;
|
|
57
|
+
return { dir, store, repo, matcherState, env };
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
function runCli(args, sandbox) {
|
|
61
|
+
return spawnSync(process.execPath, [CLI, ...args], {
|
|
62
|
+
cwd: sandbox.repo,
|
|
63
|
+
env: sandbox.env,
|
|
64
|
+
encoding: 'utf8',
|
|
65
|
+
stdio: ['ignore', 'pipe', 'pipe'],
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
function actionMatch() {
|
|
70
|
+
return { actions: [{ tool: 'shell', executable: 'git', subcommand: 'commit' }] };
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
console.log('mechanism-496-review-fixes:');
|
|
74
|
+
|
|
75
|
+
test('redacts complete Basic/Bearer authorization values before storage and signature derivation', () => {
|
|
76
|
+
const s = makeSandbox();
|
|
77
|
+
const fixtures = [
|
|
78
|
+
{ header: 'Authorization', scheme: 'Basic', credential: 'BASIC_FIXTURE_ALPHA_91' },
|
|
79
|
+
{ header: 'aUtHoRiZaTiOn', scheme: 'bAsIc', credential: 'BASIC_FIXTURE_BETA_82' },
|
|
80
|
+
{ header: 'Proxy-Authorization', scheme: 'Bearer', credential: 'BEARER_FIXTURE_ALPHA_73' },
|
|
81
|
+
{ header: 'pRoXy-aUtHoRiZaTiOn', scheme: 'bEaReR', credential: 'BEARER_FIXTURE_BETA_64' },
|
|
82
|
+
];
|
|
83
|
+
const credentials = fixtures.map(row => row.credential);
|
|
84
|
+
|
|
85
|
+
for (const [index, row] of fixtures.entries()) {
|
|
86
|
+
const res = localErrors.appendOccurrence({
|
|
87
|
+
workspaceRoot: s.repo,
|
|
88
|
+
host: 'claude',
|
|
89
|
+
sessionKey: `auth-session-${index}`,
|
|
90
|
+
toolUseId: `auth-tool-${index}`,
|
|
91
|
+
command: 'node synthetic-check.js',
|
|
92
|
+
exitCode: 1,
|
|
93
|
+
output: `Fatal synthetic diagnostic AUTH_CONTROL\n${row.header}: ${row.scheme} ${row.credential}`,
|
|
94
|
+
}, { env: s.env });
|
|
95
|
+
assert.equal(res.status, 'appended');
|
|
96
|
+
assert.ok(!res.record.outputExcerpt.includes(row.credential), 'stored occurrence excerpt must omit the whole credential');
|
|
97
|
+
assert.ok(res.record.outputExcerpt.includes('Fatal synthetic diagnostic AUTH_CONTROL'), 'diagnostic remains usable');
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
const sameFailure = (credential, toolUseId) => localErrors.appendOccurrence({
|
|
101
|
+
workspaceRoot: s.repo,
|
|
102
|
+
host: 'codex',
|
|
103
|
+
sessionKey: 'signature-session',
|
|
104
|
+
toolUseId,
|
|
105
|
+
command: 'node synthetic-check.js',
|
|
106
|
+
exitCode: 1,
|
|
107
|
+
output: `Fatal synthetic diagnostic SIGNATURE_CONTROL\nAuthorization: Basic ${credential}`,
|
|
108
|
+
}, { env: s.env });
|
|
109
|
+
const first = sameFailure('BASIC_SIGNATURE_FIXTURE_11', 'signature-tool-1');
|
|
110
|
+
const second = sameFailure('BASIC_SIGNATURE_FIXTURE_22', 'signature-tool-2');
|
|
111
|
+
assert.equal(first.record.signature, second.record.signature,
|
|
112
|
+
'automatic signatures must ignore only the authorization payload');
|
|
113
|
+
const differentDiagnostic = localErrors.appendOccurrence({
|
|
114
|
+
workspaceRoot: s.repo,
|
|
115
|
+
host: 'codex',
|
|
116
|
+
command: 'node synthetic-check.js',
|
|
117
|
+
exitCode: 1,
|
|
118
|
+
output: 'Fatal synthetic diagnostic DIFFERENT_CONTROL\nAuthorization: Basic BASIC_SIGNATURE_FIXTURE_33',
|
|
119
|
+
}, { env: s.env });
|
|
120
|
+
assert.notEqual(first.record.signature, differentDiagnostic.record.signature,
|
|
121
|
+
'different diagnostics remain distinguishable');
|
|
122
|
+
|
|
123
|
+
const lesson = localErrors.addProvisionalLesson({
|
|
124
|
+
workspaceRoot: s.repo,
|
|
125
|
+
destination: 'project',
|
|
126
|
+
signature: 'v1-git-auth-review-control',
|
|
127
|
+
match: actionMatch(),
|
|
128
|
+
lesson: 'Preserve the safe lesson. Authorization: Basic BASIC_LESSON_FIXTURE_54',
|
|
129
|
+
cue: 'Before committing. Proxy-Authorization: Bearer BEARER_CUE_FIXTURE_45',
|
|
130
|
+
}, { env: s.env });
|
|
131
|
+
assert.equal(lesson.status, 'appended');
|
|
132
|
+
credentials.push('BASIC_SIGNATURE_FIXTURE_11', 'BASIC_SIGNATURE_FIXTURE_22', 'BASIC_SIGNATURE_FIXTURE_33',
|
|
133
|
+
'BASIC_LESSON_FIXTURE_54', 'BEARER_CUE_FIXTURE_45');
|
|
134
|
+
|
|
135
|
+
const rawIndex = fs.readFileSync(path.join(s.store, 'errors-index.json'), 'utf8');
|
|
136
|
+
for (const credential of credentials) {
|
|
137
|
+
assert.ok(!rawIndex.includes(credential), `raw errors-index.json must omit ${credential}`);
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
const listed = runCli(['list', '--json'], s);
|
|
141
|
+
assert.equal(listed.status, 0, listed.stderr);
|
|
142
|
+
const exported = runCli(['export'], s);
|
|
143
|
+
assert.equal(exported.status, 0, exported.stderr);
|
|
144
|
+
for (const output of [listed.stdout, exported.stdout]) {
|
|
145
|
+
for (const credential of credentials) assert.ok(!output.includes(credential), 'CLI output must omit fixture credentials');
|
|
146
|
+
assert.ok(output.includes('Fatal synthetic diagnostic AUTH_CONTROL'), 'CLI retains a safe diagnostic');
|
|
147
|
+
assert.ok(output.includes('Preserve the safe lesson.'), 'CLI retains the safe lesson');
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
const source = createProvisionalSource({ env: s.env, workspaceRoot: s.repo });
|
|
151
|
+
const matched = matchLedgerLessons({
|
|
152
|
+
workspaceRoot: s.repo,
|
|
153
|
+
workspaceIdentity: lesson.record.workspaceKey,
|
|
154
|
+
sessionIdentity: 'synthetic-session',
|
|
155
|
+
stateDir: s.matcherState,
|
|
156
|
+
event: { phase: 'action', tool: 'shell', command: 'git commit -m "safe"', outcome: { failed: 'unknown' } },
|
|
157
|
+
provisionalSource: source,
|
|
158
|
+
});
|
|
159
|
+
assert.ok(matched && matched.text.includes('Preserve the safe lesson.'), 'positive control lesson remains deliverable');
|
|
160
|
+
for (const credential of credentials) assert.ok(!matched.text.includes(credential), 'matched context must omit fixture credentials');
|
|
161
|
+
});
|
|
162
|
+
|
|
163
|
+
test('read-side retention filters before limits, stays read-only, and withholds expired matcher lessons', () => {
|
|
164
|
+
const s = makeSandbox();
|
|
165
|
+
const now = Date.now();
|
|
166
|
+
const retentionMs = localErrors.LIMITS.retentionMs;
|
|
167
|
+
const cutoff = now - retentionMs;
|
|
168
|
+
const workspaceA = localErrors.resolveWorkspaceKey({ workspaceRoot: s.repo }, { env: s.env });
|
|
169
|
+
const otherRepo = path.join(s.dir, 'other-repo');
|
|
170
|
+
fs.mkdirSync(otherRepo);
|
|
171
|
+
execFileSync('git', ['init', '-q', otherRepo]);
|
|
172
|
+
const workspaceB = localErrors.resolveWorkspaceKey({ workspaceRoot: otherRepo }, { env: s.env });
|
|
173
|
+
|
|
174
|
+
const occurrence = (id, workspaceKey, createdAt, outputExcerpt) => ({
|
|
175
|
+
schemaVersion: 1,
|
|
176
|
+
kind: 'occurrence',
|
|
177
|
+
provisionalId: id,
|
|
178
|
+
workspaceKey,
|
|
179
|
+
destination: 'unknown',
|
|
180
|
+
createdAt: new Date(createdAt).toISOString(),
|
|
181
|
+
signature: `v1-git-${id}`,
|
|
182
|
+
source: 'tool-failure',
|
|
183
|
+
host: 'claude',
|
|
184
|
+
sessionKey: null,
|
|
185
|
+
toolUseId: null,
|
|
186
|
+
commandClass: 'git',
|
|
187
|
+
exitCode: 1,
|
|
188
|
+
outputExcerpt,
|
|
189
|
+
matchedLedgerIds: [],
|
|
190
|
+
});
|
|
191
|
+
const lesson = (id, workspaceKey, createdAt, text) => ({
|
|
192
|
+
schemaVersion: 1,
|
|
193
|
+
kind: 'provisional-lesson',
|
|
194
|
+
provisionalId: id,
|
|
195
|
+
workspaceKey,
|
|
196
|
+
destination: 'project',
|
|
197
|
+
createdAt: new Date(createdAt).toISOString(),
|
|
198
|
+
signature: `v1-git-${id}`,
|
|
199
|
+
match: actionMatch(),
|
|
200
|
+
lesson: text,
|
|
201
|
+
issueUrl: null,
|
|
202
|
+
promotionId: null,
|
|
203
|
+
});
|
|
204
|
+
|
|
205
|
+
const file = path.join(s.store, 'errors-index.json');
|
|
206
|
+
const initialIndex = {
|
|
207
|
+
schemaVersion: 1,
|
|
208
|
+
kind: 'local-error-store',
|
|
209
|
+
records: [
|
|
210
|
+
occurrence('future-occurrence', workspaceA, now + 60_000, 'Fresh future occurrence diagnostic.'),
|
|
211
|
+
occurrence('fresh-occurrence', workspaceA, cutoff + 2, 'Fresh cutoff occurrence diagnostic.'),
|
|
212
|
+
occurrence('expired-occurrence', workspaceA, cutoff - 1, 'Expired occurrence diagnostic.'),
|
|
213
|
+
occurrence('boundary-occurrence', workspaceA, cutoff, 'Boundary occurrence diagnostic.'),
|
|
214
|
+
occurrence('other-workspace-occurrence', workspaceB, now + 60_000, 'Other workspace diagnostic.'),
|
|
215
|
+
lesson('expired-lesson', workspaceA, cutoff - 1, 'Expired matching lesson.'),
|
|
216
|
+
lesson('boundary-lesson', workspaceA, cutoff, 'Boundary matching lesson.'),
|
|
217
|
+
lesson('fresh-cutoff-lesson', workspaceA, cutoff + 2, 'Fresh cutoff matching lesson.'),
|
|
218
|
+
lesson('future-lesson', workspaceA, now + 60_000, 'Fresh matching lesson positive control.'),
|
|
219
|
+
],
|
|
220
|
+
};
|
|
221
|
+
fs.writeFileSync(file, `${JSON.stringify(initialIndex, null, 2)}\n`, 'utf8');
|
|
222
|
+
|
|
223
|
+
const indexBefore = fs.readFileSync(file);
|
|
224
|
+
const storeEntriesBefore = fs.readdirSync(s.store).sort();
|
|
225
|
+
const limited = localErrors.listRecords({
|
|
226
|
+
env: s.env,
|
|
227
|
+
workspaceRoot: s.repo,
|
|
228
|
+
kind: 'occurrence',
|
|
229
|
+
limit: 1,
|
|
230
|
+
now,
|
|
231
|
+
limits: { retentionMs },
|
|
232
|
+
});
|
|
233
|
+
assert.equal(limited.length, 1);
|
|
234
|
+
assert.equal(limited[0].provisionalId, 'fresh-occurrence', 'retention filtering happens before the limit');
|
|
235
|
+
|
|
236
|
+
const records = localErrors.listRecords({ env: s.env, workspaceRoot: s.repo, now, limits: { retentionMs } });
|
|
237
|
+
assert.deepEqual(records.map(record => record.provisionalId), [
|
|
238
|
+
'future-occurrence', 'fresh-occurrence', 'fresh-cutoff-lesson', 'future-lesson',
|
|
239
|
+
]);
|
|
240
|
+
assert.ok(!records.some(record => /expired|boundary|other-workspace/.test(record.provisionalId)));
|
|
241
|
+
assert.deepEqual(fs.readdirSync(s.store).sort(), storeEntriesBefore, 'read must not create a lock or claim in the store');
|
|
242
|
+
assert.equal(fs.existsSync(path.join(s.store, '.index.lock')), false, 'read must not acquire the write lock');
|
|
243
|
+
assert.equal(Buffer.compare(indexBefore, fs.readFileSync(file)), 0, 'read must leave index bytes unchanged');
|
|
244
|
+
|
|
245
|
+
const listed = runCli(['list', '--json'], s);
|
|
246
|
+
assert.equal(listed.status, 0, listed.stderr);
|
|
247
|
+
const exported = runCli(['export'], s);
|
|
248
|
+
assert.equal(exported.status, 0, exported.stderr);
|
|
249
|
+
for (const output of [listed.stdout, exported.stdout]) {
|
|
250
|
+
assert.ok(output.includes('future-occurrence'), 'fresh workspace-matching occurrence is listed/exported');
|
|
251
|
+
assert.ok(output.includes('future-lesson'), 'fresh workspace-matching lesson is listed/exported');
|
|
252
|
+
assert.ok(!output.includes('expired-occurrence'));
|
|
253
|
+
assert.ok(!output.includes('boundary-occurrence'));
|
|
254
|
+
assert.ok(!output.includes('expired-lesson'));
|
|
255
|
+
assert.ok(!output.includes('boundary-lesson'));
|
|
256
|
+
assert.ok(!output.includes('other-workspace-occurrence'));
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
const source = createProvisionalSource({ env: s.env, workspaceRoot: s.repo });
|
|
260
|
+
const candidates = source(workspaceA);
|
|
261
|
+
assert.deepEqual(candidates.map(candidate => candidate.identity), ['future-lesson'],
|
|
262
|
+
'expired and cutoff-boundary lessons are not offered by the provisional source');
|
|
263
|
+
const matched = matchLedgerLessons({
|
|
264
|
+
workspaceRoot: s.repo,
|
|
265
|
+
workspaceIdentity: workspaceA,
|
|
266
|
+
sessionIdentity: 'retention-session',
|
|
267
|
+
stateDir: s.matcherState,
|
|
268
|
+
event: { phase: 'action', tool: 'shell', command: 'git commit -m "safe"', outcome: { failed: 'unknown' } },
|
|
269
|
+
provisionalSource: source,
|
|
270
|
+
});
|
|
271
|
+
assert.ok(matched && matched.text.includes('Fresh matching lesson positive control.'));
|
|
272
|
+
assert.ok(!matched.text.includes('Expired matching lesson.'));
|
|
273
|
+
assert.ok(!matched.text.includes('Boundary matching lesson.'));
|
|
274
|
+
});
|
|
275
|
+
|
|
276
|
+
for (const dir of sandboxes) fs.rmSync(dir, { recursive: true, force: true });
|
|
277
|
+
console.log(failures ? `\n${failures} failure(s)` : '\nAll review-fix checks passed.');
|
|
278
|
+
process.exit(failures ? 1 : 0);
|
|
@@ -0,0 +1,328 @@
|
|
|
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 VERIFY = path.join(ROOT, 'harness-everything', 'scripts', 'verify-gate.js');
|
|
11
|
+
const PACKAGED_POST_TOOL = path.join(ROOT, 'plugins', 'harness-everything', 'hooks', 'scripts', 'agy-post-tool.js');
|
|
12
|
+
const PACKAGED_STOP = path.join(ROOT, 'plugins', 'harness-everything', 'hooks', 'scripts', 'agy-stop.js');
|
|
13
|
+
|
|
14
|
+
const temp = fs.mkdtempSync(path.join(os.tmpdir(), 'harness-516-win-'));
|
|
15
|
+
const stateHome = path.join(temp, 'state-home');
|
|
16
|
+
const originalStateHome = process.env.HARNESS_STATE_HOME;
|
|
17
|
+
fs.mkdirSync(stateHome, { recursive: true });
|
|
18
|
+
process.env.HARNESS_STATE_HOME = stateHome;
|
|
19
|
+
|
|
20
|
+
const { isVerificationCommand, detectRoot, parseCwdPrelude } = require('../scripts/lib/verification-contract');
|
|
21
|
+
const { classifyShell } = require('../hooks/scripts/lib/workflow-isolation');
|
|
22
|
+
const { getSessionDir } = require('../plugins/harness-everything/hooks/scripts/lib/harness-state');
|
|
23
|
+
|
|
24
|
+
function git(cwd, args) {
|
|
25
|
+
const res = spawnSync('git', args, { cwd, encoding: 'utf8', timeout: 20000 });
|
|
26
|
+
assert.ifError(res.error);
|
|
27
|
+
assert.strictEqual(res.status, 0, `git ${args.join(' ')} failed: ${res.stderr}`);
|
|
28
|
+
return res.stdout.trim();
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function initRepo(dir) {
|
|
32
|
+
fs.mkdirSync(dir, { recursive: true });
|
|
33
|
+
git(dir, ['init', '-b', 'main']);
|
|
34
|
+
git(dir, ['config', 'user.name', 'Harness Test']);
|
|
35
|
+
git(dir, ['config', 'user.email', 'harness@example.test']);
|
|
36
|
+
fs.writeFileSync(path.join(dir, 'README.md'), 'seed\n');
|
|
37
|
+
git(dir, ['add', 'README.md']);
|
|
38
|
+
git(dir, ['commit', '-m', 'seed']);
|
|
39
|
+
return fs.realpathSync.native(dir);
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
function runScript(scriptPath, payload) {
|
|
43
|
+
const env = { ...process.env, HARNESS_STATE_HOME: stateHome };
|
|
44
|
+
delete env.HARNESS_REQUIRE_VERIFICATION;
|
|
45
|
+
const res = spawnSync(process.execPath, [scriptPath], {
|
|
46
|
+
input: JSON.stringify(payload),
|
|
47
|
+
encoding: 'utf8',
|
|
48
|
+
env,
|
|
49
|
+
timeout: 20000,
|
|
50
|
+
});
|
|
51
|
+
assert.ifError(res.error);
|
|
52
|
+
assert.strictEqual(res.status, 0, `${path.basename(scriptPath)} failed: ${res.stderr}`);
|
|
53
|
+
return JSON.parse(res.stdout.trim());
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
function runPowerShell(cwd, command) {
|
|
57
|
+
const env = { ...process.env };
|
|
58
|
+
delete env.NODE_TEST_CONTEXT;
|
|
59
|
+
const res = spawnSync('pwsh', ['-NoProfile', '-NonInteractive', '-Command', command], {
|
|
60
|
+
cwd,
|
|
61
|
+
encoding: 'utf8',
|
|
62
|
+
env,
|
|
63
|
+
timeout: 20000,
|
|
64
|
+
});
|
|
65
|
+
assert.ifError(res.error);
|
|
66
|
+
return res;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
function readHandoff(repo, conversationId) {
|
|
70
|
+
return JSON.parse(fs.readFileSync(path.join(getSessionDir(repo, conversationId), 'handoff-state.json'), 'utf8'));
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
function postShell(repo, conversationId, command, exitCode, cwd = repo) {
|
|
74
|
+
runScript(PACKAGED_POST_TOOL, {
|
|
75
|
+
conversationId,
|
|
76
|
+
workspacePaths: [repo],
|
|
77
|
+
toolCall: { name: 'run_command', args: { CommandLine: command, Cwd: cwd } },
|
|
78
|
+
exitCode,
|
|
79
|
+
});
|
|
80
|
+
return readHandoff(repo, conversationId);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
try {
|
|
84
|
+
const repo = initRepo(path.join(temp, 'repo'));
|
|
85
|
+
const outside = fs.realpathSync.native(fs.mkdtempSync(path.join(temp, 'outside-')));
|
|
86
|
+
fs.mkdirSync(path.join(repo, 'pkg'), { recursive: true });
|
|
87
|
+
fs.mkdirSync(path.join(repo, 'pkg[1]'));
|
|
88
|
+
fs.mkdirSync(path.join(repo, 'pkg1'));
|
|
89
|
+
const infoQueries = [
|
|
90
|
+
'node --test --help',
|
|
91
|
+
'node --test "--version"',
|
|
92
|
+
'node --test -v',
|
|
93
|
+
'mkdocs build --help',
|
|
94
|
+
'poetry run mkdocs build --strict -h',
|
|
95
|
+
'uv run mkdocs build --"help"',
|
|
96
|
+
'.venv\\Scripts\\mkdocs.exe build --help',
|
|
97
|
+
'.venv/bin/mkdocs build --help',
|
|
98
|
+
'sphinx-build --version',
|
|
99
|
+
'sphinx-build -M help docs build',
|
|
100
|
+
'.venv\\Scripts\\sphinx-build.exe -V',
|
|
101
|
+
];
|
|
102
|
+
|
|
103
|
+
// 1. Windows .cmd wrappers and Node/Docs verifiers
|
|
104
|
+
for (const cmd of [
|
|
105
|
+
'npm.cmd test',
|
|
106
|
+
'npm.cmd run test',
|
|
107
|
+
'npm.cmd run test:consistency',
|
|
108
|
+
'npm.cmd run verify:all',
|
|
109
|
+
'pnpm.cmd test',
|
|
110
|
+
'yarn.cmd lint',
|
|
111
|
+
'bun.cmd run check',
|
|
112
|
+
'node --test ci/mechanism-516-agy-post-tool-exit.test.js',
|
|
113
|
+
'node --test --test-name-pattern "mentions --help in a test name"',
|
|
114
|
+
'mkdocs build --strict',
|
|
115
|
+
'poetry run mkdocs build --strict',
|
|
116
|
+
'uv run mkdocs build --strict',
|
|
117
|
+
'.venv\\Scripts\\mkdocs build --strict',
|
|
118
|
+
'.venv/bin/mkdocs build --strict',
|
|
119
|
+
'sphinx-build -W docs build',
|
|
120
|
+
'sphinx-build -v docs build',
|
|
121
|
+
'sphinx-build -M html docs build',
|
|
122
|
+
]) {
|
|
123
|
+
assert.strictEqual(isVerificationCommand(cmd, { cwd: repo, root: repo }), true, `must recognize verifier: ${cmd}`);
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
for (const cmd of [
|
|
127
|
+
...infoQueries,
|
|
128
|
+
'mkdocs serve',
|
|
129
|
+
'node -e "console.log(1)"',
|
|
130
|
+
'npm.cmd install',
|
|
131
|
+
'npm.cmd run build && rm -rf out',
|
|
132
|
+
'npm.cmd run test:consistency; Remove-Item -Recurse .',
|
|
133
|
+
]) {
|
|
134
|
+
assert.strictEqual(isVerificationCommand(cmd, { cwd: repo, root: repo }), false, `must reject non-verifier: ${cmd}`);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
// Declared contract matches npm.cmd equivalent only in declared cwd
|
|
138
|
+
fs.mkdirSync(path.join(repo, '.harness'), { recursive: true });
|
|
139
|
+
fs.writeFileSync(path.join(repo, '.harness', 'verify.json'), JSON.stringify({
|
|
140
|
+
version: 1,
|
|
141
|
+
checks: [{ id: 'root-test', run: 'npm test', cwd: '.' }],
|
|
142
|
+
}));
|
|
143
|
+
assert.strictEqual(isVerificationCommand('npm.cmd test', { cwd: repo, root: repo }), true, 'declared npm test matches npm.cmd test');
|
|
144
|
+
assert.strictEqual(isVerificationCommand('npm.cmd test', { cwd: path.join(repo, 'pkg'), root: repo }), false, 'declared npm.cmd test must still respect cwd');
|
|
145
|
+
fs.rmSync(path.join(repo, '.harness'), { recursive: true, force: true });
|
|
146
|
+
|
|
147
|
+
// 2. mkdocs.yml detection
|
|
148
|
+
const docsRepo = initRepo(path.join(temp, 'mkdocs-repo'));
|
|
149
|
+
fs.writeFileSync(path.join(docsRepo, 'mkdocs.yml'), 'site_name: Demo\n');
|
|
150
|
+
fs.writeFileSync(path.join(docsRepo, 'pyproject.toml'), '[tool.poetry]\nname = "demo"\n');
|
|
151
|
+
const detected = detectRoot(docsRepo);
|
|
152
|
+
const runs = detected.candidates.map(c => c.run);
|
|
153
|
+
assert.ok(runs.includes('mkdocs build --strict'), `missing mkdocs candidate: ${JSON.stringify(runs)}`);
|
|
154
|
+
assert.ok(runs.includes('poetry run mkdocs build --strict'), `missing poetry mkdocs candidate: ${JSON.stringify(runs)}`);
|
|
155
|
+
for (const prefix of ['mkdocs build --strict', 'poetry run mkdocs build --strict']) {
|
|
156
|
+
assert.strictEqual(isVerificationCommand(prefix, { cwd: docsRepo, root: docsRepo }), true);
|
|
157
|
+
assert.strictEqual(isVerificationCommand(prefix + ' --help', { cwd: docsRepo, root: docsRepo }), false);
|
|
158
|
+
assert.ok(!postShell(docsRepo, 'docs-help', prefix + ' --help', 0).lastVerifyAt);
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
const gateOut = spawnSync(process.execPath, [VERIFY, '--json'], { cwd: docsRepo, encoding: 'utf8', timeout: 20000 });
|
|
162
|
+
assert.strictEqual(gateOut.status, 0);
|
|
163
|
+
const gateReport = JSON.parse(gateOut.stdout);
|
|
164
|
+
assert.strictEqual(gateReport.status, 'UNCHECKED_DISCOVERED');
|
|
165
|
+
assert.ok(gateReport.candidates.some(c => c.run === 'mkdocs build --strict'));
|
|
166
|
+
|
|
167
|
+
// 3. PowerShell Set-Location prelude
|
|
168
|
+
const changeLocation = dir => `Set-Location -LiteralPath '${dir}' -ErrorAction Stop`;
|
|
169
|
+
const testCommand = 'node --test verify.test.js';
|
|
170
|
+
const verifyInPkg = `${changeLocation('./pkg')} && ${testCommand}`;
|
|
171
|
+
const failedPrelude = `${changeLocation('./missing')} && ${testCommand}`;
|
|
172
|
+
const unconditionalPrelude = `Set-Location -Path './missing'; ${testCommand}`;
|
|
173
|
+
const wildcardPrelude = `Set-Location -Path './pkg[1]' -ErrorAction Stop && ${testCommand}`;
|
|
174
|
+
const literalBracketsPrelude = `${changeLocation('./pkg[1]')} && ${testCommand}`;
|
|
175
|
+
const posixRepo = repo.replace(/\\/g, '/');
|
|
176
|
+
fs.mkdirSync(path.join(repo, '.harness'));
|
|
177
|
+
const pkgContract = JSON.stringify({
|
|
178
|
+
version: 1,
|
|
179
|
+
checks: [{ id: 'pkg-test', run: testCommand, cwd: 'pkg' }],
|
|
180
|
+
});
|
|
181
|
+
const contractPath = path.join(repo, '.harness', 'verify.json');
|
|
182
|
+
fs.writeFileSync(contractPath, pkgContract);
|
|
183
|
+
for (const cmd of [
|
|
184
|
+
verifyInPkg,
|
|
185
|
+
`${changeLocation(path.join(repo, 'pkg'))} && ${testCommand}`,
|
|
186
|
+
`${changeLocation(posixRepo + '/pkg')} && ${testCommand}`,
|
|
187
|
+
`cd ./pkg && ${testCommand}`,
|
|
188
|
+
]) {
|
|
189
|
+
assert.strictEqual(isVerificationCommand(cmd, { cwd: repo, root: repo }), true, `must unwrap matching prelude: ${cmd}`);
|
|
190
|
+
}
|
|
191
|
+
if (process.platform === 'win32') {
|
|
192
|
+
assert.strictEqual(isVerificationCommand(`${changeLocation('.\\pkg')} && ${testCommand}`, { cwd: repo, root: repo }), true);
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
let successfulExit = 0;
|
|
196
|
+
let failedExit = 1;
|
|
197
|
+
let wildcardExit = 0;
|
|
198
|
+
if (process.platform === 'win32' || process.env.HARNESS_TEST_PWSH === '1') {
|
|
199
|
+
fs.writeFileSync(path.join(repo, 'verify.test.js'), 'require("node:test")("root verifier", () => {});\n');
|
|
200
|
+
fs.writeFileSync(path.join(repo, 'pkg', 'verify.test.js'), 'require("node:test")("package verifier", () => {});\n');
|
|
201
|
+
fs.writeFileSync(path.join(repo, 'pkg1', 'verify.test.js'), 'require("node:test")("wildcard verifier", () => {});\n');
|
|
202
|
+
fs.writeFileSync(path.join(repo, 'pkg[1]', 'verify.test.js'), 'require("node:test")("literal verifier", () => {});\n');
|
|
203
|
+
|
|
204
|
+
const success = runPowerShell(repo, verifyInPkg);
|
|
205
|
+
assert.strictEqual(success.status, 0, success.stderr);
|
|
206
|
+
assert.match(success.stdout, /package verifier/);
|
|
207
|
+
successfulExit = success.status;
|
|
208
|
+
|
|
209
|
+
const failure = runPowerShell(repo, failedPrelude);
|
|
210
|
+
assert.strictEqual(failure.status, 1, failure.stderr);
|
|
211
|
+
assert.doesNotMatch(failure.stdout, /verifier/);
|
|
212
|
+
failedExit = failure.status;
|
|
213
|
+
|
|
214
|
+
const unconditional = runPowerShell(repo, unconditionalPrelude);
|
|
215
|
+
assert.strictEqual(unconditional.status, 0, unconditional.stderr);
|
|
216
|
+
assert.match(unconditional.stdout, /root verifier/);
|
|
217
|
+
|
|
218
|
+
const wildcard = runPowerShell(repo, wildcardPrelude);
|
|
219
|
+
assert.strictEqual(wildcard.status, 0, wildcard.stderr);
|
|
220
|
+
assert.match(wildcard.stdout, /wildcard verifier/);
|
|
221
|
+
wildcardExit = wildcard.status;
|
|
222
|
+
|
|
223
|
+
const literal = runPowerShell(repo, literalBracketsPrelude);
|
|
224
|
+
assert.strictEqual(literal.status, 0, literal.stderr);
|
|
225
|
+
assert.match(literal.stdout, /literal verifier/);
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
for (const cmd of [
|
|
229
|
+
failedPrelude,
|
|
230
|
+
unconditionalPrelude,
|
|
231
|
+
`Set-Location -Path './pkg' -ErrorAction Stop && ${testCommand}`,
|
|
232
|
+
`Set-Location -LiteralPath './pkg' && ${testCommand}`,
|
|
233
|
+
`${changeLocation('./pkg')}; ${testCommand}`,
|
|
234
|
+
literalBracketsPrelude,
|
|
235
|
+
wildcardPrelude,
|
|
236
|
+
`${changeLocation('./pkg1')} && ${testCommand}`,
|
|
237
|
+
`${changeLocation('./pkg1/../pkg')} && ${testCommand}`,
|
|
238
|
+
`${changeLocation('FileSystem::./pkg')} && ${testCommand}`,
|
|
239
|
+
`${changeLocation(outside)} && ${testCommand}`,
|
|
240
|
+
`${changeLocation('./pkg')} && ${testCommand} && echo done`,
|
|
241
|
+
]) {
|
|
242
|
+
assert.strictEqual(isVerificationCommand(cmd, { cwd: repo, root: repo }), false, `must reject unsafe Set-Location prelude: ${cmd}`);
|
|
243
|
+
assert.ok(!postShell(repo, 'rejected-prelude', cmd, 0).lastVerifyAt, `must not credit prelude: ${cmd}`);
|
|
244
|
+
}
|
|
245
|
+
assert.ok(!postShell(repo, 'failed-prelude', failedPrelude, failedExit).lastVerifyAt);
|
|
246
|
+
assert.strictEqual(parseCwdPrelude(`${changeLocation(outside)} && ${testCommand}`, { cwd: repo, root: repo }), null);
|
|
247
|
+
assert.ok(!postShell(repo, 'wrong-tool-cwd', testCommand, 0).lastVerifyAt);
|
|
248
|
+
assert.ok(postShell(repo, 'tool-cwd', testCommand, 0, path.join(repo, 'pkg')).lastVerifyAt);
|
|
249
|
+
// The wildcard fixture is checked against the directory the literal path
|
|
250
|
+
// would credit, so a contract mismatch cannot mask incorrect recognition.
|
|
251
|
+
fs.writeFileSync(contractPath, JSON.stringify({
|
|
252
|
+
version: 1,
|
|
253
|
+
checks: [{ id: 'literal-test', run: testCommand, cwd: 'pkg[1]' }],
|
|
254
|
+
}));
|
|
255
|
+
for (const command of [wildcardPrelude, literalBracketsPrelude]) {
|
|
256
|
+
assert.ok(!postShell(repo, 'wildcard-prelude', command, wildcardExit).lastVerifyAt);
|
|
257
|
+
}
|
|
258
|
+
fs.rmSync(contractPath);
|
|
259
|
+
for (const cmd of infoQueries) {
|
|
260
|
+
assert.ok(!postShell(repo, 'verifier-info', cmd, 0).lastVerifyAt, `must not credit info query: ${cmd}`);
|
|
261
|
+
}
|
|
262
|
+
fs.writeFileSync(contractPath, pkgContract);
|
|
263
|
+
|
|
264
|
+
// 4. Read-only PowerShell cmdlets & agy CLI read commands
|
|
265
|
+
for (const cmd of [
|
|
266
|
+
'Get-Command agy',
|
|
267
|
+
'Get-FileHash hooks/scripts/agy-stop.js',
|
|
268
|
+
'Get-ChildItem | Select-Object Name',
|
|
269
|
+
'Get-ChildItem | Sort-Object LastWriteTime | Format-Table Name',
|
|
270
|
+
'agy --version',
|
|
271
|
+
'agy plugin list --json',
|
|
272
|
+
'agy plugin validate --json ./plugins/harness-everything',
|
|
273
|
+
]) {
|
|
274
|
+
assert.strictEqual(classifyShell(cmd), 'read-only', `must classify as read-only: ${cmd}`);
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
assert.strictEqual(classifyShell('Get-ChildItem | ForEach-Object { Remove-Item $_.FullName }'), 'untrusted');
|
|
278
|
+
assert.notStrictEqual(classifyShell('Set-Location C:\\outside; git status'), 'read-only');
|
|
279
|
+
assert.strictEqual(classifyShell('Get-Content a.txt > b.txt'), 'untrusted');
|
|
280
|
+
|
|
281
|
+
// 5. End-to-end packaged AGY hooks: read-only PowerShell doesn't trigger false Stop;
|
|
282
|
+
// A successful, contained Set-Location verifier allows Stop.
|
|
283
|
+
const convReadOnly = 'win-readonly-' + Date.now();
|
|
284
|
+
runScript(PACKAGED_POST_TOOL, {
|
|
285
|
+
conversationId: convReadOnly,
|
|
286
|
+
workspacePaths: [repo],
|
|
287
|
+
toolCall: { name: 'run_command', args: { CommandLine: 'Get-ChildItem | Select-Object Name', Cwd: repo } },
|
|
288
|
+
});
|
|
289
|
+
runScript(PACKAGED_POST_TOOL, {
|
|
290
|
+
conversationId: convReadOnly,
|
|
291
|
+
workspacePaths: [repo],
|
|
292
|
+
toolCall: { name: 'run_command', args: { CommandLine: 'agy plugin list --json', Cwd: repo } },
|
|
293
|
+
});
|
|
294
|
+
const handoffReadOnly = JSON.parse(fs.readFileSync(path.join(getSessionDir(repo, convReadOnly), 'handoff-state.json'), 'utf8'));
|
|
295
|
+
assert.ok(!handoffReadOnly.lastEditAt, `read-only PowerShell/agy commands must not set lastEditAt: ${JSON.stringify(handoffReadOnly)}`);
|
|
296
|
+
assert.deepStrictEqual(
|
|
297
|
+
runScript(PACKAGED_STOP, { conversationId: convReadOnly, workspacePaths: [repo], terminationReason: 'NO_TOOL_CALL' }),
|
|
298
|
+
{ decision: 'allow' }
|
|
299
|
+
);
|
|
300
|
+
|
|
301
|
+
const convEditVerify = 'win-edit-verify-' + Date.now();
|
|
302
|
+
const target = path.join(repo, 'README.md');
|
|
303
|
+
fs.writeFileSync(target, 'edited\n');
|
|
304
|
+
runScript(PACKAGED_POST_TOOL, {
|
|
305
|
+
conversationId: convEditVerify,
|
|
306
|
+
workspacePaths: [repo],
|
|
307
|
+
toolCall: { name: 'write_file', args: { Path: target, Content: 'edited\n' } },
|
|
308
|
+
});
|
|
309
|
+
const afterEdit = readHandoff(repo, convEditVerify);
|
|
310
|
+
for (const exitCode of [undefined, '0']) {
|
|
311
|
+
const unverified = postShell(repo, convEditVerify, verifyInPkg, exitCode);
|
|
312
|
+
assert.strictEqual(unverified.lastEditAt, afterEdit.lastEditAt);
|
|
313
|
+
assert.strictEqual(unverified.lastVerifyAt, afterEdit.lastVerifyAt);
|
|
314
|
+
}
|
|
315
|
+
assert.strictEqual(postShell(repo, convEditVerify, verifyInPkg, 1).lastVerifyAt, afterEdit.lastVerifyAt);
|
|
316
|
+
const afterPass = postShell(repo, convEditVerify, verifyInPkg, successfulExit);
|
|
317
|
+
assert.ok(afterPass.lastVerifyAt >= afterEdit.lastEditAt, 'confirmed Set-Location verifier must advance lastVerifyAt');
|
|
318
|
+
assert.deepStrictEqual(
|
|
319
|
+
runScript(PACKAGED_STOP, { conversationId: convEditVerify, workspacePaths: [repo], terminationReason: 'NO_TOOL_CALL' }),
|
|
320
|
+
{ decision: 'allow' }
|
|
321
|
+
);
|
|
322
|
+
|
|
323
|
+
console.log('Windows verification-contract, PowerShell read-only classification, and packaged AGY hook flow verified.');
|
|
324
|
+
} finally {
|
|
325
|
+
if (originalStateHome === undefined) delete process.env.HARNESS_STATE_HOME;
|
|
326
|
+
else process.env.HARNESS_STATE_HOME = originalStateHome;
|
|
327
|
+
fs.rmSync(temp, { recursive: true, force: true });
|
|
328
|
+
}
|
|
@@ -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 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.
|
|
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), plus Windows Desktop and `agy` CLI `1.5.16` (`harness-everything` `1.0.1`), for plugin loading/validation and lifecycle hooks (including bounded 1-continuation `Stop` on Windows) 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
|
|
|
@@ -73,7 +73,7 @@ A shared matcher (`hooks/scripts/lib/ledger-match.js`) selects workspace ledger
|
|
|
73
73
|
| Platform surface | Standalone skills | Plugin support | Hooks/lifecycle | Project scope | Global scope | Current evidence boundary |
|
|
74
74
|
| --- | --- | --- | --- | --- | --- | --- |
|
|
75
75
|
| Codex | `Supported` | `Mechanism verified` | `Partial`: user-hook compatibility capture is live-verified for `UserPromptSubmit` and `Stop` on one Windows Codex CLI host; native plugin hooks remain mechanism-verified | `.agents/skills/`, `AGENTS.md` | `~/.agents/skills/` | [Live evidence](../benchmarks/results/live-host/codex-2026-10-13/README.md) verifies two consecutive turns on Codex CLI 0.162.1; native plugin mounting, other lifecycle events, and other versions remain unverified. |
|
|
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
|
|
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, plus `agy` CLI `1.5.16` `validate`/`list --json` on Windows; `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`); Windows Desktop + CLI `1.5.16` (`harness-everything` `1.0.1`) live-verified `SessionStart`, `PreInvocation`, and bounded 1-continuation `Stop`; `PostToolUse` omits `exitCode`/`error` on shell outcomes on macOS `2.34.0`/CLI `1.5.15` and Windows Desktop, 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) + [macOS partial live-host evidence](../benchmarks/results/live-host/agy-2026-11-23/README.md) + [Windows partial live-host evidence](../benchmarks/results/live-host/agy-2026-11-25/README.md); `/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
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. |
|
|
@@ -294,11 +294,11 @@
|
|
|
294
294
|
"bundledSkills": {"status": "Mechanism verified", "paths": {"skills": ["plugins/harness-everything/skills/<name>/SKILL.md"]}, "notes": "Package checks verify all 28 canonical skills, and agy plugin validate --json (1.5.15) counted skills: 28; live invocation across all 28 skills remains unverified."},
|
|
295
295
|
"hooksLifecycle": {"status": "Partial", "notes": "Deterministic mechanism tests cover SessionStart, PreInvocation, PreToolUse, PostToolUse, and Stop. Desktop App 2.34.0 and CLI 1.5.15 (macOS) live-verified SessionStart, PreInvocation, PreToolUse (write_file/run_command), PostToolUse edit timestamps, and Stop (NO_TOOL_CALL). Host limits: PostToolUse omits exitCode and error on shell non-zero exit (1) on both Desktop 2.34.0 and CLI 1.5.15, so unknown shell outcomes grant no verification credit and preserve failed state (explicit exitCode === 0 required); IDE write tools (write_to_file, replace_file_content, multi_replace_file_content) and live Stop model_stop remain unverified."},
|
|
296
296
|
"projectScope": {"status": "Partial", "paths": {"plugins": [".agents/plugins/harness-everything"], "rules": [".agents/rules/AGENTS.md"]}, "notes": "agy CLI 1.5.15 plugin list --json only lists global plugins, while agy --print discovered and executed project-scope .agents/plugins/ hooks from a temporary probe plugin. Full project-scope harness-everything isolation without global install and Desktop App project-scope loading remain unverified."},
|
|
297
|
-
"globalScope": {"status": "Partial", "paths": {"plugins": ["~/.gemini/config/plugins/harness-everything"]}, "notes": "Global load and hook execution are live-verified on Antigravity 2.0 Desktop App 2.34.0 (macOS)
|
|
297
|
+
"globalScope": {"status": "Partial", "paths": {"plugins": ["~/.gemini/config/plugins/harness-everything"]}, "notes": "Global load and hook execution are live-verified on Antigravity 2.0 Desktop App 2.34.0 (macOS), agy CLI 1.5.15 (macOS), and Windows Antigravity Desktop + agy CLI 1.5.16; Linux and other AGY versions remain unverified."},
|
|
298
298
|
"installUninstallSymmetry": {"status": "Mechanism verified", "notes": "scripts/plugin-sync.js --host agy install/update/dry-run and staged rollback are covered by mechanism tests and synced live to global scope; plugin-sync.js does not provide uninstall symmetry."},
|
|
299
299
|
"assetsReferences": {"status": "Mechanism verified", "notes": "Packaged skills, rules/AGENTS.md byte-for-byte parity, and packaged agy-*.js hook scripts are verified by ci/mechanism-agy-plugin-package.test.js."},
|
|
300
300
|
"updateSync": {"status": "Partial", "notes": "scripts/plugin-sync.js --host agy --json is mechanism-tested and was observed live updating ~/.gemini/config/plugins/harness-everything on macOS; other OSes and project-scope sync live behavior remain unverified."},
|
|
301
|
-
"liveHostVerification": {"status": "Partial", "evidence": "benchmarks/results/live-host/agy-2026-11-23/README.md", "notes": "Partial live-host evidence covers global Antigravity 2.0 Desktop App 2.34.0 (macOS)
|
|
301
|
+
"liveHostVerification": {"status": "Partial", "evidence": "benchmarks/results/live-host/agy-2026-11-23/README.md", "notes": "Partial live-host evidence covers global Antigravity 2.0 Desktop App 2.34.0 (macOS), agy CLI 1.5.15 (macOS), and Windows Desktop + agy CLI 1.5.16 (benchmarks/results/live-host/agy-2026-11-25/README.md): plugin validate/list, SessionStart, PreInvocation, PreToolUse (write_file/run_command), PostToolUse edit timestamps, bounded Stop continuation (NO_TOOL_CALL / direct revision + workspace fingerprint), and temporary project-scope hook discovery. IDE write tools, live shell exitCode: 0 verification credit, live Stop model_stop, full project-scope isolation, and Linux hosts remain unverified."}
|
|
302
302
|
}
|
|
303
303
|
}
|
|
304
304
|
]
|