agent-inspect 6.17.3 → 6.17.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.
Files changed (40) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/README.md +1 -1
  3. package/docs/ADAPTER-CONFORMANCE.md +24 -0
  4. package/docs/ADAPTERS.md +3 -3
  5. package/docs/API.md +13 -7
  6. package/docs/CI-ARTIFACTS.md +2 -1
  7. package/docs/CLI.md +2 -0
  8. package/docs/LIMITATIONS.md +1 -0
  9. package/docs/OPENAI-AGENTS-LOCAL.md +14 -0
  10. package/docs/SAFE-TRACE-SHARING.md +1 -0
  11. package/docs/SELF-HOSTING.md +2 -0
  12. package/docs/STANDARDS.md +15 -0
  13. package/docs/SUPPORT-LEVELS.md +23 -0
  14. package/docs/TRACE-CONTRACTS.md +90 -0
  15. package/package.json +7 -3
  16. package/packages/cli/dist/{chunk-5GGYDIZD.mjs → chunk-GOHYSE7W.mjs} +93 -19
  17. package/packages/cli/dist/chunk-GOHYSE7W.mjs.map +1 -0
  18. package/packages/cli/dist/index.cjs +505 -88
  19. package/packages/cli/dist/index.cjs.map +1 -1
  20. package/packages/cli/dist/index.mjs +417 -74
  21. package/packages/cli/dist/index.mjs.map +1 -1
  22. package/packages/cli/dist/{src-IDMCWKRH.mjs → src-OYGG7QAZ.mjs} +3 -3
  23. package/packages/cli/dist/{src-IDMCWKRH.mjs.map → src-OYGG7QAZ.mjs.map} +1 -1
  24. package/packages/core/dist/advanced.cjs +86 -17
  25. package/packages/core/dist/advanced.cjs.map +1 -1
  26. package/packages/core/dist/advanced.d.cts +1 -1
  27. package/packages/core/dist/advanced.d.ts +1 -1
  28. package/packages/core/dist/advanced.mjs +15 -5
  29. package/packages/core/dist/advanced.mjs.map +1 -1
  30. package/packages/core/dist/checks.cjs +126 -28
  31. package/packages/core/dist/checks.cjs.map +1 -1
  32. package/packages/core/dist/checks.d.cts +28 -2
  33. package/packages/core/dist/checks.d.ts +28 -2
  34. package/packages/core/dist/checks.mjs +1 -1
  35. package/packages/core/dist/{chunk-UFP54T7F.mjs → chunk-DIZPIPY2.mjs} +128 -30
  36. package/packages/core/dist/chunk-DIZPIPY2.mjs.map +1 -0
  37. package/packages/core/dist/{index-Xk9X-yjY.d.cts → index-DWu54Y28.d.cts} +107 -122
  38. package/packages/core/dist/{index-BsCcOKxy.d.ts → index-DlwbVqEs.d.ts} +107 -122
  39. package/packages/cli/dist/chunk-5GGYDIZD.mjs.map +0 -1
  40. package/packages/core/dist/chunk-UFP54T7F.mjs.map +0 -1
@@ -7,7 +7,7 @@ import { P as PersistedInspectEvent } from './persisted-inspect-event-CVZWZldL.c
7
7
  import { Stats } from 'node:fs';
8
8
  import { b as ObservedOutcome } from './types-B562HgN_.cjs';
9
9
  export { O as ObservedOutcomeStatus } from './types-B562HgN_.cjs';
10
- import { b as TraceCheckResult, J as TraceCheckStatus } from './index-Xk9X-yjY.cjs';
10
+ import { b as TraceCheckResult, N as TraceCheckStatus } from './index-DWu54Y28.cjs';
11
11
  import './writers.cjs';
12
12
  import './log-config-CFlIJHTf.cjs';
13
13
  import './index-B259NKkH.cjs';
@@ -7,7 +7,7 @@ import { P as PersistedInspectEvent } from './persisted-inspect-event-BVucFVrP.j
7
7
  import { Stats } from 'node:fs';
8
8
  import { b as ObservedOutcome } from './types-B562HgN_.js';
9
9
  export { O as ObservedOutcomeStatus } from './types-B562HgN_.js';
10
- import { b as TraceCheckResult, J as TraceCheckStatus } from './index-BsCcOKxy.js';
10
+ import { b as TraceCheckResult, N as TraceCheckStatus } from './index-DlwbVqEs.js';
11
11
  import './writers.js';
12
12
  import './log-config-OZRfpHED.js';
13
13
  import './index-B9ZGvUVL.js';
@@ -1,4 +1,4 @@
1
- import { runTraceChecks, createRunStatusRule, createToolUsageRule, createRunDurationRule, createLlmUsageRule, createObservedOutcomeRule } from './chunk-UFP54T7F.mjs';
1
+ import { runTraceChecks, createRunStatusRule, createToolUsageRule, createRunDurationRule, createLlmUsageRule, createObservedOutcomeRule } from './chunk-DIZPIPY2.mjs';
2
2
  export { MAX_TERMINAL_DEPTH, MAX_TERMINAL_NAME_LENGTH, TERMINAL_INDENT, TraceDirectory, createInspector, createInspectorRuntime, formatTerminalName, getCurrentContext, getCurrentCorrelationMetadata, getCurrentDepth, getCurrentRunId, getCurrentRunName, getCurrentStepId, getIndent, getParentStepId, getTraceDirFromContext, getTraceSafetyFromContext, hasActiveContext, isAgentInspectEnabled, isSilentContext, maybeInspectRun, printError, printFailedAt, printRunComplete, printRunStart, printStepComplete, printStepStart, renderErrorLine, renderRunSummary, renderStepLine, resolveTraceDir, runWithContext, runWithStepContext } from './chunk-ZWA5RWMV.mjs';
