claude-flow 3.63.5 → 3.63.7

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 (42) hide show
  1. package/.claude/agents/github/github-modes.md +3 -3
  2. package/.claude/agents/github/issue-tracker.md +6 -6
  3. package/.claude/agents/github/pr-manager.md +6 -6
  4. package/.claude/agents/github/release-manager.md +11 -11
  5. package/.claude/agents/github/repo-architect.md +9 -9
  6. package/.claude/agents/github/swarm-issue.md +4 -4
  7. package/.claude/agents/github/swarm-pr.md +5 -5
  8. package/.claude/agents/github/sync-coordinator.md +18 -18
  9. package/.claude/agents/github/workflow-automation.md +7 -7
  10. package/.claude/agents/goal/code-goal-planner.md +2 -2
  11. package/.claude/commands/agents/agent-spawning.md +1 -1
  12. package/.claude/commands/github/github-modes.md +3 -3
  13. package/.claude/commands/github/issue-tracker.md +6 -6
  14. package/.claude/commands/github/pr-manager.md +6 -6
  15. package/.claude/commands/github/release-manager.md +11 -11
  16. package/.claude/commands/github/repo-architect.md +9 -9
  17. package/.claude/commands/github/sync-coordinator.md +9 -9
  18. package/.claude/commands/sparc/orchestrator.md +1 -1
  19. package/.claude/commands/sparc/sparc-modes.md +1 -1
  20. package/.claude/proven-config.json +1 -1
  21. package/.claude/skills/github-code-review/SKILL.md +3 -3
  22. package/.claude/skills/github-multi-repo/SKILL.md +6 -9
  23. package/.claude/skills/github-project-management/SKILL.md +7 -7
  24. package/.claude/skills/github-release-management/SKILL.md +12 -14
  25. package/.claude/skills/github-workflow-automation/SKILL.md +7 -7
  26. package/.claude/skills/hooks-automation/SKILL.md +121 -151
  27. package/.claude/skills/sparc-methodology/SKILL.md +11 -11
  28. package/.claude/skills/swarm-advanced/SKILL.md +5 -5
  29. package/.claude-plugin/marketplace.json +3 -3
  30. package/README.md +1 -1
  31. package/package.json +1 -1
  32. package/v3/@claude-flow/cli/README.md +179 -63
  33. package/v3/@claude-flow/cli/catalog-manifest.json +5 -5
  34. package/v3/@claude-flow/cli/dist/src/commands/hooks.js +7 -0
  35. package/v3/@claude-flow/cli/dist/src/mcp-tools/agent-tools.js +19 -5
  36. package/v3/@claude-flow/cli/dist/src/mcp-tools/claims-tools.js +5 -1
  37. package/v3/@claude-flow/cli/dist/src/mcp-tools/coordination-tools.js +10 -12
  38. package/v3/@claude-flow/cli/dist/src/mcp-tools/hooks-tools.js +11 -2
  39. package/v3/@claude-flow/cli/dist/src/mcp-tools/performance-tools.js +13 -23
  40. package/v3/@claude-flow/cli/dist/src/mcp-tools/session-tools.js +25 -8
  41. package/v3/@claude-flow/cli/dist/src/services/worker-daemon.js +11 -4
  42. package/v3/@claude-flow/cli/package.json +2 -1
@@ -225,8 +225,8 @@ export const coordinationTools = [
225
225
  inputSchema: {
226
226
  type: 'object',
227
227
  properties: {
228
- action: { type: 'string', enum: ['status', 'trigger', 'resolve'], description: 'Action to perform' },
229
- force: { type: 'boolean', description: 'Force synchronization' },
228
+ action: { type: 'string', enum: ['status', 'trigger', 'resolve'], description: 'Action to perform. `trigger` is unavailable: nodes are local records with no sync backend, so it is refused (#4557)' },
229
+ force: { type: 'boolean', description: 'Unused: `trigger` is refused regardless (#4557)' },
230
230
  conflictResolution: { type: 'string', enum: ['latest', 'merge', 'manual'], description: 'Conflict resolution strategy' },
231
231
  },
232
232
  },
@@ -243,18 +243,16 @@ export const coordinationTools = [
243
243
  };
244
244
  }
