harness-everything 1.5.4 → 1.6.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 (65) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/.claude-plugin/plugin.json +1 -1
  3. package/.github/ISSUE_TEMPLATE/bug_report.yml +68 -0
  4. package/.github/ISSUE_TEMPLATE/config.yml +8 -0
  5. package/.github/ISSUE_TEMPLATE/feature_request.yml +33 -0
  6. package/.github/ISSUE_TEMPLATE/platform_compatibility.yml +80 -0
  7. package/.github/PULL_REQUEST_TEMPLATE.md +19 -0
  8. package/.github/dependabot.yml +13 -0
  9. package/.github/workflows/ci.yml +2 -2
  10. package/.github/workflows/release.yml +1 -1
  11. package/CHANGELOG.md +27 -0
  12. package/PRIVACY.md +34 -14
  13. package/README.md +76 -311
  14. package/ROADMAP.md +50 -0
  15. package/SECURITY.md +29 -8
  16. package/SUPPORT.md +4 -4
  17. package/TERMS.md +3 -3
  18. package/behavioral-evals/paired-benchmark.js +2 -2
  19. package/behavioral-evals/run-with-plugin.js +8 -3
  20. package/behavioral-evals/run.js +5 -3
  21. package/benchmarks/results/live-host/opencode-2026-12-02-450-steering/README.md +20 -0
  22. package/benchmarks/results/live-host/opencode-2026-12-02-450-steering/lifecycle.sanitized.jsonl +14 -0
  23. package/benchmarks/results/live-host/opencode-2026-12-02-450-steering/observations.sanitized.json +20 -0
  24. package/bin/cli.js +30 -7
  25. package/ci/ab-test-harness.js +2 -2
  26. package/ci/action-gate.test.js +186 -0
  27. package/ci/installer-roundtrip.test.js +20 -0
  28. package/ci/lib/opencode-v2-driver.js +3 -1
  29. package/ci/mechanism-2aa-codex-action-gate-policy.test.js +21 -0
  30. package/ci/mechanism-2ap-sbom.test.js +6 -6
  31. package/ci/mechanism-2j-behavioral-runner.test.js +45 -1
  32. package/ci/mechanism-2j-fixture-entrypoints.test.js +39 -0
  33. package/ci/mechanism-2x-release-commit-message.test.js +34 -23
  34. package/ci/mechanism-32-paired-benchmark.test.js +38 -0
  35. package/ci/mechanism-341-opencode-lane.test.js +5 -1
  36. package/ci/mechanism-397-cycle-import.test.js +5 -1
  37. package/ci/mechanism-397-opencode-observations.test.js +260 -24
  38. package/ci/mechanism-468-dispatch-cli.test.js +23 -0
  39. package/ci/mechanism-552-ledger-pairs.test.js +2 -0
  40. package/ci/mechanism-system-one-curves.test.js +26 -3
  41. package/ci/mechanism-system-one-cycle.test.js +5 -4
  42. package/ci/mechanism-system-one-live.test.js +6 -1
  43. package/ci/mechanism-task-git-authorization.test.js +14 -0
  44. package/docs/README.md +81 -0
  45. package/docs/codex-action-gate.md +1 -1
  46. package/docs/platform-capabilities.md +9 -4
  47. package/docs/platform-compatibility.json +3 -3
  48. package/docs/system-one-cycle.md +5 -5
  49. package/docs/system-one-routing.md +10 -7
  50. package/docs/system-one-training.md +4 -5
  51. package/harness-everything/SKILL.md +1 -1
  52. package/harness-everything/scripts/system-one/router.js +0 -1
  53. package/hooks/scripts/action-gate.js +82 -2
  54. package/opencode-plugin/index.mjs +97 -35
  55. package/opencode-plugin/plugin.json +1 -1
  56. package/package.json +15 -2
  57. package/plugins/harness-everything/.antigravity-plugin/plugin.json +1 -1
  58. package/plugins/harness-everything/.codex-plugin/plugin.json +1 -1
  59. package/plugins/harness-everything/hooks/scripts/action-gate.js +82 -2
  60. package/plugins/harness-everything/plugin.json +1 -1
  61. package/plugins/harness-everything/skills/harness-everything/SKILL.md +1 -1
  62. package/plugins/harness-everything/skills/harness-everything/scripts/system-one/router.js +0 -1
  63. package/sbom.cdx.json +7 -7
  64. package/scripts/dispatch.js +3 -2
  65. package/scripts/system-one-curves.js +4 -32
