nexus-agents 8.54.14 → 8.54.15
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-GOJL7V5S.js → chunk-2EIW5DWE.js} +2 -2
- package/dist/{chunk-UAHOUDJG.js → chunk-BD3Y6A5Q.js} +2 -2
- package/dist/{chunk-BOXTTA7E.js → chunk-NQ4ROOA3.js} +2 -2
- package/dist/{chunk-4I2LUNEB.js → chunk-RKQOM7EB.js} +102 -101
- package/dist/chunk-RKQOM7EB.js.map +1 -0
- package/dist/{chunk-VQ5WGLU6.js → chunk-V6BRGJGM.js} +7 -7
- package/dist/{chunk-Q2BG37YB.js → chunk-XCX6SI4A.js} +3 -3
- package/dist/cli.js +7 -7
- package/dist/{consensus-vote-37BQMIHS.js → consensus-vote-NUISIJFX.js} +4 -6
- package/dist/{improvement-review-555I4MGM.js → improvement-review-PU3ZH7SL.js} +4 -4
- package/dist/index.js +6 -6
- package/dist/{setup-data-dir-E2U6U7BT.js → setup-data-dir-ICAEBXQO.js} +3 -3
- package/package.json +1 -1
- package/dist/chunk-4I2LUNEB.js.map +0 -1
- /package/dist/{chunk-GOJL7V5S.js.map → chunk-2EIW5DWE.js.map} +0 -0
- /package/dist/{chunk-UAHOUDJG.js.map → chunk-BD3Y6A5Q.js.map} +0 -0
- /package/dist/{chunk-BOXTTA7E.js.map → chunk-NQ4ROOA3.js.map} +0 -0
- /package/dist/{chunk-VQ5WGLU6.js.map → chunk-V6BRGJGM.js.map} +0 -0
- /package/dist/{chunk-Q2BG37YB.js.map → chunk-XCX6SI4A.js.map} +0 -0
- /package/dist/{consensus-vote-37BQMIHS.js.map → consensus-vote-NUISIJFX.js.map} +0 -0
- /package/dist/{improvement-review-555I4MGM.js.map → improvement-review-PU3ZH7SL.js.map} +0 -0
- /package/dist/{setup-data-dir-E2U6U7BT.js.map → setup-data-dir-ICAEBXQO.js.map} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
VERSION
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-NQ4ROOA3.js";
|
|
4
4
|
import {
|
|
5
5
|
emitClawGuardViolation
|
|
6
6
|
} from "./chunk-MG7XTYJW.js";
|
|
@@ -2374,4 +2374,4 @@ export {
|
|
|
2374
2374
|
DEFAULT_CONSENSUS_CONFIG,
|
|
2375
2375
|
ConsensusMetricsSchema
|
|
2376
2376
|
};
|
|
2377
|
-
//# sourceMappingURL=chunk-
|
|
2377
|
+
//# sourceMappingURL=chunk-2EIW5DWE.js.map
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
toolStructuredError,
|
|
8
8
|
toolSuccessStructured,
|
|
9
9
|
wrapToolWithTimeout
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-2EIW5DWE.js";
|
|
11
11
|
import {
|
|
12
12
|
JsonlStore,
|
|
13
13
|
SECURITY_KEYWORDS,
|
|
@@ -2278,4 +2278,4 @@ export {
|
|
|
2278
2278
|
runImprovementReview,
|
|
2279
2279
|
registerImprovementReviewTool
|
|
2280
2280
|
};
|
|
2281
|
-
//# sourceMappingURL=chunk-
|
|
2281
|
+
//# sourceMappingURL=chunk-BD3Y6A5Q.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// src/version.ts
|
|
2
2
|
import semver from "semver";
|
|
3
|
-
var VERSION = true ? "8.54.
|
|
3
|
+
var VERSION = true ? "8.54.15" : "dev";
|
|
4
4
|
var NODE_ENGINE_RANGE = ">=22.5.0";
|
|
5
5
|
function isNodeVersionSupported(version) {
|
|
6
6
|
return semver.satisfies(version, NODE_ENGINE_RANGE);
|
|
@@ -11,4 +11,4 @@ export {
|
|
|
11
11
|
NODE_ENGINE_RANGE,
|
|
12
12
|
isNodeVersionSupported
|
|
13
13
|
};
|
|
14
|
-
//# sourceMappingURL=chunk-
|
|
14
|
+
//# sourceMappingURL=chunk-NQ4ROOA3.js.map
|
|
@@ -25,10 +25,10 @@ import {
|
|
|
25
25
|
toolSuccessStructured,
|
|
26
26
|
withProgressHeartbeat,
|
|
27
27
|
wrapToolWithTimeout
|
|
28
|
-
} from "./chunk-
|
|
28
|
+
} from "./chunk-2EIW5DWE.js";
|
|
29
29
|
import {
|
|
30
30
|
VERSION
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-NQ4ROOA3.js";
|
|
32
32
|
import {
|
|
33
33
|
UNRESOLVED_MODEL_ID,
|
|
34
34
|
assessPanelIndependence,
|
|
@@ -92,18 +92,6 @@ import {
|
|
|
92
92
|
// src/mcp/tools/consensus-vote.ts
|
|
93
93
|
import { z as z12 } from "zod";
|
|
94
94
|
|
|
95
|
-
// src/utils/bounded-artifact.ts
|
|
96
|
-
function boundArtifactForReview(text, budget, label) {
|
|
97
|
-
if (text.length <= budget) {
|
|
98
|
-
return { text, note: "", bound: void 0 };
|
|
99
|
-
}
|
|
100
|
-
return {
|
|
101
|
-
text: text.slice(0, budget),
|
|
102
|
-
note: `> NOTE: partial view \u2014 you are seeing the first ${String(budget)} of ${String(text.length)} characters of the ${label}. Judge only what is shown, and treat insufficient visibility as itself a reason to raise a concern.`,
|
|
103
|
-
bound: { reviewedChars: budget, totalChars: text.length, partial: true }
|
|
104
|
-
};
|
|
105
|
-
}
|
|
106
|
-
|
|
107
95
|
// src/cli/voter-roles.ts
|
|
108
96
|
var VOTER_ROLES = {
|
|
109
97
|
architect: "Software Architect - evaluates technical design, scalability, and maintainability",
|
|
@@ -5573,6 +5561,104 @@ function applyErrorPolicy(votes, policy) {
|
|
|
5573
5561
|
};
|
|
5574
5562
|
}
|
|
5575
5563
|
|
|
5564
|
+
// src/utils/bounded-artifact.ts
|
|
5565
|
+
function boundArtifactForReview(text, budget, label) {
|
|
5566
|
+
if (text.length <= budget) {
|
|
5567
|
+
return { text, note: "", bound: void 0 };
|
|
5568
|
+
}
|
|
5569
|
+
return {
|
|
5570
|
+
text: text.slice(0, budget),
|
|
5571
|
+
note: `> NOTE: partial view \u2014 you are seeing the first ${String(budget)} of ${String(text.length)} characters of the ${label}. Judge only what is shown, and treat insufficient visibility as itself a reason to raise a concern.`,
|
|
5572
|
+
bound: { reviewedChars: budget, totalChars: text.length, partial: true }
|
|
5573
|
+
};
|
|
5574
|
+
}
|
|
5575
|
+
|
|
5576
|
+
// src/mcp/tools/consensus-vote-contrarian.ts
|
|
5577
|
+
var CONTRARIAN_ESCALATION_THRESHOLD = 0.8;
|
|
5578
|
+
var CONTRARIAN_PROPOSAL_BUDGET = 2e3;
|
|
5579
|
+
function buildContrarianPrompt(bounded) {
|
|
5580
|
+
return [
|
|
5581
|
+
"You are a contrarian analyst. Your job is to find reasons this proposal should be REJECTED.",
|
|
5582
|
+
"Look for: YAGNI (not needed), MISALIGNED (wrong tech/architecture), SECURITY_RISK, SCOPE_CREEP.",
|
|
5583
|
+
"",
|
|
5584
|
+
...bounded.note === "" ? [] : [bounded.note, ""],
|
|
5585
|
+
`Proposal: ${bounded.text}`,
|
|
5586
|
+
"",
|
|
5587
|
+
"If you find a strong reason to reject, respond with JSON:",
|
|
5588
|
+
'{"decision":"reject","confidence":0.0-1.0,"reasoning":"your concern"}',
|
|
5589
|
+
"If the proposal is sound, respond with:",
|
|
5590
|
+
'{"decision":"approve","confidence":0.0-1.0,"reasoning":"why it is acceptable"}'
|
|
5591
|
+
].join("\n");
|
|
5592
|
+
}
|
|
5593
|
+
function logPartialProposal(bounded, log) {
|
|
5594
|
+
if (bounded.bound === void 0) return;
|
|
5595
|
+
log.info("Contrarian sees a partial proposal", {
|
|
5596
|
+
reviewedChars: bounded.bound.reviewedChars,
|
|
5597
|
+
totalChars: bounded.bound.totalChars
|
|
5598
|
+
});
|
|
5599
|
+
}
|
|
5600
|
+
async function runContrarianCheck(proposal, log) {
|
|
5601
|
+
try {
|
|
5602
|
+
const { executeExpert } = await import("./expert-bridge-3O73XHYM.js");
|
|
5603
|
+
const bounded = boundArtifactForReview(proposal, CONTRARIAN_PROPOSAL_BUDGET, "proposal");
|
|
5604
|
+
logPartialProposal(bounded, log);
|
|
5605
|
+
const result = await executeExpert("architecture", buildContrarianPrompt(bounded));
|
|
5606
|
+
if (!result.success) return { shouldEscalate: false, reason: "", confidence: 0, errored: true };
|
|
5607
|
+
const jsonMatch = result.text.match(/\{[\s\S]*\}/);
|
|
5608
|
+
if (jsonMatch === null)
|
|
5609
|
+
return { shouldEscalate: false, reason: "", confidence: 0, errored: false };
|
|
5610
|
+
const parsed = JSON.parse(jsonMatch[0]);
|
|
5611
|
+
const isRejection = parsed.decision === "reject";
|
|
5612
|
+
const confidence = typeof parsed.confidence === "number" ? parsed.confidence : 0;
|
|
5613
|
+
const reasoning = typeof parsed.reasoning === "string" ? parsed.reasoning : "";
|
|
5614
|
+
if (isRejection && confidence >= CONTRARIAN_ESCALATION_THRESHOLD) {
|
|
5615
|
+
log.info("Contrarian rejected with high confidence", {
|
|
5616
|
+
confidence,
|
|
5617
|
+
reasoning: reasoning.slice(0, 200)
|
|
5618
|
+
});
|
|
5619
|
+
return { shouldEscalate: true, reason: reasoning, confidence, errored: false };
|
|
5620
|
+
}
|
|
5621
|
+
return { shouldEscalate: false, reason: "", confidence, errored: false };
|
|
5622
|
+
} catch (error) {
|
|
5623
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
5624
|
+
log.warn("Contrarian check failed; defaulting to no escalation", { error: message });
|
|
5625
|
+
return { shouldEscalate: false, reason: "", confidence: 0, errored: true };
|
|
5626
|
+
}
|
|
5627
|
+
}
|
|
5628
|
+
async function maybeEscalateContrarian(input, outcome, ctx, logger11, opts) {
|
|
5629
|
+
if (!input.quickMode || outcome !== "approved" || input.simulateVotes) {
|
|
5630
|
+
return { contrarianCheck: "skipped" };
|
|
5631
|
+
}
|
|
5632
|
+
if (shouldEscalateLowPosterior(ctx.strategy, outcome, input.quickMode, ctx.posteriorApproval)) {
|
|
5633
|
+
logger11.warn("Posterior-confidence escalation: re-running with full vote (#3174)", {
|
|
5634
|
+
strategy: ctx.strategy,
|
|
5635
|
+
posteriorApproval: ctx.posteriorApproval
|
|
5636
|
+
});
|
|
5637
|
+
return {
|
|
5638
|
+
escalated: await ctx.revote({ ...input, quickMode: false }, logger11, opts),
|
|
5639
|
+
contrarianCheck: "skipped"
|
|
5640
|
+
};
|
|
5641
|
+
}
|
|
5642
|
+
const escalation = await runContrarianCheck(input.proposal, logger11);
|
|
5643
|
+
const contrarianCheck = escalation.errored ? "errored" : "ok";
|
|
5644
|
+
if (escalation.errored && input.errorPolicy === "absolute_quorum") {
|
|
5645
|
+
logger11.warn("Contrarian check errored under absolute_quorum \u2014 degrading to no_quorum (#4132)");
|
|
5646
|
+
return {
|
|
5647
|
+
degradeReason: "no_quorum: re-run \u2014 contrarian check errored (absolute_quorum quick-mode)",
|
|
5648
|
+
contrarianCheck
|
|
5649
|
+
};
|
|
5650
|
+
}
|
|
5651
|
+
if (!escalation.shouldEscalate) return { contrarianCheck };
|
|
5652
|
+
logger11.warn("Contrarian escalation: re-running with full vote", {
|
|
5653
|
+
reason: escalation.reason,
|
|
5654
|
+
confidence: escalation.confidence
|
|
5655
|
+
});
|
|
5656
|
+
return {
|
|
5657
|
+
escalated: await ctx.revote({ ...input, quickMode: false }, logger11, opts),
|
|
5658
|
+
contrarianCheck
|
|
5659
|
+
};
|
|
5660
|
+
}
|
|
5661
|
+
|
|
5576
5662
|
// src/audit/vote-record-store.ts
|
|
5577
5663
|
import { appendFileSync as appendFileSync2, existsSync as existsSync2, mkdirSync as mkdirSync2, readFileSync as readFileSync3 } from "node:fs";
|
|
5578
5664
|
import { dirname as dirname2, isAbsolute as isAbsolute2, relative, resolve as resolve3, sep } from "node:path";
|
|
@@ -7831,57 +7917,6 @@ async function processVotesWithCascade(engineVotes, opts) {
|
|
|
7831
7917
|
const outcome = engineResult.outcome === "approved" ? "approved" : "rejected";
|
|
7832
7918
|
return { engineResult, voteMap, higherOrderResult, outcome, cascaded: cascadeInfo.decided };
|
|
7833
7919
|
}
|
|
7834
|
-
var CONTRARIAN_ESCALATION_THRESHOLD = 0.8;
|
|
7835
|
-
var CONTRARIAN_PROPOSAL_BUDGET = 2e3;
|
|
7836
|
-
function buildContrarianPrompt(bounded) {
|
|
7837
|
-
return [
|
|
7838
|
-
"You are a contrarian analyst. Your job is to find reasons this proposal should be REJECTED.",
|
|
7839
|
-
"Look for: YAGNI (not needed), MISALIGNED (wrong tech/architecture), SECURITY_RISK, SCOPE_CREEP.",
|
|
7840
|
-
"",
|
|
7841
|
-
...bounded.note === "" ? [] : [bounded.note, ""],
|
|
7842
|
-
`Proposal: ${bounded.text}`,
|
|
7843
|
-
"",
|
|
7844
|
-
"If you find a strong reason to reject, respond with JSON:",
|
|
7845
|
-
'{"decision":"reject","confidence":0.0-1.0,"reasoning":"your concern"}',
|
|
7846
|
-
"If the proposal is sound, respond with:",
|
|
7847
|
-
'{"decision":"approve","confidence":0.0-1.0,"reasoning":"why it is acceptable"}'
|
|
7848
|
-
].join("\n");
|
|
7849
|
-
}
|
|
7850
|
-
function logPartialProposal(bounded, log) {
|
|
7851
|
-
if (bounded.bound === void 0) return;
|
|
7852
|
-
log.info("Contrarian sees a partial proposal", {
|
|
7853
|
-
reviewedChars: bounded.bound.reviewedChars,
|
|
7854
|
-
totalChars: bounded.bound.totalChars
|
|
7855
|
-
});
|
|
7856
|
-
}
|
|
7857
|
-
async function runContrarianCheck(proposal, log) {
|
|
7858
|
-
try {
|
|
7859
|
-
const { executeExpert } = await import("./expert-bridge-3O73XHYM.js");
|
|
7860
|
-
const bounded = boundArtifactForReview(proposal, CONTRARIAN_PROPOSAL_BUDGET, "proposal");
|
|
7861
|
-
logPartialProposal(bounded, log);
|
|
7862
|
-
const result = await executeExpert("architecture", buildContrarianPrompt(bounded));
|
|
7863
|
-
if (!result.success) return { shouldEscalate: false, reason: "", confidence: 0, errored: true };
|
|
7864
|
-
const jsonMatch = result.text.match(/\{[\s\S]*\}/);
|
|
7865
|
-
if (jsonMatch === null)
|
|
7866
|
-
return { shouldEscalate: false, reason: "", confidence: 0, errored: false };
|
|
7867
|
-
const parsed = JSON.parse(jsonMatch[0]);
|
|
7868
|
-
const isRejection = parsed.decision === "reject";
|
|
7869
|
-
const confidence = typeof parsed.confidence === "number" ? parsed.confidence : 0;
|
|
7870
|
-
const reasoning = typeof parsed.reasoning === "string" ? parsed.reasoning : "";
|
|
7871
|
-
if (isRejection && confidence >= CONTRARIAN_ESCALATION_THRESHOLD) {
|
|
7872
|
-
log.info("Contrarian rejected with high confidence", {
|
|
7873
|
-
confidence,
|
|
7874
|
-
reasoning: reasoning.slice(0, 200)
|
|
7875
|
-
});
|
|
7876
|
-
return { shouldEscalate: true, reason: reasoning, confidence, errored: false };
|
|
7877
|
-
}
|
|
7878
|
-
return { shouldEscalate: false, reason: "", confidence, errored: false };
|
|
7879
|
-
} catch (error) {
|
|
7880
|
-
const message = error instanceof Error ? error.message : String(error);
|
|
7881
|
-
log.warn("Contrarian check failed; defaulting to no escalation", { error: message });
|
|
7882
|
-
return { shouldEscalate: false, reason: "", confidence: 0, errored: true };
|
|
7883
|
-
}
|
|
7884
|
-
}
|
|
7885
7920
|
function buildPolicyShortCircuitResult(args) {
|
|
7886
7921
|
args.logger.warn("Consensus vote short-circuited by error policy", {
|
|
7887
7922
|
errorPolicy: args.errorPolicy,
|
|
@@ -7908,39 +7943,6 @@ function buildPolicyShortCircuitResult(args) {
|
|
|
7908
7943
|
policyReason: args.reason
|
|
7909
7944
|
};
|
|
7910
7945
|
}
|
|
7911
|
-
async function maybeEscalateContrarian(input, outcome, ctx, logger11, opts) {
|
|
7912
|
-
if (!input.quickMode || outcome !== "approved" || input.simulateVotes) {
|
|
7913
|
-
return { contrarianCheck: "skipped" };
|
|
7914
|
-
}
|
|
7915
|
-
if (shouldEscalateLowPosterior(ctx.strategy, outcome, input.quickMode, ctx.posteriorApproval)) {
|
|
7916
|
-
logger11.warn("Posterior-confidence escalation: re-running with full vote (#3174)", {
|
|
7917
|
-
strategy: ctx.strategy,
|
|
7918
|
-
posteriorApproval: ctx.posteriorApproval
|
|
7919
|
-
});
|
|
7920
|
-
return {
|
|
7921
|
-
escalated: await executeVoting({ ...input, quickMode: false }, logger11, opts),
|
|
7922
|
-
contrarianCheck: "skipped"
|
|
7923
|
-
};
|
|
7924
|
-
}
|
|
7925
|
-
const escalation = await runContrarianCheck(input.proposal, logger11);
|
|
7926
|
-
const contrarianCheck = escalation.errored ? "errored" : "ok";
|
|
7927
|
-
if (escalation.errored && input.errorPolicy === "absolute_quorum") {
|
|
7928
|
-
logger11.warn("Contrarian check errored under absolute_quorum \u2014 degrading to no_quorum (#4132)");
|
|
7929
|
-
return {
|
|
7930
|
-
degradeReason: "no_quorum: re-run \u2014 contrarian check errored (absolute_quorum quick-mode)",
|
|
7931
|
-
contrarianCheck
|
|
7932
|
-
};
|
|
7933
|
-
}
|
|
7934
|
-
if (!escalation.shouldEscalate) return { contrarianCheck };
|
|
7935
|
-
logger11.warn("Contrarian escalation: re-running with full vote", {
|
|
7936
|
-
reason: escalation.reason,
|
|
7937
|
-
confidence: escalation.confidence
|
|
7938
|
-
});
|
|
7939
|
-
return {
|
|
7940
|
-
escalated: await executeVoting({ ...input, quickMode: false }, logger11, opts),
|
|
7941
|
-
contrarianCheck
|
|
7942
|
-
};
|
|
7943
|
-
}
|
|
7944
7946
|
async function executeVoting(input, logger11, opts) {
|
|
7945
7947
|
const project = opts?.project ?? resolveAndLogVoterProject(input.project, logger11);
|
|
7946
7948
|
const result = await executeVotingInner(input, logger11, { ...opts, project });
|
|
@@ -8020,7 +8022,7 @@ async function executeVotingInner(input, logger11, opts) {
|
|
|
8020
8022
|
const escalation = await maybeEscalateContrarian(
|
|
8021
8023
|
input,
|
|
8022
8024
|
outcome,
|
|
8023
|
-
{ strategy, posteriorApproval: higherOrderResult?.posteriorApproval },
|
|
8025
|
+
{ strategy, posteriorApproval: higherOrderResult?.posteriorApproval, revote: executeVoting },
|
|
8024
8026
|
logger11,
|
|
8025
8027
|
opts
|
|
8026
8028
|
);
|
|
@@ -8504,7 +8506,6 @@ export {
|
|
|
8504
8506
|
simulationDeniedResult,
|
|
8505
8507
|
resetCorrelationTracker,
|
|
8506
8508
|
createPolicyFailedResult,
|
|
8507
|
-
maybeEscalateContrarian,
|
|
8508
8509
|
executeVoting,
|
|
8509
8510
|
applyOptionGate,
|
|
8510
8511
|
runConsensusForGoal,
|
|
@@ -8513,4 +8514,4 @@ export {
|
|
|
8513
8514
|
CONSENSUS_VOTE_TOOL_SCHEMA,
|
|
8514
8515
|
registerConsensusVoteTool
|
|
8515
8516
|
};
|
|
8516
|
-
//# sourceMappingURL=chunk-
|
|
8517
|
+
//# sourceMappingURL=chunk-RKQOM7EB.js.map
|