nexus-agents 2.150.4 → 2.151.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.
@@ -18,7 +18,7 @@ import {
18
18
  DEFAULT_TASK_TTL_MS,
19
19
  DEFAULT_TOOL_RATE_LIMITS,
20
20
  clampTaskTtl
21
- } from "./chunk-UIUTDHRX.js";
21
+ } from "./chunk-SJFARLAQ.js";
22
22
  import {
23
23
  executeExpert
24
24
  } from "./chunk-JYHSZDKL.js";
@@ -41,7 +41,7 @@ import {
41
41
  toJobSummary,
42
42
  warnIfSimulatedOutsideTests,
43
43
  writeJobCancelled
44
- } from "./chunk-CB234Y3O.js";
44
+ } from "./chunk-UIL37D2V.js";
45
45
  import {
46
46
  normalizeTopicToCanonical,
47
47
  synthesizeResearch
@@ -43446,7 +43446,7 @@ ${contextBlock}`;
43446
43446
  const strategy = config.votingStrategy ?? "higher_order";
43447
43447
  await postProgress(config, "Vote", `Running consensus with ${strategy} strategy...`);
43448
43448
  try {
43449
- const { executeVoting } = await import("./consensus-vote-7R6RNZXS.js");
43449
+ const { executeVoting } = await import("./consensus-vote-72AX6HNF.js");
43450
43450
  const votingResult = await executeVoting(
43451
43451
  {
43452
43452
  proposal: buildVoteProposal(plan, research),
@@ -44392,13 +44392,16 @@ var PR_REVIEW_ROLES = [
44392
44392
  "scope_steward"
44393
44393
  ];
44394
44394
  var MAX_DIFF_LENGTH = 5e4;
44395
+ var MAX_REPO_CONTEXT_LENGTH = 2e3;
44395
44396
  var MAX_DESCRIPTION_LENGTH = 1e4;
44396
44397
  var PR_REVIEW_ASYNC_HINT = "A pr_review run fans out to 5 live LLM voters and can exceed the synchronous MCP request timeout. Retry with `dispatch: 'async'` to get a jobId immediately, then poll get_job_result({ jobId }) for the result.";
44397
44398
  var PrReviewInputSchema = z91.object({
44398
44399
  prTitle: z91.string().min(1).max(500).describe("PR title"),
44399
44400
  prDescription: z91.string().max(MAX_DESCRIPTION_LENGTH).optional().describe("PR body / description"),
44400
44401
  prDiff: z91.string().min(1).max(MAX_DIFF_LENGTH).describe(`Unified diff text (max ${String(MAX_DIFF_LENGTH)} chars; truncate before calling)`),
44401
- repoContext: z91.string().max(2e3).optional().describe("Optional one-paragraph repo context (architecture, conventions)"),
44402
+ repoContext: z91.string().max(MAX_REPO_CONTEXT_LENGTH).optional().describe(
44403
+ `Optional one-paragraph repo context (architecture, conventions; max ${String(MAX_REPO_CONTEXT_LENGTH)} chars; trim before calling)`
44404
+ ),
44402
44405
  baseRef: z91.string().max(200).optional().describe("Base branch ref (e.g. main)"),
44403
44406
  headRef: z91.string().max(200).optional().describe("Head branch ref"),
44404
44407
  /**
@@ -44417,6 +44420,20 @@ var PrReviewInputSchema = z91.object({
44417
44420
  "40-hex base commit sha the reviewed diff was computed from (Option-C binding, #4031)"
44418
44421
  ),
44419
44422
  simulate: z91.boolean().default(false).describe("Use simulated voters (testing only; never ship live with this true)"),
44423
+ /**
44424
+ * Error policy (#4132). `standard` (default) keeps the pre-#4132 aggregation:
44425
+ * an errored voter is simply excluded from the panel. `absolute_quorum` gates
44426
+ * the verified-approve verdict on a COMPLETE, error-free panel with the
44427
+ * contrarian (catfish) present and approving — any errored voter (especially
44428
+ * catfish) degrades the verdict to a recoverable `{ decision: 'abstain',
44429
+ * verified: false }` (the no_quorum analogue; `PrReviewAggregate` has no
44430
+ * `no_quorum` state), so an induced voter error can never manufacture a
44431
+ * verified approve. A genuine `request_changes` blocker still wins (Tiers 1-2
44432
+ * run first).
44433
+ */
44434
+ errorPolicy: z91.enum(["standard", "absolute_quorum"]).default("standard").describe(
44435
+ "Error policy (#4132). 'standard' (default): errored voters excluded. 'absolute_quorum': any errored voter \u2014 esp. the contrarian \u2014 degrades a would-be approve to a recoverable abstain (verified:false); never manufactures a verified approve from an induced error."
44436
+ ),
44420
44437
  /**
44421
44438
  * Dispatch mode (#3731). `sync` (default) runs the 5-voter panel inline and
44422
44439
  * returns the result — but a live fan-out can exceed the MCP request timeout.
@@ -44433,7 +44450,7 @@ function mapVoteDecisionToPrDecision(voteDecision) {
44433
44450
  return voteDecision;
44434
44451
  }
44435
44452
  var SOFT_BLOCK_REQUEST_CHANGES_THRESHOLD = 3;
44436
- function aggregatePrDecisions(reviews) {
44453
+ function aggregatePrDecisions(reviews, errorPolicy = "standard") {
44437
44454
  const valid = reviews.filter((r) => r.source !== "error");
44438
44455
  if (valid.length === 0) return { decision: "abstain", verified: true };
44439
44456
  const hasVerifiedBlocker = valid.some(
@@ -44445,10 +44462,31 @@ function aggregatePrDecisions(reviews) {
44445
44462
  return { decision: "request_changes", verified: false };
44446
44463
  }
44447
44464
  if (valid.every((r) => r.decision === "approve")) {
44465
+ if (errorPolicy === "absolute_quorum") {
44466
+ return absoluteQuorumApprove(reviews, valid);
44467
+ }
44448
44468
  return { decision: "approve", verified: true };
44449
44469
  }
44450
44470
  return { decision: "abstain", verified: true };
44451
44471
  }
44472
+ function absoluteQuorumApprove(reviews, valid) {
44473
+ const errorCount = reviews.length - valid.length;
44474
+ const erroredRoles = reviews.filter((r) => r.source === "error").map((r) => r.role);
44475
+ const catfish = valid.find((r) => r.role === "catfish");
44476
+ const catfishApproved = catfish?.decision === "approve";
44477
+ const panelComplete = valid.length === PR_REVIEW_ROLES.length;
44478
+ if (errorCount > 0 || !catfishApproved || !panelComplete) {
44479
+ const missing = catfishApproved ? [] : ["catfish"];
44480
+ const named = [...erroredRoles, ...missing];
44481
+ const list = named.length > 0 ? named.join(", ") : "incomplete panel";
44482
+ return {
44483
+ decision: "abstain",
44484
+ verified: false,
44485
+ reason: `no_quorum: re-run \u2014 voter(s) [${list}] errored/missing (absolute_quorum)`
44486
+ };
44487
+ }
44488
+ return { decision: "approve", verified: true };
44489
+ }
44452
44490
  function buildPrReviewProposal(input) {
44453
44491
  const parts = [];
44454
44492
  parts.push(`# Pull Request Review
@@ -44533,6 +44571,16 @@ function summarizeReviews(reviews) {
44533
44571
  errorCount: reviews.filter((r) => r.source === "error").length
44534
44572
  };
44535
44573
  }