3
3
  import { buildRunTimeline, filterTraces, extractMetadata, buildRunSummary } from './chunk-SGL4JGCD.mjs';
4
4
  export { buildRunSummary, buildRunTimeline, buildRunWhatSummary, buildTraceStats, extractMetadata, filterTraces, formatStepLabel, renderRunWhat, renderTimeline, renderTraceStats } from './chunk-SGL4JGCD.mjs';
@@ -1043,14 +1043,15 @@ function groupSessionCohorts(runs, options = {}) {
1043
1043
 
1044
1044
  // packages/core/src/sessions/checks.ts
1045
1045
  function emptySummary() {
1046
- return { passed: 0, failed: 0, warnings: 0, errors: 0 };
1046
+ return { passed: 0, failed: 0, warnings: 0, errors: 0, rulesEvaluated: 0 };
1047
1047
  }
1048
1048
  function mergeSummary(target, source) {
1049
1049
  return {
1050
1050
  passed: target.passed + source.passed,
1051
1051
  failed: target.failed + source.failed,
1052
1052
  warnings: target.warnings + source.warnings,
1053
- errors: target.errors + source.errors
1053
+ errors: target.errors + source.errors,
1054
+ rulesEvaluated: target.rulesEvaluated + source.rulesEvaluated
1054
1055
  };
1055
1056
  }
1056
1057
  function sessionDiagnostic(code, message) {
@@ -1074,6 +1075,7 @@ function aggregateSessionCheckResults(perRun, scope) {
1074
1075
  `${scope.scopeKind} not found: ${scope.scopeLabel}`
1075
1076
  )
1076
1077
  ],
1078
+ ruleExecutions: [],
1077
1079
  ...scope.sessionWarnings?.length ? { sessionWarnings: [...scope.sessionWarnings] } : {}
1078
1080
  };
1079
1081
  }
@@ -1094,17 +1096,20 @@ function aggregateSessionCheckResults(perRun, scope) {
1094
1096
  `No readable traces in ${scope.scopeKind}: ${scope.scopeLabel}`
1095
1097
  )
1096
1098
  ],
1099
+ ruleExecutions: [],
1097
1100
  ...scope.sessionWarnings?.length ? { sessionWarnings: [...scope.sessionWarnings] } : {}
1098
1101
  };
1099
1102
  }
1100
1103
  let summary = emptySummary();
1101
1104
  const findings = [];
1102
1105
  const diagnostics = [];
1106
+ const ruleExecutions = [];
1103
1107
  const runResults = [];
1104
1108
  for (const result of perRun) {
1105
1109
  summary = mergeSummary(summary, result.summary);
1106
1110
  findings.push(...result.findings);
1107
1111
  diagnostics.push(...result.diagnostics);
1112
+ ruleExecutions.push(...result.ruleExecutions ?? []);
1108
1113
  if (result.runId) {
1109
1114
  runResults.push({ runId: result.runId, status: result.status });
1110
1115
  }
@@ -1117,6 +1122,11 @@ function aggregateSessionCheckResults(perRun, scope) {
1117
1122
  if (runCmp !== 0) return runCmp;
1118
1123
  return a.ruleId.localeCompare(b.ruleId);
1119
1124
  });
1125
+ ruleExecutions.sort((a, b) => {
1126
+ const runCmp = (a.runId ?? "").localeCompare(b.runId ?? "");
1127
+ if (runCmp !== 0) return runCmp;
1128
+ return a.ruleId.localeCompare(b.ruleId);
1129
+ });
1120
1130
  const hasErrors = diagnostics.some((item) => item.severity === "error");
1121
1131
  const status = hasErrors ? "error" : summary.failed > 0 ? "fail" : "pass";
1122
1132
  return {
@@ -1130,6 +1140,7 @@ function aggregateSessionCheckResults(perRun, scope) {
1130
1140
  summary,
1131
1141
  findings,
1132
1142
  diagnostics,
1143
+ ruleExecutions,
1133
1144
  ...scope.sessionWarnings?.length ? { sessionWarnings: [...scope.sessionWarnings] } : {}
1134
1145
  };
1135
1146
  }
@@ -3206,8 +3217,7 @@ async function runSuiteCase(suiteCase, config, options) {
3206
3217
  status: "pass",
3207
3218
  format: read.format,
3208
3219
  findings: [],
3209
- diagnostics: []
3210
- };
3220
+ diagnostics: []};
3211
3221
  const observationResult = validateExpectedObservations(suiteCase, read);
3212
3222
  const diagnostics = [
3213
3223
  ...checkResult.diagnostics.map(