245
245
  if (action === 'trigger') {
246
- store.sync.syncCount++;
247
- store.sync.lastSync = new Date().toISOString();
248
- store.sync.pendingChanges = 0;
249
- // Simulate sync
250
- await new Promise(resolve => setTimeout(resolve, 50));
251
- saveCoordStore(store);
246
+ // #4557: this waited on a simulated 50ms "sync", bumped syncCount/lastSync
247
+ // and reported every node synchronized, but no state moves between
248
+ // nodes. Refuse without touching the stored sync record, as
249
+ // neural_compress quantize/prune do (#4195, #4423).
252
250
  return {
253
- success: true,
254
- action: 'synchronized',
251
+ success: false,
252
+ action: 'trigger',
253
+ error: 'Synchronization is unavailable: coordination nodes are local records with no sync backend, so nothing would be transferred.',
255
254
  syncCount: store.sync.syncCount,
256
- syncedAt: store.sync.lastSync,
257
- nodesSync: Object.keys(store.nodes).length,
255
+ lastSync: store.sync.lastSync,
258
256
  };
259
257
  }
260
258
  if (action === 'resolve') {
@@ -2212,7 +2212,14 @@ export const hooksBuildAgents = {
2212
2212
  },
2213
2213
  },
2214
2214
  handler: async (params) => {
2215
- const outputDir = resolve(params.outputDir || './agents');
2215
+ // #4558: outputDir was never validated and resolved against the process
2216
+ // cwd, so a default call from another directory overwrote files there.
2217
+ if (params.outputDir !== undefined) {
2218
+ const v = validatePath(params.outputDir, 'outputDir');
2219
+ if (!v.valid)
2220
+ return { success: false, error: v.error };
2221
+ }
2222
+ const outputDir = resolve(getProjectCwd(), params.outputDir || './agents');
2216
2223
  const focus = params.focus || 'all';
2217
2224
  const format = params.format || 'yaml';
2218
2225
  const persist = params.persist !== false; // Default to true
@@ -2255,9 +2262,11 @@ export const hooksBuildAgents = {
2255
2262
  agents: filteredAgents,
2256
2263
  stats: {
2257
2264
  configsGenerated: filteredAgents.length,
2258
- patternsApplied: filteredAgents.length * 3,
2265
+ // #4558: was agents * 3; no pretrain data is read, the configs are templates.
2266
+ patternsApplied: 0,
2259
2267
  optimizationsIncluded: filteredAgents.reduce((acc, a) => acc + a.optimizations.length, 0),
2260
2268
  },
2269
+ _note: 'Configs are built-in templates; pretrain data is not read.',
2261
2270
  };
2262
2271
  },
2263
2272
  };
@@ -612,6 +612,14 @@ export const performanceTools = [
612
612
  };
613
613
  const cpuStats = calcStats(cpuHistory, cpuPercent);
614
614
  const memStats = calcStats(memHistory, memUsedMB);
