@wix/pathgrade 1.0.30 → 1.0.32

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 (109) hide show
  1. package/dist/adapters/jest/invocation-adapter.d.ts +2 -2
  2. package/dist/adapters/jest/invocation-adapter.js +1 -1
  3. package/dist/adapters/jest/lifecycle.d.ts +3 -3
  4. package/dist/adapters/jest/lifecycle.js +1 -1
  5. package/dist/adapters/jest/metadata.d.ts +0 -1
  6. package/dist/adapters/jest/metadata.js +1 -1
  7. package/dist/adapters/jest/results.d.ts +4 -2
  8. package/dist/adapters/jest/results.js +6 -0
  9. package/dist/adapters/jest/runner-adapter.js +3 -0
  10. package/dist/adapters/node-test/index.js +2 -0
  11. package/dist/adapters/node-test/runner-adapter.js +6 -5
  12. package/dist/affected/format.d.ts +0 -23
  13. package/dist/affected/format.js +1 -1
  14. package/dist/affected/sidecar.d.ts +0 -1
  15. package/dist/affected/sidecar.js +1 -1
  16. package/dist/affected/types.d.ts +2 -17
  17. package/dist/agents/claude/ask-user-answer-store.d.ts +2 -1
  18. package/dist/agents/claude/tool-results.d.ts +1 -1
  19. package/dist/agents/claude/tool-results.js +1 -1
  20. package/dist/agents/claude.d.ts +2 -1
  21. package/dist/agents/codex-app-server/protocol/DynamicToolCallParams.d.ts +2 -1
  22. package/dist/agents/codex-app-server/protocol/GrantedPermissionProfile.d.ts +3 -2
  23. package/dist/agents/codex-app-server/protocol/McpElicitationRequestParams.d.ts +3 -2
  24. package/dist/agents/codex-app-server/protocol/PermissionsRequestApprovalParams.d.ts +3 -2
  25. package/dist/agents/codex-app-server/protocol/ThreadStartParams.d.ts +7 -6
  26. package/dist/agents/codex-app-server/protocol/TurnCompletedNotification.d.ts +2 -1
  27. package/dist/agents/codex-app-server/transport.d.ts +2 -2
  28. package/dist/commands/analyze.d.ts +0 -13
  29. package/dist/commands/report.d.ts +0 -7
  30. package/dist/commands/report.js +1 -1
  31. package/dist/core/generated-mcp-protocol.d.ts +0 -2
  32. package/dist/core/generated-mcp-protocol.js +2 -2
  33. package/dist/evals/discovery.d.ts +0 -1
  34. package/dist/evals/discovery.js +1 -1
  35. package/dist/internal/direct-mcp-v2/acp-client.d.ts +0 -8
  36. package/dist/internal/direct-mcp-v2/acp-direct-mcp.d.ts +2 -1
  37. package/dist/internal/direct-mcp-v2/claude-direct-mcp.d.ts +1 -1
  38. package/dist/internal/direct-mcp-v2/claude-profile.d.ts +0 -10
  39. package/dist/internal/direct-mcp-v2/claude-profile.js +3 -3
  40. package/dist/internal/direct-mcp-v2/codex-direct-mcp.d.ts +2 -1
  41. package/dist/internal/direct-mcp-v2/compiler.d.ts +0 -1
  42. package/dist/internal/direct-mcp-v2/compiler.js +1 -1
  43. package/dist/internal/direct-mcp-v2/json.d.ts +0 -2
  44. package/dist/internal/direct-mcp-v2/json.js +2 -2
  45. package/dist/internal/direct-mcp-v2/runtime-lock.d.ts +2 -1
  46. package/dist/internal/direct-mcp-v2/runtime-profile.d.ts +0 -1
  47. package/dist/internal/direct-mcp-v2/runtime-profile.js +1 -1
  48. package/dist/internal/direct-mcp-v2/types.d.ts +5 -4
  49. package/dist/providers/mcp-config.d.ts +0 -2
  50. package/dist/providers/mcp-config.js +2 -2
  51. package/dist/providers/mcp-runtime-mounting.d.ts +1 -9
  52. package/dist/providers/sandbox-lifecycle.d.ts +0 -2
  53. package/dist/providers/sandbox-lifecycle.js +2 -2
  54. package/dist/providers/scripted-mcp-mock-host.d.ts +1 -1
  55. package/dist/providers/workspace.d.ts +0 -1
  56. package/dist/reporters/github-comment.d.ts +0 -11
  57. package/dist/reporters/github-comment.js +1 -1
  58. package/dist/reporters/verbose-emitter.d.ts +7 -19
  59. package/dist/reporters/verbose-emitter.js +5 -5
  60. package/dist/reporting/comparison-contract.d.ts +10 -0
  61. package/dist/reporting/comparison-contract.js +127 -0
  62. package/dist/reporting/core.js +14 -1
  63. package/dist/reporting/report-parser.d.ts +2 -0
  64. package/dist/reporting/report-parser.js +112 -0
  65. package/dist/reporting/source-metadata.d.ts +5 -0
  66. package/dist/reporting/source-metadata.js +20 -0
  67. package/dist/reporting/types.d.ts +6 -1
  68. package/dist/runners/adapter-loader.d.ts +0 -3
  69. package/dist/runners/model-builders.d.ts +3 -1
  70. package/dist/runners/model-builders.js +19 -7
  71. package/dist/runners/model-validation.d.ts +2 -1
  72. package/dist/runners/model.d.ts +4 -0
  73. package/dist/runners/repeated-attempts.d.ts +0 -5
  74. package/dist/runners/repeated-attempts.js +1 -1
  75. package/dist/runners/report-projection.js +15 -1
  76. package/dist/runners/vitest-adapter.js +9 -3
  77. package/dist/runners/vitest-invocation.d.ts +2 -2
  78. package/dist/runners/vitest-invocation.js +1 -1
  79. package/dist/runners/vitest-lifecycle.d.ts +0 -2
  80. package/dist/runners/vitest-lifecycle.js +1 -1
  81. package/dist/sdk/ask-bus/handler.d.ts +3 -2
  82. package/dist/sdk/diagnostics.d.ts +4 -3
  83. package/dist/sdk/evaluate.js +5 -0
  84. package/dist/sdk/index.d.ts +2 -0
  85. package/dist/sdk/index.js +1 -0
  86. package/dist/sdk/judge-tool-runner.d.ts +1 -2
  87. package/dist/sdk/lifecycle.js +1 -0
  88. package/dist/sdk/mcp-mock-approvals.d.ts +3 -2
  89. package/dist/sdk/reaction-loader.d.ts +1 -2
  90. package/dist/sdk/reaction-preview.d.ts +1 -4
  91. package/dist/sdk/reaction-preview.js +3 -3
  92. package/dist/sdk/run-scorer.d.ts +1 -4
  93. package/dist/sdk/run-scorer.js +3 -3
  94. package/dist/sdk/runtime-policy.d.ts +0 -1
  95. package/dist/sdk/runtime-policy.js +1 -1
  96. package/dist/sdk/types.d.ts +3 -0
  97. package/dist/tool-events.d.ts +0 -1
  98. package/dist/tool-events.js +1 -1
  99. package/dist/types.d.ts +22 -26
  100. package/dist/types.js +1 -1
  101. package/dist/utils/cli.d.ts +0 -15
  102. package/dist/utils/cli.js +4 -4
  103. package/dist/utils/llm-mocks.d.ts +3 -2
  104. package/dist/utils/llm-providers/cli.d.ts +0 -1
  105. package/dist/utils/llm-providers/cli.js +1 -1
  106. package/dist/utils/llm-types.d.ts +4 -3
  107. package/dist/utils/llm.d.ts +2 -2
  108. package/dist/utils/llm.js +1 -1
  109. package/package.json +2 -2
