agent-inspect 6.14.0 → 6.14.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.
Files changed (76) hide show
  1. package/CHANGELOG.md +22 -6
  2. package/README.md +47 -45
  3. package/docs/DEMO-SCRIPT.md +2 -2
  4. package/docs/GOLDEN-PATH.md +18 -18
  5. package/docs/KNOWN-ISSUES.md +2 -1
  6. package/docs/SUPPORT-LEVELS.md +2 -2
  7. package/docs/TRACE-CONTRACTS.md +13 -3
  8. package/package.json +15 -6
  9. package/packages/cli/dist/{chunk-MEO2Z3KE.mjs → chunk-AACUXCHT.mjs} +205 -35
  10. package/packages/cli/dist/chunk-AACUXCHT.mjs.map +1 -0
  11. package/packages/cli/dist/index.cjs +265 -35
  12. package/packages/cli/dist/index.cjs.map +1 -1
  13. package/packages/cli/dist/index.mjs +59 -6
  14. package/packages/cli/dist/index.mjs.map +1 -1
  15. package/packages/cli/dist/{src-6VZNGIF6.mjs → src-ABTS4GO4.mjs} +3 -3
  16. package/packages/cli/dist/{src-6VZNGIF6.mjs.map → src-ABTS4GO4.mjs.map} +1 -1
  17. package/packages/core/dist/advanced.cjs +156 -19
  18. package/packages/core/dist/advanced.cjs.map +1 -1
  19. package/packages/core/dist/advanced.d.cts +17 -9
  20. package/packages/core/dist/advanced.d.ts +17 -9
  21. package/packages/core/dist/advanced.mjs +6 -6
  22. package/packages/core/dist/checks.cjs +108 -18
  23. package/packages/core/dist/checks.cjs.map +1 -1
  24. package/packages/core/dist/checks.d.cts +4 -4
  25. package/packages/core/dist/checks.d.ts +4 -4
  26. package/packages/core/dist/checks.mjs +1 -1
  27. package/packages/core/dist/{chunk-CTA6XNDP.mjs → chunk-5N2OBM7S.mjs} +3 -3
  28. package/packages/core/dist/{chunk-CTA6XNDP.mjs.map → chunk-5N2OBM7S.mjs.map} +1 -1
  29. package/packages/core/dist/chunk-AK5EN4U2.mjs +174 -0
  30. package/packages/core/dist/chunk-AK5EN4U2.mjs.map +1 -0
  31. package/packages/core/dist/{chunk-BS2QCAJX.mjs → chunk-BHMXLDLK.mjs} +110 -20
  32. package/packages/core/dist/chunk-BHMXLDLK.mjs.map +1 -0
  33. package/packages/core/dist/{chunk-UOPVGCOB.mjs → chunk-NXQF73EC.mjs} +3 -3
  34. package/packages/core/dist/{chunk-UOPVGCOB.mjs.map → chunk-NXQF73EC.mjs.map} +1 -1
  35. package/packages/core/dist/{chunk-LFWZEO2L.mjs → chunk-SGL4JGCD.mjs} +3 -3
  36. package/packages/core/dist/{chunk-LFWZEO2L.mjs.map → chunk-SGL4JGCD.mjs.map} +1 -1
  37. package/packages/core/dist/{context-BHAgRjOe.d.cts → context-Ca5yK8Cs.d.cts} +3 -3
  38. package/packages/core/dist/{context-Blyjb5my.d.ts → context-D6cS4XIL.d.ts} +3 -3
  39. package/packages/core/dist/diff.d.cts +3 -3
  40. package/packages/core/dist/diff.d.ts +3 -3
  41. package/packages/core/dist/exporters.d.cts +3 -3
  42. package/packages/core/dist/exporters.d.ts +3 -3
  43. package/packages/core/dist/exporters.mjs +1 -1
  44. package/packages/core/dist/{index-CmXMS-MF.d.cts → index-BY6XZ5aG.d.cts} +3 -3
  45. package/packages/core/dist/{index-Bu_vOjql.d.ts → index-D9HBequ_.d.ts} +3 -3
  46. package/packages/core/dist/index.d.cts +6 -6
  47. package/packages/core/dist/index.d.ts +6 -6
  48. package/packages/core/dist/{inspect-event-DVg84S4v.d.cts → inspect-event-DRthdZlf.d.cts} +9 -0
  49. package/packages/core/dist/{inspect-event-DVg84S4v.d.ts → inspect-event-DRthdZlf.d.ts} +9 -0
  50. package/packages/core/dist/{log-config-BG1WmWf2.d.cts → log-config-CFlIJHTf.d.cts} +1 -1
  51. package/packages/core/dist/{log-config-Ck0aT_Ou.d.ts → log-config-OZRfpHED.d.ts} +1 -1
  52. package/packages/core/dist/logs.cjs +95 -15
  53. package/packages/core/dist/logs.cjs.map +1 -1
  54. package/packages/core/dist/logs.d.cts +3 -3
  55. package/packages/core/dist/logs.d.ts +3 -3
  56. package/packages/core/dist/logs.mjs +2 -2
  57. package/packages/core/dist/{persisted-inspect-event-ChE7pGb7.d.ts → persisted-inspect-event-BVucFVrP.d.ts} +1 -1
  58. package/packages/core/dist/{persisted-inspect-event-d-mSP8kd.d.cts → persisted-inspect-event-CVZWZldL.d.cts} +1 -1
  59. package/packages/core/dist/persisted.cjs +95 -15
  60. package/packages/core/dist/persisted.cjs.map +1 -1
  61. package/packages/core/dist/persisted.d.cts +5 -5
  62. package/packages/core/dist/persisted.d.ts +5 -5
  63. package/packages/core/dist/persisted.mjs +3 -3
  64. package/packages/core/dist/readers.cjs +95 -15
  65. package/packages/core/dist/readers.cjs.map +1 -1
  66. package/packages/core/dist/readers.d.cts +2 -2
  67. package/packages/core/dist/readers.d.ts +2 -2
  68. package/packages/core/dist/readers.mjs +3 -3
  69. package/packages/core/dist/{types-MuwXSJ4b.d.ts → types--ainI31J.d.ts} +1 -1
  70. package/packages/core/dist/{types-BLX3tiOW.d.cts → types-UnrNaTo2.d.cts} +1 -1
  71. package/packages/core/dist/writers.d.cts +2 -2
  72. package/packages/core/dist/writers.d.ts +2 -2
  73. package/packages/cli/dist/chunk-MEO2Z3KE.mjs.map +0 -1
  74. package/packages/core/dist/chunk-BS2QCAJX.mjs.map +0 -1
  75. package/packages/core/dist/chunk-T5MASTIW.mjs +0 -94
  76. package/packages/core/dist/chunk-T5MASTIW.mjs.map +0 -1
