nexus-agents 2.176.1 → 2.176.2

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-OKERZLJQ.js";
24
+ } from "./chunk-LGBCHTC6.js";
25
25
  import {
26
26
  executeExpert
27
27
  } from "./chunk-G5URP3V7.js";
@@ -46565,6 +46565,18 @@ function buildPrReviewRecord(input) {
46565
46565
  };
46566
46566
  return { ...payload, hash: computePrReviewRecordHash(payload) };
46567
46567
  }
46568
+ function isUnderTestRunner() {
46569
+ return process.env["VITEST"] !== void 0 || process.env["NODE_ENV"] === "test";
46570
+ }
46571
+ function assertNotSourceCheckoutWrite(filePath) {
46572
+ if (!isUnderTestRunner()) return;
46573
+ const here = findRepoRoot(process.cwd());
46574
+ if (here === null) return;
46575
+ if (resolve13(filePath) !== resolve13(join9(here, PR_REVIEW_RECORDS_REL_PATH))) return;
46576
+ throw new Error(
46577
+ `Refusing to write ${filePath} from a test run (#4415): this is the source checkout's tracked, hash-chained audit file, and a fabricated record that chains cleanly is indistinguishable from a real verdict. Pass repoPath to a throwaway repo, or set NEXUS_PR_REVIEW_RECORDS_PATH.`
46578
+ );
46579
+ }
46568
46580
  function resolvePrReviewRecordsPath(repoPathOverride) {
46569
46581
  const envPath = process.env[PR_REVIEW_RECORDS_PATH_ENV];
46570
46582
  if (envPath !== void 0 && envPath.trim() !== "") {
@@ -46619,6 +46631,7 @@ function persistPrReviewRecord(opts) {
46619
46631
  });
46620
46632
  return void 0;
46621
46633
  }
46634
+ assertNotSourceCheckoutWrite(filePath);
46622
46635
  try {
46623
46636
  mkdirSync6(dirname4(filePath), { recursive: true });
46624
46637
  const { maxSequence, lastHash } = readPrReviewLedgerTip(filePath, logger58);
@@ -54123,4 +54136,4 @@ export {
54123
54136
  shutdownFeedbackSubscriber,
54124
54137
  createEventBusBridge
54125
54138
  };
54126
- //# sourceMappingURL=chunk-2AFKZAXN.js.map
54139
+ //# sourceMappingURL=chunk-6HBMN6GZ.js.map