package/dist/types.d.ts CHANGED
@@ -8,10 +8,10 @@ export interface CommandResult {
8
8
  timedOut?: boolean;
9
9
  killed?: boolean;
10
10
  }
11
- export interface TurnCommand extends CommandResult {
11
+ interface TurnCommand extends CommandResult {
12
12
  command: string;
13
13
  }
14
- export type ConversationReplySource = 'opener' | 'reaction' | 'persona_llm';
14
+ type ConversationReplySource = 'opener' | 'reaction' | 'persona_llm';
15
15
  export interface ConversationTurn {
16
16
  turn_number: number;
17
17
  user_message: string;
@@ -24,7 +24,7 @@ export interface ConversationTurn {
24
24
  step_scorer_results?: ScorerResult[];
25
25
  tool_events?: import('./tool-events.js').ToolEvent[];
26
26
  }
27
- export type ConversationCompletionReason = 'max_turns' | 'signal' | 'done_phrase' | 'done_when' | 'timeout' | 'no_replies' | 'error';
27
+ type ConversationCompletionReason = 'max_turns' | 'signal' | 'done_phrase' | 'done_when' | 'timeout' | 'no_replies' | 'error';
28
28
  export interface ScorerResult {
29
29
  scorer_type: string;
30
30
  score: number;
@@ -32,25 +32,7 @@ export interface ScorerResult {
32
32
  details: string;
33
33
  status?: import('./sdk/types.js').ScorerStatus;
34
34
  }
35
- /**
36
- * JSON contract for deterministic scorer stdout.
37
- * The scorer script must print a JSON object matching this shape to stdout.
38
- */
39
- export interface ScorerOutput {
40
- /** Score between 0.0 and 1.0 (required). Clamped by pathgrade. */
41
- score: number;
42
- /** Human-readable summary (optional). */
43
- details?: string;
44
- /** Per-check breakdown, rendered as checkmarks in reports (optional). */
45
- checks?: ScorerCheck[];
46
- }
47
- /** Individual check result within a ScorerOutput. */
48
- export interface ScorerCheck {
49
- name: string;
50
- passed: boolean;
51
- message?: string;
52
- }
53
- export interface JudgeToolCallLogData {
35
+ interface JudgeToolCallLogData {
54
36
  /** Tool name (readFile | listDir | grep | getToolEvents). */
55
37
  name: string;
56
38
  /** Arguments the LLM passed to the tool. */
@@ -219,6 +201,16 @@ export interface EvalReport {
219
201
  trials: TrialResult[];
220
202
  skills_used: string[];
221
203
  }
204
+ export type ComparisonUnavailableReason = 'definition_metadata_missing' | 'scorer_metadata_missing' | 'runtime_metadata_missing' | 'sampling_incomplete';
205
+ export interface ComparisonContract {
206
+ version: 1;
207
+ definition_revision?: string;
208
+ scorer_revision?: string;
209
+ runtime_revision?: string;
210
+ sampling_revision?: string;
211
+ report_schema_revision: 'pathgrade-results-v2';
212
+ unavailable_reasons?: ComparisonUnavailableReason[];
213
+ }
222
214
  /**
223
215
  * TrialResult with `session_log` and `conversation` stripped. These fields
224
216
  * live only in the per-group trace files; the consolidated results.json keeps
@@ -232,6 +224,8 @@ export type StrippedTrialResult = Omit<TrialResult, 'session_log' | 'conversatio
232
224
  export type PathgradeGroupReport = Omit<EvalReport, 'trials' | 'status'> & {
233
225
  status?: 'pass' | 'fail';
234
226
  trials: StrippedTrialResult[];
227
+ source_file?: string;
228
+ comparison_contract?: ComparisonContract;
235
229
  /** Relative path from `.pathgrade/` to the trace file for this group. */
236
230
  trace_file: string;
237
231
  };
@@ -277,6 +271,8 @@ export interface PathgradeReport {
277
271
  * in every group passed its vitest test.
278
272
  */
279
273
  status: 'pass' | 'fail';
274
+ /** Agent Evals compatibility manifest when changed selection finds no runnable evals. */
275
+ run_kind?: 'evaluation' | 'no-affected';
280
276
  groups: PathgradeGroupReport[];
281
277
  /**
282
278
  * Present when `pathgrade run --changed` produced the run. Absent on
@@ -286,7 +282,7 @@ export interface PathgradeReport {
286
282
  selection?: PathgradeSelectionReport;
287
283
  }
288
284
  export type PassAtKUnavailableReason = 'non_binary_reward' | 'incomplete_attempts' | 'case_identity_mismatch';
289
- export interface TrialPaths {
285
+ interface TrialPaths {
290
286
  root: string;
291
287
  workspace: string;
292
288
  home: string;
@@ -303,11 +299,11 @@ export interface TrialRuntime {
303
299
  }
304
300
  export type EnvironmentHandle = string | TrialRuntime;
305
301
  export type AgentCommandRunner = (cmd: string) => Promise<CommandResult>;
306
- export interface AgentTurnInput {
302
+ interface AgentTurnInput {
307
303
  message: string;
308
304
  continueSession?: boolean;
309
305
  }
310
- export type VisibleAssistantMessageSource = 'assistant_message';
306
+ type VisibleAssistantMessageSource = 'assistant_message';
311
307
  export interface AgentTurnResult {
312
308
  rawOutput: string;
313
309
  assistantMessage: string;
@@ -381,7 +377,6 @@ export interface AgentSession {
381
377
  dispose?(): Promise<void>;
382
378
  }
383
379
  export declare function getWorkspacePath(handle: EnvironmentHandle): string;
384
- export declare function getRuntimeHandle(handle: EnvironmentHandle): string;
385
380
  export declare function getRuntimeEnv(handle: EnvironmentHandle): Record<string, string>;
386
381
  export type McpConfigOrigin = 'generated_mock' | 'caller_config';
387
382
  export interface AgentSessionOptions {
@@ -435,3 +430,4 @@ export declare abstract class BaseAgent {
435
430
  run(_instruction: string, _workspacePath: string, _runCommand: AgentCommandRunner): Promise<string>;
436
431
  }
437
432
  export declare function createAgentSession(agent: BaseAgent, runtime: EnvironmentHandle, runCommand: AgentCommandRunner, options?: AgentSessionOptions): Promise<AgentSession>;
433
+ export {};
package/dist/types.js CHANGED
@@ -1,7 +1,7 @@
1
1
  export function getWorkspacePath(handle) {
2
2
  return typeof handle === 'string' ? handle : handle.workspacePath;
3
3
  }
4
- export function getRuntimeHandle(handle) {
4
+ function getRuntimeHandle(handle) {
5
5
  return typeof handle === 'string' ? handle : handle.handle;
6
6
  }
7
7
  export function getRuntimeEnv(handle) {
@@ -15,21 +15,6 @@ export declare const fmt: {
15
15
  };
16
16
  /** Print a section header with a rule line */
17
17
  export declare function header(title: string, width?: number): void;
18
- /** Print a labeled key-value pair */
19
- export declare function kv(label: string, value: string, indent?: number): void;
20
- /** Print a trial result row */
21
- export declare function trialRow(trialId: number, total: number, reward: number, duration: string, commands: number, scorers: {
22
- type: string;
23
- score: number;
24
- }[]): void;
25
- /** Print the results summary block */
26
- export declare function resultsSummary(passRate: number, passAtK: number, passPowK: number, trials: number, preset?: string): void;
27
- /** Print a validation result */
28
- export declare function validationResult(passed: boolean, reward: number, scorers: {
29
- type: string;
30
- score: number;
31
- details: string;
32
- }[]): void;
33
18
  /**
34
19
  * In-place spinner that shows current phase + elapsed time on one line.
35
20
  *
package/dist/utils/cli.js CHANGED
@@ -27,13 +27,13 @@ export function header(title, width = 60) {
27
27
  console.log(`\n${fmt.bold(`── ${title} `)}${fmt.dim(rule)}`);
28
28
  }
29
29
  /** Print a labeled key-value pair */
30
- export function kv(label, value, indent = 2) {
30
+ function kv(label, value, indent = 2) {
31
31
  const pad = ' '.repeat(indent);
32
32
  const labelPad = label.padEnd(12);
33
33
  console.log(`${pad}${fmt.dim(labelPad)}${value}`);
34
34
  }
35
35
  /** Print a trial result row */
36
- export function trialRow(trialId, total, reward, duration, commands, scorers) {
36
+ function trialRow(trialId, total, reward, duration, commands, scorers) {
37
37
  const pad = ' ';
38
38
  const status = reward >= 0.5 ? fmt.pass('PASS') : fmt.fail('FAIL');
39
39
  const rewardStr = reward.toFixed(2);
@@ -47,7 +47,7 @@ export function trialRow(trialId, total, reward, duration, commands, scorers) {
47
47
  console.log(`${pad} ${fmt.dim(trialLabel)} ${status} ${fmt.bold(rewardStr)} ${fmt.dim(duration.padEnd(7))} ${fmt.dim(commands + ' cmds')} ${scorerStr}`);
48
48
  }
49
49
  /** Print the results summary block */
50
- export function resultsSummary(passRate, passAtK, passPowK, trials, preset) {
50
+ function resultsSummary(passRate, passAtK, passPowK, trials, preset) {
51
51
  const presetLabel = preset === 'smoke' ? ' (smoke test)'
52
52
  : preset === 'reliable' ? ' (reliable)'
53
53
  : preset === 'regression' ? ' (regression)'
@@ -61,7 +61,7 @@ export function resultsSummary(passRate, passAtK, passPowK, trials, preset) {
61
61
  console.log();
62
62
  }
63
63
  /** Print a validation result */
64
- export function validationResult(passed, reward, scorers) {
64
+ function validationResult(passed, reward, scorers) {
65
65
  for (const g of scorers) {
66
66
  const scoreStr = g.score.toFixed(2);
67
67
  const color = g.score >= 0.5 ? fmt.green(scoreStr) : fmt.red(scoreStr);
@@ -26,11 +26,11 @@ export interface CreateMockLLMOptions {
26
26
  /** When set, replaces the queue for `.call()`. Useful for dynamic / side-effecting tests. */
27
27
  respond?: (prompt: string, opts?: LLMCallOptions) => MockResponse | Promise<MockResponse>;
28
28
  }
29
- export interface MockCallRecord {
29
+ interface MockCallRecord {
30
30
  prompt: string;
31
31
  opts?: LLMCallOptions;
32
32
  }
33
- export interface MockToolCallRecord {
33
+ interface MockToolCallRecord {
34
34
  messages: ToolUseMessage[];
35
35
  opts: CallWithToolsOptions;
36
36
  }
@@ -41,3 +41,4 @@ export interface MockLLM extends LLMPort {
41
41
  readonly toolCalls: readonly MockToolCallRecord[];
42
42
  }
43
43
  export declare function createMockLLM(opts?: CreateMockLLMOptions): MockLLM;
44
+ export {};
@@ -3,7 +3,6 @@ import type { LLMProvider } from '../llm-types.js';
3
3
  export declare function resetCliCache(): void;
4
4
  /** Check if claude CLI is installed and authenticated. */
5
5
  export declare function isClaudeCliAvailable(): Promise<boolean>;
6
- export declare function isCodexCliAvailable(): Promise<boolean>;
7
6
  interface CliEnvelope {
8
7
  result?: string;
9
8
  structured_output?: unknown;
@@ -27,7 +27,7 @@ export function resetCliCache() {
27
27
  export async function isClaudeCliAvailable() {
28
28
  return getCliAvailability('claude', ['auth', 'status'], 5);
29
29
  }
30
- export async function isCodexCliAvailable() {
30
+ async function isCodexCliAvailable() {
31
31
  return getCliAvailability('codex', ['login', 'status'], 5);
32
32
  }
33
33
  export function parseCliEnvelope(raw) {
@@ -73,12 +73,12 @@ export interface ToolResultBlock {
73
73
  content: string;
74
74
  is_error?: boolean;
75
75
  }
76
- export interface TextBlock {
76
+ interface TextBlock {
77
77
  type: 'text';
78
78
  text: string;
79
79
  }
80
- export type AssistantContentBlock = TextBlock | ToolUseBlock;
81
- export type UserContentBlock = TextBlock | ToolResultBlock;
80
+ type AssistantContentBlock = TextBlock | ToolUseBlock;
81
+ type UserContentBlock = TextBlock | ToolResultBlock;
82
82
  export interface ToolUseMessage {
83
83
  role: 'user' | 'assistant';
84
84
  content: string | Array<AssistantContentBlock | UserContentBlock>;
@@ -105,3 +105,4 @@ export interface LLMProviderAdapter {
105
105
  }
106
106
  /** @deprecated Use `LLMProviderAdapter`. Alias retained only during the RFC 010a migration. */
107
107
  export type LLMProvider = LLMProviderAdapter;
108
+ export {};
@@ -1,5 +1,5 @@
1
1
  import type { LLMProviderAdapter, LLMCallOptions, LLMCallResult, LLMPort } from './llm-types.js';
2
- export type { LLMCallOptions, LLMCallResult, LLMPort, LLMProviderAdapter, LLMProvider, TokenUsage } from './llm-types.js';
2
+ export type { LLMCallOptions, LLMCallResult, LLMPort, LLMProviderAdapter, TokenUsage } from './llm-types.js';
3
3
  export interface CreateLLMClientOptions {
4
4
  adapters?: LLMProviderAdapter[];
5
5
  agent?: string;
@@ -11,7 +11,7 @@ export declare class ProviderNotSupportedError extends Error {
11
11
  readonly adapterName: string;
12
12
  constructor(adapterName: string);
13
13
  }
14
- export { isClaudeCliAvailable, isCodexCliAvailable, resetCliCache, extractStructuredOutput, parseCliEnvelope } from './llm-providers/cli.js';
14
+ export { isClaudeCliAvailable, } from './llm-providers/cli.js';
15
15
  /**
16
16
  * Create an LLM client that tries providers in order.
17
17
  *
package/dist/utils/llm.js CHANGED
@@ -14,7 +14,7 @@ export class ProviderNotSupportedError extends Error {
14
14
  }
15
15
  }
16
16
  // Re-export provider utilities that callsites depend on
17
- export { isClaudeCliAvailable, isCodexCliAvailable, resetCliCache, extractStructuredOutput, parseCliEnvelope } from './llm-providers/cli.js';
17
+ export { isClaudeCliAvailable, } from './llm-providers/cli.js';
18
18
  function inferProviderFromModel(model) {
19
19
  const normalized = model?.trim().toLowerCase();
20
20
  if (!normalized)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wix/pathgrade",
3
- "version": "1.0.30",
3
+ "version": "1.0.32",
4
4
  "packageManager": "yarn@4.12.0",
5
5
  "description": "Evaluate whether AI agents discover and use your skills correctly",
6
6
  "exports": {
@@ -140,5 +140,5 @@
140
140
  "typescript": "^5.9.3",
141
141
  "zod": "4.3.6"
142
142
  },
143
- "falconPackageHash": "c85431c64d766806f41ca2adad9d390e73dc8d09a2feea2ae9285a1c"
143
+ "falconPackageHash": "c7a69bbfe306a62f3d89b21d92a09f18996516cd374f1772d1181d3f"
144
144
  }