nexus-agents 3.1.0 → 3.2.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.
Files changed (29) hide show
  1. package/dist/{chunk-4UN4M4NI.js → chunk-5NRFPUNP.js} +44 -7
  2. package/dist/chunk-5NRFPUNP.js.map +1 -0
  3. package/dist/{chunk-FVEPECIW.js → chunk-NFFGQZQ2.js} +2 -2
  4. package/dist/{chunk-PQQP66XZ.js → chunk-OJVNSOZZ.js} +3 -3
  5. package/dist/{chunk-QZINUMKA.js → chunk-PE35GMXD.js} +10 -2
  6. package/dist/chunk-PE35GMXD.js.map +1 -0
  7. package/dist/{chunk-IMOLBA2M.js → chunk-TE37WUAC.js} +109 -89
  8. package/dist/{chunk-IMOLBA2M.js.map → chunk-TE37WUAC.js.map} +1 -1
  9. package/dist/cli.d.ts +1 -1
  10. package/dist/cli.js +6 -6
  11. package/dist/{consensus-vote-ORVUPPWD.js → consensus-vote-PPZUA3EN.js} +2 -2
  12. package/dist/{consensus-vote-types-DusDu6pM.d.ts → consensus-vote-types-C7kiyyqD.d.ts} +10 -0
  13. package/dist/{dist-GR7PQU7T.js → dist-CYRF4S6L.js} +3105 -2284
  14. package/dist/dist-CYRF4S6L.js.map +1 -0
  15. package/dist/index.d.ts +15 -4
  16. package/dist/index.js +7 -5
  17. package/dist/index.js.map +1 -1
  18. package/dist/{issue-triage-3YWM3P2C.js → issue-triage-Q7SYODHT.js} +2 -2
  19. package/dist/model-registry.generated.json +2046 -1418
  20. package/dist/{setup-command-QYKLSOC6.js → setup-command-T6OHZYMY.js} +3 -3
  21. package/package.json +9 -9
  22. package/dist/chunk-4UN4M4NI.js.map +0 -1
  23. package/dist/chunk-QZINUMKA.js.map +0 -1
  24. package/dist/dist-GR7PQU7T.js.map +0 -1
  25. /package/dist/{chunk-FVEPECIW.js.map → chunk-NFFGQZQ2.js.map} +0 -0
  26. /package/dist/{chunk-PQQP66XZ.js.map → chunk-OJVNSOZZ.js.map} +0 -0
  27. /package/dist/{consensus-vote-ORVUPPWD.js.map → consensus-vote-PPZUA3EN.js.map} +0 -0
  28. /package/dist/{issue-triage-3YWM3P2C.js.map → issue-triage-Q7SYODHT.js.map} +0 -0
  29. /package/dist/{setup-command-QYKLSOC6.js.map → setup-command-T6OHZYMY.js.map} +0 -0
@@ -4321,12 +4321,14 @@ function getDefaultErrorPolicy(strategy) {
4321
4321
  return "reduce_denominator";
4322
4322
  }
