nexus-agents 8.15.0 → 8.15.2

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.
@@ -7,7 +7,7 @@ import {
7
7
  toolStructuredError,
8
8
  toolSuccessStructured,
9
9
  wrapToolWithTimeout
10
- } from "./chunk-XC2J6JRK.js";
10
+ } from "./chunk-LZ65QEVJ.js";
11
11
  import {
12
12
  JsonlStore,
13
13
  SECURITY_KEYWORDS,
@@ -2159,4 +2159,4 @@ export {
2159
2159
  runImprovementReview,
2160
2160
  registerImprovementReviewTool
2161
2161
  };
2162
- //# sourceMappingURL=chunk-ZK3MZC3S.js.map
2162
+ //# sourceMappingURL=chunk-7NE6ERWJ.js.map
@@ -21,7 +21,7 @@ import {
21
21
  import {
22
22
  DEFAULT_TASK_TTL_MS,
23
23
  clampTaskTtl
24
- } from "./chunk-YIEYSK7C.js";
24
+ } from "./chunk-P7E5EBZC.js";
25
25
  import {
26
26
  executeExpert
27
27
  } from "./chunk-EVBYS5PY.js";
@@ -48,7 +48,7 @@ import {
48
48
  simulationDeniedResult,
49
49
  toJobSummary,
50
50
  writeJobCancelled
51
- } from "./chunk-VA3SFFJJ.js";
51
+ } from "./chunk-PYIVLWVO.js";
52
52
  import {
53
53
  allOf
54
54
  } from "./chunk-OQB3XC5O.js";
@@ -67,7 +67,7 @@ import {
67
67
  } from "./chunk-M4PYLLYN.js";
