nexus-agents 8.58.10 → 8.59.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.
Files changed (27) hide show
  1. package/dist/{chunk-E6MWPEEL.js → chunk-B4UNELI4.js} +3 -3
  2. package/dist/{chunk-6A4Y2GBP.js → chunk-BYDAXNOG.js} +2 -2
  3. package/dist/{chunk-6A4Y2GBP.js.map → chunk-BYDAXNOG.js.map} +1 -1
  4. package/dist/{chunk-YAYKF6LF.js → chunk-JJR5HS4N.js} +2 -2
  5. package/dist/{chunk-KX5IRY7D.js → chunk-K3K4TOBA.js} +3 -3
  6. package/dist/{chunk-JIPTZ357.js → chunk-KLZUZSON.js} +9 -9
  7. package/dist/{chunk-K76PTPGD.js → chunk-NRIH6GVC.js} +106 -68
  8. package/dist/chunk-NRIH6GVC.js.map +1 -0
  9. package/dist/{chunk-LAJNJNGM.js → chunk-TNRG3PNO.js} +2 -2
  10. package/dist/cli.js +8 -8
  11. package/dist/{consensus-vote-LE33M3GF.js → consensus-vote-6K54HCI5.js} +4 -4
  12. package/dist/{improvement-review-PV6WRKEX.js → improvement-review-VE3B65NP.js} +4 -4
  13. package/dist/index.d.ts +89 -23
  14. package/dist/index.js +7 -7
  15. package/dist/{issue-triage-6IL7DQ2I.js → issue-triage-7YCOFZXK.js} +2 -2
  16. package/dist/{setup-data-dir-7F5AJNBG.js → setup-data-dir-RVWQ3D32.js} +3 -3
  17. package/package.json +1 -1
  18. package/dist/chunk-K76PTPGD.js.map +0 -1
  19. /package/dist/{chunk-E6MWPEEL.js.map → chunk-B4UNELI4.js.map} +0 -0
  20. /package/dist/{chunk-YAYKF6LF.js.map → chunk-JJR5HS4N.js.map} +0 -0
  21. /package/dist/{chunk-KX5IRY7D.js.map → chunk-K3K4TOBA.js.map} +0 -0
  22. /package/dist/{chunk-JIPTZ357.js.map → chunk-KLZUZSON.js.map} +0 -0
  23. /package/dist/{chunk-LAJNJNGM.js.map → chunk-TNRG3PNO.js.map} +0 -0
  24. /package/dist/{consensus-vote-LE33M3GF.js.map → consensus-vote-6K54HCI5.js.map} +0 -0
  25. /package/dist/{improvement-review-PV6WRKEX.js.map → improvement-review-VE3B65NP.js.map} +0 -0
  26. /package/dist/{issue-triage-6IL7DQ2I.js.map → issue-triage-7YCOFZXK.js.map} +0 -0
  27. /package/dist/{setup-data-dir-7F5AJNBG.js.map → setup-data-dir-RVWQ3D32.js.map} +0 -0
@@ -11,7 +11,7 @@ import {
11
11
  NODE_ENGINE_RANGE,
12
12
  VERSION,
13
13
  isNodeVersionSupported
14
- } from "./chunk-6A4Y2GBP.js";
14
+ } from "./chunk-BYDAXNOG.js";
15
15
  import {
16
16
  claimGlobalRegistry
17
17
  } from "./chunk-KLTLIQOC.js";