615
+ // #4554: latency/throughput used to be fixed literals (45ms, 1250 ops/s).
616
+ // Report the samples performance_report records (ADR-093 F8), or say none exist.
617
+ const sampled = (values, unit) => {
618
+ const real = values.filter(n => Number.isFinite(n));
619
+ return real.length === 0
620
+ ? { available: false, unit, samples: 0, _real: false, _note: 'No samples recorded yet: run performance_report to record one.' }
621
+ : { ...calcStats(real, real[real.length - 1]), unit, samples: real.length, _real: true };
622
+ };
615
623
  const allMetrics = {
616
624
  cpu: {
617
625
  ...cpuStats,
@@ -630,30 +638,12 @@ export const performanceTools = [
630
638
  unit: 'MB',
631
639
  _real: true,
632
640
  },
633
- latency: {
634
- current: 45,
635
- avg: 52,
636
- min: 15,
637
- max: 250,
638
- p50: 48,
639
- p95: 150,
640
- p99: 220,
641
- unit: 'ms',
642
- },
643
- throughput: {
644
- current: 1250,
645
- avg: 1100,
646
- min: 500,
647
- max: 2000,
648
- p50: 1050,
649
- p95: 1800,
650
- p99: 1950,
651
- unit: 'ops/s',
652
- },
641
+ latency: sampled(history.map(m => m.latency?.avg), 'ms'),
642
+ throughput: sampled(history.map(m => m.throughput?.operations), 'ops/s'),
653
643
  };
654
644
  if (metric === 'all') {
655
645
  return {
656
- _real: true,
646
+ _real: Object.values(allMetrics).every(m => m._real),
657
647
  metrics: allMetrics,
658
648
  aggregation,
659
649
  historySize: history.length,
@@ -662,9 +652,9 @@ export const performanceTools = [
662
652
  }
663
653
  const selectedMetric = allMetrics[metric];
664
654
  return {
665
- _real: ['cpu', 'memory'].includes(metric),
655
+ _real: selectedMetric._real,
666
656
  metric,
667
- value: selectedMetric[aggregation],
657
+ value: selectedMetric[aggregation] ?? null,
668
658
  unit: selectedMetric.unit,
669
659
  details: selectedMetric,
670
660
  timestamp: new Date().toISOString(),
@@ -54,6 +54,21 @@ function ensureSessionDir() {
54
54
  mkdirRestricted(dir);
55
55
  }
56
56
  }
57
+ /**
58
+ * The session hook (`session.js` from init/helpers-generator.ts) writes its
59
+ * records into this same directory: `current.json` and `session-<n>.json`
60
+ * archives shaped `{ id, startedAt, ... }` rather than session_save's
61
+ * `{ sessionId, name, savedAt, stats }`. Read the id and time from either shape
62
+ * (ADR-093 F6), falling back to the file's own id.
63
+ */
64
+ function sessionIdentity(session, fileId) {
65
+ const raw = session;
66
+ const pick = (...values) => values.find((v) => typeof v === 'string' && v !== '');
67
+ return {
68
+ sessionId: pick(raw.sessionId, raw.id) ?? fileId,
69
+ savedAt: pick(raw.savedAt, raw.startedAt) ?? '',
70
+ };
71
+ }
57
72
  function loadSession(sessionId) {
58
73
  try {
59
74
  const path = getSessionPath(sessionId);
@@ -583,12 +598,13 @@ export const sessionTools = [
583
598
  if (session) {
584
599
  const path = getSessionPath(sessionId);
585
600
  const stat = statSync(path);
601
+ const identity = sessionIdentity(session, sessionId);
586
602
  return {
587
- sessionId: session.sessionId,
588
- name: session.name,
603
+ sessionId: identity.sessionId,
604
+ name: session.name ?? identity.sessionId,
589
605
  description: session.description,
590
- savedAt: session.savedAt,
591
- stats: session.stats,
606
+ savedAt: identity.savedAt,
607
+ stats: session.stats ?? null,
592
608
  fileSize: stat.size,
593
609
  path,
594
610
  hasData: {
@@ -631,12 +647,13 @@ export const sessionTools = [
631
647
  const session = loadSession(sessionId);
632
648
  if (!session)
633
649
  return { sessionId, status: 'unknown', startedAt: '', error: 'Session file unreadable' };
650
+ const identity = sessionIdentity(session, sessionId);
634
651
  return {
635
- sessionId: session.sessionId,
636
- name: session.name,
652
+ sessionId: identity.sessionId,
653
+ name: session.name ?? identity.sessionId,
637
654
  status: 'active',
638
- startedAt: session.savedAt,
639
- stats: session.stats,
655
+ startedAt: identity.savedAt,
656
+ stats: session.stats ?? null,
640
657
  };
641
658
  },
642
659
  },
@@ -1580,14 +1580,21 @@ export class WorkerDaemon extends EventEmitter {
1580
1580
  const audit = {
1581
1581
  timestamp: new Date().toISOString(),
1582
1582
  mode: 'local',
1583
+ // This fallback performs file-presence checks only. It must not report
1584
+ // a clean secret scan or a low risk level it did not actually establish:
1585
+ // the worker runs by default at critical priority, so a fabricated
1586
+ // noHardcodedSecrets/riskLevel pair is a believable false negative.
1587
+ scanned: false,
1583
1588
  checks: {
1584
1589
  envFilesProtected: !existsSync(join(this.projectRoot, '.env.local')),
1585
1590
  gitIgnoreExists: existsSync(join(this.projectRoot, '.gitignore')),
1586
- noHardcodedSecrets: true, // Would need actual scanning
1591
+ noHardcodedSecrets: null,
1587
1592
  },
1588
- riskLevel: 'low',
1589
- recommendations: [],
1590
- note: 'Install Claude Code CLI for AI-powered security analysis',
1593
+ riskLevel: 'unknown',
1594
+ recommendations: [
1595
+ 'No secret scan or code analysis was performed by the local fallback; install Claude Code CLI for AI-powered security analysis.',
1596
+ ],
1597
+ note: 'Local fallback checks file presence only; it does not scan source contents.',
1591
1598
  };
1592
1599
  writeFileSync(auditFile, JSON.stringify(audit, null, 2));
1593
1600
  return audit;
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@claude-flow/cli",
3
- "version": "3.63.5",
3
+ "version": "3.63.7",
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",
@@ -131,6 +131,7 @@
131
131
  },
132
132
  "optionalDependencies": {
133
133
  "@agntcy/slim-bindings": "2.1.1",
134
+ "@claude-flow/aidefence": "3.0.2",
134
135
  "@claude-flow/memory": "3.0.9",
135
136
  "@metaharness/darwin": "~0.12.0",
136
137
  "@metaharness/flywheel": "~0.1.10",