68
68
  import {
69
69
  withPrerequisite
70
- } from "./chunk-ZK3MZC3S.js";
70
+ } from "./chunk-7NE6ERWJ.js";
71
71
  import {
72
72
  NOOP_NOTIFIER,
73
73
  RateLimiter,
@@ -92,7 +92,7 @@ import {
92
92
  withAuditTrail,
93
93
  withProgressHeartbeat,
94
94
  wrapToolWithTimeout
95
- } from "./chunk-XC2J6JRK.js";
95
+ } from "./chunk-LZ65QEVJ.js";
96
96
  import {
97
97
  createAuditTrail,
98
98
  createGraphAuditBridge,
@@ -47422,7 +47422,7 @@ ${contextBlock}`;
47422
47422
  const strategy = config.votingStrategy ?? "higher_order";
47423
47423
  await postProgress(config, "Vote", `Running consensus with ${strategy} strategy...`);
47424
47424
  try {
47425
- const { executeVoting } = await import("./consensus-vote-VLC2HYHE.js");
47425
+ const { executeVoting } = await import("./consensus-vote-ZPD6EGE7.js");
47426
47426
  const votingResult = await executeVoting(
47427
47427
  {
47428
47428
  proposal: buildVoteProposal(plan, research),
@@ -56086,4 +56086,4 @@ export {
56086
56086
  shutdownFeedbackSubscriber,
56087
56087
  createEventBusBridge
56088
56088
  };
56089
- //# sourceMappingURL=chunk-MWTWTKZI.js.map
56089
+ //# sourceMappingURL=chunk-B7OYAWOE.js.map
@@ -0,0 +1,7 @@
1
+ // src/version.ts
2
+ var VERSION = true ? "8.15.2" : "dev";
3
+
4
+ export {
5
+ VERSION
6
+ };
7
+ //# sourceMappingURL=chunk-BSMWRMH2.js.map
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  VERSION
3
- } from "./chunk-DPPOV7OE.js";
3
+ } from "./chunk-BSMWRMH2.js";
4
4
  import {
5
5
  emitClawGuardViolation
6
6
  } from "./chunk-5X67Q3D2.js";
@@ -2246,4 +2246,4 @@ export {
2246
2246
  VOTING_THRESHOLDS,
2247
2247
  ConsensusMetricsSchema
2248
2248
  };
2249
- //# sourceMappingURL=chunk-XC2J6JRK.js.map
2249
+ //# sourceMappingURL=chunk-LZ65QEVJ.js.map
@@ -6,7 +6,7 @@ import {
6
6
  } from "./chunk-OQB3XC5O.js";
7
7
  import {
8
8
  VERSION
9
- } from "./chunk-DPPOV7OE.js";
9
+ } from "./chunk-BSMWRMH2.js";
10
10
  import {
11
11
  capitalize
12
12
  } from "./chunk-6T3EPABN.js";
@@ -1220,7 +1220,7 @@ async function runDoctorFix(result) {
1220
1220
  writeLine2("\u2500".repeat(40));
1221
1221
  let fixCount = 0;
1222
1222
  if (!result.dataDirectory.rootExists || result.dataDirectory.subdirectories.some((d) => !d.exists || !d.writable)) {
1223
- const { initDataDirectories: initDataDirectories2, describeDataDirFix: describeDataDirFix2 } = await import("./setup-data-dir-TKHEMIER.js");
1223
+ const { initDataDirectories: initDataDirectories2, describeDataDirFix: describeDataDirFix2 } = await import("./setup-data-dir-BUW4LREF.js");
1224
1224
  const outcome = describeDataDirFix2(initDataDirectories2());
1225
1225
  writeLine2(outcome.line);
1226
1226
  if (outcome.counted) fixCount++;
@@ -1322,4 +1322,4 @@ export {
1322
1322
  startStdioServer,
1323
1323
  closeServer
1324
1324
  };
1325
- //# sourceMappingURL=chunk-YIEYSK7C.js.map
1325
+ //# sourceMappingURL=chunk-P7E5EBZC.js.map
@@ -23,10 +23,10 @@ import {
23
23
  toolSuccessStructured,
24
24
  withProgressHeartbeat,
25
25
  wrapToolWithTimeout
26
- } from "./chunk-XC2J6JRK.js";
26
+ } from "./chunk-LZ65QEVJ.js";
27
27
  import {
28
28
  VERSION
29
- } from "./chunk-DPPOV7OE.js";
29
+ } from "./chunk-BSMWRMH2.js";
30
30
  import {
31
31
  assessPanelIndependence,
32
32
  countDistinctModels,
@@ -5331,8 +5331,8 @@ registerPersistentOutcomeStoreFactory(() => new PersistentOutcomeStore());
5331
5331
 
5332
5332
  // src/mcp/tools/consensus-vote-recording.ts
5333
5333
  var logger6 = createLogger({ tool: "consensus-vote" });
5334
- function recordVoteSuccess(proposal, strategy, outcome, duration, votes) {
5335
- const allSimulated = votes !== void 0 && votes.length > 0 && votes.every((v) => v.source === "simulation");
5334
+ function recordVoteSuccess(args) {
5335
+ const allSimulated = args.votes !== void 0 && args.votes.length > 0 && args.votes.every((v) => v.source === "simulation");
5336
5336
  if (allSimulated) {
5337
5337
  logger6.debug("Skipping memory + outcome recording \u2014 all votes simulated");
5338
5338
  return;
@@ -5340,26 +5340,34 @@ function recordVoteSuccess(proposal, strategy, outcome, duration, votes) {
5340
5340
  try {
5341
5341
  const memory = getToolMemory();
5342
5342
  memory.recordTask({
5343
- approach: `Consensus vote: ${strategy} on "${proposal.slice(0, 50)}"`,
5343
+ approach: `Consensus vote: ${args.strategy} on "${args.proposal.slice(0, 50)}"`,
5344
5344
  challenges: [],
5345
- durationMs: duration
5346
- });
5347
- memory.recordLearning({
5348
- pattern: `${strategy} vote \u2192 ${outcome}`,
5349
- context: `proposal="${proposal.slice(0, 40)}" duration=${String(duration)}ms`,
5350
- confidence: 0.8,
5351
- source: "consensus-vote"
5352
- });
5353
- void memory.runPromotionPipeline().catch((error) => {
5354
- logger6.warn("Promotion pipeline failed", { error });
5345
+ durationMs: args.durationMs
5355
5346
  });
5347
+ if (args.decision !== "no_quorum") {
5348
+ memory.recordLearning({
5349
+ pattern: `${args.strategy} vote \u2192 ${args.decision}`,
5350
+ context: `proposal="${args.proposal.slice(0, 40)}" duration=${String(args.durationMs)}ms`,
5351
+ confidence: learningConfidence(args.decision, args.approvalPercentage),
5352
+ source: "consensus-vote"
5353
+ });
5354
+ void memory.runPromotionPipeline().catch((error) => {
5355
+ logger6.warn("Promotion pipeline failed", { error });
5356
+ });
5357
+ }
5356
5358
  } catch (error) {
5357
5359
  logger6.warn("Failed to record vote success to memory", { error: getErrorMessage(error) });
5358
5360
  }
5359
- if (votes !== void 0) {
5360
- recordVoteOutcomes(votes);
5361
+ if (args.decision === "no_quorum") return;
5362
+ if (args.votes !== void 0) {
5363
+ recordVoteOutcomes(args.votes);
5361
5364
  }
5362
5365
  }
5366
+ function learningConfidence(decision, approvalPercentage) {
5367
+ if (approvalPercentage === void 0) return 0.8;
5368
+ const approvalConfidence = approvalPercentage / 100;
5369
+ return decision === "approved" ? approvalConfidence : 1 - approvalConfidence;
5370
+ }
5363
5371
  var VOTE_RECORD_STRATEGIES = /* @__PURE__ */ new Set([
5364
5372
  "simple_majority",
5365
5373
  "supermajority",
@@ -6464,9 +6472,13 @@ async function maybeEscalateContrarian(input, outcome, ctx, logger10, opts) {
6464
6472
  }
6465
6473
  async function executeVoting(input, logger10, opts) {
6466
6474
  const result = await executeVotingInner(input, logger10, opts ?? {});
6475
+ const correlationAlreadyRecorded = result.decision !== void 0;
6467
6476
  const errorCount = result.votes.filter((v) => v.source === "error").length;
6468
6477
  applyOptionGate(input, result);
6469
6478
  result.decision = resolveVoteDecision(input, result, errorCount).decision;
6479
+ if (!correlationAlreadyRecorded && (result.decision === "approved" || result.decision === "rejected")) {
6480
+ recordVotesToTracker(result.votes, result.decision, logger10);
6481
+ }
6470
6482
  return result;
6471
6483
  }
6472
6484
  function applyOptionGate(input, result) {
@@ -6530,7 +6542,6 @@ async function executeVotingInner(input, logger10, opts) {
6530
6542
  log: logger10
6531
6543
  }
6532
6544
  );
6533
- recordVotesToTracker(votes, outcome, logger10);
6534
6545
  const escalation = await maybeEscalateContrarian(
6535
6546
  input,
6536
6547
  outcome,
@@ -6623,7 +6634,6 @@ async function handleConsensusVote(deps, args, signal) {
6623
6634
  ...deps.gatewayAdapters !== void 0 && { gatewayAdapters: deps.gatewayAdapters },
6624
6635
  signal
6625
6636
  });
6626
- const strategy = args.strategy ?? "simple_majority";
6627
6637
  const errorVotes = result.votes.filter((v) => v.source === "error");
6628
6638
  if (errorVotes.length === result.votes.length && result.votes.length > 0) {
6629
6639
  const failures = errorVotes.map((v) => `${v.role}: ${v.error ?? "unknown error"}`).join("; ");
@@ -6634,16 +6644,20 @@ async function handleConsensusVote(deps, args, signal) {
6634
6644
  error: `All ${String(errorVotes.length)} voters failed. Failures: ${failures}`
6635
6645
  };
6636
6646
  }
6637
- recordVoteSuccess(
6638
- args.proposal,
6639
- strategy,
6640
- result.result.outcome,
6641
- result.totalTimeMs,
6642
- result.votes
6643
- );
6647
+ if (result.decision === void 0) {
6648
+ throw new Error("Consensus vote completed without a resolved decision");
6649
+ }
6650
+ recordVoteSuccess({
6651
+ proposal: args.proposal,
6652
+ strategy: result.strategy,
6653
+ decision: toRecordDecision(result.decision) ?? "no_quorum",
6654
+ durationMs: result.totalTimeMs,
6655
+ approvalPercentage: result.result.approvalPercentage,
6656
+ votes: result.votes
6657
+ });
6644
6658
  const { costSummary, voteRecord } = recordVoteSideEffects(
6645
6659
  args.proposal,
6646
- strategy,
6660
+ result.strategy,
6647
6661
  result,
6648
6662
  logger10,
6649
6663
  args.ratifies
@@ -6974,4 +6988,4 @@ export {
6974
6988
  CONSENSUS_VOTE_TOOL_SCHEMA,
6975
6989
  registerConsensusVoteTool
6976
6990
  };
6977
- //# sourceMappingURL=chunk-VA3SFFJJ.js.map
6991
+ //# sourceMappingURL=chunk-PYIVLWVO.js.map