nexus-agents 4.3.0 → 4.3.1
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-D32WYARF.js → chunk-L7Z7ZLM5.js} +2 -2
- package/dist/{chunk-OHRCTQDC.js → chunk-LSQ6TVSS.js} +4 -4
- package/dist/{chunk-4WU3BGGK.js → chunk-LWB4RR47.js} +7 -71
- package/dist/chunk-LWB4RR47.js.map +1 -0
- package/dist/{chunk-D3BKW23W.js → chunk-UZUECKIV.js} +3 -3
- package/dist/cli.js +4 -4
- package/dist/{consensus-vote-ZRLZYJ4D.js → consensus-vote-3IHQNBNY.js} +2 -2
- package/dist/index.js +4 -4
- package/dist/{setup-command-775JEHPJ.js → setup-command-H4XOEBF5.js} +3 -3
- package/package.json +1 -1
- package/dist/chunk-4WU3BGGK.js.map +0 -1
- /package/dist/{chunk-D32WYARF.js.map → chunk-L7Z7ZLM5.js.map} +0 -0
- /package/dist/{chunk-OHRCTQDC.js.map → chunk-LSQ6TVSS.js.map} +0 -0
- /package/dist/{chunk-D3BKW23W.js.map → chunk-UZUECKIV.js.map} +0 -0
- /package/dist/{consensus-vote-ZRLZYJ4D.js.map → consensus-vote-3IHQNBNY.js.map} +0 -0
- /package/dist/{setup-command-775JEHPJ.js.map → setup-command-H4XOEBF5.js.map} +0 -0
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
checkSqlite,
|
|
9
9
|
defaultConfig,
|
|
10
10
|
initDataDirectories
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-UZUECKIV.js";
|
|
12
12
|
import {
|
|
13
13
|
BUILT_IN_EXPERTS
|
|
14
14
|
} from "./chunk-YPNQPT2F.js";
|
|
@@ -2001,4 +2001,4 @@ export {
|
|
|
2001
2001
|
setupCommand,
|
|
2002
2002
|
setupCommandAsync
|
|
2003
2003
|
};
|
|
2004
|
-
//# sourceMappingURL=chunk-
|
|
2004
|
+
//# sourceMappingURL=chunk-L7Z7ZLM5.js.map
|
|
@@ -22,7 +22,7 @@ import {
|
|
|
22
22
|
DEFAULT_TASK_TTL_MS,
|
|
23
23
|
DEFAULT_TOOL_RATE_LIMITS,
|
|
24
24
|
clampTaskTtl
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-UZUECKIV.js";
|
|
26
26
|
import {
|
|
27
27
|
executeExpert
|
|
28
28
|
} from "./chunk-OYNZ6FCZ.js";
|
|
@@ -46,7 +46,7 @@ import {
|
|
|
46
46
|
simulationDeniedResult,
|
|
47
47
|
toJobSummary,
|
|
48
48
|
writeJobCancelled
|
|
49
|
-
} from "./chunk-
|
|
49
|
+
} from "./chunk-LWB4RR47.js";
|
|
50
50
|
import {
|
|
51
51
|
allOf
|
|
52
52
|
} from "./chunk-OQB3XC5O.js";
|
|
@@ -45931,7 +45931,7 @@ ${contextBlock}`;
|
|
|
45931
45931
|
const strategy = config.votingStrategy ?? "higher_order";
|
|
45932
45932
|
await postProgress(config, "Vote", `Running consensus with ${strategy} strategy...`);
|
|
45933
45933
|
try {
|
|
45934
|
-
const { executeVoting } = await import("./consensus-vote-
|
|
45934
|
+
const { executeVoting } = await import("./consensus-vote-3IHQNBNY.js");
|
|
45935
45935
|
const votingResult = await executeVoting(
|
|
45936
45936
|
{
|
|
45937
45937
|
proposal: buildVoteProposal(plan, research),
|
|
@@ -54497,4 +54497,4 @@ export {
|
|
|
54497
54497
|
shutdownFeedbackSubscriber,
|
|
54498
54498
|
createEventBusBridge
|
|
54499
54499
|
};
|
|
54500
|
-
//# sourceMappingURL=chunk-
|
|
54500
|
+
//# sourceMappingURL=chunk-LSQ6TVSS.js.map
|
|
@@ -2657,8 +2657,6 @@ function createConsensusEngine(config, logger10) {
|
|
|
2657
2657
|
}
|
|
2658
2658
|
|
|
2659
2659
|
// src/consensus/quorum-validator.ts
|
|
2660
|
-
var DEFAULT_MIN_TRUST = 0.3;
|
|
2661
|
-
var DEFAULT_MIN_WEIGHT = 0.1;
|
|
2662
2660
|
var QuorumValidator = class {
|
|
2663
2661
|
logger;
|
|
2664
2662
|
constructor(logger10) {
|
|
@@ -2676,15 +2674,9 @@ var QuorumValidator = class {
|
|
|
2676
2674
|
return this.buildReachedResult(breakdown);
|
|
2677
2675
|
}
|
|
2678
2676
|
getQuorumBreakdown(input) {
|
|
2679
|
-
const { votes, agentWeights, config,
|
|
2677
|
+
const { votes, agentWeights, config, requiredParticipants } = input;
|
|
2680
2678
|
const voteCounts = this.countVotes(votes);
|
|
2681
|
-
const
|
|
2682
|
-
const { totalWeight, weightedCounts } = this.calculateWeights(
|
|
2683
|
-
votes,
|
|
2684
|
-
agentWeights,
|
|
2685
|
-
agentRecords,
|
|
2686
|
-
config
|
|
2687
|
-
);
|
|
2679
|
+
const { totalWeight, weightedCounts } = this.calculateWeights(votes, agentWeights, config);
|
|
2688
2680
|
const { threshold, actualQuorum, quorumReached, reasoning } = this.calculateQuorumStatus(
|
|
2689
2681
|
voteCounts,
|
|
2690
2682
|
weightedCounts,
|
|
@@ -2700,54 +2692,9 @@ var QuorumValidator = class {
|
|
|
2700
2692
|
threshold,
|
|
2701
2693
|
actualQuorum,
|
|
2702
2694
|
quorumReached,
|
|
2703
|
-
eligibleAgents,
|
|
2704
2695
|
reasoning
|
|
2705
2696
|
};
|
|
2706
2697
|
}
|
|
2707
|
-
/**
|
|
2708
|
-
* Decides whether an agent's vote counts, and with what weight.
|
|
2709
|
-
*
|
|
2710
|
-
* WIRING (#4666): this works and is tested, but **nothing in production can
|
|
2711
|
-
* reach an exclusion**. The three exclusion branches all require an
|
|
2712
|
-
* `AgentRecord`, and `getQuorumBreakdown`'s only production caller
|
|
2713
|
-
* (`voting-protocol-helpers`) passes `{ votes, config }` with no
|
|
2714
|
-
* `agentRecords` — `grep -rn agentRecords src --include=*.ts`, excluding
|
|
2715
|
-
* tests and this file, returns nothing. With no record the method returns
|
|
2716
|
-
* `{ eligible: true, weight: 1.0 }` on the first line.
|
|
2717
|
-
*
|
|
2718
|
-
* `enableByzantineDetection` additionally has zero writers anywhere in
|
|
2719
|
-
* `src/`: only this read and its declaration.
|
|
2720
|
-
*
|
|
2721
|
-
* So `eligibleAgents` is every voter, always. Do NOT read a full eligible
|
|
2722
|
-
* list as evidence that trust or Byzantine screening ran — nothing screened.
|
|
2723
|
-
* Wiring it needs a producer for `AgentRecord` (trust scores, Byzantine
|
|
2724
|
-
* flags), which the engine does not currently maintain.
|
|
2725
|
-
*
|
|
2726
|
-
* Kept rather than deleted: the behaviour is correct and covered by tests, so
|
|
2727
|
-
* this is unwired capability, not dead code. Removing a working trust model
|
|
2728
|
-
* is a decision about the resilience posture, not a cleanup — see #4666.
|
|
2729
|
-
*/
|
|
2730
|
-
isAgentEligible(agentId, record, config) {
|
|
2731
|
-
if (record === void 0) {
|
|
2732
|
-
return { eligible: true, weight: 1 };
|
|
2733
|
-
}
|
|
2734
|
-
if (config.enableByzantineDetection === true && (record.byzantineFlags ?? 0) > 0) {
|
|
2735
|
-
this.logger.debug("Agent flagged as Byzantine", { agentId, flags: record.byzantineFlags });
|
|
2736
|
-
return { eligible: false, reason: "byzantine_flagged", weight: record.weight };
|
|
2737
|
-
}
|
|
2738
|
-
if (record.trustScore < DEFAULT_MIN_TRUST) {
|
|
2739
|
-
this.logger.debug("Agent trust score below threshold", {
|
|
2740
|
-
agentId,
|
|
2741
|
-
trustScore: record.trustScore
|
|
2742
|
-
});
|
|
2743
|
-
return { eligible: false, reason: "low_trust", weight: record.weight };
|
|
2744
|
-
}
|
|
2745
|
-
if (record.weight < DEFAULT_MIN_WEIGHT) {
|
|
2746
|
-
this.logger.debug("Agent weight below threshold", { agentId, weight: record.weight });
|
|
2747
|
-
return { eligible: false, reason: "insufficient_weight", weight: record.weight };
|
|
2748
|
-
}
|
|
2749
|
-
return { eligible: true, weight: record.weight };
|
|
2750
|
-
}
|
|
2751
2698
|
countVotes(votes) {
|
|
2752
2699
|
let approve = 0;
|
|
2753
2700
|
let reject = 0;
|
|
@@ -2767,24 +2714,13 @@ var QuorumValidator = class {
|
|
|
2767
2714
|
}
|
|
2768
2715
|
return { approve, reject, abstain, total: votes.size };
|
|
2769
2716
|
}
|
|
2770
|
-
|
|
2771
|
-
const eligible = [];
|
|
2772
|
-
for (const agentId of votes.keys()) {
|
|
2773
|
-
const record = agentRecords?.get(agentId);
|
|
2774
|
-
const result = this.isAgentEligible(agentId, record, config);
|
|
2775
|
-
if (result.eligible) {
|
|
2776
|
-
eligible.push(agentId);
|
|
2777
|
-
}
|
|
2778
|
-
}
|
|
2779
|
-
return eligible;
|
|
2780
|
-
}
|
|
2781
|
-
calculateWeights(votes, agentWeights, agentRecords, config) {
|
|
2717
|
+
calculateWeights(votes, agentWeights, config) {
|
|
2782
2718
|
if (config.algorithm === "simple_majority" || config.algorithm === "unanimous") {
|
|
2783
2719
|
return { totalWeight: void 0, weightedCounts: void 0 };
|
|
2784
2720
|
}
|
|
2785
2721
|
const counts = { totalWeight: 0, approve: 0, reject: 0, abstain: 0 };
|
|
2786
2722
|
for (const [agentId, vote] of votes.entries()) {
|
|
2787
|
-
const weight = this.getVoteWeight(agentId, vote, agentWeights,
|
|
2723
|
+
const weight = this.getVoteWeight(agentId, vote, agentWeights, config);
|
|
2788
2724
|
counts.totalWeight += weight;
|
|
2789
2725
|
this.addWeightToDecision(counts, vote.decision, weight);
|
|
2790
2726
|
}
|
|
@@ -2798,8 +2734,8 @@ var QuorumValidator = class {
|
|
|
2798
2734
|
}
|
|
2799
2735
|
};
|
|
2800
2736
|
}
|
|
2801
|
-
getVoteWeight(agentId, vote, agentWeights,
|
|
2802
|
-
let weight = agentWeights?.get(agentId) ??
|
|
2737
|
+
getVoteWeight(agentId, vote, agentWeights, config) {
|
|
2738
|
+
let weight = agentWeights?.get(agentId) ?? 1;
|
|
2803
2739
|
if (config.confidenceMultiplier === true) {
|
|
2804
2740
|
weight *= vote.confidence;
|
|
2805
2741
|
}
|
|
@@ -6792,4 +6728,4 @@ export {
|
|
|
6792
6728
|
CONSENSUS_VOTE_TOOL_SCHEMA,
|
|
6793
6729
|
registerConsensusVoteTool
|
|
6794
6730
|
};
|
|
6795
|
-
//# sourceMappingURL=chunk-
|
|
6731
|
+
//# sourceMappingURL=chunk-LWB4RR47.js.map
|