@claude-flow/cli 3.23.0 → 3.24.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 (52) hide show
  1. package/.claude/evolve-proof/generation-0.json +211 -0
  2. package/.claude/evolve-proof/real-generation-0.json +406 -0
  3. package/.claude/evolve-proof/real-generation-1.json +406 -0
  4. package/.claude/helpers/.helpers-version +1 -1
  5. package/.claude/helpers/intelligence.cjs +10 -0
  6. package/.claude/proven-config.manifest.json +37 -0
  7. package/.claude/proven-config.signed.json +41 -0
  8. package/.claude/proven-config.signed.rvf +0 -0
  9. package/dist/src/config/harness-feedback-applier.d.ts +50 -0
  10. package/dist/src/config/harness-feedback-applier.js +122 -0
  11. package/dist/src/config/proven-config-refresh.d.ts +39 -0
  12. package/dist/src/config/proven-config-refresh.js +154 -0
  13. package/dist/src/config/proven-config-rvfa.d.ts +23 -0
  14. package/dist/src/config/proven-config-rvfa.js +73 -0
  15. package/dist/src/config/proven-config.d.ts +86 -0
  16. package/dist/src/config/proven-config.js +176 -0
  17. package/dist/src/index.js +35 -0
  18. package/dist/src/mcp-tools/neural-tools.d.ts +10 -0
  19. package/dist/src/mcp-tools/neural-tools.js +107 -18
  20. package/dist/src/services/daemon-autostart.d.ts +17 -0
  21. package/dist/src/services/daemon-autostart.js +79 -0
  22. package/dist/src/services/evolve-proof.d.ts +247 -0
  23. package/dist/src/services/evolve-proof.js +341 -0
  24. package/dist/src/services/harness-benchmark.d.ts +68 -0
  25. package/dist/src/services/harness-benchmark.js +94 -0
  26. package/dist/src/services/harness-canary.d.ts +60 -0
  27. package/dist/src/services/harness-canary.js +69 -0
  28. package/dist/src/services/harness-corpus-harvester.d.ts +51 -0
  29. package/dist/src/services/harness-corpus-harvester.js +74 -0
  30. package/dist/src/services/harness-flywheel-generations.d.ts +111 -0
  31. package/dist/src/services/harness-flywheel-generations.js +354 -0
  32. package/dist/src/services/harness-flywheel-runtime.d.ts +25 -0
  33. package/dist/src/services/harness-flywheel-runtime.js +101 -0
  34. package/dist/src/services/harness-flywheel.d.ts +48 -0
  35. package/dist/src/services/harness-flywheel.js +207 -0
  36. package/dist/src/services/harness-hosts.d.ts +40 -0
  37. package/dist/src/services/harness-hosts.js +88 -0
  38. package/dist/src/services/harness-improvement-ledger.d.ts +63 -0
  39. package/dist/src/services/harness-improvement-ledger.js +101 -0
  40. package/dist/src/services/harness-loop.d.ts +53 -0
  41. package/dist/src/services/harness-loop.js +85 -0
  42. package/dist/src/services/harness-qualification.d.ts +66 -0
  43. package/dist/src/services/harness-qualification.js +143 -0
  44. package/dist/src/services/harness-replay.d.ts +37 -0
  45. package/dist/src/services/harness-replay.js +92 -0
  46. package/dist/src/services/harness-verify.d.ts +33 -0
  47. package/dist/src/services/harness-verify.js +26 -0
  48. package/dist/src/services/harness-worker.d.ts +23 -0
  49. package/dist/src/services/harness-worker.js +66 -0
  50. package/dist/src/services/worker-daemon.d.ts +8 -1
  51. package/dist/src/services/worker-daemon.js +42 -0
  52. package/package.json +1 -1
