harness-everything 0.57.3 → 0.58.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (44) hide show
  1. package/.claude-plugin/marketplace.json +1 -1
  2. package/.claude-plugin/plugin.json +1 -1
  3. package/.releaserc.json +2 -0
  4. package/CHANGELOG.md +15 -0
  5. package/benchmarks/results/live-host/agy-2026-11-22/README.md +49 -0
  6. package/benchmarks/results/live-host/agy-2026-11-23/README.md +48 -0
  7. package/ci/action-gate.test.js +162 -0
  8. package/ci/doc-capability-consistency.test.js +11 -1
  9. package/ci/mechanism-2aa-codex-action-gate-policy.test.js +37 -0
  10. package/ci/mechanism-2ao-plugin-sync.test.js +235 -2
  11. package/ci/mechanism-2w-platform-compatibility.test.js +13 -2
  12. package/ci/mechanism-2x-release-automation.test.js +3 -1
  13. package/ci/mechanism-agy-hooks.test.js +1096 -0
  14. package/ci/mechanism-agy-plugin-package.test.js +76 -0
  15. package/docs/codex-action-gate.md +2 -0
  16. package/docs/platform-capabilities.md +3 -1
  17. package/docs/platform-compatibility.json +34 -1
  18. package/hooks/scripts/action-gate.js +71 -5
  19. package/hooks/scripts/agy-post-tool.js +124 -0
  20. package/hooks/scripts/agy-pre-invocation.js +185 -0
  21. package/hooks/scripts/agy-pre-tool.js +158 -0
  22. package/hooks/scripts/agy-session-start.js +54 -0
  23. package/hooks/scripts/agy-stop.js +152 -0
  24. package/hooks/scripts/lib/agy-adapter-core.js +168 -0
  25. package/hooks/scripts/state-persist.js +50 -10
  26. package/opencode-plugin/plugin.json +1 -1
  27. package/package.json +1 -1
  28. package/plugins/harness-everything/.antigravity-plugin/plugin.json +18 -0
  29. package/plugins/harness-everything/.codex-plugin/plugin.json +1 -1
  30. package/plugins/harness-everything/hooks/scripts/action-gate.js +71 -5
  31. package/plugins/harness-everything/hooks/scripts/agy-post-tool.js +124 -0
  32. package/plugins/harness-everything/hooks/scripts/agy-pre-invocation.js +185 -0
  33. package/plugins/harness-everything/hooks/scripts/agy-pre-tool.js +158 -0
  34. package/plugins/harness-everything/hooks/scripts/agy-session-start.js +54 -0
  35. package/plugins/harness-everything/hooks/scripts/agy-stop.js +152 -0
  36. package/plugins/harness-everything/hooks/scripts/lib/agy-adapter-core.js +168 -0
  37. package/plugins/harness-everything/hooks/scripts/state-persist.js +50 -10
  38. package/plugins/harness-everything/hooks.json +44 -0
  39. package/plugins/harness-everything/plugin.json +1 -1
  40. package/plugins/harness-everything/rules/AGENTS.md +111 -0
  41. package/sbom.cdx.json +7 -7
  42. package/scripts/plugin-sync.js +105 -14
  43. package/scripts/sync-openai-plugin.js +16 -1
  44. package/scripts/sync-release-version.js +1 -0