4323
4323
  var ConsensusVoteInputSchema = z6.object({
4324
- proposal: z6.string().min(1).max(MAX_PROPOSAL_LENGTH).describe("Proposal text to vote on"),
4324
+ proposal: z6.string().min(1).max(MAX_PROPOSAL_LENGTH).describe(
4325
+ "Proposal text to vote on. IMPORTANT (#4452): the tally records approve/reject/abstain ONLY. If your proposal asks voters to choose among named options (A/B/C), every voter who engages returns `approve`, so the result records as unanimous even when the panel disagreed about WHICH option \u2014 a 6-1 split persists as 7-0, 100%. Threshold semantics invert too: `unanimous` becomes trivially easy to clear, because everyone approves while choosing different things. Prefer a single yes/no question; if you must offer options, read each voter's `reasoning` to recover the real split and do NOT report the recorded percentage as agreement."
4326
+ ),
4325
4327
  threshold: VoteThresholdSchema.optional().describe(
4326
4328
  "Voting threshold (legacy): majority, supermajority, unanimous. Use strategy instead."
4327
4329
  ),
4328
4330
  strategy: VotingStrategySchema.optional().describe(
4329
- "Voting strategy: simple_majority (default), supermajority, unanimous, proof_of_learning, or higher_order (Bayesian-optimal)"
4331
+ "Voting strategy: simple_majority (default), supermajority, unanimous, proof_of_learning, or higher_order (Bayesian-optimal). NOTE (#4452): thresholds are evaluated over approve/reject/abstain, not over which option a voter chose. On a multi-option proposal even `unanimous` clears trivially \u2014 see the `proposal` field description."
4330
4332
  ),
4331
4333
  errorPolicy: ErrorPolicySchema.optional().describe(
4332
4334
  "How to treat voters that errored or timed out (#2630). Default: fail_closed for unanimous only; reduce_denominator for all other strategies incl. higher_order/opinion_wise (#3138 \u2014 a single infra timeout should not void an otherwise-unanimous vote). Opt-in absolute_quorum (#4132): an errored voter \u2014 especially the contrarian (catfish) \u2014 degrades the verdict to no_quorum (recoverable re-run) instead of being dropped from the denominator; never manufactures approved/rejected from an induced error. Regardless of policy, errors > 50% always fails."
@@ -4589,6 +4591,12 @@ var VoteRecordCountsSchema = z7.object({
4589
4591
  abstain: z7.number().int().nonnegative(),
4590
4592
  total: z7.number().int().nonnegative()
4591
4593
  }).strict();
4594
+ var VoteRecordOptionCountSchema = z7.object({
4595
+ /** The option label as declared in the proposal (e.g. 'A'). */
4596
+ option: z7.string().min(1),
4597
+ /** How many voters selected it. */
4598
+ count: z7.number().int().nonnegative()
4599
+ }).strict();
4592
4600
  var VoteRecordSchema = z7.object({
4593
4601
  /**
4594
4602
  * Schema version. '1.1' marked the chain→record-set+sequence model (#3927);
@@ -4597,7 +4605,7 @@ var VoteRecordSchema = z7.object({
4597
4605
  * `ratifies` is folded into the self-hash ONLY when present (see
4598
4606
  * {@link computeVoteRecordHash}).
4599
4607
  */
4600
- version: z7.enum(["1.1", "1.2"]),
4608
+ version: z7.enum(["1.1", "1.2", "1.3"]),
4601
4609
  /** Unique record id (also usable as a `ratificationVoteRef`). */
4602
4610
  id: z7.string().min(1),
4603
4611
  /**
@@ -4637,6 +4645,20 @@ var VoteRecordSchema = z7.object({
4637
4645
  voters: z7.array(VoterSummarySchema),
4638
4646
  /** Optional correlation/decision id linking to the cost rollup / trace. */
4639
4647
  correlationId: z7.string().min(1).optional(),
4648
+ /**
4649
+ * Per-option distribution for a multi-option proposal (#4452, schema 1.3).
4650
+ *
4651
+ * Present only when the vote declared `options`. Absent on an ordinary
4652
+ * yes/no vote, and absent on every 1.1/1.2 record — which is why it is
4653
+ * folded into the self-hash ONLY when present (see
4654
+ * {@link computeVoteRecordHash}), exactly as `ratifies` was.
4655
+ *
4656
+ * Without this, a 6-1 or 5-2 option split is recorded as `approve: 7` and
4657
+ * reads as unanimous. Threshold semantics invert too: `unanimous` becomes
4658
+ * the EASIEST bar to clear, because every engaged voter approves while
4659
+ * choosing different things.
4660
+ */
4661
+ optionTally: z7.array(VoteRecordOptionCountSchema).min(1).optional(),
4640
4662
  /**
4641
4663
  * The loop/strategy subject this vote RATIFIES (#3927 item 1). Present only on
4642
4664
  * a ratification vote; set at vote time and bound into the self-hash (so it is
@@ -4682,8 +4704,12 @@ function computeVoteRecordHash(payload) {
4682
4704
  })),
4683
4705
  correlationId: payload.correlationId ?? null
4684
4706
  };
4707
+ const withTally = payload.optionTally !== void 0 ? {
4708
+ ...base,
4709
+ optionTally: payload.optionTally.map((o) => ({ option: o.option, count: o.count }))
4710
+ } : base;
4685
4711
  const canonical = JSON.stringify(
4686
- payload.ratifies !== void 0 ? { ...base, ratifies: payload.ratifies } : base
4712
+ payload.ratifies !== void 0 ? { ...withTally, ratifies: payload.ratifies } : withTally
4687
4713
  );
4688
4714
  return crypto.createHash("sha256").update(canonical).digest("hex");
4689
4715
  }
@@ -4715,10 +4741,20 @@ function toVoterSummaries(votes) {
4715
4741
  }
4716
4742
  return summaries;
4717
4743
  }
4744
+ function tallySelectedOptions(votes) {
4745
+ const counts = /* @__PURE__ */ new Map();
4746
+ for (const v of votes) {
4747
+ if (v.selectedOption === void 0) continue;
4748
+ counts.set(v.selectedOption, (counts.get(v.selectedOption) ?? 0) + 1);
4749
+ }
4750
+ if (counts.size === 0) return void 0;
4751
+ return [...counts.entries()].map(([option, count]) => ({ option, count })).sort((a, b) => b.count !== a.count ? b.count - a.count : a.option.localeCompare(b.option));
4752
+ }
4718
4753
  function buildVoteRecord(input) {
4719
4754
  const proposalTruncated = input.proposal.length > MAX_PROPOSAL_RECORD_CHARS ? input.proposal.slice(0, MAX_PROPOSAL_RECORD_CHARS) + "..." : input.proposal;
4755
+ const optionTally = tallySelectedOptions(input.votes);
4720
4756
  const payload = {
4721
- version: "1.2",
4757
+ version: optionTally !== void 0 ? "1.3" : "1.2",
4722
4758
  id: input.id,
4723
4759
  sequence: input.sequence ?? 0,
4724
4760
  recordedAt: input.recordedAt ?? (/* @__PURE__ */ new Date()).toISOString(),
@@ -4736,6 +4772,7 @@ function buildVoteRecord(input) {
4736
4772
  voters: toVoterSummaries(input.votes),
4737
4773
  ...input.correlationId !== void 0 ? { correlationId: input.correlationId } : {},
4738
4774
  ...input.ratifies !== void 0 ? { ratifies: input.ratifies } : {},
4775
+ ...optionTally !== void 0 ? { optionTally } : {},
4739
4776
  ...input.previousHash !== void 0 ? { previousHash: input.previousHash } : {}
4740
4777
  };
4741
4778
  return { ...payload, hash: computeVoteRecordHash(payload) };
@@ -6359,7 +6396,7 @@ var CONSENSUS_VOTE_TOOL_SCHEMA = {
6359
6396
  "Authority-tier ratification subject (#4004) \u2014 the loop/strategy id this vote ratifies for an authority-ladder promotion. Bound into the authentic vote record so the promotion gate can verify it. Omit for ordinary votes."
6360
6397
  )
6361
6398
  };
6362
- var CONSENSUS_VOTE_DESCRIPTION = "Execute multi-model consensus voting on a proposal. Uses 7 roles by default (architect, security, devex, ai_ml, pm, catfish, scope_steward) or 3 with quickMode (architect, security, scope_steward), voting with configurable strategies. Supports higher_order strategy for Bayesian-optimal aggregation with correlation awareness (Issue #514). Supports async mode (mode: 'async') \u2014 returns a jobId to poll via get_job_result. Pass ratifies=<subject> to bind an authority-ladder ratification vote into its authentic record.";
6399
+ var CONSENSUS_VOTE_DESCRIPTION = "Execute multi-model consensus voting on a proposal. Uses 7 roles by default (architect, security, devex, ai_ml, pm, catfish, scope_steward) or 3 with quickMode (architect, security, scope_steward), voting with configurable strategies. Supports higher_order strategy for Bayesian-optimal aggregation with correlation awareness (Issue #514). Supports async mode (mode: 'async') \u2014 returns a jobId to poll via get_job_result. Pass ratifies=<subject> to bind an authority-ladder ratification vote into its authentic record. CAVEAT (#4452): the tally is approve/reject/abstain only. A proposal that asks voters to pick among named options records as unanimous even when they picked DIFFERENT options \u2014 recover the real split from each voter's reasoning, and do not report the percentage as agreement.";
6363
6400
  function registerConsensusVoteTool(server, deps) {
6364
6401
  const logger10 = deps.logger ?? createLogger({ tool: "consensus_vote" });
6365
6402
  const notifier = deps.notifier ?? createMcpNotifier(server);
@@ -6466,4 +6503,4 @@ export {
6466
6503
  CONSENSUS_VOTE_OUTPUT_SCHEMA,
6467
6504
  registerConsensusVoteTool
6468
6505
  };
6469
- //# sourceMappingURL=chunk-4UN4M4NI.js.map
6506
+ //# sourceMappingURL=chunk-5NRFPUNP.js.map