nexus-agents 4.33.2 → 4.35.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 (128) hide show
  1. package/dist/{child-mcp-config-P7CQABCJ.js → child-mcp-config-2EXF74GZ.js} +2 -2
  2. package/dist/{chunk-SGVZ7ZGX.js → chunk-2P6GBKUN.js} +2 -2
  3. package/dist/{chunk-C6PKLDAT.js → chunk-3IDYJL2Y.js} +2 -2
  4. package/dist/chunk-3POO3SZ5.js +7 -0
  5. package/dist/{chunk-O5GC35CK.js → chunk-77VDRUFK.js} +3 -3
  6. package/dist/{chunk-QTQGVEOH.js → chunk-7TXO7LYE.js} +2 -2
  7. package/dist/{chunk-MT24TXTU.js → chunk-AKOBOCUB.js} +2 -2
  8. package/dist/{chunk-37H55KW3.js → chunk-AVYTX7JQ.js} +3 -11
  9. package/dist/{chunk-37H55KW3.js.map → chunk-AVYTX7JQ.js.map} +1 -1
  10. package/dist/{chunk-6FD2ANO6.js → chunk-C2LEM7RD.js} +2 -2
  11. package/dist/{chunk-ORGHCHPG.js → chunk-EQRCOUJJ.js} +2 -2
  12. package/dist/{chunk-VZ442BJ3.js → chunk-FWP5FZ7V.js} +2 -2
  13. package/dist/{chunk-QU3OS74W.js → chunk-KG752W6G.js} +2 -2
  14. package/dist/{chunk-AH73DVZ2.js → chunk-KP6GFCQF.js} +69 -24
  15. package/dist/chunk-KP6GFCQF.js.map +1 -0
  16. package/dist/{chunk-7T7C4U63.js → chunk-KQPEECXT.js} +2 -2
  17. package/dist/{chunk-J2ANQRIB.js → chunk-KYOVZ2QZ.js} +5 -5
  18. package/dist/{chunk-NAGBHP3R.js → chunk-OKS6I7T7.js} +4 -4
  19. package/dist/{chunk-M2N7SGCJ.js → chunk-Q225TVYP.js} +2 -2
  20. package/dist/{chunk-DEJNDYJ2.js → chunk-QNF6NAQ3.js} +6 -6
  21. package/dist/{chunk-7W7CSKJY.js → chunk-SOKS6XK2.js} +2 -2
  22. package/dist/{chunk-MJQBB2B6.js → chunk-SZ6J4YY7.js} +2 -2
  23. package/dist/{chunk-D3A7NHQC.js → chunk-VHB3L7H7.js} +2 -2
  24. package/dist/{chunk-TELFGM7D.js → chunk-VRJJGXUE.js} +8 -8
  25. package/dist/{chunk-EICIX73A.js → chunk-VS2DUTJ5.js} +4 -4
  26. package/dist/{chunk-QPV34W5L.js → chunk-VZM7YQZL.js} +5 -5
  27. package/dist/{chunk-QK5ZVSEW.js → chunk-W3ZEC2US.js} +4 -4
  28. package/dist/{chunk-QK5ZVSEW.js.map → chunk-W3ZEC2US.js.map} +1 -1
  29. package/dist/{chunk-TKEO2CET.js → chunk-W7ITYRY2.js} +2 -2
  30. package/dist/{chunk-ZHVNCCSS.js → chunk-WIYDV6ZY.js} +3 -3
  31. package/dist/{chunk-MUTREHSB.js → chunk-WTQEMR7D.js} +7 -7
  32. package/dist/{chunk-AXBQ5TZD.js → chunk-WYTBM5DW.js} +3 -3
  33. package/dist/{chunk-OQYRMN3Z.js → chunk-XIWGJBVE.js} +4 -4
  34. package/dist/{chunk-COH5SVGN.js → chunk-Y4XI4RIB.js} +2 -2
  35. package/dist/{chunk-DJK6AVEQ.js → chunk-ZJCM257T.js} +1305 -1547
  36. package/dist/chunk-ZJCM257T.js.map +1 -0
  37. package/dist/{chunk-3U6L7DBT.js → chunk-ZSNWRX2B.js} +2 -2
  38. package/dist/{chunk-HB44B3BY.js → chunk-ZX2IIRGA.js} +7 -7
  39. package/dist/{cli-circuit-breaker-MXCFIBE6.js → cli-circuit-breaker-UFQZZVAB.js} +3 -3
  40. package/dist/cli.d.ts +1 -1
  41. package/dist/cli.js +41 -41
  42. package/dist/{composite-router-53U3PUKD.js → composite-router-KL7ZLCJY.js} +2 -2
  43. package/dist/{consensus-vote-XRX3QXQJ.js → consensus-vote-FWT6ST7Y.js} +17 -17
  44. package/dist/{consensus-vote-types-D66OPHNc.d.ts → consensus-vote-types-Br1h5IMv.d.ts} +34 -2
  45. package/dist/{context-retriever-WQ4DR5YA.js → context-retriever-GJL6HFJK.js} +8 -8
  46. package/dist/{doctor-deep-UV55I67V.js → doctor-deep-XEJ7JXQI.js} +3 -3
  47. package/dist/{doctor-live-NPITPSSM.js → doctor-live-4VAU6HLF.js} +9 -9
  48. package/dist/{expert-bridge-JHRGVFMI.js → expert-bridge-VYB4C7C5.js} +4 -4
  49. package/dist/{factory-UCHXRDLH.js → factory-S5K2EIKH.js} +9 -9
  50. package/dist/{factory-2LY3CVCA.js → factory-YYGHDTUN.js} +5 -5
  51. package/dist/{improvement-review-MIKGBXMO.js → improvement-review-XAHSZOS4.js} +6 -6
  52. package/dist/index.d.ts +16 -3
  53. package/dist/index.js +31 -31
  54. package/dist/{init-opencode-RM56PYGH.js → init-opencode-5PUDYNKQ.js} +6 -6
  55. package/dist/issue-triage-5ZFQWQ3W.js +17 -0
  56. package/dist/model-registry.generated.json +1402 -1402
  57. package/dist/{pr-reviewer-helpers-YZBSLQSA.js → pr-reviewer-helpers-4YANH63K.js} +4 -4
  58. package/dist/{registry-command-5OESX3DA.js → registry-command-KZDEZNUE.js} +2 -2
  59. package/dist/{repo-security-plan-KEDN5YJ2.js → repo-security-plan-7N2BVFFF.js} +3 -3
  60. package/dist/{research-helpers-synthesize-M7JVBCYA.js → research-helpers-synthesize-FCXEDCUC.js} +4 -4
  61. package/dist/{routing-memory-I3AXPHRE.js → routing-memory-NZZHHDN6.js} +2 -2
  62. package/dist/{session-memory-QEBRJTGN.js → session-memory-OV55DW3U.js} +3 -3
  63. package/dist/{setup-config-UWWWOY5A.js → setup-config-WFHZTYAU.js} +3 -3
  64. package/dist/{setup-custom-api-2VJQLK74.js → setup-custom-api-5V5IQUMA.js} +4 -4
  65. package/dist/setup-data-dir-VQSDNEF4.js +29 -0
  66. package/dist/{tool-memory-EJ5JZZCT.js → tool-memory-NJ5B3U27.js} +5 -5
  67. package/dist/{unified-registry-YV65LRDH.js → unified-registry-YBGPLXH3.js} +10 -10
  68. package/dist/{weather-report-R7OFTPS7.js → weather-report-U626M3HS.js} +2 -2
  69. package/package.json +1 -1
  70. package/dist/chunk-AH73DVZ2.js.map +0 -1
  71. package/dist/chunk-DJK6AVEQ.js.map +0 -1
  72. package/dist/chunk-RESSWGLL.js +0 -7
  73. package/dist/issue-triage-X5XYXWRA.js +0 -17
  74. package/dist/setup-data-dir-JGQNIML7.js +0 -29
  75. /package/dist/{child-mcp-config-P7CQABCJ.js.map → child-mcp-config-2EXF74GZ.js.map} +0 -0
  76. /package/dist/{chunk-SGVZ7ZGX.js.map → chunk-2P6GBKUN.js.map} +0 -0
  77. /package/dist/{chunk-C6PKLDAT.js.map → chunk-3IDYJL2Y.js.map} +0 -0
  78. /package/dist/{chunk-RESSWGLL.js.map → chunk-3POO3SZ5.js.map} +0 -0
  79. /package/dist/{chunk-O5GC35CK.js.map → chunk-77VDRUFK.js.map} +0 -0
  80. /package/dist/{chunk-QTQGVEOH.js.map → chunk-7TXO7LYE.js.map} +0 -0
  81. /package/dist/{chunk-MT24TXTU.js.map → chunk-AKOBOCUB.js.map} +0 -0
  82. /package/dist/{chunk-6FD2ANO6.js.map → chunk-C2LEM7RD.js.map} +0 -0
  83. /package/dist/{chunk-ORGHCHPG.js.map → chunk-EQRCOUJJ.js.map} +0 -0
  84. /package/dist/{chunk-VZ442BJ3.js.map → chunk-FWP5FZ7V.js.map} +0 -0
  85. /package/dist/{chunk-QU3OS74W.js.map → chunk-KG752W6G.js.map} +0 -0
  86. /package/dist/{chunk-7T7C4U63.js.map → chunk-KQPEECXT.js.map} +0 -0
  87. /package/dist/{chunk-J2ANQRIB.js.map → chunk-KYOVZ2QZ.js.map} +0 -0
  88. /package/dist/{chunk-NAGBHP3R.js.map → chunk-OKS6I7T7.js.map} +0 -0
  89. /package/dist/{chunk-M2N7SGCJ.js.map → chunk-Q225TVYP.js.map} +0 -0
  90. /package/dist/{chunk-DEJNDYJ2.js.map → chunk-QNF6NAQ3.js.map} +0 -0
  91. /package/dist/{chunk-7W7CSKJY.js.map → chunk-SOKS6XK2.js.map} +0 -0
  92. /package/dist/{chunk-MJQBB2B6.js.map → chunk-SZ6J4YY7.js.map} +0 -0
  93. /package/dist/{chunk-D3A7NHQC.js.map → chunk-VHB3L7H7.js.map} +0 -0
  94. /package/dist/{chunk-TELFGM7D.js.map → chunk-VRJJGXUE.js.map} +0 -0
  95. /package/dist/{chunk-EICIX73A.js.map → chunk-VS2DUTJ5.js.map} +0 -0
  96. /package/dist/{chunk-QPV34W5L.js.map → chunk-VZM7YQZL.js.map} +0 -0
  97. /package/dist/{chunk-TKEO2CET.js.map → chunk-W7ITYRY2.js.map} +0 -0
  98. /package/dist/{chunk-ZHVNCCSS.js.map → chunk-WIYDV6ZY.js.map} +0 -0
  99. /package/dist/{chunk-MUTREHSB.js.map → chunk-WTQEMR7D.js.map} +0 -0
  100. /package/dist/{chunk-AXBQ5TZD.js.map → chunk-WYTBM5DW.js.map} +0 -0
  101. /package/dist/{chunk-OQYRMN3Z.js.map → chunk-XIWGJBVE.js.map} +0 -0
  102. /package/dist/{chunk-COH5SVGN.js.map → chunk-Y4XI4RIB.js.map} +0 -0
  103. /package/dist/{chunk-3U6L7DBT.js.map → chunk-ZSNWRX2B.js.map} +0 -0
  104. /package/dist/{chunk-HB44B3BY.js.map → chunk-ZX2IIRGA.js.map} +0 -0
  105. /package/dist/{cli-circuit-breaker-MXCFIBE6.js.map → cli-circuit-breaker-UFQZZVAB.js.map} +0 -0
  106. /package/dist/{composite-router-53U3PUKD.js.map → composite-router-KL7ZLCJY.js.map} +0 -0
  107. /package/dist/{consensus-vote-XRX3QXQJ.js.map → consensus-vote-FWT6ST7Y.js.map} +0 -0
  108. /package/dist/{context-retriever-WQ4DR5YA.js.map → context-retriever-GJL6HFJK.js.map} +0 -0
  109. /package/dist/{doctor-deep-UV55I67V.js.map → doctor-deep-XEJ7JXQI.js.map} +0 -0
  110. /package/dist/{doctor-live-NPITPSSM.js.map → doctor-live-4VAU6HLF.js.map} +0 -0
  111. /package/dist/{expert-bridge-JHRGVFMI.js.map → expert-bridge-VYB4C7C5.js.map} +0 -0
  112. /package/dist/{factory-2LY3CVCA.js.map → factory-S5K2EIKH.js.map} +0 -0
  113. /package/dist/{factory-UCHXRDLH.js.map → factory-YYGHDTUN.js.map} +0 -0
  114. /package/dist/{improvement-review-MIKGBXMO.js.map → improvement-review-XAHSZOS4.js.map} +0 -0
  115. /package/dist/{init-opencode-RM56PYGH.js.map → init-opencode-5PUDYNKQ.js.map} +0 -0
  116. /package/dist/{issue-triage-X5XYXWRA.js.map → issue-triage-5ZFQWQ3W.js.map} +0 -0
  117. /package/dist/{pr-reviewer-helpers-YZBSLQSA.js.map → pr-reviewer-helpers-4YANH63K.js.map} +0 -0
  118. /package/dist/{registry-command-5OESX3DA.js.map → registry-command-KZDEZNUE.js.map} +0 -0
  119. /package/dist/{repo-security-plan-KEDN5YJ2.js.map → repo-security-plan-7N2BVFFF.js.map} +0 -0
  120. /package/dist/{research-helpers-synthesize-M7JVBCYA.js.map → research-helpers-synthesize-FCXEDCUC.js.map} +0 -0
  121. /package/dist/{routing-memory-I3AXPHRE.js.map → routing-memory-NZZHHDN6.js.map} +0 -0
  122. /package/dist/{session-memory-QEBRJTGN.js.map → session-memory-OV55DW3U.js.map} +0 -0
  123. /package/dist/{setup-config-UWWWOY5A.js.map → setup-config-WFHZTYAU.js.map} +0 -0
  124. /package/dist/{setup-custom-api-2VJQLK74.js.map → setup-custom-api-5V5IQUMA.js.map} +0 -0
  125. /package/dist/{setup-data-dir-JGQNIML7.js.map → setup-data-dir-VQSDNEF4.js.map} +0 -0
  126. /package/dist/{tool-memory-EJ5JZZCT.js.map → tool-memory-NJ5B3U27.js.map} +0 -0
  127. /package/dist/{unified-registry-YV65LRDH.js.map → unified-registry-YBGPLXH3.js.map} +0 -0
  128. /package/dist/{weather-report-R7OFTPS7.js.map → weather-report-U626M3HS.js.map} +0 -0
