hedgequantx 2.5.35 → 2.5.36

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hedgequantx",
3
- "version": "2.5.35",
3
+ "version": "2.5.36",
4
4
  "description": "HedgeQuantX - Prop Futures Trading CLI",
5
5
  "main": "src/app.js",
6
6
  "bin": {
@@ -449,11 +449,15 @@ const showStats = async (service) => {
449
449
 
450
450
  // Add consensus info if in consensus mode
451
451
  if (isConsensusMode && consensusData) {
452
- const agreement = consensusData.agreement !== null
453
- ? Math.round(consensusData.agreement * 100) + '%'
454
- : 'N/A';
452
+ const isUnanimous = consensusData.isUnanimous;
455
453
  const consensusAction = consensusData.action || 'PENDING';
456
- agentsData.push({ label: 'CONSENSUS:', value: chalk.magenta(consensusAction + ' (' + agreement + ')') });
454
+ // Show action with unanimity status
455
+ const consensusDisplay = isUnanimous
456
+ ? chalk.green(consensusAction + ' (UNANIMOUS)')
457
+ : chalk.yellow(consensusAction + ' (DISAGREEMENT)');
458
+ agentsData.push({ label: 'DECISION:', value: consensusDisplay });
459
+ } else if (isConsensusMode) {
460
+ agentsData.push({ label: 'DECISION:', value: chalk.white('WAITING...') });
457
461
  }
458
462
 
459
463
  // Add each agent as a separate line with ● indicator
@@ -298,6 +298,8 @@ class AISupervisor {
298
298
 
299
299
  /**
300
300
  * Calculate consensus from multiple agent decisions
301
+ * RULE: ALL agents must agree (100% unanimity) before taking action
302
+ *
301
303
  * @param {Array} decisions - Array of agent decisions
302
304
  * @returns {Object|null} Consensus result
303
305
  */
@@ -319,13 +321,16 @@ class AISupervisor {
319
321
  }
320
322
  }
321
323
 
322
- // Find majority action
323
- let majorityAction = null;
324
- let maxVotes = 0;
324
+ // Check for UNANIMITY - ALL agents must agree
325
+ let unanimousAction = null;
326
+ let isUnanimous = false;
327
+
325
328
  for (const [action, count] of Object.entries(votes)) {
326
- if (count > maxVotes) {
327
- maxVotes = count;
328
- majorityAction = action;
329
+ if (count === decisions.length) {
330
+ // All agents voted for this action
331
+ unanimousAction = action;
332
+ isUnanimous = true;
333
+ break;
329
334
  }
330
335
  }
331
336
 
@@ -335,13 +340,15 @@ class AISupervisor {
335
340
  : null;
336
341
 
337
342
  // Store consensus result
343
+ // If not unanimous, action is HOLD (no action taken)
338
344
  const consensus = {
339
345
  timestamp: Date.now(),
340
- action: majorityAction,
341
- confidence: avgConfidence,
346
+ action: isUnanimous ? unanimousAction : 'HOLD',
347
+ confidence: isUnanimous ? avgConfidence : null,
342
348
  votes,
343
349
  agentCount: decisions.length,
344
- agreement: maxVotes / decisions.length
350
+ isUnanimous,
351
+ agreement: isUnanimous ? 1.0 : 0
345
352
  };
346
353
 
347
354
  // Store consensus in first session for retrieval