44574
+ function aggregateWithTelemetry(reviews, errorPolicy, errorCount, logger58) {
44575
+ const aggregate = aggregatePrDecisions(reviews, errorPolicy);
44576
+ if (aggregate.reason !== void 0) {
44577
+ logger58.warn("pr_review degraded to no_quorum under absolute_quorum (#4132)", {
44578
+ reason: aggregate.reason,
44579
+ errorCount
44580
+ });
44581
+ }
44582
+ return aggregate;
44583
+ }
44536
44584
  async function executePrReviewBody(input, logger58, gatewayAdapters) {
44537
44585
  const start = Date.now();
44538
44586
  const proposal = buildPrReviewProposal(input);
@@ -44545,7 +44593,7 @@ async function executePrReviewBody(input, logger58, gatewayAdapters) {
44545
44593
  });
44546
44594
  const reviews = voteResults.map(toPrReviewVote);
44547
44595
  const counts = summarizeReviews(reviews);
44548
- const aggregate = aggregatePrDecisions(reviews);
44596
+ const aggregate = aggregateWithTelemetry(reviews, input.errorPolicy, counts.errorCount, logger58);
44549
44597
  let costSummary;
44550
44598
  try {
44551
44599
  costSummary = recordDecisionCost({
@@ -51228,4 +51276,4 @@ export {
51228
51276
  shutdownFeedbackSubscriber,
51229
51277
  createEventBusBridge
51230
51278
  };
51231
- //# sourceMappingURL=chunk-GTG2XFAS.js.map
51279
+ //# sourceMappingURL=chunk-IR7FP4SS.js.map