@vitest-agent/sdk 7.1.0 → 8.0.0
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.
- package/errors/ProjectIdentityError.js +25 -1
- package/index.d.ts +561 -434
- package/index.js +4 -5
- package/package.json +1 -1
- package/schemas/5.0/run.json +18 -222
- package/schemas/AgentReport.js +12 -12
- package/schemas/Common.js +22 -1
- package/schemas/ConsoleLeaks.js +6 -5
- package/schemas/Coverage.js +6 -5
- package/schemas/RenderState.js +8 -1
- package/schemas/RunEvent.js +8 -1
- package/schemas/StrayOutput.js +5 -4
- package/schemas/Thresholds.js +5 -4
- package/utils/console-leaks.js +27 -1
- package/version.js +1 -1
- package/utils/hyperlink.js +0 -10
package/index.js
CHANGED
|
@@ -2,12 +2,12 @@ import { AgentNotFoundError, ConversationNotFoundError, HostMetadataParseError,
|
|
|
2
2
|
import { DataStoreError, extractSqlReason } from "./errors/DataStoreError.js";
|
|
3
3
|
import { DiscoveryError } from "./errors/DiscoveryError.js";
|
|
4
4
|
import { PathResolutionError } from "./errors/PathResolutionError.js";
|
|
5
|
-
import { ProjectIdentityNotResolvableError } from "./errors/ProjectIdentityError.js";
|
|
5
|
+
import { ProjectIdentityNotResolvableError, ProjectIdentitySourceError } from "./errors/ProjectIdentityError.js";
|
|
6
6
|
import { GitCommandError, ProbeMissError } from "./errors/RunContextError.js";
|
|
7
7
|
import { BehaviorNotFoundError, GoalNotFoundError, IllegalStatusTransitionError, TddTaskAlreadyEndedError, TddTaskNotFoundError } from "./errors/TddErrors.js";
|
|
8
8
|
import { ActorType, AgentId, ChatId, ConversationId, HostKind, ProjectKey, TddTaskId } from "./schemas/Identity.js";
|
|
9
9
|
import { Agent, IdempotencyHit } from "./schemas/Agent.js";
|
|
10
|
-
import { AgentConsoleMode, CiConsoleMode, ConsoleMode, ConsoleOutputMode, DetailLevel, Environment, Executor, HumanConsoleMode, PackageManager, ReportError, TestClassification, TestRunReason, TestState } from "./schemas/Common.js";
|
|
10
|
+
import { AgentConsoleMode, CiConsoleMode, ConsoleMode, ConsoleOutputMode, DetailLevel, Environment, Executor, FiniteNumber, HumanConsoleMode, PackageManager, ReportError, TestClassification, TestRunReason, TestState } from "./schemas/Common.js";
|
|
11
11
|
import { ConsoleLeakFile, ConsoleLeaks, ConsoleLeaksFromFailingTests } from "./schemas/ConsoleLeaks.js";
|
|
12
12
|
import { MetricThresholds, PatternMetricThresholds, PatternThresholds, PerFileThresholds, ResolvedThresholds } from "./schemas/Thresholds.js";
|
|
13
13
|
import { CoverageReport, CoverageTotals, FileCoverageReport, GlobShortfall } from "./schemas/Coverage.js";
|
|
@@ -43,7 +43,7 @@ import { canonicalizeGitUrl, gitUrlToProjectKey } from "./utils/canonicalize-git
|
|
|
43
43
|
import { classifyTest } from "./utils/classify-test.js";
|
|
44
44
|
import { compressLines } from "./utils/compress-lines.js";
|
|
45
45
|
import { computeTrend, getRecentDirection, hashTargets } from "./utils/compute-trend.js";
|
|
46
|
-
import { buildConsoleLeaks, collectConsoleLeakEntries } from "./utils/console-leaks.js";
|
|
46
|
+
import { buildConsoleLeaks, collectConsoleLeakEntries, formatConsoleLeaksNote } from "./utils/console-leaks.js";
|
|
47
47
|
import { detectNonDefaultDiscoverStrategy } from "./utils/detect-non-default-discover-strategy.js";
|
|
48
48
|
import { detectPackageManager, getRunCommand } from "./utils/detect-pm.js";
|
|
49
49
|
import { isTimeoutError } from "./utils/detect-timeout.js";
|
|
@@ -52,7 +52,6 @@ import { determineTier, formatConsoleMarkdown, getWorstMetric, relativePath } fr
|
|
|
52
52
|
import { formatFatalError } from "./utils/format-fatal-error.js";
|
|
53
53
|
import { formatGfm } from "./utils/format-gfm.js";
|
|
54
54
|
import { findFunctionBoundary } from "./utils/function-boundary.js";
|
|
55
|
-
import { osc8 } from "./utils/hyperlink.js";
|
|
56
55
|
import { buildEnvPrefix, detectVitestScripts, isVitestInvocation, rewriteBashCommand } from "./utils/match-vitest-command.js";
|
|
57
56
|
import { normalizeWorkspaceKey } from "./utils/normalize-workspace-key.js";
|
|
58
57
|
import { basenamePosix, joinPosix, relativePosix, toPosix } from "./utils/posix-path.js";
|
|
@@ -64,4 +63,4 @@ import { validateCoverageTargetsShape } from "./utils/validate-coverage-targets-
|
|
|
64
63
|
import { requiredArtifactForTransition, transitionEnforcesBehaviorMatch, validatePhaseTransition } from "./utils/validate-phase-transition.js";
|
|
65
64
|
import { CURRENT_SDK_VERSION } from "./version.js";
|
|
66
65
|
|
|
67
|
-
export { ActionSeverity, ActorType, Agent, AgentConsoleMode, AgentId, AgentNotFoundError, AgentPluginOptions, AgentReport, AgentReporterOptions, BATS_FILE_GLOB_SUFFIX, BehaviorAbandonedEvent, BehaviorAddedEvent, BehaviorCompletedEvent, BehaviorDetail, BehaviorNotFoundError, BehaviorRow, BehaviorScopedEventTypes, BehaviorStartedEvent, BehaviorStatus, BehaviorsReadyEvent, BlockedEvent, CURRENT_SDK_VERSION, CacheManifest, CacheManifestEntry, ChannelEvent, ChatId, CiConsoleMode, ConsoleLeakFile, ConsoleLeaks, ConsoleLeaksFromFailingTests, ConsoleLogLevel, ConsoleMode, ConsoleOutputMode, ConsoleOutputs, ConversationId, ConversationNotFoundError, CoverageBaselines, FileCoverageReport as CoverageFile, CoverageGap, CoverageLevel, CoverageMetric, CoverageRenderState, CoverageReport, CoverageTargets, CoverageTargetsMetrics, CoverageTotals, DataStoreError, DetailLevel, DiscoveryError, Environment, Executor, FailureRecord, FileCoverageReport, FileEditPayload, GitCommandError, GlobShortfall, GoalAbandonedEvent, GoalAddedEvent, GoalCompletedEvent, GoalDetail, GoalNotFoundError, GoalRow, GoalStartedEvent, GoalStatus, GoalsReadyEvent, HistoryRecord, HookFirePayload, HookStatus, HookType, HostKind, HostMetadataParseError, HumanConsoleMode, HypothesisPayload, IdempotencyHit, IllegalStatusTransitionError, MetricThresholds, ModuleRecord, ModuleReport, NON_DISCOVERABLE_DIRS, NotePayload, PackageManager, PathResolutionError, PatternMetricThresholds, PatternThresholds, PerFileThresholds, PhaseTransitionEvent, ProbeMissError, ProjectIdentityNotResolvableError, ProjectKey, RUN_REPORT_FILE_SCHEMA_URL, RegistrationConflictError, RenderState, RenderTotals, ReportError, ReportOption, ReportSettings, ReportSummary, ResolvedThresholds, RetentionConfig, RunEvent, RunReportFile, RunRetentionPolicy, SRC_DIR, STRAY_OUTPUT_SOURCE, SessionCompleteEvent, SessionNotFoundError, SessionOutcome, SidecarTimeoutError, StrayOutput, StrayOutputSample, SuggestedActionRecord, TEST_DIR, TEST_FILE_GLOB_SUFFIX, TEST_HELPER_DIRS, TagCountEntry, TddTaskAlreadyEndedError, TddTaskId, TddTaskNotFoundError, TestAnnotation, TestArtifact, TestArtifactLocation, TestAttachment, TestClassification, TestHistory, TestRecord, TestReport, TestRun, TestRunReason, TestState, ToolCallPayload, ToolResultPayload, Transport, TrendEntry, TrendRecord, TurnPayload, UserPromptPayload, VitestAgentConfig, ansi, basenamePosix, buildAgentReport, buildConsoleLeaks, buildEnvPrefix, canonicalizeGitUrl, classifyTest, classifyTestPath, coerceErrorField, coerceErrorText, collectConsoleLeakEntries, compressLines, computeTrend, countSuiteFailures, detectNonDefaultDiscoverStrategy, detectPackageManager, detectVitestScripts, determineTier, extractSqlReason, findFunctionBoundary, findOwningWorkspace, formatConsoleMarkdown, formatFatalError, formatGfm, formatScopedCoverageNote, formatStrayOutputNote, getRecentDirection, getRunCommand, getWorstMetric, gitUrlToProjectKey, hashTargets, initialRenderState, isEscapeOnly, isTestFileName, isTimeoutError, isVitestInvocation, joinPosix, makeStrayOutputRecorder, normalizeWorkspaceKey,
|
|
66
|
+
export { ActionSeverity, ActorType, Agent, AgentConsoleMode, AgentId, AgentNotFoundError, AgentPluginOptions, AgentReport, AgentReporterOptions, BATS_FILE_GLOB_SUFFIX, BehaviorAbandonedEvent, BehaviorAddedEvent, BehaviorCompletedEvent, BehaviorDetail, BehaviorNotFoundError, BehaviorRow, BehaviorScopedEventTypes, BehaviorStartedEvent, BehaviorStatus, BehaviorsReadyEvent, BlockedEvent, CURRENT_SDK_VERSION, CacheManifest, CacheManifestEntry, ChannelEvent, ChatId, CiConsoleMode, ConsoleLeakFile, ConsoleLeaks, ConsoleLeaksFromFailingTests, ConsoleLogLevel, ConsoleMode, ConsoleOutputMode, ConsoleOutputs, ConversationId, ConversationNotFoundError, CoverageBaselines, FileCoverageReport as CoverageFile, CoverageGap, CoverageLevel, CoverageMetric, CoverageRenderState, CoverageReport, CoverageTargets, CoverageTargetsMetrics, CoverageTotals, DataStoreError, DetailLevel, DiscoveryError, Environment, Executor, FailureRecord, FileCoverageReport, FileEditPayload, FiniteNumber, GitCommandError, GlobShortfall, GoalAbandonedEvent, GoalAddedEvent, GoalCompletedEvent, GoalDetail, GoalNotFoundError, GoalRow, GoalStartedEvent, GoalStatus, GoalsReadyEvent, HistoryRecord, HookFirePayload, HookStatus, HookType, HostKind, HostMetadataParseError, HumanConsoleMode, HypothesisPayload, IdempotencyHit, IllegalStatusTransitionError, MetricThresholds, ModuleRecord, ModuleReport, NON_DISCOVERABLE_DIRS, NotePayload, PackageManager, PathResolutionError, PatternMetricThresholds, PatternThresholds, PerFileThresholds, PhaseTransitionEvent, ProbeMissError, ProjectIdentityNotResolvableError, ProjectIdentitySourceError, ProjectKey, RUN_REPORT_FILE_SCHEMA_URL, RegistrationConflictError, RenderState, RenderTotals, ReportError, ReportOption, ReportSettings, ReportSummary, ResolvedThresholds, RetentionConfig, RunEvent, RunReportFile, RunRetentionPolicy, SRC_DIR, STRAY_OUTPUT_SOURCE, SessionCompleteEvent, SessionNotFoundError, SessionOutcome, SidecarTimeoutError, StrayOutput, StrayOutputSample, SuggestedActionRecord, TEST_DIR, TEST_FILE_GLOB_SUFFIX, TEST_HELPER_DIRS, TagCountEntry, TddTaskAlreadyEndedError, TddTaskId, TddTaskNotFoundError, TestAnnotation, TestArtifact, TestArtifactLocation, TestAttachment, TestClassification, TestHistory, TestRecord, TestReport, TestRun, TestRunReason, TestState, ToolCallPayload, ToolResultPayload, Transport, TrendEntry, TrendRecord, TurnPayload, UserPromptPayload, VitestAgentConfig, ansi, basenamePosix, buildAgentReport, buildConsoleLeaks, buildEnvPrefix, canonicalizeGitUrl, classifyTest, classifyTestPath, coerceErrorField, coerceErrorText, collectConsoleLeakEntries, compressLines, computeTrend, countSuiteFailures, detectNonDefaultDiscoverStrategy, detectPackageManager, detectVitestScripts, determineTier, extractSqlReason, findFunctionBoundary, findOwningWorkspace, formatConsoleLeaksNote, formatConsoleMarkdown, formatFatalError, formatGfm, formatScopedCoverageNote, formatStrayOutputNote, getRecentDirection, getRunCommand, getWorstMetric, gitUrlToProjectKey, hashTargets, initialRenderState, isEscapeOnly, isTestFileName, isTimeoutError, isVitestInvocation, joinPosix, makeStrayOutputRecorder, normalizeWorkspaceKey, probeHostMetadataFromEnv, readStrayOutput, relativePath, relativePosix, requiredArtifactForTransition, resolveCoverageInput, rewriteBashCommand, safeFilename, stripAnsi, toPosix, transitionEnforcesBehaviorMatch, validateCoverageConfig, validateCoverageTargetsShape, validatePhaseTransition };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vitest-agent/sdk",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "8.0.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Platform-free core for the vitest-agent package family: Effect Schema definitions, reporter and dispatcher contracts, errors, and pure utilities.",
|
|
6
6
|
"keywords": [
|
package/schemas/5.0/run.json
CHANGED
|
@@ -16,69 +16,25 @@
|
|
|
16
16
|
"type": "object",
|
|
17
17
|
"properties": {
|
|
18
18
|
"total": {
|
|
19
|
-
"
|
|
20
|
-
{
|
|
21
|
-
"type": "number"
|
|
22
|
-
},
|
|
23
|
-
{
|
|
24
|
-
"type": "string",
|
|
25
|
-
"enum": ["Infinity", "-Infinity", "NaN"]
|
|
26
|
-
}
|
|
27
|
-
]
|
|
19
|
+
"type": "number"
|
|
28
20
|
},
|
|
29
21
|
"passed": {
|
|
30
|
-
"
|
|
31
|
-
{
|
|
32
|
-
"type": "number"
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
"type": "string",
|
|
36
|
-
"enum": ["Infinity", "-Infinity", "NaN"]
|
|
37
|
-
}
|
|
38
|
-
]
|
|
22
|
+
"type": "number"
|
|
39
23
|
},
|
|
40
24
|
"failed": {
|
|
41
|
-
"
|
|
42
|
-
{
|
|
43
|
-
"type": "number"
|
|
44
|
-
},
|
|
45
|
-
{
|
|
46
|
-
"type": "string",
|
|
47
|
-
"enum": ["Infinity", "-Infinity", "NaN"]
|
|
48
|
-
}
|
|
49
|
-
]
|
|
25
|
+
"type": "number"
|
|
50
26
|
},
|
|
51
27
|
"skipped": {
|
|
52
|
-
"
|
|
53
|
-
{
|
|
54
|
-
"type": "number"
|
|
55
|
-
},
|
|
56
|
-
{
|
|
57
|
-
"type": "string",
|
|
58
|
-
"enum": ["Infinity", "-Infinity", "NaN"]
|
|
59
|
-
}
|
|
60
|
-
]
|
|
28
|
+
"type": "number"
|
|
61
29
|
},
|
|
62
30
|
"duration": {
|
|
63
|
-
"
|
|
64
|
-
{
|
|
65
|
-
"type": "number"
|
|
66
|
-
},
|
|
67
|
-
{
|
|
68
|
-
"type": "string",
|
|
69
|
-
"enum": ["Infinity", "-Infinity", "NaN"]
|
|
70
|
-
}
|
|
71
|
-
]
|
|
31
|
+
"type": "number"
|
|
72
32
|
},
|
|
73
33
|
"modules": {
|
|
74
34
|
"anyOf": [
|
|
75
35
|
{
|
|
76
36
|
"type": "number"
|
|
77
37
|
},
|
|
78
|
-
{
|
|
79
|
-
"type": "string",
|
|
80
|
-
"enum": ["Infinity", "-Infinity", "NaN"]
|
|
81
|
-
},
|
|
82
38
|
{
|
|
83
39
|
"type": "null"
|
|
84
40
|
}
|
|
@@ -163,10 +119,6 @@
|
|
|
163
119
|
{
|
|
164
120
|
"type": "number"
|
|
165
121
|
},
|
|
166
|
-
{
|
|
167
|
-
"type": "string",
|
|
168
|
-
"enum": ["Infinity", "-Infinity", "NaN"]
|
|
169
|
-
},
|
|
170
122
|
{
|
|
171
123
|
"type": "null"
|
|
172
124
|
}
|
|
@@ -233,10 +185,6 @@
|
|
|
233
185
|
{
|
|
234
186
|
"type": "number"
|
|
235
187
|
},
|
|
236
|
-
{
|
|
237
|
-
"type": "string",
|
|
238
|
-
"enum": ["Infinity", "-Infinity", "NaN"]
|
|
239
|
-
},
|
|
240
188
|
{
|
|
241
189
|
"type": "null"
|
|
242
190
|
}
|
|
@@ -269,48 +217,16 @@
|
|
|
269
217
|
"type": "object",
|
|
270
218
|
"properties": {
|
|
271
219
|
"statements": {
|
|
272
|
-
"
|
|
273
|
-
{
|
|
274
|
-
"type": "number"
|
|
275
|
-
},
|
|
276
|
-
{
|
|
277
|
-
"type": "string",
|
|
278
|
-
"enum": ["Infinity", "-Infinity", "NaN"]
|
|
279
|
-
}
|
|
280
|
-
]
|
|
220
|
+
"type": "number"
|
|
281
221
|
},
|
|
282
222
|
"branches": {
|
|
283
|
-
"
|
|
284
|
-
{
|
|
285
|
-
"type": "number"
|
|
286
|
-
},
|
|
287
|
-
{
|
|
288
|
-
"type": "string",
|
|
289
|
-
"enum": ["Infinity", "-Infinity", "NaN"]
|
|
290
|
-
}
|
|
291
|
-
]
|
|
223
|
+
"type": "number"
|
|
292
224
|
},
|
|
293
225
|
"functions": {
|
|
294
|
-
"
|
|
295
|
-
{
|
|
296
|
-
"type": "number"
|
|
297
|
-
},
|
|
298
|
-
{
|
|
299
|
-
"type": "string",
|
|
300
|
-
"enum": ["Infinity", "-Infinity", "NaN"]
|
|
301
|
-
}
|
|
302
|
-
]
|
|
226
|
+
"type": "number"
|
|
303
227
|
},
|
|
304
228
|
"lines": {
|
|
305
|
-
"
|
|
306
|
-
{
|
|
307
|
-
"type": "number"
|
|
308
|
-
},
|
|
309
|
-
{
|
|
310
|
-
"type": "string",
|
|
311
|
-
"enum": ["Infinity", "-Infinity", "NaN"]
|
|
312
|
-
}
|
|
313
|
-
]
|
|
229
|
+
"type": "number"
|
|
314
230
|
}
|
|
315
231
|
},
|
|
316
232
|
"required": ["statements", "branches", "functions", "lines"],
|
|
@@ -324,10 +240,6 @@
|
|
|
324
240
|
{
|
|
325
241
|
"type": "number"
|
|
326
242
|
},
|
|
327
|
-
{
|
|
328
|
-
"type": "string",
|
|
329
|
-
"enum": ["Infinity", "-Infinity", "NaN"]
|
|
330
|
-
},
|
|
331
243
|
{
|
|
332
244
|
"type": "null"
|
|
333
245
|
}
|
|
@@ -338,10 +250,6 @@
|
|
|
338
250
|
{
|
|
339
251
|
"type": "number"
|
|
340
252
|
},
|
|
341
|
-
{
|
|
342
|
-
"type": "string",
|
|
343
|
-
"enum": ["Infinity", "-Infinity", "NaN"]
|
|
344
|
-
},
|
|
345
253
|
{
|
|
346
254
|
"type": "null"
|
|
347
255
|
}
|
|
@@ -352,10 +260,6 @@
|
|
|
352
260
|
{
|
|
353
261
|
"type": "number"
|
|
354
262
|
},
|
|
355
|
-
{
|
|
356
|
-
"type": "string",
|
|
357
|
-
"enum": ["Infinity", "-Infinity", "NaN"]
|
|
358
|
-
},
|
|
359
263
|
{
|
|
360
264
|
"type": "null"
|
|
361
265
|
}
|
|
@@ -366,10 +270,6 @@
|
|
|
366
270
|
{
|
|
367
271
|
"type": "number"
|
|
368
272
|
},
|
|
369
|
-
{
|
|
370
|
-
"type": "string",
|
|
371
|
-
"enum": ["Infinity", "-Infinity", "NaN"]
|
|
372
|
-
},
|
|
373
273
|
{
|
|
374
274
|
"type": "null"
|
|
375
275
|
}
|
|
@@ -396,10 +296,6 @@
|
|
|
396
296
|
{
|
|
397
297
|
"type": "number"
|
|
398
298
|
},
|
|
399
|
-
{
|
|
400
|
-
"type": "string",
|
|
401
|
-
"enum": ["Infinity", "-Infinity", "NaN"]
|
|
402
|
-
},
|
|
403
299
|
{
|
|
404
300
|
"type": "null"
|
|
405
301
|
}
|
|
@@ -410,10 +306,6 @@
|
|
|
410
306
|
{
|
|
411
307
|
"type": "number"
|
|
412
308
|
},
|
|
413
|
-
{
|
|
414
|
-
"type": "string",
|
|
415
|
-
"enum": ["Infinity", "-Infinity", "NaN"]
|
|
416
|
-
},
|
|
417
309
|
{
|
|
418
310
|
"type": "null"
|
|
419
311
|
}
|
|
@@ -424,10 +316,6 @@
|
|
|
424
316
|
{
|
|
425
317
|
"type": "number"
|
|
426
318
|
},
|
|
427
|
-
{
|
|
428
|
-
"type": "string",
|
|
429
|
-
"enum": ["Infinity", "-Infinity", "NaN"]
|
|
430
|
-
},
|
|
431
319
|
{
|
|
432
320
|
"type": "null"
|
|
433
321
|
}
|
|
@@ -438,10 +326,6 @@
|
|
|
438
326
|
{
|
|
439
327
|
"type": "number"
|
|
440
328
|
},
|
|
441
|
-
{
|
|
442
|
-
"type": "string",
|
|
443
|
-
"enum": ["Infinity", "-Infinity", "NaN"]
|
|
444
|
-
},
|
|
445
329
|
{
|
|
446
330
|
"type": "null"
|
|
447
331
|
}
|
|
@@ -587,10 +471,6 @@
|
|
|
587
471
|
{
|
|
588
472
|
"type": "number"
|
|
589
473
|
},
|
|
590
|
-
{
|
|
591
|
-
"type": "string",
|
|
592
|
-
"enum": ["Infinity", "-Infinity", "NaN"]
|
|
593
|
-
},
|
|
594
474
|
{
|
|
595
475
|
"type": "null"
|
|
596
476
|
}
|
|
@@ -659,10 +539,6 @@
|
|
|
659
539
|
{
|
|
660
540
|
"type": "number"
|
|
661
541
|
},
|
|
662
|
-
{
|
|
663
|
-
"type": "string",
|
|
664
|
-
"enum": ["Infinity", "-Infinity", "NaN"]
|
|
665
|
-
},
|
|
666
542
|
{
|
|
667
543
|
"type": "null"
|
|
668
544
|
}
|
|
@@ -673,10 +549,6 @@
|
|
|
673
549
|
{
|
|
674
550
|
"type": "number"
|
|
675
551
|
},
|
|
676
|
-
{
|
|
677
|
-
"type": "string",
|
|
678
|
-
"enum": ["Infinity", "-Infinity", "NaN"]
|
|
679
|
-
},
|
|
680
552
|
{
|
|
681
553
|
"type": "null"
|
|
682
554
|
}
|
|
@@ -687,10 +559,6 @@
|
|
|
687
559
|
{
|
|
688
560
|
"type": "number"
|
|
689
561
|
},
|
|
690
|
-
{
|
|
691
|
-
"type": "string",
|
|
692
|
-
"enum": ["Infinity", "-Infinity", "NaN"]
|
|
693
|
-
},
|
|
694
562
|
{
|
|
695
563
|
"type": "null"
|
|
696
564
|
}
|
|
@@ -706,26 +574,10 @@
|
|
|
706
574
|
"type": "string"
|
|
707
575
|
},
|
|
708
576
|
"stdout": {
|
|
709
|
-
"
|
|
710
|
-
{
|
|
711
|
-
"type": "number"
|
|
712
|
-
},
|
|
713
|
-
{
|
|
714
|
-
"type": "string",
|
|
715
|
-
"enum": ["Infinity", "-Infinity", "NaN"]
|
|
716
|
-
}
|
|
717
|
-
]
|
|
577
|
+
"type": "number"
|
|
718
578
|
},
|
|
719
579
|
"stderr": {
|
|
720
|
-
"
|
|
721
|
-
{
|
|
722
|
-
"type": "number"
|
|
723
|
-
},
|
|
724
|
-
{
|
|
725
|
-
"type": "string",
|
|
726
|
-
"enum": ["Infinity", "-Infinity", "NaN"]
|
|
727
|
-
}
|
|
728
|
-
]
|
|
580
|
+
"type": "number"
|
|
729
581
|
},
|
|
730
582
|
"tests": {
|
|
731
583
|
"anyOf": [
|
|
@@ -758,26 +610,10 @@
|
|
|
758
610
|
"type": "object",
|
|
759
611
|
"properties": {
|
|
760
612
|
"total": {
|
|
761
|
-
"
|
|
762
|
-
{
|
|
763
|
-
"type": "number"
|
|
764
|
-
},
|
|
765
|
-
{
|
|
766
|
-
"type": "string",
|
|
767
|
-
"enum": ["Infinity", "-Infinity", "NaN"]
|
|
768
|
-
}
|
|
769
|
-
]
|
|
613
|
+
"type": "number"
|
|
770
614
|
},
|
|
771
615
|
"files": {
|
|
772
|
-
"
|
|
773
|
-
{
|
|
774
|
-
"type": "number"
|
|
775
|
-
},
|
|
776
|
-
{
|
|
777
|
-
"type": "string",
|
|
778
|
-
"enum": ["Infinity", "-Infinity", "NaN"]
|
|
779
|
-
}
|
|
780
|
-
]
|
|
616
|
+
"type": "number"
|
|
781
617
|
}
|
|
782
618
|
},
|
|
783
619
|
"required": ["total", "files"],
|
|
@@ -787,15 +623,7 @@
|
|
|
787
623
|
"type": "object",
|
|
788
624
|
"properties": {
|
|
789
625
|
"total": {
|
|
790
|
-
"
|
|
791
|
-
{
|
|
792
|
-
"type": "number"
|
|
793
|
-
},
|
|
794
|
-
{
|
|
795
|
-
"type": "string",
|
|
796
|
-
"enum": ["Infinity", "-Infinity", "NaN"]
|
|
797
|
-
}
|
|
798
|
-
]
|
|
626
|
+
"type": "number"
|
|
799
627
|
},
|
|
800
628
|
"byFile": {
|
|
801
629
|
"type": "array",
|
|
@@ -845,48 +673,16 @@
|
|
|
845
673
|
"type": "object",
|
|
846
674
|
"properties": {
|
|
847
675
|
"total": {
|
|
848
|
-
"
|
|
849
|
-
{
|
|
850
|
-
"type": "number"
|
|
851
|
-
},
|
|
852
|
-
{
|
|
853
|
-
"type": "string",
|
|
854
|
-
"enum": ["Infinity", "-Infinity", "NaN"]
|
|
855
|
-
}
|
|
856
|
-
]
|
|
676
|
+
"type": "number"
|
|
857
677
|
},
|
|
858
678
|
"stdout": {
|
|
859
|
-
"
|
|
860
|
-
{
|
|
861
|
-
"type": "number"
|
|
862
|
-
},
|
|
863
|
-
{
|
|
864
|
-
"type": "string",
|
|
865
|
-
"enum": ["Infinity", "-Infinity", "NaN"]
|
|
866
|
-
}
|
|
867
|
-
]
|
|
679
|
+
"type": "number"
|
|
868
680
|
},
|
|
869
681
|
"stderr": {
|
|
870
|
-
"
|
|
871
|
-
{
|
|
872
|
-
"type": "number"
|
|
873
|
-
},
|
|
874
|
-
{
|
|
875
|
-
"type": "string",
|
|
876
|
-
"enum": ["Infinity", "-Infinity", "NaN"]
|
|
877
|
-
}
|
|
878
|
-
]
|
|
682
|
+
"type": "number"
|
|
879
683
|
},
|
|
880
684
|
"bytes": {
|
|
881
|
-
"
|
|
882
|
-
{
|
|
883
|
-
"type": "number"
|
|
884
|
-
},
|
|
885
|
-
{
|
|
886
|
-
"type": "string",
|
|
887
|
-
"enum": ["Infinity", "-Infinity", "NaN"]
|
|
888
|
-
}
|
|
889
|
-
]
|
|
685
|
+
"type": "number"
|
|
890
686
|
},
|
|
891
687
|
"samples": {
|
|
892
688
|
"type": "array",
|
package/schemas/AgentReport.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ReportError, TestClassification, TestRunReason, TestState } from "./Common.js";
|
|
1
|
+
import { FiniteNumber, ReportError, TestClassification, TestRunReason, TestState } from "./Common.js";
|
|
2
2
|
import { ConsoleLeaks } from "./ConsoleLeaks.js";
|
|
3
3
|
import { CoverageReport } from "./Coverage.js";
|
|
4
4
|
import { StrayOutput } from "./StrayOutput.js";
|
|
@@ -10,11 +10,11 @@ import { Schema } from "effect";
|
|
|
10
10
|
* @public
|
|
11
11
|
*/
|
|
12
12
|
const ReportSummary = Schema.Struct({
|
|
13
|
-
total:
|
|
14
|
-
passed:
|
|
15
|
-
failed:
|
|
16
|
-
skipped:
|
|
17
|
-
duration:
|
|
13
|
+
total: FiniteNumber,
|
|
14
|
+
passed: FiniteNumber,
|
|
15
|
+
failed: FiniteNumber,
|
|
16
|
+
skipped: FiniteNumber,
|
|
17
|
+
duration: FiniteNumber,
|
|
18
18
|
/**
|
|
19
19
|
* Count of every collected module, passing modules included.
|
|
20
20
|
* `AgentReport.failed` only carries failing modules, so a green run
|
|
@@ -22,7 +22,7 @@ const ReportSummary = Schema.Struct({
|
|
|
22
22
|
* this a fully-passing replay reads as "0 modules all-passed"
|
|
23
23
|
* (issue #204). Optional to keep existing fixtures/reports valid.
|
|
24
24
|
*/
|
|
25
|
-
modules: Schema.optional(
|
|
25
|
+
modules: Schema.optional(FiniteNumber)
|
|
26
26
|
}).annotate({ identifier: "ReportSummary" });
|
|
27
27
|
/**
|
|
28
28
|
* An individual test case result.
|
|
@@ -32,7 +32,7 @@ const TestReport = Schema.Struct({
|
|
|
32
32
|
name: Schema.String,
|
|
33
33
|
fullName: Schema.String,
|
|
34
34
|
state: TestState,
|
|
35
|
-
duration: Schema.optional(
|
|
35
|
+
duration: Schema.optional(FiniteNumber),
|
|
36
36
|
flaky: Schema.optional(Schema.Boolean),
|
|
37
37
|
slow: Schema.optional(Schema.Boolean),
|
|
38
38
|
errors: Schema.optional(Schema.Array(ReportError)),
|
|
@@ -45,7 +45,7 @@ const TestReport = Schema.Struct({
|
|
|
45
45
|
const ModuleReport = Schema.Struct({
|
|
46
46
|
file: Schema.String,
|
|
47
47
|
state: TestState,
|
|
48
|
-
duration: Schema.optional(
|
|
48
|
+
duration: Schema.optional(FiniteNumber),
|
|
49
49
|
errors: Schema.optional(Schema.Array(ReportError)),
|
|
50
50
|
tests: Schema.Array(TestReport)
|
|
51
51
|
}).annotate({ identifier: "ModuleReport" });
|
|
@@ -54,9 +54,9 @@ const ModuleReport = Schema.Struct({
|
|
|
54
54
|
* @public
|
|
55
55
|
*/
|
|
56
56
|
const TagCountEntry = Schema.Struct({
|
|
57
|
-
passed: Schema.optional(
|
|
58
|
-
failed: Schema.optional(
|
|
59
|
-
skipped: Schema.optional(
|
|
57
|
+
passed: Schema.optional(FiniteNumber),
|
|
58
|
+
failed: Schema.optional(FiniteNumber),
|
|
59
|
+
skipped: Schema.optional(FiniteNumber)
|
|
60
60
|
}).annotate({ identifier: "TagCountEntry" });
|
|
61
61
|
/**
|
|
62
62
|
* Complete per-project test report written to disk as JSON.
|
package/schemas/Common.js
CHANGED
|
@@ -2,6 +2,27 @@ import { Schema } from "effect";
|
|
|
2
2
|
|
|
3
3
|
// src/schemas/Common.ts
|
|
4
4
|
/**
|
|
5
|
+
* A finite JSON number: the numeric field type for every schema that
|
|
6
|
+
* reaches a published document (`RunReportFile` and the `schemas/5.0/run.json`
|
|
7
|
+
* it generates). The `Type` is still `number`, and a finite value decodes
|
|
8
|
+
* exactly as it did under `Schema.Number`; only `NaN`, `Infinity` and
|
|
9
|
+
* `-Infinity` are rejected.
|
|
10
|
+
*
|
|
11
|
+
* @remarks
|
|
12
|
+
* `Schema.Number` lowers to JSON Schema as
|
|
13
|
+
* `anyOf: [{ type: "number" }, { type: "string", enum: ["Infinity", "-Infinity", "NaN"] }]`
|
|
14
|
+
* so the JSON codec can round-trip the non-finite values JSON has no
|
|
15
|
+
* literal for. The reporter writes those fields with `JSON.stringify`,
|
|
16
|
+
* which never produces the string arms, so the published schema was
|
|
17
|
+
* looser than the data and a type generator read every count and
|
|
18
|
+
* duration as `number | "Infinity" | "-Infinity" | "NaN"` (issue #392).
|
|
19
|
+
* `Schema.Finite`'s check carries a `{ type: "number" }` JSON Schema
|
|
20
|
+
* annotation that the emitter folds into the bare number type.
|
|
21
|
+
*
|
|
22
|
+
* @public
|
|
23
|
+
*/
|
|
24
|
+
const FiniteNumber = Schema.Finite;
|
|
25
|
+
/**
|
|
5
26
|
* Possible states for an individual test case.
|
|
6
27
|
* @public
|
|
7
28
|
*/
|
|
@@ -145,4 +166,4 @@ const ReportError = Schema.Struct({
|
|
|
145
166
|
received: Schema.optional(Schema.String)
|
|
146
167
|
}).annotate({ identifier: "ReportError" });
|
|
147
168
|
|
|
148
|
-
export { AgentConsoleMode, CiConsoleMode, ConsoleMode, ConsoleOutputMode, DetailLevel, Environment, Executor, HumanConsoleMode, PackageManager, ReportError, TestClassification, TestRunReason, TestState };
|
|
169
|
+
export { AgentConsoleMode, CiConsoleMode, ConsoleMode, ConsoleOutputMode, DetailLevel, Environment, Executor, FiniteNumber, HumanConsoleMode, PackageManager, ReportError, TestClassification, TestRunReason, TestState };
|
package/schemas/ConsoleLeaks.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { FiniteNumber } from "./Common.js";
|
|
1
2
|
import { Schema } from "effect";
|
|
2
3
|
|
|
3
4
|
// src/schemas/ConsoleLeaks.ts
|
|
@@ -8,8 +9,8 @@ import { Schema } from "effect";
|
|
|
8
9
|
*/
|
|
9
10
|
const ConsoleLeakFile = Schema.Struct({
|
|
10
11
|
file: Schema.String,
|
|
11
|
-
stdout:
|
|
12
|
-
stderr:
|
|
12
|
+
stdout: FiniteNumber,
|
|
13
|
+
stderr: FiniteNumber,
|
|
13
14
|
tests: Schema.optional(Schema.Array(Schema.String)),
|
|
14
15
|
sample: Schema.optional(Schema.String)
|
|
15
16
|
}).annotate({ identifier: "ConsoleLeakFile" });
|
|
@@ -22,8 +23,8 @@ const ConsoleLeakFile = Schema.Struct({
|
|
|
22
23
|
* @public
|
|
23
24
|
*/
|
|
24
25
|
const ConsoleLeaksFromFailingTests = Schema.Struct({
|
|
25
|
-
total:
|
|
26
|
-
files:
|
|
26
|
+
total: FiniteNumber,
|
|
27
|
+
files: FiniteNumber
|
|
27
28
|
}).annotate({ identifier: "ConsoleLeaksFromFailingTests" });
|
|
28
29
|
/**
|
|
29
30
|
* Aggregate stray-console-output signal for a single test run. Omitted from
|
|
@@ -35,7 +36,7 @@ const ConsoleLeaksFromFailingTests = Schema.Struct({
|
|
|
35
36
|
* @public
|
|
36
37
|
*/
|
|
37
38
|
const ConsoleLeaks = Schema.Struct({
|
|
38
|
-
total:
|
|
39
|
+
total: FiniteNumber,
|
|
39
40
|
byFile: Schema.Array(ConsoleLeakFile),
|
|
40
41
|
truncated: Schema.optional(Schema.Boolean),
|
|
41
42
|
fromFailingTests: Schema.optional(ConsoleLeaksFromFailingTests)
|
package/schemas/Coverage.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { FiniteNumber } from "./Common.js";
|
|
1
2
|
import { MetricThresholds, PatternThresholds } from "./Thresholds.js";
|
|
2
3
|
import { Effect, Schema } from "effect";
|
|
3
4
|
|
|
@@ -7,10 +8,10 @@ import { Effect, Schema } from "effect";
|
|
|
7
8
|
* @public
|
|
8
9
|
*/
|
|
9
10
|
const CoverageTotals = Schema.Struct({
|
|
10
|
-
statements:
|
|
11
|
-
branches:
|
|
12
|
-
functions:
|
|
13
|
-
lines:
|
|
11
|
+
statements: FiniteNumber,
|
|
12
|
+
branches: FiniteNumber,
|
|
13
|
+
functions: FiniteNumber,
|
|
14
|
+
lines: FiniteNumber
|
|
14
15
|
}).annotate({ identifier: "CoverageTotals" });
|
|
15
16
|
/**
|
|
16
17
|
* Per-file coverage data including uncovered line ranges.
|
|
@@ -58,7 +59,7 @@ const CoverageReport = Schema.Struct({
|
|
|
58
59
|
})),
|
|
59
60
|
scoped: Schema.Boolean.pipe(Schema.withDecodingDefaultKey(Effect.succeed(false))),
|
|
60
61
|
scopedFiles: Schema.optional(Schema.Array(Schema.String)),
|
|
61
|
-
totalFiles: Schema.optional(
|
|
62
|
+
totalFiles: Schema.optional(FiniteNumber),
|
|
62
63
|
lowCoverage: Schema.Array(FileCoverageReport),
|
|
63
64
|
lowCoverageFiles: Schema.Array(Schema.String),
|
|
64
65
|
belowTarget: Schema.optional(Schema.Array(FileCoverageReport)),
|
package/schemas/RenderState.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ReportError, TestClassification, TestState } from "./Common.js";
|
|
2
|
+
import { ConsoleLeaks } from "./ConsoleLeaks.js";
|
|
2
3
|
import { MetricThresholds } from "./Thresholds.js";
|
|
3
4
|
import { CoverageTotals, GlobShortfall } from "./Coverage.js";
|
|
4
5
|
import { StrayOutput } from "./StrayOutput.js";
|
|
@@ -163,7 +164,13 @@ const RenderState = Schema.Struct({
|
|
|
163
164
|
* capture, folded from `RunFinished.strayOutput`. Absent when the run
|
|
164
165
|
* wrote nothing stray.
|
|
165
166
|
*/
|
|
166
|
-
strayOutput: Schema.optional(StrayOutput)
|
|
167
|
+
strayOutput: Schema.optional(StrayOutput),
|
|
168
|
+
/**
|
|
169
|
+
* `console.*` output Vitest captured from tests that did not fail, folded
|
|
170
|
+
* from `RunFinished.consoleLeaks`. Absent when the run logged nothing
|
|
171
|
+
* (issue #544).
|
|
172
|
+
*/
|
|
173
|
+
consoleLeaks: Schema.optional(ConsoleLeaks)
|
|
167
174
|
}).annotate({ identifier: "RenderState" });
|
|
168
175
|
/**
|
|
169
176
|
* Initial state — what the reducer returns when no events have been
|
package/schemas/RunEvent.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ReportError, TestClassification, TestState } from "./Common.js";
|
|
2
|
+
import { ConsoleLeaks } from "./ConsoleLeaks.js";
|
|
2
3
|
import { MetricThresholds } from "./Thresholds.js";
|
|
3
4
|
import { CoverageTotals, FileCoverageReport, GlobShortfall } from "./Coverage.js";
|
|
4
5
|
import { StrayOutput } from "./StrayOutput.js";
|
|
@@ -226,7 +227,13 @@ const RunEvent = Schema.Union([
|
|
|
226
227
|
* capture (`AgentReport.strayOutput`). Optional: absent when the run
|
|
227
228
|
* wrote nothing stray, and in older replay data.
|
|
228
229
|
*/
|
|
229
|
-
strayOutput: Schema.optional(StrayOutput)
|
|
230
|
+
strayOutput: Schema.optional(StrayOutput),
|
|
231
|
+
/**
|
|
232
|
+
* `console.*` output Vitest captured from tests that did not fail
|
|
233
|
+
* (`AgentReport.consoleLeaks`). Optional: absent when the run logged
|
|
234
|
+
* nothing, and in older replay data (issue #544).
|
|
235
|
+
*/
|
|
236
|
+
consoleLeaks: Schema.optional(ConsoleLeaks)
|
|
230
237
|
})
|
|
231
238
|
]).annotate({ identifier: "RunEvent" });
|
|
232
239
|
|
package/schemas/StrayOutput.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { FiniteNumber } from "./Common.js";
|
|
1
2
|
import { Schema } from "effect";
|
|
2
3
|
|
|
3
4
|
// src/schemas/StrayOutput.ts
|
|
@@ -27,10 +28,10 @@ const StrayOutputSample = Schema.Struct({
|
|
|
27
28
|
* @public
|
|
28
29
|
*/
|
|
29
30
|
const StrayOutput = Schema.Struct({
|
|
30
|
-
total:
|
|
31
|
-
stdout:
|
|
32
|
-
stderr:
|
|
33
|
-
bytes:
|
|
31
|
+
total: FiniteNumber,
|
|
32
|
+
stdout: FiniteNumber,
|
|
33
|
+
stderr: FiniteNumber,
|
|
34
|
+
bytes: FiniteNumber,
|
|
34
35
|
samples: Schema.Array(StrayOutputSample)
|
|
35
36
|
}).annotate({ identifier: "StrayOutput" });
|
|
36
37
|
|