@@ -6354,6 +6354,78 @@ var init_resolve2 = __esm({
6354
6354
  }
6355
6355
  });
6356
6356
 
6357
+ // packages/core/src/safety/sensitive-key.ts
6358
+ function normalizeSensitiveKey(value) {
6359
+ return value.toLowerCase().replace(/[^a-z0-9_]/g, "");
6360
+ }
6361
+ function isTokenCredentialKey(normalized) {
6362
+ if (NON_CREDENTIAL_TOKEN_CONFIG_KEYS.has(normalized)) return false;
6363
+ if (normalized === "token") return true;
6364
+ if (normalized.endsWith("tokens")) return false;
6365
+ return normalized.endsWith("token");
6366
+ }
6367
+ function isCredentialSensitiveKey(key, sensitiveKeys = DEFAULT_CREDENTIAL_SENSITIVE_KEYS) {
6368
+ if (!key) return false;
6369
+ const normalized = normalizeSensitiveKey(key);
6370
+ if (!normalized) return false;
6371
+ if (NON_CREDENTIAL_TOKEN_CONFIG_KEYS.has(normalized)) return false;
6372
+ for (const sensitive of sensitiveKeys) {
6373
+ const s = normalizeSensitiveKey(sensitive);
6374
+ if (!s) continue;
6375
+ if (s === "token") {
6376
+ if (isTokenCredentialKey(normalized)) return true;
6377
+ continue;
6378
+ }
6379
+ if (normalized === s) return true;
6380
+ if (normalized.endsWith(`_${s}`) || normalized.startsWith(`${s}_`)) return true;
6381
+ }
6382
+ return false;
6383
+ }
6384
+ var NON_CREDENTIAL_TOKEN_CONFIG_KEYS, DEFAULT_CREDENTIAL_SENSITIVE_KEYS;
6385
+ var init_sensitive_key = __esm({
6386
+ "packages/core/src/safety/sensitive-key.ts"() {
6387
+ NON_CREDENTIAL_TOKEN_CONFIG_KEYS = new Set(
6388
+ [
6389
+ "tokens",
6390
+ "max_tokens",
6391
+ "min_tokens",
6392
+ "ls_max_tokens",
6393
+ "token_count",
6394
+ "token_limit",
6395
+ "token_budget",
6396
+ "input_tokens",
6397
+ "output_tokens",
6398
+ "total_tokens",
6399
+ "cached_tokens",
6400
+ "prompt_tokens",
6401
+ "completion_tokens"
6402
+ ].map(normalizeSensitiveKey)
6403
+ );
6404
+ DEFAULT_CREDENTIAL_SENSITIVE_KEYS = [
6405
+ "authorization",
6406
+ "cookie",
6407
+ "token",
6408
+ "access_token",
6409
+ "accesstoken",
6410
+ "auth_token",
6411
+ "authtoken",
6412
+ "refresh_token",
6413
+ "refreshtoken",
6414
+ "id_token",
6415
+ "idtoken",
6416
+ "bearer_token",
6417
+ "bearertoken",
6418
+ "api_token",
6419
+ "apitoken",
6420
+ "apikey",
6421
+ "api_key",
6422
+ "password",
6423
+ "secret",
6424
+ "email"
6425
+ ];
6426
+ }
6427
+ });
6428
+
6357
6429
  // packages/core/src/checks/logical-events.ts