@@ -32,13 +32,13 @@ assert.ok(
32
32
  'GitHub Release must publish the generated SBOM as an asset'
33
33
  );
34
34
 
35
- const releaseWorkflow = fs.readFileSync(path.join(ROOT, '.github/workflows/release.yml'), 'utf8');
36
- assert.match(releaseWorkflow, /uses:\s+actions\/upload-artifact@v4/,
37
- 'release workflow must retain the generated SBOM as an Actions artifact');
38
- assert.match(releaseWorkflow, /if:\s+\$\{\{\s*hashFiles\('sbom\.cdx\.json'\)\s*!=\s*''\s*\}\}/,
35
+ const releaseWorkflow = require('js-yaml').load(fs.readFileSync(path.join(ROOT, '.github/workflows/release.yml'), 'utf8'));
36
+ const sbomUpload = releaseWorkflow.jobs.release.steps.find(step =>
37
+ step.uses?.startsWith('actions/upload-artifact@') && step.with?.path === 'sbom.cdx.json'
38
+ );
39
+ assert.ok(sbomUpload, 'release workflow must retain the generated SBOM as an Actions artifact');
40
+ assert.strictEqual(sbomUpload.if, "${{ hashFiles('sbom.cdx.json') != '' }}",
39
41
  'release workflow must skip artifact upload when semantic-release has no release');
40
- assert.match(releaseWorkflow, /path:\s+sbom\.cdx\.json/,
41
- 'release workflow artifact must point at the generated SBOM');
42
42
 
43
43
  const bom = buildBom(ROOT, {
44
44
  version: packageJson.version,
@@ -3,7 +3,7 @@ const fs = require('fs');
3
3
  const os = require('os');
4
4
  const path = require('path');
5
5
  const { spawnSync } = require('child_process');
6
- const { buildEngineInvocation, buildWorkspace, runFixtureSetup, prepareWorkspace, summarizePairResults } = require('../behavioral-evals/run');
6
+ const { buildEngineInvocation, buildWorkspace, runFixtureSetup, prepareWorkspace, summarizePairResults, runHeadless } = require('../behavioral-evals/run');
7
7
 
8
8
  console.log('\n[2j] Behavioral runner argv integrity...');
9
9
  const prompt = "Add punctuation stripping to slug.js, then run npm test. Do not truncate this request.";
@@ -179,4 +179,48 @@ helper.check(
179
179
  JSON.stringify(fixtureFailureSummary)
180
180
  );
181
181
 
182
+ const opencodeInvocation = buildEngineInvocation('opencode', prompt, 'C:/fixture with spaces', 16);
183
+ helper.check(
184
+ '2j. opencode invocation omits --dir and passes --standalone',
185
+ !opencodeInvocation.args.includes('--dir') &&
186
+ opencodeInvocation.args.includes('--standalone') &&
187
+ !opencodeInvocation.args.includes('C:/fixture with spaces'),
188
+ JSON.stringify(opencodeInvocation.args)
189
+ );
190
+
191
+ const runParentDir = fs.mkdtempSync(path.join(os.tmpdir(), 'harness-2j-opencode-'));
192
+ const runWs = path.join(runParentDir, 'ws');
193
+ fs.mkdirSync(runWs, { recursive: true });
194
+ const prevPwd2j = process.env.PWD;
195
+ const prevModel2j = process.env.BEHAVIORAL_MODEL;
196
+ try {
197
+ process.env.PWD = '/stale/parent/dir';
198
+ delete process.env.BEHAVIORAL_MODEL;
199
+ let capturedRun = null;
200
+ if (typeof runHeadless === 'function') {
201
+ runHeadless(prompt, runWs, 16, 'opencode', 'baseline', (command, args, options) => {
202
+ capturedRun = { command, args, options };
203
+ });
204
+ }
205
+ helper.check(
206
+ '2j. runHeadless spawns opencode with --standalone, no --dir, cwd=ws, and env.PWD=cwd',
207
+ Boolean(
208
+ capturedRun &&
209
+ !capturedRun.args.includes('--dir') &&
210
+ capturedRun.args.includes('--standalone') &&
211
+ capturedRun.options &&
212
+ capturedRun.options.cwd === runWs &&
213
+ capturedRun.options.env &&
214
+ capturedRun.options.env.PWD === capturedRun.options.cwd
215
+ ),
216
+ capturedRun ? JSON.stringify({ args: capturedRun.args, cwd: capturedRun.options && capturedRun.options.cwd, pwd: capturedRun.options && capturedRun.options.env && capturedRun.options.env.PWD }) : 'runHeadless is not exported'
217
+ );
218
+ } finally {
219
+ if (prevPwd2j === undefined) delete process.env.PWD;
220
+ else process.env.PWD = prevPwd2j;
221
+ if (prevModel2j === undefined) delete process.env.BEHAVIORAL_MODEL;
222
+ else process.env.BEHAVIORAL_MODEL = prevModel2j;
223
+ fs.rmSync(runParentDir, { recursive: true, force: true });
224
+ }
225
+
182
226
  helper.finish();
@@ -93,6 +93,45 @@ try {
93
93
  assert.strictEqual(result.fixture_setup.status, 'pass');
94
94
  assert.strictEqual(result.outcome, 'fail', 'an untouched topology must fail the actual final-state graders');
95
95
 
96
+ // Exercise run-with-plugin.js real runHeadless spawn argv and env.PWD.
97
+ const childProcess = require('child_process');
98
+ const originalExecFileSync = childProcess.execFileSync;
99
+ const pluginPath = require.resolve('../behavioral-evals/run-with-plugin');
100
+ const prevPwdPlugin = process.env.PWD;
101
+ let capturedPluginSpawn = null;
102
+ try {
103
+ process.env.PWD = '/stale/parent/dir';
104
+ childProcess.execFileSync = (command, args, options) => {
105
+ capturedPluginSpawn = { command, args, options };
106
+ return Buffer.alloc(0);
107
+ };
108
+ delete require.cache[pluginPath];
109
+ const freshPlugin = require('../behavioral-evals/run-with-plugin');
110
+ const spawnCase = {
111
+ id: 'opencode-spawn-contract',
112
+ loaded_skills: ['tdd'],
113
+ fixture: { files: [{ path: 'seed.txt', content: 'seed' }] },
114
+ prompt: 'Verify OpenCode standalone spawn contract.',
115
+ max_turns: 2,
116
+ expectations: [{ type: 'file_contains', path: 'seed.txt', value: 'seed' }],
117
+ };
118
+ const spawnRecord = freshPlugin.runCase(spawnCase);
119
+ track(spawnRecord.workspace);
120
+ track(spawnRecord.transcript);
121
+ assert.ok(capturedPluginSpawn, 'run-with-plugin runCase must invoke execFileSync via runHeadless');
122
+ assert.strictEqual(capturedPluginSpawn.command, 'opencode');
123
+ assert.ok(!capturedPluginSpawn.args.includes('--dir'), `unexpected --dir in args: ${JSON.stringify(capturedPluginSpawn.args)}`);
124
+ assert.ok(capturedPluginSpawn.args.includes('--standalone'), `missing --standalone in args: ${JSON.stringify(capturedPluginSpawn.args)}`);
125
+ assert.strictEqual(capturedPluginSpawn.options.cwd, spawnRecord.workspace);
126
+ assert.ok(capturedPluginSpawn.options.env && capturedPluginSpawn.options.env.PWD === capturedPluginSpawn.options.cwd,
127
+ `expected env.PWD === cwd (${capturedPluginSpawn.options.cwd}), got ${capturedPluginSpawn.options.env && capturedPluginSpawn.options.env.PWD}`);
128
+ } finally {
129
+ childProcess.execFileSync = originalExecFileSync;
130
+ delete require.cache[pluginPath];
131
+ if (prevPwdPlugin === undefined) delete process.env.PWD;
132
+ else process.env.PWD = prevPwdPlugin;
133
+ }
134
+
96
135
  for (const fixture of [
97
136
  { files: [{ path: '../escape', content: 'bad' }] },
98
137
  { files: [{ path: 'seed', content: 'ok' }], setup: '../escape.js' },
@@ -23,15 +23,20 @@ assert.ok(currentLines.every(line => line.length <= 100), 'release commit must r
23
23
 
24
24
  const temp = fs.mkdtempSync(path.join(os.tmpdir(), 'harness-release-commitlint-'));
25
25
  const currentFile = path.join(temp, 'current-message.txt');
26
- const legacyFile = path.join(temp, 'legacy-message.txt');
26
+ const longReleaseFile = path.join(temp, 'long-release-message.txt');
27
+ const invalidFile = path.join(temp, 'invalid-message.txt');
28
+ const strictConfigFile = path.join(temp, 'commitlint.config.json');
29
+ // Disable default ignores only when testing release-message formatting rules.
30
+ fs.writeFileSync(strictConfigFile, JSON.stringify({
31
+ extends: [path.join(ROOT, 'commitlint.config.js')],
32
+ defaultIgnores: false
33
+ }));
27
34
  fs.writeFileSync(currentFile, `${currentMessage}\n`);
28
35
 
29
- // Negative control: this reproduces the production failure from release run
30
- // 34970424994. Generated notes contain long Markdown links, so copying them
31
- // into the Git commit body violates body-max-line-length/footer constraints.
32
- const longReleaseNote = `* **behavioral-evals:** ${'x'.repeat(110)} ([90e36c2](https://github.com/dyphn1/Harness-everything/commit/90e36c2071fb5a71e16cdc99b1060cd3d699c43b)), closes #52`;
33
- const legacyMessage = `chore(release): 0.4.0 [skip ci]\n\n${longReleaseNote}\n`;
34
- fs.writeFileSync(legacyFile, legacyMessage);
36
+ // Unlike the historical notes in #115, this fixture has no URL that could exempt the line.
37
+ const longReleaseNote = `* **behavioral-evals:** ${'x'.repeat(110)}`;
38
+ fs.writeFileSync(longReleaseFile, `${currentMessage}\n\n${longReleaseNote}\n`);
39
+ fs.writeFileSync(invalidFile, 'fix: UPPERCASE SUBJECT\n');
35
40
 
36
41
  const commitlintPackageFile = require.resolve('@commitlint/cli/package.json');
37
42
  const commitlintPackage = JSON.parse(fs.readFileSync(commitlintPackageFile, 'utf8'));
@@ -41,26 +46,32 @@ const commitlintBin = typeof commitlintPackage.bin === 'string'
41
46
  assert.ok(commitlintBin, '@commitlint/cli must expose a commitlint executable');
42
47
  const commitlintCli = path.resolve(path.dirname(commitlintPackageFile), commitlintBin);
43
48
 
44
- function commitlint(file) {
45
- return spawnSync(process.execPath, [commitlintCli, '--edit', file], {
49
+ function commitlint(file, options = []) {
50
+ return spawnSync(process.execPath, [commitlintCli, '--edit', file, ...options], {
46
51
  cwd: ROOT,
47
52
  encoding: 'utf8'
48
53
  });
49
54
  }
50
55
 
51
- const currentResult = commitlint(currentFile);
52
- assert.strictEqual(
53
- currentResult.status,
54
- 0,
55
- `current semantic-release commit must pass commitlint:\n${currentResult.stdout}\n${currentResult.stderr}`
56
- );
56
+ try {
57
+ const strictOptions = ['--config', strictConfigFile];
58
+ const productionResult = commitlint(currentFile);
59
+ assert.strictEqual(productionResult.status, 0,
60
+ `release commit must pass the repository config:\n${productionResult.stdout}\n${productionResult.stderr}`);
57
61
 
58
- const legacyResult = commitlint(legacyFile);
59
- assert.notStrictEqual(legacyResult.status, 0, 'legacy release-notes-in-commit behavior must fail commitlint');
60
- assert.match(
61
- `${legacyResult.stdout}\n${legacyResult.stderr}`,
62
- /body-max-line-length|footer-max-line-length/,
63
- 'negative control must fail for the same long-line class seen in production'
64
- );
62
+ const strictResult = commitlint(currentFile, strictOptions);
63
+ assert.strictEqual(strictResult.status, 0,
64
+ `release commit must pass with default ignores disabled:\n${strictResult.stdout}\n${strictResult.stderr}`);
65
65
 
66
- console.log('Release commit contract verified: compact message passes commitlint and legacy release-note embedding is rejected.');
66
+ const longReleaseResult = commitlint(longReleaseFile, strictOptions);
67
+ assert.strictEqual(longReleaseResult.status, 1);
68
+ assert.match(`${longReleaseResult.stdout}\n${longReleaseResult.stderr}`, /body-max-line-length|footer-max-line-length/);
69
+
70
+ const invalidResult = commitlint(invalidFile);
71
+ assert.strictEqual(invalidResult.status, 1);
72
+ assert.match(`${invalidResult.stdout}\n${invalidResult.stderr}`, /subject-case/);
73
+
74
+ console.log('Release commit contract verified with repository and strict test configs.');
75
+ } finally {
76
+ fs.rmSync(temp, { recursive: true, force: true });
77
+ }
@@ -9,6 +9,7 @@ const {
9
9
  pairContract,
10
10
  prepareArmWorkspace,
11
11
  retrieveLesson,
12
+ runArm,
12
13
  summarizePairs,
13
14
  validateLessonCase,
14
15
  validatePairRecord,
@@ -385,6 +386,43 @@ try {
385
386
  JSON.stringify(summary.decision),
386
387
  );
387
388
 
389
+ const opencodePairDir = helper.tempDir('.paired-opencode-spawn');
390
+ fs.mkdirSync(opencodePairDir, { recursive: true });
391
+ const prevPwd32 = process.env.PWD;
392
+ let capturedPairedSpawn = null;
393
+ try {
394
+ process.env.PWD = '/stale/parent/dir';
395
+ const spawnCase = {
396
+ id: 'paired-opencode-spawn',
397
+ discipline: 'tdd',
398
+ prompt: 'Verify paired-benchmark OpenCode standalone spawn.',
399
+ max_turns: 4,
400
+ fixture: { files: [{ path: 'probe.txt', content: 'baseline\n' }] },
401
+ expectations: [{ type: 'file_contains', path: 'probe.txt', value: 'baseline' }],
402
+ };
403
+ runArm(spawnCase, { effect_type: 'skill-text', engine: 'opencode', model: 'test/model' }, 'baseline', opencodePairDir, (command, args, options) => {
404
+ capturedPairedSpawn = { command, args, options };
405
+ return { status: 1, stdout: '', stderr: '' };
406
+ });
407
+ } finally {
408
+ if (prevPwd32 === undefined) delete process.env.PWD;
409
+ else process.env.PWD = prevPwd32;
410
+ }
411
+ helper.check(
412
+ '32. paired-benchmark spawns opencode with --standalone, no --dir, cwd=ws, and env.PWD=cwd',
413
+ Boolean(
414
+ capturedPairedSpawn &&
415
+ !capturedPairedSpawn.args.includes('--dir') &&
416
+ capturedPairedSpawn.args.includes('--standalone') &&
417
+ capturedPairedSpawn.options &&
418
+ capturedPairedSpawn.options.cwd &&
419
+ capturedPairedSpawn.options.env &&
420
+ capturedPairedSpawn.options.env.PWD === capturedPairedSpawn.options.cwd &&
421
+ capturedPairedSpawn.options.env.HARNESS_STATE_HOME
422
+ ),
423
+ capturedPairedSpawn ? JSON.stringify({ args: capturedPairedSpawn.args, cwd: capturedPairedSpawn.options && capturedPairedSpawn.options.cwd, pwd: capturedPairedSpawn.options && capturedPairedSpawn.options.env && capturedPairedSpawn.options.env.PWD }) : 'execute was not called',
424
+ );
425
+
388
426
  helper.finish();
389
427
  } catch (error) {
390
428
  helper.check('32. paired behavioral benchmark contract', false, error.stack);
@@ -172,12 +172,16 @@ test('V2 execute.after writes no E1 journal while ordinary telemetry, edit, obse
172
172
  const sessionId = `native-v2-unhooked-${label}`;
173
173
  const { sessionDir } = seedWorkflow(d.workspace, sessionId);
174
174
  const observationsDir = process.env.HARNESS_OBSERVATIONS_DIR;
175
+ const messageID = `turn-${label}`;
175
176
 
176
177
  await d.sessionHook('prompt')({
177
178
  sessionID: sessionId,
178
- messageID: `turn-${label}`,
179
+ messageID,
179
180
  prompt: { text: 'update retry doc and verify' },
180
181
  });
182
+ d.emit('session.execution.started', sessionId);
183
+ d.emit('session.inbox.delivered', sessionId, { inboxID: messageID });
184
+ await d.settled({ quietMs: 0 });
181
185
 
182
186
  const skillEvent = { tool: 'skill', sessionID: sessionId, id: 'call-skill', messageID: 'msg-skill', input: { skill: 'tdd' } };
183
187
  await d.toolHook('execute.before')(skillEvent);
@@ -9,6 +9,7 @@ const { test } = require('node:test');
9
9
  const { collect } = require('../scripts/system-one-cycle/collect');
10
10
  const { importStore } = require('../scripts/system-one-observations-import-store');
11
11
  const observations = require('../hooks/scripts/lib/observations');
12
+ const { v2Event } = require('./lib/opencode-v2-driver');
12
13
 
13
14
  const ROOT = path.resolve(__dirname, '..');
14
15
  const PLUGIN = path.join(ROOT, 'opencode-plugin', 'index.mjs');
@@ -201,7 +202,10 @@ test('cycle collect imports production OpenCode captures into private prompt/lab
201
202
  const messageID = 'shared-turn';
202
203
  f.setTurn(messageID, turn.prompt, LABELS[index]);
203
204
  await f.sessionHooks.get('prompt')({ sessionID: turn.sessionID, messageID, prompt: { text: turn.prompt } });
204
- f.push({ type: 'session.execution.succeeded', data: { sessionID: turn.sessionID } });
205
+ const sessionID = turn.sessionID;
206
+ f.push(v2Event('session.execution.started', sessionID));
207
+ f.push(v2Event('session.inbox.delivered', sessionID, { inboxID: messageID }));
208
+ f.push(v2Event('session.execution.succeeded', sessionID));
205
209
  await waitFor(() => recordList(f.store).length === index + 1);
206
210
  }
207
211