@@ -1314,7 +1314,7 @@ async function runDoctorFix(result) {
1314
1314
  writeLine2("\u2500".repeat(40));
1315
1315
  let fixCount = 0;
1316
1316
  if (!result.dataDirectory.rootExists || result.dataDirectory.subdirectories.some((d) => !d.exists || !d.writable)) {
1317
- const { initDataDirectories: initDataDirectories2, describeDataDirFix: describeDataDirFix2 } = await import("./setup-data-dir-7F5AJNBG.js");
1317
+ const { initDataDirectories: initDataDirectories2, describeDataDirFix: describeDataDirFix2 } = await import("./setup-data-dir-RVWQ3D32.js");
1318
1318
  const outcome = describeDataDirFix2(initDataDirectories2());
1319
1319
  writeLine2(outcome.line);
1320
1320
  if (outcome.counted) fixCount++;
@@ -1416,4 +1416,4 @@ export {
1416
1416
  startStdioServer,
1417
1417
  closeServer
1418
1418
  };
1419
- //# sourceMappingURL=chunk-E6MWPEEL.js.map
1419
+ //# sourceMappingURL=chunk-B4UNELI4.js.map
@@ -1,6 +1,6 @@
1
1
  // src/version.ts
2
2
  import semver from "semver";
3
- var VERSION = true ? "8.58.10" : "dev";
3
+ var VERSION = true ? "8.59.1" : "dev";
4
4
  var NODE_ENGINE_RANGE = ">=22.5.0";
5
5
  function isNodeVersionSupported(version) {
6
6
  return semver.satisfies(version, NODE_ENGINE_RANGE);
@@ -11,4 +11,4 @@ export {
11
11
  NODE_ENGINE_RANGE,
12
12
  isNodeVersionSupported
13
13
  };
14
- //# sourceMappingURL=chunk-6A4Y2GBP.js.map
14
+ //# sourceMappingURL=chunk-BYDAXNOG.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/version.ts"],"sourcesContent":["/**\n * nexus-agents - Version constant\n *\n * Injected at build time via tsup define from package.json.\n * Do NOT edit VERSION manually — it is replaced during build.\n */\n\nimport semver from 'semver';\n\ndeclare const __NEXUS_VERSION__: string;\n\nexport const VERSION: string = typeof __NEXUS_VERSION__ !== 'undefined' ? __NEXUS_VERSION__ : 'dev';\n\n/** Supported Node.js versions. Pinned to package.json by a regression test. */\nexport const NODE_ENGINE_RANGE = '>=22.5.0';\n\n/** Returns whether a Node.js version satisfies the package engine requirement. */\nexport function isNodeVersionSupported(version: string): boolean {\n return semver.satisfies(version, NODE_ENGINE_RANGE);\n}\n"],"mappings":";AAOA,OAAO,YAAY;AAIZ,IAAM,UAAkB,OAA2C,YAAoB;AAGvF,IAAM,oBAAoB;AAG1B,SAAS,uBAAuB,SAA0B;AAC/D,SAAO,OAAO,UAAU,SAAS,iBAAiB;AACpD;","names":[]}
1
+ {"version":3,"sources":["../src/version.ts"],"sourcesContent":["/**\n * nexus-agents - Version constant\n *\n * Injected at build time via tsup define from package.json.\n * Do NOT edit VERSION manually — it is replaced during build.\n */\n\nimport semver from 'semver';\n\ndeclare const __NEXUS_VERSION__: string;\n\nexport const VERSION: string = typeof __NEXUS_VERSION__ !== 'undefined' ? __NEXUS_VERSION__ : 'dev';\n\n/** Supported Node.js versions. Pinned to package.json by a regression test. */\nexport const NODE_ENGINE_RANGE = '>=22.5.0';\n\n/** Returns whether a Node.js version satisfies the package engine requirement. */\nexport function isNodeVersionSupported(version: string): boolean {\n return semver.satisfies(version, NODE_ENGINE_RANGE);\n}\n"],"mappings":";AAOA,OAAO,YAAY;AAIZ,IAAM,UAAkB,OAA2C,WAAoB;AAGvF,IAAM,oBAAoB;AAG1B,SAAS,uBAAuB,SAA0B;AAC/D,SAAO,OAAO,UAAU,SAAS,iBAAiB;AACpD;","names":[]}
@@ -7,7 +7,7 @@ import {
7
7
  toolStructuredError,
8
8
  toolSuccessStructured,
9
9
  wrapToolWithTimeout
10
- } from "./chunk-LAJNJNGM.js";
10
+ } from "./chunk-TNRG3PNO.js";
11
11
  import {
12
12
  JsonlStore,
13
13
  SECURITY_KEYWORDS,
@@ -2282,4 +2282,4 @@ export {
2282
2282
  runImprovementReview,
2283
2283
  registerImprovementReviewTool
2284
2284
  };
2285
- //# sourceMappingURL=chunk-YAYKF6LF.js.map
2285
+ //# sourceMappingURL=chunk-JJR5HS4N.js.map
@@ -25,10 +25,10 @@ import {
25
25
  toolSuccessStructured,
26
26
  withProgressHeartbeat,
27
27
  wrapToolWithTimeout
28
- } from "./chunk-LAJNJNGM.js";
28
+ } from "./chunk-TNRG3PNO.js";
29
29
  import {
30
30
  VERSION
31
- } from "./chunk-6A4Y2GBP.js";
31
+ } from "./chunk-BYDAXNOG.js";
32
32
  import {
33
33
  UNRESOLVED_MODEL_ID,
34
34
  assessPanelIndependence,
@@ -8930,4 +8930,4 @@ export {
8930
8930
  CONSENSUS_VOTE_TOOL_SCHEMA,
8931
8931
  registerConsensusVoteTool
8932
8932
  };
8933
- //# sourceMappingURL=chunk-KX5IRY7D.js.map
8933
+ //# sourceMappingURL=chunk-K3K4TOBA.js.map
@@ -21,7 +21,7 @@ import {
21
21
  import {
22
22
  DEFAULT_TASK_TTL_MS,
23
23
  clampTaskTtl
24
- } from "./chunk-E6MWPEEL.js";
24
+ } from "./chunk-B4UNELI4.js";
25
25
  import {
26
26
  executeExpert
27
27
  } from "./chunk-QHTZS3P7.js";
@@ -71,7 +71,7 @@ import {
71
71
  updateStage,
72
72
  withWarnings,
73
73
  writeJobCancelled
74
- } from "./chunk-KX5IRY7D.js";
74
+ } from "./chunk-K3K4TOBA.js";
75
75
  import {
76
76
  allOf,
77
77
  anyOf
@@ -84,14 +84,14 @@ import {
84
84
  IssueTriage,
85
85
  createDurableAuditSink,
86
86
  createDurableAuditTrail
87
- } from "./chunk-K76PTPGD.js";
87
+ } from "./chunk-NRIH6GVC.js";
88
88
  import {
89
89
  resolveEnvMode,
90
90
  sanitizeInput
91
91
  } from "./chunk-UX2SOSH3.js";
92
92
  import {
93
93
  withPrerequisite
94
- } from "./chunk-YAYKF6LF.js";
94
+ } from "./chunk-JJR5HS4N.js";
95
95
  import {
96
96
  NOOP_NOTIFIER,
97
97
  RateLimiter,
@@ -116,7 +116,7 @@ import {
116
116
  withAuditTrail,
117
117
  withProgressHeartbeat,
118
118
  wrapToolWithTimeout
119
- } from "./chunk-LAJNJNGM.js";
119
+ } from "./chunk-TNRG3PNO.js";
120
120
  import {
121
121
  createAuditTrail,
122
122
  createGraphAuditBridge,
@@ -45801,7 +45801,7 @@ async function tryIssueTriage(task) {
45801
45801
  try {
45802
45802
  const issueMatch = task.match(/github\.com\/([^/]+\/[^/]+)\/issues\/(\d+)/);
45803
45803
  if (issueMatch === null) return null;
45804
- const { createIssueTriage } = await import("./issue-triage-6IL7DQ2I.js");
45804
+ const { createIssueTriage } = await import("./issue-triage-7YCOFZXK.js");
45805
45805
  const triage = createIssueTriage();
45806
45806
  const owner = issueMatch[1] ?? "";
45807
45807
  const num2 = issueMatch[2] ?? "";
@@ -46203,7 +46203,7 @@ function buildVotingInput(plan, config) {
46203
46203
  }
46204
46204
  async function executeSingleVote(plan, config, log) {
46205
46205
  try {
46206
- const { executeVoting } = await import("./consensus-vote-LE33M3GF.js");
46206
+ const { executeVoting } = await import("./consensus-vote-6K54HCI5.js");
46207
46207
  const input = buildVotingInput(plan, config);
46208
46208
  const result = await executeVoting(input, log);
46209
46209
  return parseVotingResult(result);
@@ -48001,7 +48001,7 @@ ${contextBlock}`;
48001
48001
  const strategy = config.votingStrategy ?? "higher_order";
48002
48002
  await postProgress(config, "Vote", `Running consensus with ${strategy} strategy...`);
48003
48003
  try {
48004
- const { executeVoting } = await import("./consensus-vote-LE33M3GF.js");
48004
+ const { executeVoting } = await import("./consensus-vote-6K54HCI5.js");
48005
48005
  const votingResult = await executeVoting(
48006
48006
  {
48007
48007
  proposal: buildVoteProposal(plan, research),
@@ -57195,4 +57195,4 @@ export {
57195
57195
  startPipelineEventBridge,
57196
57196
  shutdownPipelineEventBridge
57197
57197
  };
57198
- //# sourceMappingURL=chunk-JIPTZ357.js.map
57198
+ //# sourceMappingURL=chunk-KLZUZSON.js.map
@@ -38,14 +38,14 @@ import { z } from "zod";
38
38
  var FirewallPolicyModeSchema = z.enum(["off", "audit", "enforce"]);
39
39
  var DEFAULT_FIREWALL_POLICY_MODE = "off";
40
40
  var FIREWALL_POLICY_ENV_VAR = "NEXUS_FIREWALL_POLICY";
41
- function resolveFirewallPolicyMode(env = process.env, logger6) {
41
+ function resolveFirewallPolicyMode(env = process.env, logger7) {
42
42
  return resolveEnvMode(
43
43
  env[FIREWALL_POLICY_ENV_VAR],
44
44
  FirewallPolicyModeSchema,
45
45
  DEFAULT_FIREWALL_POLICY_MODE,
46
46
  FIREWALL_POLICY_ENV_VAR,
47
47
  {
48
- ...logger6 !== void 0 ? { logger: logger6 } : {},
48
+ ...logger7 !== void 0 ? { logger: logger7 } : {},
49
49
  // An explicit-but-invalid value lands on `audit`, NOT on the unset
50
50
  // default `off`. Unset means "the operator has not opted in" and `off` is
51
51
  // right for it; a typo means "the operator opted in and mistyped how",
@@ -729,6 +729,15 @@ function checkSourceTrustTiers(action) {
729
729
  }
730
730
  return void 0;
731
731
  }
732
+ var ACTION_SCOPED_POLICY_RULES = [
733
+ "REQUIRE_CITATION",
734
+ "INSUFFICIENT_TRUST",
735
+ "UNTRUSTED_INFLUENCE",
736
+ "LABEL_SET_UNAVAILABLE",
737
+ "INVALID_LABELS",
738
+ "PRIVILEGED_LABEL",
739
+ "SOURCE_TRUST_MISMATCH"
740
+ ];
732
741
  function evaluatePolicy(action, context, auditTrail) {
733
742
  const violations = [];
734
743
  const checks = [
@@ -772,6 +781,54 @@ function canProceed(actionType, inputTrustTier) {
772
781
  return canInfluenceDecisions(inputTrustTier);
773
782
  }
774
783
 
784
+ // src/security/firewall/firewall-policy-stage.ts
785
+ var logger2 = createLogger({ component: "HostileInputFirewall" });
786
+ function buildActionContext(effectiveTrustTier, context, options) {
787
+ return {
788
+ inputTrustTier: effectiveTrustTier,
789
+ hasWriteAccess: context.hasWriteAccess,
790
+ hasSecretAccess: context.hasSecretAccess,
791
+ ...options?.existingLabels !== void 0 ? { existingLabels: options.existingLabels } : {}
792
+ };
793
+ }
794
+ function evaluateFirewallPolicy(context, action, auditTrail) {
795
+ if (action === void 0) {
796
+ const violation = checkRuleOfTwo(context);
797
+ return {
798
+ scope: "context",
799
+ reason: "no-action-supplied",
800
+ violations: violation !== void 0 ? [violation] : [],
801
+ unmeasured: ACTION_SCOPED_POLICY_RULES
802
+ };
803
+ }
804
+ const decision = evaluatePolicy(action, context, auditTrail);
805
+ return {
806
+ scope: "action",
807
+ actionType: action.type,
808
+ allowed: decision.allowed,
809
+ requiresApproval: decision.requiresApproval,
810
+ violations: decision.violations,
811
+ unmeasured: []
812
+ };
813
+ }
814
+ function blockingViolations(policy) {
815
+ return policy?.violations.filter((v) => v.severity === "block") ?? [];
816
+ }
817
+ function policyRefusal(policy, policyMode, user, effectiveTrustTier) {
818
+ const blocking = blockingViolations(policy);
819
+ if (blocking.length === 0 || policyMode !== "enforce") return void 0;
820
+ logger2.warn("Firewall REFUSED input under enforce mode", {
821
+ user,
822
+ effectiveTrustTier,
823
+ rules: blocking.map((v) => v.rule)
824
+ });
825
+ return {
826
+ code: "POLICY_REFUSED",
827
+ message: `Refused by firewall policy: ` + blocking.map((v) => `${v.rule} \u2014 ${v.message}`).join("; "),
828
+ stage: "policy"
829
+ };
830
+ }
831
+
775
832
  // src/security/corroboration-validator.ts
776
833
  function hasCIPass(sources) {
777
834
  return sources.some((s) => s.type === "ciResult" && s.status === "pass");
@@ -911,7 +968,7 @@ function getCorroborationRules(actionType) {
911
968
  }
912
969
 
913
970
  // src/security/firewall/firewall-pipeline.ts
914
- var logger2 = createLogger({ component: "HostileInputFirewall" });
971
+ var logger3 = createLogger({ component: "HostileInputFirewall" });
915
972
  var HostileInputFirewall = class {
916
973
  stages;
917
974
  /**
@@ -985,8 +1042,8 @@ var HostileInputFirewall = class {
985
1042
  );
986
1043
  this.recordTrustDecision(meta, trust, effectiveTrustTier, reputationGate, allowlist);
987
1044
  const atl = this.buildATL(meta, effectiveTrustTier, sanitized, reputation);
988
- const ruleOfTwoViolation = this.runPolicyEnforcement(meta, effectiveTrustTier, context);
989
- const refusal = this.refuseIfEnforcing(ruleOfTwoViolation, meta, effectiveTrustTier);
1045
+ const policy = this.runPolicyEnforcement(meta, effectiveTrustTier, context, options);
1046
+ const refusal = policyRefusal(policy, this.policyMode, meta.username, effectiveTrustTier);
990
1047
  if (refusal !== void 0) return err(refusal);
991
1048
  return ok(
992
1049
  this.assembleResult({
@@ -998,32 +1055,34 @@ var HostileInputFirewall = class {
998
1055
  effectiveTrustTier,
999
1056
  reputationGate,
1000
1057
  atl,
1001
- ruleOfTwoViolation,
1058
+ policy,
1002
1059
  start
1003
1060
  })
1004
1061
  );
1005
1062
  }
1006
1063
  /**
1007
- * Evaluates the Rule of Two against the call's access posture and surfaces
1008
- * the violation (previously the `policyEnforcement` stage was declared but
1009
- * never read — #3198). Returns `undefined` when the stage is disabled or the
1010
- * rule holds.
1064
+ * Runs the policy checks the call's facts allow — see
1065
+ * {@link evaluateFirewallPolicy} (#5380; Rule-of-Two-only since #3198). The
1066
+ * decision reaches the audit trail when the audit stage is on. Returns
1067
+ * `undefined` when the stage is disabled, so absence keeps meaning "not run".
1011
1068
  */
1012
- runPolicyEnforcement(meta, effectiveTrustTier, context) {
1069
+ runPolicyEnforcement(meta, effectiveTrustTier, context, options) {
1013
1070
  if (!this.stages.policyEnforcement) return void 0;
1014
- const violation = checkRuleOfTwo({
1015
- inputTrustTier: effectiveTrustTier,
1016
- hasWriteAccess: context.hasWriteAccess,
1017
- hasSecretAccess: context.hasSecretAccess
1018
- });
1019
- if (violation !== void 0) {
1020
- logger2.warn("Firewall surfaced a Rule-of-Two violation", {
1071
+ const evaluation = evaluateFirewallPolicy(
1072
+ buildActionContext(effectiveTrustTier, context, options),
1073
+ options?.action,
1074
+ this.stages.audit ? this.auditTrail : void 0
1075
+ );
1076
+ const blocking = blockingViolations(evaluation);
1077
+ if (blocking.length > 0) {
1078
+ logger3.warn("Firewall surfaced blocking policy violations", {
1021
1079
  user: meta.username,
1022
1080
  effectiveTrustTier,
1023
- rule: violation.rule
1081
+ scope: evaluation.scope,
1082
+ rules: blocking.map((v) => v.rule)
1024
1083
  });
1025
1084
  }
1026
- return violation;
1085
+ return evaluation;
1027
1086
  }
1028
1087
  /**
1029
1088
  * Builds the successful result. Optional fields are spread in only when they
@@ -1031,8 +1090,9 @@ var HostileInputFirewall = class {
1031
1090
  * docs on {@link FirewallResult}).
1032
1091
  */
1033
1092
  assembleResult(parts) {
1034
- const { isAllowlisted, reputation, reputationGate, ruleOfTwoViolation } = parts;
1035
- const blocking = ruleOfTwoViolation?.severity === "block";
1093
+ const { isAllowlisted, reputation, reputationGate, policy } = parts;
1094
+ const ruleOfTwoViolation = policy?.violations.find((v) => v.rule === "RULE_OF_TWO");
1095
+ const blocking = blockingViolations(policy).length > 0;
1036
1096
  return {
1037
1097
  sanitized: parts.sanitized,
1038
1098
  trust: parts.trust,
@@ -1042,10 +1102,11 @@ var HostileInputFirewall = class {
1042
1102
  ...reputationGate !== void 0 ? { reputationGate } : {},
1043
1103
  atl: parts.atl,
1044
1104
  ...ruleOfTwoViolation !== void 0 ? { ruleOfTwoViolation } : {},
1105
+ ...policy !== void 0 ? { policy } : {},
1045
1106
  policyMode: this.policyMode,
1046
1107
  // Reached only when we did NOT refuse, so this is "audit mode saw
1047
1108
  // something enforce would have stopped". Under `off` it stays false: the
1048
- // signal is already on `ruleOfTwoViolation`, and reporting a would-be
1109
+ // signal is already on `policy.violations`, and reporting a would-be
1049
1110
  // refusal for a mode that has not opted in would overstate the gate.
1050
1111
  wouldRefuse: blocking && this.policyMode === "audit",
1051
1112
  auditEvents: this.auditTrail.query().map((e) => ({ id: e.id, type: e.type })),
@@ -1053,32 +1114,6 @@ var HostileInputFirewall = class {
1053
1114
  durationMs: Date.now() - parts.start
1054
1115
  };
1055
1116
  }
1056
- /**
1057
- * The fail-closed half of the #5382 gate: under `enforce`, a blocking policy
1058
- * violation refuses the input instead of riding along as a signal on an
1059
- * `ok()` result that a caller checking only `result.ok` walks straight past.
1060
- *
1061
- * This gates the RESPONSE to a violation, never its detection. It cannot
1062
- * manufacture a refusal where the `policyEnforcement` stage never ran, and it
1063
- * cannot refuse a non-blocking (`warn`) violation — so `enforce` is not a
1064
- * kill switch, and an allowlisted maintainer stays served.
1065
- *
1066
- * @returns the refusal, or `undefined` when the input passes or the mode has
1067
- * not opted in.
1068
- */
1069
- refuseIfEnforcing(violation, meta, effectiveTrustTier) {
1070
- if (violation?.severity !== "block" || this.policyMode !== "enforce") return void 0;
1071
- logger2.warn("Firewall REFUSED input under enforce mode", {
1072
- user: meta.username,
1073
- effectiveTrustTier,
1074
- rule: violation.rule
1075
- });
1076
- return {
1077
- code: "POLICY_REFUSED",
1078
- message: `Refused by firewall policy: ${violation.rule} \u2014 ${violation.message}`,
1079
- stage: "policy"
1080
- };
1081
- }
1082
1117
  /**
1083
1118
  * Validates corroboration for a decided action (#5382).
1084
1119
  *
@@ -1110,7 +1145,7 @@ var HostileInputFirewall = class {
1110
1145
  }
1111
1146
  const corroboration = validateCorroboration(action);
1112
1147
  if (!corroboration.satisfied && this.policyMode === "enforce") {
1113
- logger2.warn("Firewall REFUSED an uncorroborated action under enforce mode", {
1148
+ logger3.warn("Firewall REFUSED an uncorroborated action under enforce mode", {
1114
1149
  actionType: corroboration.actionType,
1115
1150
  missing: corroboration.missing
1116
1151
  });
@@ -1335,7 +1370,7 @@ function createGitHubAdapter() {
1335
1370
  }
1336
1371
 
1337
1372
  // src/dogfooding/untrusted-input-firewall.ts
1338
- var logger3 = createLogger({ component: "UntrustedInputFirewall" });
1373
+ var logger4 = createLogger({ component: "UntrustedInputFirewall" });
1339
1374
  var singleton;
1340
1375
  var configuredAuditLogger;
1341
1376
  function configureUntrustedInputFirewall(deps) {
@@ -1354,7 +1389,7 @@ function runUntrustedInputFirewall(input, options) {
1354
1389
  const result = getUntrustedInputFirewall().process(input, options);
1355
1390
  if (!result.ok) {
1356
1391
  const { code, stage, message } = result.error;
1357
- logger3.warn("Untrusted-input firewall rejected the input", {
1392
+ logger4.warn("Untrusted-input firewall rejected the input", {
1358
1393
  user: input.username,
1359
1394
  sourceType: input.type,
1360
1395
  code,
@@ -1363,11 +1398,14 @@ function runUntrustedInputFirewall(input, options) {
1363
1398
  return err(new Error(`Untrusted-input firewall ${code} at stage ${stage}: ${message}`));
1364
1399
  }
1365
1400
  if (result.value.wouldRefuse) {
1366
- logger3.warn("Untrusted-input firewall would refuse under enforce (audit mode)", {
1401
+ const policy = result.value.policy;
1402
+ logger4.warn("Untrusted-input firewall would refuse under enforce (audit mode)", {
1367
1403
  user: input.username,
1368
1404
  sourceType: input.type,
1369
1405
  trustTier: result.value.effectiveTrustTier,
1370
- rule: result.value.ruleOfTwoViolation?.rule
1406
+ scope: policy?.scope,
1407
+ rules: policy?.violations.filter((v) => v.severity === "block").map((v) => v.rule),
1408
+ unmeasured: policy?.unmeasured
1371
1409
  });
1372
1410
  }
1373
1411
  return ok(result.value);
@@ -1414,7 +1452,7 @@ function parseIssueUrl(url) {
1414
1452
  }
1415
1453
 
1416
1454
  // src/scm/github-provider-traits.ts
1417
- var logger4 = createLogger({ component: "GitHubProviderTraits" });
1455
+ var logger5 = createLogger({ component: "GitHubProviderTraits" });
1418
1456
  var cachedGhToken = null;
1419
1457
  var ghTokenPromise;
1420
1458
  async function resolveGhToken() {
@@ -1525,7 +1563,7 @@ var GitHubReviewer = class {
1525
1563
  provider;
1526
1564
  async getPullRequestDetail(prNumber) {
1527
1565
  const repo = this.provider.repo;
1528
- logger4.debug("Getting PR detail", { repo, prNumber });
1566
+ logger5.debug("Getting PR detail", { repo, prNumber });
1529
1567
  const prResult = await execGhApi(`repos/${repo}/pulls/${String(prNumber)}`);
1530
1568
  if (!prResult.ok) return prResult;
1531
1569
  const filesResult = await execGhApiList(
@@ -1562,7 +1600,7 @@ var GitHubReviewer = class {
1562
1600
  request_changes: "REQUEST_CHANGES",
1563
1601
  comment: "COMMENT"
1564
1602
  };
1565
- logger4.info("Creating review", { repo, prNumber, decision });
1603
+ logger5.info("Creating review", { repo, prNumber, decision });
1566
1604
  const { execFile } = await import("node:child_process");
1567
1605
  const { promisify } = await import("node:util");
1568
1606
  const exec = promisify(execFile);
@@ -1589,7 +1627,7 @@ var GitHubReviewer = class {
1589
1627
  }
1590
1628
  async getIssueDetail(issueNumber) {
1591
1629
  const repo = this.provider.repo;
1592
- logger4.debug("Getting issue detail", { repo, issueNumber });
1630
+ logger5.debug("Getting issue detail", { repo, issueNumber });
1593
1631
  const result = await execGhApi(`repos/${repo}/issues/${String(issueNumber)}`);
1594
1632
  if (!result.ok) return result;
1595
1633
  try {
@@ -1611,7 +1649,7 @@ var GitHubReviewer = class {
1611
1649
  }
1612
1650
  async listCommentDetails(issueNumber) {
1613
1651
  const repo = this.provider.repo;
1614
- logger4.debug("Listing comment details", { repo, issueNumber });
1652
+ logger5.debug("Listing comment details", { repo, issueNumber });
1615
1653
  const result = await execGhApiList(
1616
1654
  `repos/${repo}/issues/${String(issueNumber)}/comments`
1617
1655
  );
@@ -1634,7 +1672,7 @@ var GitHubReviewer = class {
1634
1672
  };
1635
1673
  var GitHubUserInfo = class {
1636
1674
  async fetchUserMetadata(username) {
1637
- logger4.debug("Fetching user metadata", { username });
1675
+ logger5.debug("Fetching user metadata", { username });
1638
1676
  const result = await execGhApi(`users/${username}`);
1639
1677
  if (!result.ok) return result;
1640
1678
  try {
@@ -1772,7 +1810,7 @@ function buildActionDetails(action, policy, corrob) {
1772
1810
  }
1773
1811
 
1774
1812
  // src/dogfooding/issue-triage.ts
1775
- var logger5 = createLogger({ component: "IssueTriage" });
1813
+ var logger6 = createLogger({ component: "IssueTriage" });
1776
1814
  function applySafetyActions(actions, gateDecision, reputation, issue) {
1777
1815
  const withRefusal = appendRefusalIfHostile(actions, gateDecision, issue);
1778
1816
  return appendApprovalIfBorderline(withRefusal, gateDecision, reputation, issue);
@@ -1808,7 +1846,7 @@ function appendRefusalIfHostile(actions, gateDecision, issue) {
1808
1846
  }
1809
1847
  function logSuppressedDemotion(issueNumber, author, trustResult, gateDecision) {
1810
1848
  if (!gateDecision.demotionSuppressed) return;
1811
- logger5.warn("Reputation demotion suppressed by gating mode (would block under enforce)", {
1849
+ logger6.warn("Reputation demotion suppressed by gating mode (would block under enforce)", {
1812
1850
  issueNumber,
1813
1851
  author,
1814
1852
  mode: gateDecision.mode,
@@ -1828,7 +1866,7 @@ var IssueTriage = class {
1828
1866
  */
1829
1867
  async triageIssue(issueUrl) {
1830
1868
  const startTime = getTimeProvider().now();
1831
- logger5.info("Starting issue triage", { issueUrl });
1869
+ logger6.info("Starting issue triage", { issueUrl });
1832
1870
  const parseResult = parseIssueUrl(issueUrl);
1833
1871
  if (!parseResult.ok) return parseResult;
1834
1872
  const { owner, repo, issueNumber } = parseResult.value;
@@ -1861,7 +1899,7 @@ var IssueTriage = class {
1861
1899
  safeContent: { title: safeTitle, body: safeBody },
1862
1900
  startTime
1863
1901
  });
1864
- logger5.info("Issue triage completed", {
1902
+ logger6.info("Issue triage completed", {
1865
1903
  issueNumber,
1866
1904
  category: result.category,
1867
1905
  actionCount: result.proposedActions.length,
@@ -1877,7 +1915,7 @@ var IssueTriage = class {
1877
1915
  if (text.length === 0) return text;
1878
1916
  const result = sanitizeInput(text, "unknown", author);
1879
1917
  if (result.wasModified) {
1880
- logger5.warn("Issue content sanitized", {
1918
+ logger6.warn("Issue content sanitized", {
1881
1919
  author,
1882
1920
  strippedCount: result.strippedElements.length,
1883
1921
  injectionFlags: result.injectionFlags
@@ -2071,7 +2109,7 @@ var IssueTriage = class {
2071
2109
  const issue = { ...detail, owner, repo };
2072
2110
  const commentsResult = await provider.listCommentDetails(issueNumber);
2073
2111
  if (!commentsResult.ok) {
2074
- logger5.warn("Failed to fetch issue comments; activity reputation is unmeasured", {
2112
+ logger6.warn("Failed to fetch issue comments; activity reputation is unmeasured", {
2075
2113
  issueNumber,
2076
2114
  error: commentsResult.error.message
2077
2115
  });
@@ -2080,7 +2118,7 @@ var IssueTriage = class {
2080
2118
  const commentsAvailable = commentsResult.ok;
2081
2119
  const labelsResult = await provider.listRepositoryLabels();
2082
2120
  if (!labelsResult.ok) {
2083
- logger5.warn("Failed to fetch repository labels; label validity is unmeasured", {
2121
+ logger6.warn("Failed to fetch repository labels; label validity is unmeasured", {
2084
2122
  issueNumber,
2085
2123
  error: labelsResult.error.message
2086
2124
  });
@@ -2162,4 +2200,4 @@ export {
2162
2200
  IssueTriage,
2163
2201
  createIssueTriage
2164
2202
  };
2165
- //# sourceMappingURL=chunk-K76PTPGD.js.map
2203
+ //# sourceMappingURL=chunk-NRIH6GVC.js.map