@@ -2,7 +2,7 @@ import {
2
2
  CACHE_TIMEOUTS,
3
3
  createLogger,
4
4
  getTimeProvider
5
- } from "./chunk-37H55KW3.js";
5
+ } from "./chunk-AVYTX7JQ.js";
6
6
 
7
7
  // src/security/trust-types.ts
8
8
  import { z } from "zod";
@@ -560,4 +560,4 @@ export {
560
560
  resolveReputationGatingMode,
561
561
  gateWithReputation
562
562
  };
563
- //# sourceMappingURL=chunk-6FD2ANO6.js.map
563
+ //# sourceMappingURL=chunk-C2LEM7RD.js.map
@@ -11,7 +11,7 @@ import {
11
11
  createGetRetryConfig,
12
12
  createGetTimeout,
13
13
  createGetToolRateLimit
14
- } from "./chunk-37H55KW3.js";
14
+ } from "./chunk-AVYTX7JQ.js";
15
15
 
16
16
  // src/config/defaults.ts
17
17
  var CUSTOM_API_DEFAULT_MODEL = "gpt-5.5";
@@ -230,4 +230,4 @@ export {
230
230
  CUSTOM_API_DEFAULT_MODEL,
231
231
  DEFAULTS
232
232
  };
233
- //# sourceMappingURL=chunk-ORGHCHPG.js.map
233
+ //# sourceMappingURL=chunk-EQRCOUJJ.js.map
@@ -3,7 +3,7 @@ import {
3
3
  MODEL_IDS,
4
4
  getTimeProvider,
5
5
  resolveModelIdentitySync
6
- } from "./chunk-37H55KW3.js";
6
+ } from "./chunk-AVYTX7JQ.js";
7
7
 