@@ -387,7 +387,7 @@ for (const sourceType of ['git', 'npm', 'remote', 'unknown']) {
387
387
 
388
388
  {
389
389
  const result = sync({ host: 'all' }, { commandAvailable: () => false, log: () => {}, warn: () => {} });
390
- assert.strictEqual(result.skipped, 2);
390
+ assert.strictEqual(result.skipped, 3);
391
391
  assert.strictEqual(result.failed, 0);
392
392
  assert.ok(result.results.every(entry => entry.reasonCode === 'cli-not-found'), 'an absent CLI must stay distinguishable from a capability boundary');
393
393
  }
@@ -403,7 +403,7 @@ for (const sourceType of ['git', 'npm', 'remote', 'unknown']) {
403
403
  events.push(`call:${command}`);
404
404
  return fake.runner(command, args, opts);
405
405
  };
406
- const result = sync({ host: 'all', codexHome, repository: 'dyphn1/Harness-everything', ref: 'main' }, {
406
+ const result = sync({ host: 'all', codexHome, agyHome: codexHome, repository: 'dyphn1/Harness-everything', ref: 'main' }, {
407
407
  runner,
408
408
  codexHooksInstall: fake.codexHooksInstall,
409
409
  commandAvailable: () => true,
@@ -415,10 +415,243 @@ for (const sourceType of ['git', 'npm', 'remote', 'unknown']) {
415
415
  assert.strictEqual(fake.codexHookInstalls.length, 1, 'progress test must mock hook installation as well as host commands');
416
416
  assert.ok(events.includes('warn:[...] claude: syncing'), 'a claude progress notice must be emitted');
417
417
  assert.ok(events.includes('warn:[...] codex: syncing'), 'a codex progress notice must be emitted');
418
+ assert.ok(events.includes('warn:[...] agy: syncing'), 'an agy progress notice must be emitted');
418
419
  assert.ok(events.indexOf('warn:[...] claude: syncing') < events.indexOf('call:claude'), 'the claude notice must be emitted before its first host command, not buffered until the run finishes');
419
420
  assert.ok(events.indexOf('warn:[...] codex: syncing') < events.indexOf('call:codex'), 'the codex notice must be emitted before its first host command');
420
421
  }
421
422
 
423
+ {
424
+ const agyTemp = fs.mkdtempSync(path.join(os.tmpdir(), 'harness-agy-sync-'));
425
+ const target = path.join(agyTemp, 'plugins', 'harness-everything');
426
+
427
+ // Test absent -> install
428
+ const installResult = sync({ host: 'agy', agyTarget: target }, {
429
+ commandAvailable: () => true,
430
+ log: () => {},
431
+ warn: () => {}
432
+ });
433
+ assert.strictEqual(installResult.failed, 0);
434
+ assert.strictEqual(installResult.results[0].action, 'install');
435
+ assert.ok(fs.existsSync(path.join(target, 'plugin.json')), 'plugin.json must be installed');
436
+
437
+ // Test present -> update
438
+ const updateResult = sync({ host: 'agy', agyTarget: target }, {
439
+ commandAvailable: () => true,
440
+ log: () => {},
441
+ warn: () => {}
442
+ });
443
+ assert.strictEqual(updateResult.failed, 0);
444
+ assert.strictEqual(updateResult.results[0].action, 'update');
445
+
446
+ // Test dry-run on absent target: reports dry-run (not synchronized) and writes nothing
447
+ const absentTarget = path.join(agyTemp, 'plugins', 'absent-dry-run');
448
+ const absentDryLogs = [];
449
+ const absentDryResult = sync({ host: 'agy', agyTarget: absentTarget, dryRun: true }, {
450
+ commandAvailable: () => true,
451
+ log: msg => absentDryLogs.push(msg),
452
+ warn: () => {}
453
+ });
454
+ assert.strictEqual(absentDryResult.failed, 0);
455
+ assert.strictEqual(absentDryResult.synchronized, 0, 'dry-run must not increment synchronized count');
456
+ assert.strictEqual(absentDryResult.planned, 1, 'dry-run must increment planned count');
457
+ assert.strictEqual(absentDryResult.results[0].status, 'dry-run', 'dry-run must report status=dry-run');
458
+ assert.strictEqual(absentDryResult.results[0].action, 'install');
459
+ assert.ok(!fs.existsSync(absentTarget), 'dry-run must not create target directory');
460
+ assert.ok(absentDryLogs.some(log => log.includes('[dry-run] agy plugin install')), 'dry-run install log must be emitted');
461
+
462
+ // Test dry-run on existing target: reports dry-run (not synchronized)
463
+ const dryLogs = [];
464
+ const dryResult = sync({ host: 'agy', agyTarget: target, dryRun: true }, {
465
+ commandAvailable: () => true,
466
+ log: msg => dryLogs.push(msg),
467
+ warn: () => {}
468
+ });
469
+ assert.strictEqual(dryResult.failed, 0);
470
+ assert.strictEqual(dryResult.synchronized, 0, 'dry-run update must not report synchronized');
471
+ assert.strictEqual(dryResult.planned, 1);
472
+ assert.strictEqual(dryResult.results[0].status, 'dry-run');
473
+ assert.strictEqual(dryResult.results[0].action, 'update');
474
+ assert.ok(dryLogs.some(log => log.includes('[dry-run] agy plugin update')), 'dry-run log must be emitted');
475
+
476
+ // Test CLI exit code 0 for `--host agy --dry-run` in a repo with bare `.agents/` -> targets global ~/.gemini, never pollutes .agents/plugins/
477
+ const bareAgentsRepo = path.join(agyTemp, 'codex-repo');
478
+ fs.mkdirSync(path.join(bareAgentsRepo, '.agents', 'skills'), { recursive: true });
479
+ const cliDryRun = require('child_process').spawnSync(
480
+ process.execPath,
481
+ [path.join(ROOT, 'scripts', 'plugin-sync.js'), '--host', 'agy', '--dry-run', '--json'],
482
+ {
483
+ cwd: bareAgentsRepo,
484
+ encoding: 'utf8',
485
+ env: { ...process.env, HOME: agyTemp, USERPROFILE: agyTemp, PATH: '' }
486
+ }
487
+ );
488
+ assert.strictEqual(cliDryRun.status, 0, `CLI --host agy --dry-run must exit 0: ${cliDryRun.stderr}`);
489
+ const cliDryJson = JSON.parse(cliDryRun.stdout);
490
+ assert.strictEqual(cliDryJson.results[0].status, 'dry-run', 'CLI JSON output must report status=dry-run');
491
+ assert.strictEqual(cliDryJson.synchronized, 0);
492
+ assert.strictEqual(cliDryJson.planned, 1);
493
+ assert.strictEqual(
494
+ cliDryJson.results[0].target,
495
+ path.join(agyTemp, '.gemini', 'config', 'plugins', 'harness-everything'),
496
+ 'Fresh --host agy inside a repo with bare .agents/ must target global ~/.gemini, not .agents/plugins/'
497
+ );
498
+ assert.ok(
499
+ !fs.existsSync(path.join(bareAgentsRepo, '.agents', 'plugins')),
500
+ 'Fresh --host agy must not pollute bare .agents/plugins/'
501
+ );
502
+
503
+ // Test real CLI `--host all --dry-run --json` discovers an existing global $HOME/.gemini/config/plugins/harness-everything
504
+ const globalExisting = path.join(agyTemp, '.gemini', 'config', 'plugins', 'harness-everything', '.antigravity-plugin');
505
+ fs.mkdirSync(globalExisting, { recursive: true });
506
+ fs.writeFileSync(path.join(globalExisting, 'plugin.json'), '{"name":"harness-everything"}\n', 'utf8');
507
+ const cliAllDryRun = require('child_process').spawnSync(
508
+ process.execPath,
509
+ [path.join(ROOT, 'scripts', 'plugin-sync.js'), '--host', 'all', '--dry-run', '--json'],
510
+ {
511
+ cwd: bareAgentsRepo,
512
+ encoding: 'utf8',
513
+ env: { ...process.env, HOME: agyTemp, USERPROFILE: agyTemp, PATH: '' }
514
+ }
515
+ );
516
+ assert.strictEqual(cliAllDryRun.status, 0, `CLI --host all --dry-run with existing global AGY install must exit 0: ${cliAllDryRun.stderr}`);
517
+ const cliAllDryJson = JSON.parse(cliAllDryRun.stdout);
518
+ const agyAllEntry = cliAllDryJson.results.find(r => r.host === 'agy');
519
+ assert.ok(agyAllEntry, 'agy entry must be present in --host all output');
520
+ assert.strictEqual(agyAllEntry.status, 'dry-run', 'Existing global AGY install must be discovered under real CLI --host all');
521
+ assert.strictEqual(agyAllEntry.action, 'update', 'Existing global AGY install must take update action');
522
+ assert.strictEqual(
523
+ agyAllEntry.target,
524
+ path.join(agyTemp, '.gemini', 'config', 'plugins', 'harness-everything')
525
+ );
526
+
527
+ fs.rmSync(agyTemp, { recursive: true, force: true });
528
+ }
529
+
530
+ // AGY sync acceptance: --host all with Codex .agents (including bare plugin.json) skips AGY
531
+ {
532
+ const projectTemp = fs.mkdtempSync(path.join(os.tmpdir(), 'harness-codex-only-'));
533
+ fs.mkdirSync(path.join(projectTemp, '.agents', 'skills'), { recursive: true });
534
+ const codexOnlyPluginDir = path.join(projectTemp, '.agents', 'plugins', 'harness-everything');
535
+ fs.mkdirSync(codexOnlyPluginDir, { recursive: true });
536
+ fs.writeFileSync(path.join(codexOnlyPluginDir, 'plugin.json'), '{"name":"harness-everything"}\n', 'utf8');
537
+
538
+ const result = sync({ host: 'all', cwd: projectTemp, agyHome: projectTemp }, {
539
+ commandAvailable: cmd => cmd === 'codex',
540
+ log: () => {},
541
+ warn: () => {},
542
+ codexHooksInstall: () => ({ status: 'installed' })
543
+ });
544
+
545
+ const agyRes = result.results.find(r => r.host === 'agy');
546
+ assert.ok(agyRes, 'agy result should be present');
547
+ assert.strictEqual(agyRes.status, 'skipped', 'agy must be skipped when .agents/plugins lacks .antigravity-plugin/plugin.json');
548
+ assert.strictEqual(agyRes.reasonCode, 'cli-not-found');
549
+ assert.ok(
550
+ !fs.existsSync(path.join(codexOnlyPluginDir, '.antigravity-plugin', 'plugin.json')),
551
+ 'No AGY manifest should be installed into Codex-only project'
552
+ );
553
+
554
+ fs.rmSync(projectTemp, { recursive: true, force: true });
555
+ }
556
+
557
+ // AGY sync acceptance: partial/corrupted target dir without plugin.json is replaced cleanly
558
+ {
559
+ const partialTemp = fs.mkdtempSync(path.join(os.tmpdir(), 'harness-agy-partial-'));
560
+ const target = path.join(partialTemp, 'plugins', 'harness-everything');
561
+ fs.mkdirSync(target, { recursive: true });
562
+ const brokenMarker = path.join(target, 'corrupted-partial.tmp');
563
+ fs.writeFileSync(brokenMarker, 'incomplete install', 'utf8');
564
+
565
+ const repairResult = sync({ host: 'agy', agyTarget: target }, {
566
+ commandAvailable: () => true,
567
+ log: () => {},
568
+ warn: () => {}
569
+ });
570
+ assert.strictEqual(repairResult.failed, 0, `Partial dir replacement must not fail: ${JSON.stringify(repairResult)}`);
571
+ assert.strictEqual(repairResult.results[0].status, 'synchronized');
572
+ assert.strictEqual(repairResult.results[0].action, 'install');
573
+ assert.ok(!fs.existsSync(brokenMarker), 'Corrupted leftover file must be removed');
574
+ assert.ok(fs.existsSync(path.join(target, '.antigravity-plugin', 'plugin.json')), 'Valid AGY manifest must be installed');
575
+
576
+ fs.rmSync(partialTemp, { recursive: true, force: true });
577
+ }
578
+
579
+ // AGY sync acceptance: atomic refresh removes obsolete files
580
+ {
581
+ const agyTemp = fs.mkdtempSync(path.join(os.tmpdir(), 'harness-agy-update-'));
582
+ const target = path.join(agyTemp, 'plugins', 'harness-everything');
583
+
584
+ // Initial install
585
+ sync({ host: 'agy', agyTarget: target }, {
586
+ commandAvailable: () => true,
587
+ log: () => {},
588
+ warn: () => {}
589
+ });
590
+ assert.ok(fs.existsSync(path.join(target, 'plugin.json')));
591
+
592
+ // Add an obsolete file
593
+ const obsoleteFile = path.join(target, 'obsolete-leftover.txt');
594
+ fs.writeFileSync(obsoleteFile, 'legacy content', 'utf8');
595
+ assert.ok(fs.existsSync(obsoleteFile));
596
+
597
+ // Run update
598
+ const updateResult = sync({ host: 'agy', agyTarget: target }, {
599
+ commandAvailable: () => true,
600
+ log: () => {},
601
+ warn: () => {}
602
+ });
603
+ assert.strictEqual(updateResult.failed, 0);
604
+ assert.strictEqual(updateResult.results[0].action, 'update');
605
+ assert.ok(!fs.existsSync(obsoleteFile), 'Obsolete file must be removed on atomic refresh update');
606
+
607
+ fs.rmSync(agyTemp, { recursive: true, force: true });
608
+ }
609
+
610
+ // AGY sync acceptance: simulated copy failure leaves previous valid install intact
611
+ {
612
+ const agyTemp = fs.mkdtempSync(path.join(os.tmpdir(), 'harness-agy-rollback-'));
613
+ const target = path.join(agyTemp, 'plugins', 'harness-everything');
614
+
615
+ // Initial valid install
616
+ sync({ host: 'agy', agyTarget: target }, {
617
+ commandAvailable: () => true,
618
+ log: () => {},
619
+ warn: () => {}
620
+ });
621
+ assert.ok(fs.existsSync(path.join(target, 'plugin.json')));
622
+ const markerFile = path.join(target, 'valid-install.txt');
623
+ fs.writeFileSync(markerFile, 'pre-existing valid state', 'utf8');
624
+
625
+ // Simulate copy failure
626
+ const originalCpSync = fs.cpSync;
627
+ let simulatedFailureTriggered = false;
628
+ fs.cpSync = (src, dest, opts) => {
629
+ if (typeof dest === 'string' && dest.includes(target) && dest.includes('.tmp')) {
630
+ simulatedFailureTriggered = true;
631
+ throw new Error('Simulated disk full or copy interruption');
632
+ }
633
+ return originalCpSync(src, dest, opts);
634
+ };
635
+
636
+ try {
637
+ const failResult = sync({ host: 'agy', agyTarget: target }, {
638
+ commandAvailable: () => true,
639
+ log: () => {},
640
+ warn: () => {}
641
+ });
642
+ assert.strictEqual(failResult.failed, 1);
643
+ assert.strictEqual(failResult.results[0].status, 'failed');
644
+ } finally {
645
+ fs.cpSync = originalCpSync;
646
+ }
647
+
648
+ assert.ok(simulatedFailureTriggered, 'Simulated failure must have triggered');
649
+ assert.ok(fs.existsSync(markerFile), 'Previous valid install must remain intact after copy failure');
650
+ assert.strictEqual(fs.readFileSync(markerFile, 'utf8'), 'pre-existing valid state');
651
+
652
+ fs.rmSync(agyTemp, { recursive: true, force: true });
653
+ }
654
+
422
655
  // resolveOnPath() is pure filesystem logic (platform choice happens only at
423
656
  // the defaultRunner call site), so its directory-order-first contract runs
424
657
  // on every CI OS, not only Windows.
@@ -33,7 +33,8 @@ const OFFICIAL_HOSTS = {
33
33
  'github-copilot': new Set(['docs.github.com']),
34
34
  cursor: new Set(['cursor.com', 'prod.cursor.com']),
35
35
  continue: new Set(['docs.continue.dev']),
36
- hermes: new Set(['hermes-agent.nousresearch.com'])
36
+ hermes: new Set(['hermes-agent.nousresearch.com']),
37
+ agy: new Set(['antigravity.google'])
37
38
  };
38
39
 
39
40
  function filesUnder(root, base = root, out = []) {
@@ -52,7 +53,7 @@ function sha256(file) {
52
53
  assert.strictEqual(matrix.format, 'harness-platform-compatibility-v1');
53
54
  assert.deepStrictEqual(Object.keys(matrix.status_vocabulary).sort(), [...STATUSES].sort());
54
55
  assert.deepStrictEqual(matrix.dimensions, DIMENSIONS);
55
- assert.strictEqual(matrix.platforms.length, 8, 'compatibility matrix must cover every issue #82 platform');
56
+ assert.strictEqual(matrix.platforms.length, 9, 'compatibility matrix must cover every supported platform');
56
57
  assert.deepStrictEqual(
57
58
  matrix.platforms.map(platform => platform.id).sort(),
58
59
  Object.keys(OFFICIAL_HOSTS).sort()
@@ -98,6 +99,13 @@ for (const platform of matrix.platforms) {
98
99
  assert.strictEqual(evidence.format, 'harness-codex-live-observation-evidence-v1');
99
100
  assert.strictEqual(evidence.turns.length, 2, 'Codex artifact must preserve both consecutive turns');
100
101
  assert.ok(evidence.turns.every(turn => turn.host === 'codex' && turn.selfReportReason === null));
102
+ } else if (platform.id === 'agy') {
103
+ const capability = platform.capabilities.liveHostVerification;
104
+ assert.strictEqual(capability.status, 'Partial');
105
+ assert.strictEqual(capability.evidence, 'benchmarks/results/live-host/agy-2026-11-23/README.md');
106
+ const artifactRoot = path.dirname(path.join(ROOT, capability.evidence));
107
+ assert.ok(fs.statSync(path.join(artifactRoot, 'README.md')).size > 0, 'Missing AGY live-host evidence');
108
+ assert.ok(fs.statSync(path.join(ROOT, 'benchmarks', 'results', 'live-host', 'agy-2026-11-22', 'README.md')).size > 0, 'Missing AGY mechanism evidence');
101
109
  } else {
102
110
  assert.strictEqual(platform.capabilities.liveHostVerification.status, 'Unknown', `${platform.id}: no preserved live evidence`);
103
111
  }
@@ -112,6 +120,9 @@ const installerTargetSpecs = {
112
120
  hermes: { platform: 'hermes', project: '.agents/skills', global: '~/.hermes/skills' }
113
121
  };
114
122
  assert.deepStrictEqual(Object.keys(matrix.installer_targets).sort(), Object.keys(OFFICIAL_HOSTS).sort());
123
+ assert.strictEqual(matrix.installer_targets.agy.project, '.agents/plugins/harness-everything');
124
+ assert.strictEqual(matrix.installer_targets.agy.global, '~/.gemini/config/plugins/harness-everything');
125
+ assert.ok(STATUSES.has(matrix.installer_targets.agy.host_discovery_status), 'agy: installer target status is invalid');
115
126
  for (const [id, spec] of Object.entries(installerTargetSpecs)) {
116
127
  const targetSpec = matrix.installer_targets[id];
117
128
  assert.strictEqual(targetSpec.project, spec.project, `${id}: project installer target drifted`);
@@ -44,6 +44,7 @@ assert.ok(gitPlugin, 'release commit plugin missing');
44
44
  assert.match(gitPlugin[1].message, /\[skip ci\]/);
45
45
  assert.ok(gitPlugin[1].assets.includes('package-lock.json'));
46
46
  assert.ok(gitPlugin[1].assets.includes('opencode-plugin/plugin.json'));
47
+ assert.ok(gitPlugin[1].assets.includes('plugins/harness-everything/.antigravity-plugin/plugin.json'));
47
48
  assert.ok(gitPlugin[1].assets.includes('*/SKILL.md'));
48
49
  assert.ok(gitPlugin[1].assets.includes('*/**/SKILL.md'));
49
50
 
@@ -92,13 +93,14 @@ function fixture() {
92
93
  json(path.join(root, '.claude-plugin/marketplace.json'), { plugins: [{ name: 'harness-everything', version: '0.3.8-beta' }] });
93
94
  json(path.join(root, 'plugins/harness-everything/plugin.json'), { name: 'harness-everything', version: '0.3.8-beta' });
94
95
  json(path.join(root, 'plugins/harness-everything/.codex-plugin/plugin.json'), { name: 'harness-everything', version: '0.3.8-beta' });
96
+ json(path.join(root, 'plugins/harness-everything/.antigravity-plugin/plugin.json'), { name: 'harness-everything', version: '0.3.8-beta' });
95
97
  json(path.join(root, 'opencode-plugin/plugin.json'), { name: 'harness-enforcement', version: '0.3.6' });
96
98
  return root;
97
99
  }
98
100
 
99
101
  const root = fixture();
100
102
  const files = syncReleaseVersion(root, '1.2.3');
101
- assert.strictEqual(files.length, 7);
103
+ assert.strictEqual(files.length, 8);
102
104
  syncReleaseVersion(root, '1.2.3', { checkOnly: true });
103
105
 
104
106
  const first = new Map(files.map(file => [file, fs.readFileSync(path.join(root, file), 'utf8')]));