@@ -30,6 +30,7 @@ const DEFAULT_WORKERS = [
30
30
  { type: 'consolidate', intervalMs: 30 * 60 * 1000, offsetMs: 6 * 60 * 1000, priority: 'low', description: 'Memory distillation (ADR-174)', enabled: true },
31
31
  { type: 'testgaps', intervalMs: 20 * 60 * 1000, offsetMs: 8 * 60 * 1000, priority: 'normal', description: 'Test coverage analysis', enabled: true },
32
32
  { type: 'backup', intervalMs: 24 * 60 * 60 * 1000, offsetMs: 10 * 60 * 1000, priority: 'low', description: 'Nightly memory DB backup (WAL-safe, rotated)', enabled: true },
33
+ { type: 'harness', intervalMs: 6 * 60 * 60 * 1000, offsetMs: 12 * 60 * 1000, priority: 'low', description: 'Self-optimizing harness loop (opt-in RUFLO_HARNESS_LOOP, $0-default)', enabled: true },
33
34
  { type: 'predict', intervalMs: 10 * 60 * 1000, offsetMs: 0, priority: 'low', description: 'Predictive preloading', enabled: false },
34
35
  { type: 'document', intervalMs: 60 * 60 * 1000, offsetMs: 0, priority: 'low', description: 'Auto-documentation', enabled: false },
35
36
  ];
@@ -1162,6 +1163,8 @@ export class WorkerDaemon extends EventEmitter {
1162
1163
  return this.runConsolidateWorker();
1163
1164
  case 'backup':
1164
1165
  return this.runBackupWorker();
1166
+ case 'harness':
1167
+ return this.runHarnessWorker();
1165
1168
  case 'testgaps':
1166
1169
  return this.runTestGapsWorkerLocal();
1167
1170
  case 'predict':
@@ -1437,6 +1440,45 @@ export class WorkerDaemon extends EventEmitter {
1437
1440
  writeFileSync(backupFile, JSON.stringify(result, null, 2));
1438
1441
  return result;
1439
1442
  }
1443
+ /**
1444
+ * Self-optimizing harness loop worker (ADR-176 phase 8). Strictly bounded:
1445
+ * OPT-IN (RUFLO_HARNESS_LOOP), $0-default (no optimizer/verifier wired => no
1446
+ * promotion), trajectory-capped, single-flight via the daemon, never throws.
1447
+ * On acceptance the (unsigned) champion is staged for the separate sign step.
1448
+ */
1449
+ async runHarnessWorker() {
1450
+ const metricsDir = join(this.projectRoot, '.claude-flow', 'metrics');
1451
+ if (!existsSync(metricsDir))
1452
+ mkdirSync(metricsDir, { recursive: true });
1453
+ const harnessFile = join(metricsDir, 'harness-loop.json');
1454
+ let result;
1455
+ try {
1456
+ // ADR-176 flywheel (A-P3b autonomy loop): run ONE COMPOUNDING generation
1457
+ // on the install's REAL data — read the persisted champion as baseline,
1458
+ // gate a constrained candidate on the frozen self-supervised held-out with
1459
+ // the human-anchor guard + separate canary, and on a verified promotion
1460
+ // advance the champion so the NEXT tick compounds. Shadow-first (serve lags
1461
+ // one tick). Opt-in ($0 no-op without RUFLO_HARNESS_LOOP).
1462
+ const { runFlywheelGenerationWorker } = await import('./harness-flywheel-runtime.js');
1463
+ const gen = await runFlywheelGenerationWorker(this.projectRoot, { sample: 120 });
1464
+ let status = null;
1465
+ try {
1466
+ const { flywheelStatus } = await import('./harness-flywheel-generations.js');
1467
+ status = flywheelStatus(this.projectRoot);
1468
+ }
1469
+ catch { /* no lineage yet */ }
1470
+ if (gen.promoted)
1471
+ this.log('info', `Flywheel gen ${gen.generation}: PROMOTED (+${(gen.delta ?? 0).toFixed(4)} held-out, significant=${gen.significant}) — champion advanced`);
1472
+ result = { timestamp: new Date().toISOString(), flywheel: gen, lineage: status };
1473
+ }
1474
+ catch (error) {
1475
+ const message = error instanceof Error ? error.message : String(error);
1476
+ this.log('warn', `Harness worker failed: ${message}`);
1477
+ result = { timestamp: new Date().toISOString(), ran: false, error: message };
1478
+ }
1479
+ writeFileSync(harnessFile, JSON.stringify(result, null, 2));
1480
+ return result;
1481
+ }
1440
1482
  /**
1441
1483
  * Local testgaps worker (fallback when headless unavailable)
1442
1484
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@claude-flow/cli",
3
- "version": "3.23.0",
3
+ "version": "3.24.0",
4
4
  "type": "module",
5
5
  "description": "Ruflo CLI - Enterprise AI agent orchestration with 60+ specialized agents, swarm coordination, MCP server, self-learning hooks, and vector memory for Claude Code",
6
6
  "main": "dist/src/index.js",