8
8
  // src/config/model-availability.ts
9
9
  var DEFAULT_TTL_MS = 6e4;
@@ -150,4 +150,4 @@ export {
150
150
  resetAvailabilityCache,
151
151
  filterAvailableModels
152
152
  };
153
- //# sourceMappingURL=chunk-VZ442BJ3.js.map
153
+ //# sourceMappingURL=chunk-FWP5FZ7V.js.map
@@ -8,7 +8,7 @@ import {
8
8
  getTimeProvider,
9
9
  isRateLimitText,
10
10
  ok
11
- } from "./chunk-37H55KW3.js";
11
+ } from "./chunk-AVYTX7JQ.js";
12
12
 
13
13
  // src/cli-adapters/circuit-breaker-types.ts
14
14
  var CircuitErrorCode = {
@@ -541,4 +541,4 @@ export {
541
541
  CliCircuitBreakerIntegration,
542
542
  createCliCircuitBreakerIntegration
543
543
  };
544
- //# sourceMappingURL=chunk-QU3OS74W.js.map
544
+ //# sourceMappingURL=chunk-KG752W6G.js.map
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  computeCostDetail,
3
3
  priceBasisOf
4
- } from "./chunk-7W7CSKJY.js";
4
+ } from "./chunk-SOKS6XK2.js";
5
5
  import {
6
6
  allOf
7
7
  } from "./chunk-OQB3XC5O.js";
