nexus-agents 2.152.1 → 2.153.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.
@@ -18,7 +18,7 @@ import {
18
18
  DEFAULT_TASK_TTL_MS,
19
19
  DEFAULT_TOOL_RATE_LIMITS,
20
20
  clampTaskTtl
21
- } from "./chunk-FQEYEH7X.js";
21
+ } from "./chunk-EJXJNWV6.js";
22
22
  import {
23
23
  executeExpert
24
24
  } from "./chunk-JYHSZDKL.js";
@@ -51296,4 +51296,4 @@ export {
51296
51296
  shutdownFeedbackSubscriber,
51297
51297
  createEventBusBridge
51298
51298
  };
51299
- //# sourceMappingURL=chunk-KZUJBQYH.js.map
51299
+ //# sourceMappingURL=chunk-C6S6L5WB.js.map
@@ -42,7 +42,7 @@ import {
42
42
  } from "./chunk-DHVMSIT5.js";
43
43
 
44
44
  // src/version.ts
45
- var VERSION = true ? "2.152.1" : "dev";
45
+ var VERSION = true ? "2.153.0" : "dev";
46
46
 
47
47
  // src/config/schemas-core.ts
48
48
  import { z } from "zod";
@@ -2132,7 +2132,7 @@ async function runDoctorFix(result) {
2132
2132
  writeLine2("\u2500".repeat(40));
2133
2133
  let fixCount = 0;
2134
2134
  if (!result.dataDirectory.rootExists || result.dataDirectory.subdirectories.some((d) => !d.exists || !d.writable)) {
2135
- const { runSetup } = await import("./setup-command-FMQRL3YR.js");
2135
+ const { runSetup } = await import("./setup-command-4WFSYJK2.js");
2136
2136
  const setupResult = runSetup({
2137
2137
  skipMcp: true,
2138
2138
  skipRules: true,
@@ -2245,4 +2245,4 @@ export {
2245
2245
  startStdioServer,
2246
2246
  closeServer
2247
2247
  };
2248
- //# sourceMappingURL=chunk-FQEYEH7X.js.map
2248
+ //# sourceMappingURL=chunk-EJXJNWV6.js.map
@@ -8,7 +8,7 @@ import {
8
8
  checkSqlite,
9
9
  defaultConfig,
10
10
  initDataDirectories
11
- } from "./chunk-FQEYEH7X.js";
11
+ } from "./chunk-EJXJNWV6.js";
12
12
  import {
13
13
  BUILT_IN_EXPERTS
14
14
  } from "./chunk-ZM4O442V.js";
@@ -2000,4 +2000,4 @@ export {
2000
2000
  setupCommand,
2001
2001
  setupCommandAsync
2002
2002
  };
2003
- //# sourceMappingURL=chunk-RBRUPCZL.js.map
2003
+ //# sourceMappingURL=chunk-HTXQVLOI.js.map
package/dist/cli.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { C as CliNameLiteral, J as VoteThreshold, K as ErrorPolicy, N as NoQuorumPolicy } from './consensus-vote-types-B06ynHGk.js';
2
+ import { C as CliNameLiteral, K as VoteThreshold, E as ErrorPolicy, N as NoQuorumPolicy } from './consensus-vote-types-BNBMB415.js';
3
3
  import 'zod';
4
4
 
5
5
  /**
package/dist/cli.js CHANGED
@@ -22,7 +22,7 @@ import "./chunk-M4YN3U3P.js";
22
22
  import {
23
23
  setupCommandAsync,
24
24
  verifyCommand
25
- } from "./chunk-RBRUPCZL.js";
25
+ } from "./chunk-HTXQVLOI.js";
26
26
  import "./chunk-CD7FU55Z.js";
27
27
  import {
28
28
  AuthHandler,
@@ -142,7 +142,7 @@ import {
142
142
  validateCommand,
143
143
  validateWorkflow,
144
144
  wrapInMarkdownFence
145
- } from "./chunk-KZUJBQYH.js";
145
+ } from "./chunk-C6S6L5WB.js";
146
146
  import "./chunk-CMAQI2SJ.js";
147
147
  import "./chunk-T2SGTVB4.js";
148
148
  import "./chunk-HFOQKCD2.js";
@@ -170,7 +170,7 @@ import {
170
170
  loadConfig,
171
171
  runDoctor,
172
172
  validateNexusEnv
173
- } from "./chunk-FQEYEH7X.js";
173
+ } from "./chunk-EJXJNWV6.js";
174
174
  import "./chunk-GMQH2I4P.js";
175
175
  import {
176
176
  shutdownExpertBridge
@@ -23572,19 +23572,33 @@ function buildVoteInput(proposal, algorithm) {
23572
23572
  return ConsensusVoteInputSchema.parse({
23573
23573
  proposal,
23574
23574
  strategy: algorithm,
23575
- simulateVotes: false
23575
+ simulateVotes: false,
23576
23576
  // never gate auto-remediation on simulated votes
23577
+ errorPolicy: "absolute_quorum"
23578
+ // #4138: an errored voice → no_quorum, never a flipped verdict
23577
23579
  });
23578
23580
  }
23579
23581
  function makeDefaultRunner(logger19) {
23580
23582
  return async (proposal, algorithm) => {
23581
- const { result } = await executeVoting(buildVoteInput(proposal, algorithm), logger19);
23583
+ const voting = await executeVoting(buildVoteInput(proposal, algorithm), logger19);
23582
23584
  return {
23583
- approved: result.outcome === "approved",
23584
- approvalPercentage: result.approvalPercentage
23585
+ approved: voting.result.outcome === "approved",
23586
+ approvalPercentage: voting.result.approvalPercentage,
23587
+ // #4138: carry the #4135-stamped response-layer decision (incl. no_quorum) so
23588
+ // the gate honors an absolute_quorum void instead of collapsing it to reject.
23589
+ // Conditional spread keeps `decision` absent (not `undefined`) under
23590
+ // exactOptionalPropertyTypes when executeVoting left it unstamped.
23591
+ ...voting.decision !== void 0 ? { decision: voting.decision } : {}
23585
23592
  };
23586
23593
  };
23587
23594
  }
23595
+ async function retryOnNoQuorum(runVote2, maxRetries) {
23596
+ let verdict = await runVote2();
23597
+ for (let attempt = 0; attempt < maxRetries && verdict.decision === "no_quorum"; attempt++) {
23598
+ verdict = await runVote2();
23599
+ }
23600
+ return verdict;
23601
+ }
23588
23602
  function makeVoteAdapter(runner, logger19 = createLogger({ tool: "auto-remediation-vote" })) {
23589
23603
  const run = runner ?? makeDefaultRunner(logger19);
23590
23604
  return (input) => run(input.proposal, input.algorithm);
@@ -24910,6 +24924,7 @@ function planTouchesProtectedPath(plan) {
24910
24924
  }
24911
24925
 
24912
24926
  // src/mcp/tools/improvement-remediation-enforce.ts
24927
+ var AUTO_REMEDIATION_NO_QUORUM_RETRIES = 1;
24913
24928
  var AUTO_REMEDIATE_ENV = "NEXUS_AUTO_REMEDIATE";
24914
24929
  var AUTO_REMEDIATE_LEASE_KEY = "auto-remediation";
24915
24930
  function resolveAutoRemediateMode(raw) {
@@ -25013,18 +25028,29 @@ function admitSignal(signal, guard, now) {
25013
25028
  if (!decision.allowed) return { admit: false, reason: `runaway guard: ${decision.detail}` };
25014
25029
  return { admit: true, priority, requirement };
25015
25030
  }
25031
+ function voteVerdictLabel(v) {
25032
+ if (v.decision === "no_quorum") return "no_quorum";
25033
+ return v.approved ? "approved" : "rejected";
25034
+ }
25016
25035
  async function consensusGate(signal, plan, requirement, ledger, deps) {
25017
25036
  const algorithm = requirement.algorithm;
25018
25037
  if (algorithm === void 0) return "no consensus algorithm for tier";
25019
25038
  const proposal = `Auto-remediation for '${signal.signalKey}'.
25020
25039
 
25021
25040
  ${renderPlanAsResearch(plan)}`;
25022
- const vote = await deps.vote({ proposal, algorithm });
25023
- deps.audit({
25024
- step: "vote",
25025
- signalKey: signal.signalKey,
25026
- detail: `${algorithm}: ${vote.approved ? "approved" : "rejected"} (${String(Math.round(vote.approvalPercentage))}%)`
25027
- });
25041
+ const runVote2 = async () => {
25042
+ const v = await deps.vote({ proposal, algorithm });
25043
+ deps.audit({
25044
+ step: "vote",
25045
+ signalKey: signal.signalKey,
25046
+ detail: `${algorithm}: ${voteVerdictLabel(v)} (${String(Math.round(v.approvalPercentage))}%)`
25047
+ });
25048
+ return v;
25049
+ };
25050
+ const vote = await retryOnNoQuorum(runVote2, AUTO_REMEDIATION_NO_QUORUM_RETRIES);
25051
+ if (vote.decision === "no_quorum") {
25052
+ return `consensus no_quorum \u2014 quorum not reached after ${String(AUTO_REMEDIATION_NO_QUORUM_RETRIES)} re-run(s); left as an issue`;
25053
+ }
25028
25054
  if (!vote.approved) {
25029
25055
  return `consensus ${algorithm} not reached (${String(Math.round(vote.approvalPercentage))}%) \u2014 left as an issue`;
25030
25056
  }