nexus-agents 2.152.1 → 2.154.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.
- package/dist/{chunk-FQEYEH7X.js → chunk-25F6LRU2.js} +3 -3
- package/dist/{chunk-RBRUPCZL.js → chunk-6VYNHHII.js} +2 -2
- package/dist/{chunk-KZUJBQYH.js → chunk-KNVO4P4W.js} +163 -13
- package/dist/chunk-KNVO4P4W.js.map +1 -0
- package/dist/cli.d.ts +1 -1
- package/dist/cli.js +39 -13
- package/dist/cli.js.map +1 -1
- package/dist/{consensus-vote-types-B06ynHGk.d.ts → consensus-vote-types-BNBMB415.d.ts} +1 -1
- package/dist/index.d.ts +66 -5
- package/dist/index.js +9 -6
- package/dist/index.js.map +1 -1
- package/dist/{setup-command-FMQRL3YR.js → setup-command-OAJCXIMR.js} +3 -3
- package/package.json +1 -1
- package/dist/chunk-KZUJBQYH.js.map +0 -1
- /package/dist/{chunk-FQEYEH7X.js.map → chunk-25F6LRU2.js.map} +0 -0
- /package/dist/{chunk-RBRUPCZL.js.map → chunk-6VYNHHII.js.map} +0 -0
- /package/dist/{setup-command-FMQRL3YR.js.map → setup-command-OAJCXIMR.js.map} +0 -0
package/dist/cli.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import { C as CliNameLiteral,
|
|
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-
|
|
25
|
+
} from "./chunk-6VYNHHII.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-
|
|
145
|
+
} from "./chunk-KNVO4P4W.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-
|
|
173
|
+
} from "./chunk-25F6LRU2.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
|
|
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
|
|
25023
|
-
|
|
25024
|
-
|
|
25025
|
-
|
|
25026
|
-
|
|
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
|
}
|