nexus-agents 2.173.4 → 2.173.5

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.
@@ -21,7 +21,7 @@ import {
21
21
  DEFAULT_TASK_TTL_MS,
22
22
  DEFAULT_TOOL_RATE_LIMITS,
23
23
  clampTaskTtl
24
- } from "./chunk-YYCG236I.js";
24
+ } from "./chunk-7GIRIDHH.js";
25
25
  import {
26
26
  executeExpert
27
27
  } from "./chunk-MBTEWGZK.js";
@@ -46534,11 +46534,15 @@ function buildPrReviewRecord(input) {
46534
46534
  };
46535
46535
  return { ...payload, hash: computePrReviewRecordHash(payload) };
46536
46536
  }
46537
- function resolvePrReviewRecordsPath() {
46537
+ function resolvePrReviewRecordsPath(repoPathOverride) {
46538
46538
  const envPath = process.env[PR_REVIEW_RECORDS_PATH_ENV];
46539
46539
  if (envPath !== void 0 && envPath.trim() !== "") {
46540
46540
  return isAbsolute(envPath) ? envPath : resolve13(envPath);
46541
46541
  }
46542
+ if (repoPathOverride !== void 0 && repoPathOverride.trim() !== "") {
46543
+ const overrideRoot = findRepoRoot(repoPathOverride);
46544
+ if (overrideRoot !== null) return join9(overrideRoot, PR_REVIEW_RECORDS_REL_PATH);
46545
+ }
46542
46546
  const root = findRepoRoot(process.cwd());
46543
46547
  if (root === null) return void 0;
46544
46548
  return join9(root, PR_REVIEW_RECORDS_REL_PATH);
@@ -46577,7 +46581,7 @@ function readPrReviewLedgerTip(filePath, logger58) {
46577
46581
  }
46578
46582
  function persistPrReviewRecord(opts) {
46579
46583
  const logger58 = opts.logger ?? createLogger({ component: "pr-review-record-store" });
46580
- const filePath = opts.filePath ?? resolvePrReviewRecordsPath();
46584
+ const filePath = opts.filePath ?? resolvePrReviewRecordsPath(opts.repoPathOverride);
46581
46585
  if (filePath === void 0) {
46582
46586
  logger58.warn("Cannot persist pr-review record: no records path resolved", {
46583
46587
  prNumber: opts.prNumber
@@ -46634,6 +46638,9 @@ function buildAndPersist(prNumber, baseSha, args) {
46634
46638
  total: reviewCount
46635
46639
  },
46636
46640
  summary: `${aggregate.decision} (${String(counts.approveCount)} approve / ${String(counts.requestChangesCount)} request_changes / ${String(counts.abstainCount)} abstain) \u2014 ${input.prTitle}${coverageSuffix}`,
46641
+ // #4278: lets a caller (e.g. an MCP server whose cwd has no `.git`
46642
+ // ancestor) say where the repo is, so the record isn't silently dropped.
46643
+ ...input.repoPath !== void 0 ? { repoPathOverride: input.repoPath } : {},
46637
46644
  logger: logger58
46638
46645
  });
46639
46646
  if (record === void 0) {
@@ -46815,6 +46822,45 @@ function applyPartialCoverageGate(aggregate, coverage) {
46815
46822
  return aggregate;
46816
46823
  }
46817
46824
 
46825
+ // src/mcp/tools/pr-review-result-mapping.ts
46826
+ function resolveFindings(result) {
46827
+ const raw = result.vote.findings;
46828
+ if (raw !== void 0 && raw.length > 0) {
46829
+ return raw.map((f) => ({
46830
+ summary: f.summary,
46831
+ location: f.location,
46832
+ severity: f.severity,
46833
+ gate: f.gate,
46834
+ claim: f.claim,
46835
+ verified: isFindingVerified(f.gate)
46836
+ }));
46837
+ }
46838
+ return parseFindings(result.vote.reasoning);
46839
+ }
46840
+ function toPrReviewVote(result) {
46841
+ return {
46842
+ role: result.role,
46843
+ decision: mapVoteDecisionToPrDecision(result.vote.decision),
46844
+ confidence: result.vote.confidence,
46845
+ reasoning: result.vote.reasoning,
46846
+ findings: resolveFindings(result),
46847
+ source: result.source,
46848
+ cli: result.cli,
46849
+ processingTimeMs: result.processingTimeMs,
46850
+ ...result.error !== void 0 && { errorMessage: result.error }
46851
+ };
46852
+ }
46853
+ function summarizeReviews(reviews) {
46854
+ return {
46855
+ approveCount: reviews.filter((r) => r.source !== "error" && r.decision === "approve").length,
46856
+ requestChangesCount: reviews.filter(
46857
+ (r) => r.source !== "error" && r.decision === "request_changes"
46858
+ ).length,
46859
+ abstainCount: reviews.filter((r) => r.source !== "error" && r.decision === "abstain").length,
46860
+ errorCount: reviews.filter((r) => r.source === "error").length
46861
+ };
46862
+ }
46863
+
46818
46864
  // src/mcp/tools/pr-review-tool.ts
46819
46865
  var PR_REVIEW_ROLES = [
46820
46866
  "architect",
@@ -46854,6 +46900,9 @@ var PrReviewInputSchema = z93.object({
46854
46900
  baseSha: z93.string().regex(/^[0-9a-f]{40}$/, "baseSha must be a 40-char lowercase hex commit sha").optional().describe(
46855
46901
  "40-hex base commit sha the reviewed diff was computed from (Option-C binding, #4031)"
46856
46902
  ),
46903
+ repoPath: z93.string().max(1024).optional().describe(
46904
+ "Repo root path for persisting the governance pr-review record (overrides cwd auto-detection). Must contain a .git ancestor \u2014 relative paths are resolved against cwd; ignored (falls back to cwd auto-detection) if it is not a real repo root. Env NEXUS_PR_REVIEW_RECORDS_PATH still takes precedence and is unrestricted."
46905
+ ),
46857
46906
  simulate: z93.boolean().default(false).describe("Use simulated voters (testing only; never ship live with this true)"),
46858
46907
  /**
46859
46908
  * Error policy (#4132). `standard` (default) keeps the pre-#4132 aggregation:
@@ -46969,43 +47018,6 @@ ${FINDINGS_FORMAT_INSTRUCTIONS}
46969
47018
  `);
46970
47019
  return parts.join("");
46971
47020
  }
46972
- function resolveFindings(result) {
46973
- const raw = result.vote.findings;
46974
- if (raw !== void 0 && raw.length > 0) {
46975
- return raw.map((f) => ({
46976
- summary: f.summary,
46977
- location: f.location,
46978
- severity: f.severity,
46979
- gate: f.gate,
46980
- claim: f.claim,
46981
- verified: isFindingVerified(f.gate)
46982
- }));
46983
- }
46984
- return parseFindings(result.vote.reasoning);
46985
- }
46986
- function toPrReviewVote(result) {
46987
- return {
46988
- role: result.role,
46989
- decision: mapVoteDecisionToPrDecision(result.vote.decision),
46990
- confidence: result.vote.confidence,
46991
- reasoning: result.vote.reasoning,
46992
- findings: resolveFindings(result),
46993
- source: result.source,
46994
- cli: result.cli,
46995
- processingTimeMs: result.processingTimeMs,
46996
- ...result.error !== void 0 && { errorMessage: result.error }
46997
- };
46998
- }
46999
- function summarizeReviews(reviews) {
47000
- return {
47001
- approveCount: reviews.filter((r) => r.source !== "error" && r.decision === "approve").length,
47002
- requestChangesCount: reviews.filter(
47003
- (r) => r.source !== "error" && r.decision === "request_changes"
47004
- ).length,
47005
- abstainCount: reviews.filter((r) => r.source !== "error" && r.decision === "abstain").length,
47006
- errorCount: reviews.filter((r) => r.source === "error").length
47007
- };
47008
- }
47009
47021
  function resolveAggregate(reviews, input, errorCount, coverage, logger58) {
47010
47022
  const preGate = aggregatePrDecisions(reviews, input.errorPolicy);
47011
47023
  if (preGate.reason !== void 0) {
@@ -54045,4 +54057,4 @@ export {
54045
54057
  shutdownFeedbackSubscriber,
54046
54058
  createEventBusBridge
54047
54059
  };
54048
- //# sourceMappingURL=chunk-R4ZINS62.js.map
54060
+ //# sourceMappingURL=chunk-6YM52YW6.js.map