6358
6430
  function isRecord7(value) {
6359
6431
  return typeof value === "object" && value !== null && !Array.isArray(value);
@@ -6549,6 +6621,23 @@ function projectLogicalEvents(events) {
6549
6621
  }
6550
6622
  }
6551
6623
  if (!remapped) {
6624
+ if (originalParentId === event.eventId) {
6625
+ diagnostics.push({
6626
+ code: "AI_LOGICAL_SELF_PARENT_REMOVED",
6627
+ message: `Removed self-parent edge on ${event.eventId}.`,
6628
+ eventIds: [event.eventId]
6629
+ });
6630
+ const { parentId: _drop, ...rest } = event;
6631
+ normalized.push({
6632
+ ...rest,
6633
+ projection: {
6634
+ ...event.projection,
6635
+ parentNormalized: true,
6636
+ originalParentId
6637
+ }
6638
+ });
6639
+ continue;
6640
+ }
6552
6641
  if (!logicalById.has(originalParentId) && !logicalByRawId.has(originalParentId)) {
6553
6642
  const mapping = event.attributes?.parentMapping;
6554
6643
  const unresolved = mapping === "unresolved" || event.attributes?.parentUnresolved === true || event.attributes?.unresolvedParent === true || // LangGraph/framework scaffolding sentinel labels are not event ids.
@@ -6564,6 +6653,23 @@ function projectLogicalEvents(events) {
6564
6653
  normalized.push(event);
6565
6654
  continue;
6566
6655
  }
6656
+ if (nextParent === event.eventId) {
6657
+ diagnostics.push({
6658
+ code: "AI_LOGICAL_SELF_PARENT_REMOVED",
6659
+ message: `Removed self-parent edge on ${event.eventId} (was ${originalParentId}).`,
6660
+ eventIds: [event.eventId]
6661
+ });
6662
+ const { parentId: _drop, ...rest } = event;
6663
+ normalized.push({
6664
+ ...rest,
6665
+ projection: {
6666
+ ...event.projection,
6667
+ parentNormalized: true,
6668
+ originalParentId
6669
+ }
6670
+ });
6671
+ continue;
6672
+ }
6567
6673
  diagnostics.push({
6568
6674
  code: "AI_LOGICAL_PARENT_REMAPPED",
6569
6675
  message: `Remapped parent ${originalParentId} \u2192 ${nextParent} for ${event.eventId}.`,
@@ -7017,9 +7123,7 @@ function hasRedactionMarker(value, markers) {
7017
7123
  return markers.some((marker) => value.includes(marker)) || /^\[HASH:[A-Za-z0-9_-]+\]$/.test(value);
7018
7124
  }
7019
7125
  function isSensitiveKey(key, sensitiveKeys) {
7020
- if (!key) return false;
7021
- const normalized = normalizedKey(key);
7022
- return sensitiveKeys.some((sensitive) => normalized.includes(normalizedKey(sensitive)));
7126
+ return isCredentialSensitiveKey(key, sensitiveKeys);
7023
7127
  }
7024
7128
  function isRawContentKey(key, forbiddenKeys) {
7025
7129
  if (!key) return false;
@@ -7342,7 +7446,7 @@ function createToolUsageRule(options) {
7342
7446
  }
7343
7447
  }
7344
7448
  const forbidden = new Set(options.forbidden ?? []);
7345
- const allowed = options.allowed ? new Set(options.allowed) : void 0;
7449
+ const allowed = options.allowed?.length ? new Set(options.allowed) : void 0;
7346
7450
  for (const event of tools) {
7347
7451
  const name = toolName(event);
7348
7452
  if (forbidden.has(name)) {
@@ -7378,9 +7482,9 @@ function createLlmUsageRule(options) {
7378
7482
  evaluate(context) {
7379
7483
  const llms = finishedEvents(context, "LLM");
7380
7484
  const findings = [];
7381
- const allowedModels = options.allowedModels ? new Set(options.allowedModels) : void 0;
7382
- const allowedProviders = options.allowedProviders ? new Set(options.allowedProviders) : void 0;
7383
- const finishReasons = options.finishReasons ? new Set(options.finishReasons) : void 0;
7485
+ const allowedModels = options.allowedModels?.length ? new Set(options.allowedModels) : void 0;
7486
+ const allowedProviders = options.allowedProviders?.length ? new Set(options.allowedProviders) : void 0;
7487
+ const finishReasons = options.finishReasons?.length ? new Set(options.finishReasons) : void 0;
7384
7488
  if (options.maxCalls !== void 0 && llms.length > options.maxCalls) {
7385
7489
  findings.push(
7386
7490
  failFinding(
@@ -8060,9 +8164,11 @@ var SEVERITY_RANK, STATUS_RANK, CONFIDENCE_RANK, DEFAULT_SENSITIVE_KEYS, DEFAULT
8060
8164
  var init_checks2 = __esm({
8061
8165
  "packages/core/src/checks/index.ts"() {
8062
8166
  init_outcomes();
8167
+ init_sensitive_key();
8063
8168
  init_logical_events();
8064
8169
  init_logical_events();
8065
8170
  init_trace_facts();
8171
+ init_sensitive_key();
8066
8172
  init_contract();
8067
8173
  SEVERITY_RANK = {
8068
8174
  error: 0,
@@ -8080,16 +8186,7 @@ var init_checks2 = __esm({
8080
8186
  correlated: 2,
8081
8187
  explicit: 3
8082
8188
  };
8083
- DEFAULT_SENSITIVE_KEYS = [
8084
- "authorization",
8085
- "cookie",
8086
- "token",
8087
- "apikey",
8088
- "api_key",
8089
- "password",
8090
- "secret",
8091
- "email"
8092
- ];
8189
+ DEFAULT_SENSITIVE_KEYS = DEFAULT_CREDENTIAL_SENSITIVE_KEYS;
8093
8190
  DEFAULT_RAW_CONTENT_KEYS = [
8094
8191
  "body",
8095
8192
  "headers",
@@ -8434,6 +8531,20 @@ var init_from_trace_event = __esm({
8434
8531
  function inc(map, key) {
8435
8532
  map[key] = (map[key] ?? 0) + 1;
8436
8533
  }
8534
+ function confidenceRank(confidence) {
8535
+ switch (confidence) {
8536
+ case "unknown":
8537
+ return 0;
8538
+ case "heuristic":
8539
+ return 1;
8540
+ case "correlated":
8541
+ return 2;
8542
+ case "explicit":
8543
+ return 3;
8544
+ default:
8545
+ return 0;
8546
+ }
8547
+ }
8437
8548
  function computeRunStatus(events) {
8438
8549
  let runTerminal;
8439
8550
  let sawRunEvent = false;
@@ -8454,6 +8565,84 @@ function computeRunStatus(events) {
8454
8565
  }
8455
8566
  return hasRunning ? "running" : "ok";
8456
8567
  }
8568
+ function linkNodesVisibilityFirst(nodes) {
8569
+ let selfParentCount = 0;
8570
+ let unresolvedParentCount = 0;
8571
+ let normalizedEdgeCount = 0;
8572
+ let cycleCount = 0;
8573
+ const pending = [];
8574
+ for (const node of nodes.values()) {
8575
+ const parentId = node.event.parentId;
8576
+ if (!parentId) continue;
8577
+ if (parentId === node.event.eventId) {
8578
+ selfParentCount += 1;
8579
+ normalizedEdgeCount += 1;
8580
+ continue;
8581
+ }
8582
+ if (!nodes.has(parentId)) {
8583
+ unresolvedParentCount += 1;
8584
+ continue;
8585
+ }
8586
+ pending.push({
8587
+ childId: node.event.eventId,
8588
+ parentId,
8589
+ childTimestamp: node.event.timestamp,
8590
+ childConfidence: node.event.confidence
8591
+ });
8592
+ }
8593
+ pending.sort((a, b) => {
8594
+ const conf = confidenceRank(b.childConfidence) - confidenceRank(a.childConfidence);
8595
+ if (conf !== 0) return conf;
8596
+ return a.childTimestamp - b.childTimestamp;
8597
+ });
8598
+ const parentOf = /* @__PURE__ */ new Map();
8599
+ for (const edge of pending) {
8600
+ parentOf.set(edge.childId, edge.parentId);
8601
+ let cursor = edge.parentId;
8602
+ const seen = /* @__PURE__ */ new Set([edge.childId]);
8603
+ let cyclic = false;
8604
+ while (cursor) {
8605
+ if (seen.has(cursor)) {
8606
+ cyclic = true;
8607
+ break;
8608
+ }
8609
+ seen.add(cursor);
8610
+ cursor = parentOf.get(cursor);
8611
+ }
8612
+ if (cyclic) {
8613
+ parentOf.delete(edge.childId);
8614
+ cycleCount += 1;
8615
+ normalizedEdgeCount += 1;
8616
+ }
8617
+ }
8618
+ for (const [childId, parentId] of parentOf) {
8619
+ nodes.get(parentId).children.push(nodes.get(childId));
8620
+ }
8621
+ const roots = [];
8622
+ for (const node of nodes.values()) {
8623
+ if (!parentOf.has(node.event.eventId)) {
8624
+ roots.push(node);
8625
+ }
8626
+ }
8627
+ const assignDepth = (n, depth, stack) => {
8628
+ if (stack.has(n.event.eventId)) return;
8629
+ n.depth = depth;
8630
+ stack.add(n.event.eventId);
8631
+ for (const c of n.children) assignDepth(c, depth + 1, stack);
8632
+ stack.delete(n.event.eventId);
8633
+ };
8634
+ for (const r of roots) assignDepth(r, 0, /* @__PURE__ */ new Set());
8635
+ return {
8636
+ roots,
8637
+ summary: {
8638
+ rootCount: roots.length,
8639
+ selfParentCount,
8640
+ cycleCount,
8641
+ unresolvedParentCount,
8642
+ normalizedEdgeCount
8643
+ }
8644
+ };
8645
+ }
8457
8646
  var TreeBuilder;
8458
8647
  var init_tree_builder = __esm({
8459
8648
  "packages/core/src/logs/tree-builder.ts"() {
@@ -8474,20 +8663,7 @@ var init_tree_builder = __esm({
8474
8663
  for (const e of sorted) {
8475
8664
  nodes.set(e.eventId, { event: e, children: [], depth: 0 });
8476
8665
  }
8477
- const roots = [];
8478
- for (const node of nodes.values()) {
8479
- const parentId = node.event.parentId;
8480
- if (parentId && nodes.has(parentId)) {
8481
- nodes.get(parentId).children.push(node);
8482
- } else {
8483
- roots.push(node);
8484
- }
8485
- }
8486
- const assignDepth = (n, depth) => {
8487
- n.depth = depth;
8488
- for (const c of n.children) assignDepth(c, depth + 1);
8489
- };
8490
- for (const r of roots) assignDepth(r, 0);
8666
+ const { roots, summary } = linkNodesVisibilityFirst(nodes);
8491
8667
  const confidenceBreakdown = {
8492
8668
  explicit: 0,
8493
8669
  correlated: 0,
@@ -8515,7 +8691,8 @@ var init_tree_builder = __esm({
8515
8691
  metadata: {
8516
8692
  totalEvents: sorted.length,
8517
8693
  confidenceBreakdown,
8518
- kinds
8694
+ kinds,
8695
+ relationshipSummary: summary
8519
8696
  }
8520
8697
  });
8521
8698
  }
@@ -12193,7 +12370,7 @@ var init_src = __esm({
12193
12370
  });
12194
12371
 
12195
12372
  // package.json
12196
- var version = "6.14.0";
12373
+ var version = "6.14.2";
12197
12374
 
12198
12375
  // packages/cli/src/list.ts
12199
12376
  init_advanced();
@@ -15540,7 +15717,7 @@ async function searchCommand(options = {}) {
15540
15717
  }
15541
15718
  console.log(`Search results (${results.length})`);
15542
15719
  for (const r of results) {
15543
- const step = r.stepName !== void 0 ? ` | ${r.stepType ?? "step"}:${r.stepName}` : "";
15720
+ const step = r.stepName !== void 0 ? ` | ${formatStepLabel(r.stepType ?? "step", r.stepName)}` : "";
15544
15721
  const dur = r.durationMs !== void 0 ? ` | ${r.durationMs}ms` : "";
15545
15722
  console.log(
15546
15723
  `${r.runId}${step} | ${r.runStatus}${dur} | ${r.matchReason}`
@@ -16083,6 +16260,53 @@ async function reportCommand(runId, options = {}) {
16083
16260
 
16084
16261
  // packages/cli/src/redact.ts
16085
16262
  init_advanced();
16263
+
16264
+ // packages/redact/src/sensitive-key.ts
16265
+ function normalizeSensitiveKey2(value) {
16266
+ return value.toLowerCase().replace(/[^a-z0-9_]/g, "");
16267
+ }
16268
+ var NON_CREDENTIAL_TOKEN_CONFIG_KEYS2 = new Set(
16269
+ [
16270
+ "tokens",
16271
+ "max_tokens",
16272
+ "min_tokens",
16273
+ "ls_max_tokens",
16274
+ "token_count",
16275
+ "token_limit",
16276
+ "token_budget",
16277
+ "input_tokens",
16278
+ "output_tokens",
16279
+ "total_tokens",
16280
+ "cached_tokens",
16281
+ "prompt_tokens",
16282
+ "completion_tokens"
16283
+ ].map(normalizeSensitiveKey2)
16284
+ );
16285
+ function isTokenCredentialKey2(normalized) {
16286
+ if (NON_CREDENTIAL_TOKEN_CONFIG_KEYS2.has(normalized)) return false;
16287
+ if (normalized === "token") return true;
16288
+ if (normalized.endsWith("tokens")) return false;
16289
+ return normalized.endsWith("token");
16290
+ }
16291
+ function isCredentialSensitiveKey2(key, sensitiveKeys) {
16292
+ if (!key) return false;
16293
+ const normalized = normalizeSensitiveKey2(key);
16294
+ if (!normalized) return false;
16295
+ if (NON_CREDENTIAL_TOKEN_CONFIG_KEYS2.has(normalized)) return false;
16296
+ for (const sensitive of sensitiveKeys) {
16297
+ const s = normalizeSensitiveKey2(sensitive);
16298
+ if (!s) continue;
16299
+ if (s === "token") {
16300
+ if (isTokenCredentialKey2(normalized)) return true;
16301
+ continue;
16302
+ }
16303
+ if (normalized === s) return true;
16304
+ if (normalized.endsWith(`_${s}`) || normalized.startsWith(`${s}_`)) return true;
16305
+ }
16306
+ return false;
16307
+ }
16308
+
16309
+ // packages/redact/src/index.ts
16086
16310
  var DEFAULT_REDACT_KEYS2 = [
16087
16311
  "authorization",
16088
16312
  "cookie",
@@ -16144,6 +16368,12 @@ function isRecord15(value) {
16144
16368
  function toKey2(key) {
16145
16369
  return key.toLowerCase();
16146
16370
  }
16371
+ function findCompiledKeyRule(key, rules) {
16372
+ const exact = toKey2(key);
16373
+ const direct = rules.find((candidate) => candidate.key === exact);
16374
+ if (direct) return direct;
16375
+ return rules.find((candidate) => isCredentialSensitiveKey2(key, [candidate.key]));
16376
+ }
16147
16377
  function stableHash2(value) {
16148
16378
  const hash = crypto__default.default.createHash("sha256").update(value, "utf8").digest("hex");
16149
16379
  return hash.slice(0, 8);
@@ -16465,7 +16695,7 @@ var Redactor2 = class {
16465
16695
  return "[Truncated]";
16466
16696
  }
16467
16697
  if (key !== void 0) {
16468
- const rule = this.#rules.find((candidate) => candidate.key === toKey2(key));
16698
+ const rule = findCompiledKeyRule(key, this.#rules);
16469
16699
  if (rule) {
16470
16700
  this.#recordFinding(
16471
16701
  state,