@@ -23,22 +23,22 @@ import {
23
23
  toolSuccessStructured,
24
24
  withProgressHeartbeat,
25
25
  wrapToolWithTimeout
26
- } from "./chunk-QK5ZVSEW.js";
26
+ } from "./chunk-W3ZEC2US.js";
27
27
  import {
28
28
  assessPanelIndependence,
29
29
  countDistinctModels,
30
30
  createEvent,
31
31
  getGlobalRegistry
32
- } from "./chunk-NAGBHP3R.js";
32
+ } from "./chunk-OKS6I7T7.js";
33
33
  import {
34
34
  getToolMemory
35
- } from "./chunk-EICIX73A.js";
35
+ } from "./chunk-VS2DUTJ5.js";
36
36
  import {
37
37
  authRemediation,
38
38
  delay,
39
39
  getAvailableClis,
40
40
  withTimeout
41
- } from "./chunk-TELFGM7D.js";
41
+ } from "./chunk-VRJJGXUE.js";
42
42
  import {
43
43
  AgentError,
44
44
  CLI_NAMES,
@@ -66,7 +66,7 @@ import {
66
66
  registerPersistentOutcomeStoreFactory,
67
67
  resolveClassGuardMs,
68
68
  resolveVoteTimeout
69
- } from "./chunk-37H55KW3.js";
69
+ } from "./chunk-AVYTX7JQ.js";
70
70
  import {
71
71
  ensureLearningDir,
72
72
  getOutcomesFile
@@ -1879,6 +1879,14 @@ function createHigherOrderVotingStrategy(options) {
1879
1879
  }
1880
1880
 
1881
1881
  // src/consensus/strategies.ts
1882
+ function deriveWeightBasis(votes, weights) {
1883
+ let withRecord = 0;
1884
+ for (const agentId of votes.keys()) {
1885
+ if (weights.has(agentId)) withRecord++;
1886
+ }
1887
+ if (withRecord === 0) return "unweighted";
1888
+ return withRecord === votes.size ? "performance" : "partial";
1889
+ }
1882
1890
  function evaluateThreshold(approveCount, votingTotal, threshold, inclusive) {
1883
1891
  const ratio = approveCount / votingTotal;
1884
1892
  return {
@@ -2051,15 +2059,32 @@ var ProofOfLearningStrategy = class extends BaseVotingStrategy {
2051
2059
  threshold,
2052
2060
  false
2053
2061
  );
2062
+ const weightBasis = deriveWeightBasis(votes, effectiveWeights);
2063
+ const verdict = approved ? "Approved" : "Rejected";
2054
2064
  return {
2055
2065
  approved,
2056
2066
  approvalPercentage,
2057
2067
  voteCounts: counts,
2058
2068
  weightedCounts,
2059
- reason: approved ? `Approved with ${approvalPercentage.toFixed(1)}% weighted approval` : `Rejected with ${approvalPercentage.toFixed(1)}% weighted approval`
2069
+ weightBasis,
2070
+ reason: `${verdict} with ${approvalPercentage.toFixed(1)}% ${describeBasis(weightBasis)}`
2060
2071
  };
2061
2072
  }
2062
2073
  };
2074
+ function describeBasis(basis) {
2075
+ switch (basis) {
2076
+ case "performance":
2077
+ return "weighted approval (weights from voter performance history)";
2078
+ case "partial":
2079
+ return "partly weighted approval (some voters have no performance history; those count as 1.0)";
2080
+ case "unweighted":
2081
+ return "approval (UNWEIGHTED \u2014 no voter performance history recorded)";
2082
+ default: {
2083
+ const unreachable = basis;
2084
+ throw new Error(`Unhandled weight basis: ${String(unreachable)}`);
2085
+ }
2086
+ }
2087
+ }
2063
2088
  function calculateVoteWeight(performance) {
2064
2089
  if (performance === void 0 || performance.totalVotes === 0) {
2065
2090
  return 1;
@@ -2115,6 +2140,7 @@ function buildPendingResult(state, proposalId, outcome, config) {
2115
2140
  votes: new Map(state.votes),
2116
2141
  voteCounts: outcome.voteCounts,
2117
2142
  weightedCounts: outcome.weightedCounts,
2143
+ weightBasis: outcome.weightBasis,
2118
2144
  approvalPercentage: outcome.approvalPercentage,
2119
2145
  quorumReached: state.votes.size >= config.minVotersForQuorum,
2120
2146
  startedAt: state.startedAt.toISOString(),
@@ -2133,6 +2159,7 @@ function buildFinalResult(state, proposalId, outcome, config) {
2133
2159
  votes: new Map(state.votes),
2134
2160
  voteCounts: outcome.voteCounts,
2135
2161
  weightedCounts: outcome.weightedCounts,
2162
+ weightBasis: outcome.weightBasis,
2136
2163
  approvalPercentage: outcome.approvalPercentage,
2137
2164
  quorumReached,
2138
2165
  startedAt: state.startedAt.toISOString(),
@@ -2149,6 +2176,7 @@ function buildTimeoutResult(state, proposalId, outcome, config) {
2149
2176
  votes: new Map(state.votes),
2150
2177
  voteCounts: outcome.voteCounts,
2151
2178
  weightedCounts: outcome.weightedCounts,
2179
+ weightBasis: outcome.weightBasis,
2152
2180
  approvalPercentage: outcome.approvalPercentage,
2153
2181
  quorumReached: state.votes.size >= config.minVotersForQuorum,
2154
2182
  startedAt: state.startedAt.toISOString(),
@@ -2414,7 +2442,9 @@ var ConsensusEngine = class {
2414
2442
  });
2415
2443
  if (state.proposal.algorithm === "proof_of_learning") {
2416
2444
  const performance = this.agentPerformance.get(agentId);
2417
- state.voteWeights.set(agentId, calculateVoteWeight(performance));
2445
+ if (performance !== void 0) {
2446
+ state.voteWeights.set(agentId, calculateVoteWeight(performance));
2447
+ }
2418
2448
  }
2419
2449
  this.logger.debug("Vote recorded", {
2420
2450
  proposalId: state.proposal.id,
@@ -2692,13 +2722,15 @@ var QuorumValidator = class {
2692
2722
  const { votes, agentWeights, config, requiredParticipants } = input;
2693
2723
  const voteCounts = this.countVotes(votes);
2694
2724
  const { totalWeight, weightedCounts } = this.calculateWeights(votes, agentWeights, config);
2695
- const { threshold, actualQuorum, quorumReached, reasoning } = this.calculateQuorumStatus(
2725
+ const anyWeightSupplied = [...votes.keys()].some((id) => agentWeights?.has(id) === true);
2726
+ const { threshold, actualQuorum, quorumReached, reasoning } = this.calculateQuorumStatus({
2696
2727
  voteCounts,
2697
2728
  weightedCounts,
2698
2729
  totalWeight,
2699
2730
  config,
2700
- requiredParticipants ?? votes.size
2701
- );
2731
+ requiredParticipants: requiredParticipants ?? votes.size,
2732
+ anyWeightSupplied
2733
+ });
2702
2734
  return {
2703
2735
  totalVotes: votes.size,
2704
2736
  voteCounts,
@@ -2759,37 +2791,50 @@ var QuorumValidator = class {
2759
2791
  addWeightToDecision(counts, decision, weight) {
2760
2792
  counts[decision] += weight;
2761
2793
  }
2762
- calculateQuorumStatus(voteCounts, weightedCounts, totalWeight, config, requiredParticipants) {
2794
+ calculateQuorumStatus(opts) {
2795
+ const { voteCounts, weightedCounts, totalWeight, config, requiredParticipants, anyWeightSupplied } = opts;
2763
2796
  const threshold = config.threshold;
2764
2797
  if (weightedCounts !== void 0 && totalWeight !== void 0 && totalWeight > 0) {
2765
- return this.calculateWeightedQuorum(weightedCounts, totalWeight, threshold);
2798
+ return this.calculateWeightedQuorum(weightedCounts, totalWeight, threshold, anyWeightSupplied);
2766
2799
  }
2767
2800
  return this.calculateSimpleQuorum(voteCounts, requiredParticipants, threshold, config);
2768
2801
  }
2769
- calculateWeightedQuorum(weightedCounts, totalWeight, threshold) {
2802
+ calculateWeightedQuorum(weightedCounts, totalWeight, threshold, anyWeightSupplied) {
2770
2803
  const quorumReached = totalWeight >= threshold;
2771
2804
  const approveRatio = weightedCounts.approve / totalWeight;
2772
2805
  const rejectRatio = weightedCounts.reject / totalWeight;
2773
- const reasoning = this.buildWeightedReasoning(
2806
+ const reasoning = this.buildWeightedReasoning({
2774
2807
  quorumReached,
2775
2808
  totalWeight,
2776
2809
  threshold,
2777
2810
  approveRatio,
2778
- rejectRatio
2779
- );
2811
+ rejectRatio,
2812
+ weighted: anyWeightSupplied
2813
+ });
2780
2814
  return { threshold, actualQuorum: totalWeight, quorumReached, reasoning };
2781
2815
  }
2782
- buildWeightedReasoning(quorumReached, totalWeight, threshold, approveRatio, rejectRatio) {
2816
+ /**
2817
+ * Reasoning text for the weighted-quorum branch.
2818
+ *
2819
+ * `weighted` is qualified rather than asserted (#5117). `agentWeights` has no
2820
+ * non-test producer, so every real call reaches `getVoteWeight`'s `?? 1.0`
2821
+ * fallback and this branch describes a plain headcount as a weighted ratio.
2822
+ * The word is kept where weights genuinely varied and replaced where they
2823
+ * did not, so the reader can tell the two apart.
2824
+ */
2825
+ buildWeightedReasoning(opts) {
2826
+ const { quorumReached, totalWeight, threshold, approveRatio, rejectRatio, weighted } = opts;
2827
+ const kind = weighted ? "weighted" : "unweighted (no agent weights supplied)";
2783
2828
  if (!quorumReached) {
2784
- return `Weighted quorum not reached: ${totalWeight.toFixed(2)} < ${String(threshold)}`;
2829
+ return `Quorum not reached: ${totalWeight.toFixed(2)} < ${String(threshold)} (${kind})`;
2785
2830
  }
2786
2831
  if (approveRatio > rejectRatio) {
2787
- return `Approval wins with weighted ratio ${formatPercentage(approveRatio, 1)}`;
2832
+ return `Approval wins with ${kind} ratio ${formatPercentage(approveRatio, 1)}`;
2788
2833
  }
2789
2834
  if (rejectRatio > approveRatio) {
2790
- return `Rejection wins with weighted ratio ${formatPercentage(rejectRatio, 1)}`;
2835
+ return `Rejection wins with ${kind} ratio ${formatPercentage(rejectRatio, 1)}`;
2791
2836
  }
2792
- return `No clear winner: approve=${formatPercentage(approveRatio, 1)}, reject=${formatPercentage(rejectRatio, 1)}`;
2837
+ return `No clear winner: approve=${formatPercentage(approveRatio, 1)}, reject=${formatPercentage(rejectRatio, 1)} (${kind})`;
2793
2838
  }
2794
2839
  calculateSimpleQuorum(voteCounts, requiredParticipants, threshold, config) {
2795
2840
  const activeVotes = config.includeAbstentions === true ? voteCounts.total : voteCounts.approve + voteCounts.reject;
@@ -6216,7 +6261,7 @@ async function processVotesWithCascade(engineVotes, opts) {
6216
6261
  var CONTRARIAN_ESCALATION_THRESHOLD = 0.8;
6217
6262
  async function runContrarianCheck(proposal, log) {
6218
6263
  try {
6219
- const { executeExpert } = await import("./expert-bridge-JHRGVFMI.js");
6264
+ const { executeExpert } = await import("./expert-bridge-VYB4C7C5.js");
6220
6265
  const prompt = [
6221
6266
  "You are a contrarian analyst. Your job is to find reasons this proposal should be REJECTED.",
6222
6267
  "Look for: YAGNI (not needed), MISALIGNED (wrong tech/architecture), SECURITY_RISK, SCOPE_CREEP.",
@@ -6803,4 +6848,4 @@ export {
6803
6848
  CONSENSUS_VOTE_TOOL_SCHEMA,
6804
6849
  registerConsensusVoteTool
6805
6850
  };
6806
- //# sourceMappingURL=chunk-AH73DVZ2.js.map
6851
+ //# sourceMappingURL=chunk-KP6GFCQF.js.map