executable-stories-formatters 0.8.0 → 0.10.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/dist/adapters.d.cts +1 -1
- package/dist/adapters.d.ts +1 -1
- package/dist/cli.js +1306 -96
- package/dist/cli.js.map +1 -1
- package/dist/{index-BiAYcEiz.d.cts → index-CbWFyoTx.d.cts} +161 -4
- package/dist/{index-BiAYcEiz.d.ts → index-CbWFyoTx.d.ts} +161 -4
- package/dist/index.cjs +1196 -56
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +413 -126
- package/dist/index.d.ts +413 -126
- package/dist/index.js +1178 -55
- package/dist/index.js.map +1 -1
- package/package.json +3 -5
- package/schemas/behavior-manifest-v1.json +65 -0
- package/schemas/examples/dotnet.json +84 -20
- package/schemas/examples/go.json +77 -20
- package/schemas/examples/junit5.json +84 -20
- package/schemas/examples/pytest.json +92 -20
- package/schemas/examples/rust.json +84 -20
- package/schemas/raw-run.schema.json +49 -2
- package/schemas/scenario-index-v1.json +88 -0
- package/schemas/story-report-v1.json +5 -0
- package/bin/intent.js +0 -3
package/dist/index.d.ts
CHANGED
|
@@ -1,125 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export { J as JestAdapterOptions,
|
|
3
|
-
|
|
4
|
-
/** Canonical test status (Cucumber-compatible) */
|
|
5
|
-
type TestStatus$1 = "passed" | "failed" | "skipped" | "pending";
|
|
6
|
-
/** Step result with status and timing */
|
|
7
|
-
interface StepResult {
|
|
8
|
-
/** Step index (0-based) */
|
|
9
|
-
index: number;
|
|
10
|
-
/** Stable step ID when available */
|
|
11
|
-
stepId?: string;
|
|
12
|
-
/** Step status */
|
|
13
|
-
status: TestStatus$1;
|
|
14
|
-
/** Duration in milliseconds (default 0) */
|
|
15
|
-
durationMs: number;
|
|
16
|
-
/** Error message if step failed */
|
|
17
|
-
errorMessage?: string;
|
|
18
|
-
}
|
|
19
|
-
/** Resolved attachment (always has body) */
|
|
20
|
-
interface Attachment {
|
|
21
|
-
/** Attachment name */
|
|
22
|
-
name: string;
|
|
23
|
-
/** MIME type */
|
|
24
|
-
mediaType: string;
|
|
25
|
-
/** Content (base64-encoded or URL) */
|
|
26
|
-
body: string;
|
|
27
|
-
/** Content encoding */
|
|
28
|
-
contentEncoding: "BASE64" | "IDENTITY";
|
|
29
|
-
}
|
|
30
|
-
/** Single test attempt for retry tracking */
|
|
31
|
-
interface TestCaseAttempt {
|
|
32
|
-
/** Attempt number (0-based) */
|
|
33
|
-
attempt: number;
|
|
34
|
-
/** Status of this attempt */
|
|
35
|
-
status: TestStatus$1;
|
|
36
|
-
/** Duration of this attempt in milliseconds */
|
|
37
|
-
durationMs: number;
|
|
38
|
-
/** Error message if this attempt failed */
|
|
39
|
-
errorMessage?: string;
|
|
40
|
-
/** Error stack trace if this attempt failed */
|
|
41
|
-
errorStack?: string;
|
|
42
|
-
}
|
|
43
|
-
/** Canonical test case result */
|
|
44
|
-
interface TestCaseResult {
|
|
45
|
-
/** Unique deterministic ID */
|
|
46
|
-
id: string;
|
|
47
|
-
/** Story metadata (required) */
|
|
48
|
-
story: StoryMeta;
|
|
49
|
-
/** Source file path (required) */
|
|
50
|
-
sourceFile: string;
|
|
51
|
-
/** Source line number (required, default 1) */
|
|
52
|
-
sourceLine: number;
|
|
53
|
-
/** Test status (required) */
|
|
54
|
-
status: TestStatus$1;
|
|
55
|
-
/** Original adapter/framework status (preserved for diagnostics). */
|
|
56
|
-
rawStatus?: RawStatus;
|
|
57
|
-
/** Duration in milliseconds (required, default 0) */
|
|
58
|
-
durationMs: number;
|
|
59
|
-
/** Error message if failed */
|
|
60
|
-
errorMessage?: string;
|
|
61
|
-
/** Error stack trace if failed */
|
|
62
|
-
errorStack?: string;
|
|
63
|
-
/** Attachments (required, empty array if none) */
|
|
64
|
-
attachments: Attachment[];
|
|
65
|
-
/** Step results (required, always populated via fallback rules) */
|
|
66
|
-
stepResults: StepResult[];
|
|
67
|
-
/** Full title path from suite/describe blocks (required, empty array if none) */
|
|
68
|
-
titlePath: string[];
|
|
69
|
-
/** Playwright project name (optional) */
|
|
70
|
-
projectName?: string;
|
|
71
|
-
/** Retry attempt number (required, default 0) */
|
|
72
|
-
retry: number;
|
|
73
|
-
/** Total retries configured (required, default 0) */
|
|
74
|
-
retries: number;
|
|
75
|
-
/** Normalized tags from story (required, empty array if none) */
|
|
76
|
-
tags: string[];
|
|
77
|
-
/** All retry attempts (optional, includes details per attempt) */
|
|
78
|
-
attempts?: TestCaseAttempt[];
|
|
79
|
-
}
|
|
80
|
-
/** CI environment info */
|
|
81
|
-
interface CIInfo {
|
|
82
|
-
name: string;
|
|
83
|
-
url?: string;
|
|
84
|
-
buildNumber?: string;
|
|
85
|
-
branch?: string;
|
|
86
|
-
commitSha?: string;
|
|
87
|
-
prNumber?: string;
|
|
88
|
-
}
|
|
89
|
-
/** Coverage summary for the test run */
|
|
90
|
-
interface CoverageSummary {
|
|
91
|
-
/** Line coverage percentage (0-100) */
|
|
92
|
-
linesPct?: number;
|
|
93
|
-
/** Branch coverage percentage (0-100) */
|
|
94
|
-
branchesPct?: number;
|
|
95
|
-
/** Function coverage percentage (0-100) */
|
|
96
|
-
functionsPct?: number;
|
|
97
|
-
/** Statement coverage percentage (0-100) */
|
|
98
|
-
statementsPct?: number;
|
|
99
|
-
}
|
|
100
|
-
/** Canonical test run result */
|
|
101
|
-
interface TestRunResult {
|
|
102
|
-
/** All test case results */
|
|
103
|
-
testCases: TestCaseResult[];
|
|
104
|
-
/** Run start time (epoch ms, required) */
|
|
105
|
-
startedAtMs: number;
|
|
106
|
-
/** Run finish time (epoch ms, required) */
|
|
107
|
-
finishedAtMs: number;
|
|
108
|
-
/** Total duration in milliseconds (required) */
|
|
109
|
-
durationMs: number;
|
|
110
|
-
/** Project root directory (required) */
|
|
111
|
-
projectRoot: string;
|
|
112
|
-
/** Unique run ID (required, generated) */
|
|
113
|
-
runId: string;
|
|
114
|
-
/** Package version */
|
|
115
|
-
packageVersion?: string;
|
|
116
|
-
/** Git commit SHA */
|
|
117
|
-
gitSha?: string;
|
|
118
|
-
/** CI environment info */
|
|
119
|
-
ci?: CIInfo;
|
|
120
|
-
/** Coverage summary for the run */
|
|
121
|
-
coverage?: CoverageSummary;
|
|
122
|
-
}
|
|
1
|
+
import { C as CIInfo, T as TestRunResult, a as TestCaseResult, S as StoryStep, D as DocEntry, b as TestStatus$1, N as NormalizedTicket, A as Attachment, c as DocPhase, O as OtelSpan, d as StepResult, e as CIProvider, R as RawStatus, f as RawAttachment, g as RawRun, h as RawCIInfo, i as adaptJestRun, j as adaptPlaywrightRun, k as adaptVitestRun } from './index-CbWFyoTx.js';
|
|
2
|
+
export { l as CIInfo, m as CoverageSummary, J as JestAdapterOptions, n as JestAggregatedResult, o as JestFileResult, p as JestTestResult, q as OtelAttributeValue, P as PlaywrightAdapterOptions, r as PlaywrightAnnotation, s as PlaywrightAttachment, t as PlaywrightError, u as PlaywrightLocation, v as PlaywrightStatus, w as PlaywrightTestCase, x as PlaywrightTestResult, y as RawStepEvent, z as RawTestCase, B as STORY_META_KEY, E as StepKeyword, F as StepMode, G as StoryFileReport, H as StoryMeta, I as TestCaseAttempt, K as TestCaseEvidence, V as VitestAdapterOptions, L as VitestSerializedError, M as VitestState, Q as VitestTestCase, U as VitestTestModule, W as VitestTestResult, X as toCIInfo, Y as toRawCIInfo } from './index-CbWFyoTx.js';
|
|
123
3
|
|
|
124
4
|
/**
|
|
125
5
|
* Notification types for webhook integrations (Slack, Teams).
|
|
@@ -137,7 +17,7 @@ interface NotificationSummary {
|
|
|
137
17
|
name: string;
|
|
138
18
|
error?: string;
|
|
139
19
|
}>;
|
|
140
|
-
ci?: CIInfo
|
|
20
|
+
ci?: CIInfo;
|
|
141
21
|
reportUrl?: string;
|
|
142
22
|
}
|
|
143
23
|
/** When to send notifications. */
|
|
@@ -270,7 +150,7 @@ interface CanonicalizeOptions {
|
|
|
270
150
|
};
|
|
271
151
|
}
|
|
272
152
|
/** Output format for report generation */
|
|
273
|
-
type OutputFormat = "astro" | "confluence" | "cucumber-json" | "cucumber-messages" | "cucumber-html" | "html" | "junit" | "markdown" | "story-report-json";
|
|
153
|
+
type OutputFormat = "astro" | "behavior-manifest-json" | "confluence" | "cucumber-json" | "cucumber-messages" | "cucumber-html" | "html" | "junit" | "markdown" | "scenario-index-json" | "story-report-json";
|
|
274
154
|
/** Sort order for test cases in reports (deterministic for diff-friendly output) */
|
|
275
155
|
type SortTestCasesMode = "id" | "source" | "none";
|
|
276
156
|
/** Output mode for report routing */
|
|
@@ -341,6 +221,16 @@ interface FormatterOptions {
|
|
|
341
221
|
/** Pretty-print JSON output. Default: true */
|
|
342
222
|
pretty?: boolean;
|
|
343
223
|
};
|
|
224
|
+
/** Scenario index JSON specific options */
|
|
225
|
+
scenarioIndexJson?: {
|
|
226
|
+
/** Pretty-print JSON output. Default: true */
|
|
227
|
+
pretty?: boolean;
|
|
228
|
+
};
|
|
229
|
+
/** Behavior manifest JSON specific options */
|
|
230
|
+
behaviorManifestJson?: {
|
|
231
|
+
/** Pretty-print JSON output. Default: true */
|
|
232
|
+
pretty?: boolean;
|
|
233
|
+
};
|
|
344
234
|
/** HTML specific options */
|
|
345
235
|
html?: {
|
|
346
236
|
/** Report title. Default: "Test Results" */
|
|
@@ -507,6 +397,12 @@ interface ResolvedFormatterOptions {
|
|
|
507
397
|
storyReportJson: {
|
|
508
398
|
pretty: boolean;
|
|
509
399
|
};
|
|
400
|
+
scenarioIndexJson: {
|
|
401
|
+
pretty: boolean;
|
|
402
|
+
};
|
|
403
|
+
behaviorManifestJson: {
|
|
404
|
+
pretty: boolean;
|
|
405
|
+
};
|
|
510
406
|
cucumberMessages: {
|
|
511
407
|
uriStrategy: "sourceFile" | "virtual";
|
|
512
408
|
includeSynthetics: boolean;
|
|
@@ -899,6 +795,8 @@ interface ReportScenario {
|
|
|
899
795
|
durationMs: number;
|
|
900
796
|
tags: string[];
|
|
901
797
|
tickets?: ReportTicket[];
|
|
798
|
+
/** Product-code paths/globs this scenario exercises (project-root-relative). */
|
|
799
|
+
covers?: string[];
|
|
902
800
|
sourceLine?: number;
|
|
903
801
|
errorMessage?: string;
|
|
904
802
|
errorStack?: string;
|
|
@@ -932,6 +830,118 @@ interface StoryReport {
|
|
|
932
830
|
declare const STORY_REPORT_SCHEMA_VERSION: StoryReportSchemaVersion;
|
|
933
831
|
declare const STORY_REPORT_SCHEMA_MAJOR: 1;
|
|
934
832
|
|
|
833
|
+
/**
|
|
834
|
+
* Review types — the model behind the Evidence-Driven Review report.
|
|
835
|
+
*
|
|
836
|
+
* The review report reframes a test run as "communication with evidence" for
|
|
837
|
+
* reviewing AI-authored changes: intent, approach, proof, outcome — where the
|
|
838
|
+
* proof is that the test passes, graded by how credible that proof actually is.
|
|
839
|
+
*
|
|
840
|
+
* `buildReview(run, context)` mirrors `diffRuns(baseline, current)`:
|
|
841
|
+
* a pure function that produces a {@link ReviewResult} which the review
|
|
842
|
+
* formatters render. Diff context ({@link ReviewContext}) enters at the
|
|
843
|
+
* CLI/Action layer — adapters stay diff-blind.
|
|
844
|
+
*/
|
|
845
|
+
|
|
846
|
+
/** Who a claim is addressed to. Derived from file convention (override via `audience:` tag). */
|
|
847
|
+
type ReviewAudience = "stakeholder" | "engineer";
|
|
848
|
+
/** The kind of change a claim documents. Declared via a `change:*` tag. */
|
|
849
|
+
type ChangeType = "feature" | "bugfix" | "refactor" | "perf" | "deps" | "unknown";
|
|
850
|
+
/**
|
|
851
|
+
* How credible a claim's proof is, worst → best.
|
|
852
|
+
* - `none`: the test isn't passing, so it proves nothing about the change.
|
|
853
|
+
* - `weak`: a passing self-authored unit assertion with no corroborating signal.
|
|
854
|
+
* - `moderate`: integration-level, or corroborated by coverage / a screenshot / a trace.
|
|
855
|
+
* - `strong`: tamper-resistant or constraint-proving — failing-first verified, high
|
|
856
|
+
* mutation score, or a stakeholder e2e claim backed by screenshot + trace.
|
|
857
|
+
*/
|
|
858
|
+
type EvidenceStrength = "none" | "weak" | "moderate" | "strong";
|
|
859
|
+
/** Which evidence band a changed source file falls into. */
|
|
860
|
+
type ReviewBand = "uncovered" | "weak" | "covered";
|
|
861
|
+
/** Change kind for a file in the diff. */
|
|
862
|
+
type FileChangeKind = "added" | "modified" | "deleted" | "renamed";
|
|
863
|
+
/** A single changed file from the diff, fed in at the CLI/Action layer. */
|
|
864
|
+
interface ChangedFile {
|
|
865
|
+
/** Repo-relative path. */
|
|
866
|
+
path: string;
|
|
867
|
+
/** How the file changed. */
|
|
868
|
+
changeKind: FileChangeKind;
|
|
869
|
+
/** Added/modified line numbers in the new file (best-effort; enables finer correlation). */
|
|
870
|
+
changedLines?: number[];
|
|
871
|
+
}
|
|
872
|
+
/**
|
|
873
|
+
* Diff/PR context for a review. Supplied by the Action (`git diff`) or CLI —
|
|
874
|
+
* NEVER by framework adapters. Optional so the report degrades to "claims only"
|
|
875
|
+
* when no diff is available.
|
|
876
|
+
*/
|
|
877
|
+
interface ReviewContext {
|
|
878
|
+
/** Files changed in the PR/diff. */
|
|
879
|
+
changedFiles: ChangedFile[];
|
|
880
|
+
/** Base ref/sha the diff is against (informational). */
|
|
881
|
+
baseRef?: string;
|
|
882
|
+
/** Head ref/sha (informational). */
|
|
883
|
+
headRef?: string;
|
|
884
|
+
}
|
|
885
|
+
/** One reviewable claim = one story/test case, enriched for review. */
|
|
886
|
+
interface ReviewClaim {
|
|
887
|
+
/** Canonical test case id. */
|
|
888
|
+
id: string;
|
|
889
|
+
/** Scenario title (the claim being made). */
|
|
890
|
+
scenario: string;
|
|
891
|
+
sourceFile: string;
|
|
892
|
+
sourceLine: number;
|
|
893
|
+
/** Test outcome. */
|
|
894
|
+
status: TestStatus$1;
|
|
895
|
+
/** Derived from file convention / `audience:` tag. */
|
|
896
|
+
audience: ReviewAudience;
|
|
897
|
+
/** Declared via `change:*` tag (defaults to `unknown`). */
|
|
898
|
+
changeType: ChangeType;
|
|
899
|
+
/** Graded credibility of this claim's proof. */
|
|
900
|
+
strength: EvidenceStrength;
|
|
901
|
+
/** Human-readable reasons the strength was assigned (what corroborated / what was missing). */
|
|
902
|
+
strengthReasons: string[];
|
|
903
|
+
/** Intent/approach narrative pulled from a "Why"/intent section or note, if present. */
|
|
904
|
+
intent?: string;
|
|
905
|
+
/** Changed source files this claim plausibly covers (colocated-filename correlation in v1). */
|
|
906
|
+
coversFiles: string[];
|
|
907
|
+
/** The underlying canonical test case (for formatters needing full detail). */
|
|
908
|
+
testCase: TestCaseResult;
|
|
909
|
+
}
|
|
910
|
+
/** A changed source file correlated against the claims that touch it. */
|
|
911
|
+
interface ChangedFileReview {
|
|
912
|
+
path: string;
|
|
913
|
+
changeKind: FileChangeKind;
|
|
914
|
+
/** Evidence band: uncovered (🔴), weak (🟡), covered (🟢). */
|
|
915
|
+
band: ReviewBand;
|
|
916
|
+
/** Claims correlated to this file, with their strength. */
|
|
917
|
+
claims: Array<{
|
|
918
|
+
id: string;
|
|
919
|
+
scenario: string;
|
|
920
|
+
strength: EvidenceStrength;
|
|
921
|
+
}>;
|
|
922
|
+
}
|
|
923
|
+
/** Roll-up counts for the review. */
|
|
924
|
+
interface ReviewSummary {
|
|
925
|
+
totalClaims: number;
|
|
926
|
+
byAudience: Record<ReviewAudience, number>;
|
|
927
|
+
byStrength: Record<EvidenceStrength, number>;
|
|
928
|
+
/** Number of changed source files considered (test/config files excluded). */
|
|
929
|
+
changedSourceFiles: number;
|
|
930
|
+
uncovered: number;
|
|
931
|
+
weaklyCovered: number;
|
|
932
|
+
covered: number;
|
|
933
|
+
}
|
|
934
|
+
/** The full review model the formatters render. */
|
|
935
|
+
interface ReviewResult {
|
|
936
|
+
run: TestRunResult;
|
|
937
|
+
context: ReviewContext;
|
|
938
|
+
summary: ReviewSummary;
|
|
939
|
+
/** Claims, sorted stakeholder-first then by strength (weakest first, to surface risk). */
|
|
940
|
+
claims: ReviewClaim[];
|
|
941
|
+
/** Changed source files, sorted uncovered → weak → covered. */
|
|
942
|
+
changedFiles: ChangedFileReview[];
|
|
943
|
+
}
|
|
944
|
+
|
|
935
945
|
/**
|
|
936
946
|
* Render an OTel trace waterfall (fn(args, deps)).
|
|
937
947
|
*/
|
|
@@ -1531,6 +1541,185 @@ declare class StoryReportJsonFormatter {
|
|
|
1531
1541
|
format(run: TestRunResult): string;
|
|
1532
1542
|
}
|
|
1533
1543
|
|
|
1544
|
+
interface ScenarioIndex {
|
|
1545
|
+
schemaVersion: "1.0";
|
|
1546
|
+
runId: string;
|
|
1547
|
+
generatedAtMs: number;
|
|
1548
|
+
summary: StoryReport["summary"];
|
|
1549
|
+
scenarios: ScenarioIndexItem[];
|
|
1550
|
+
}
|
|
1551
|
+
interface ScenarioIndexItem {
|
|
1552
|
+
id: string;
|
|
1553
|
+
title: string;
|
|
1554
|
+
status: TestStatus;
|
|
1555
|
+
feature: string;
|
|
1556
|
+
sourceFile: string;
|
|
1557
|
+
sourceLine?: number;
|
|
1558
|
+
tags: string[];
|
|
1559
|
+
tickets: Array<{
|
|
1560
|
+
id: string;
|
|
1561
|
+
url?: string;
|
|
1562
|
+
}>;
|
|
1563
|
+
covers: string[];
|
|
1564
|
+
durationMs: number;
|
|
1565
|
+
steps: ScenarioIndexStep[];
|
|
1566
|
+
docKinds: string[];
|
|
1567
|
+
error?: {
|
|
1568
|
+
message: string;
|
|
1569
|
+
stack?: string;
|
|
1570
|
+
};
|
|
1571
|
+
}
|
|
1572
|
+
interface ScenarioIndexStep {
|
|
1573
|
+
id: string;
|
|
1574
|
+
index: number;
|
|
1575
|
+
keyword: ReportStep["keyword"];
|
|
1576
|
+
text: string;
|
|
1577
|
+
status: TestStatus;
|
|
1578
|
+
durationMs: number;
|
|
1579
|
+
errorMessage?: string;
|
|
1580
|
+
docKinds: string[];
|
|
1581
|
+
}
|
|
1582
|
+
interface ScenarioIndexFilters {
|
|
1583
|
+
statuses?: TestStatus[];
|
|
1584
|
+
tags?: string[];
|
|
1585
|
+
sourceFiles?: string[];
|
|
1586
|
+
}
|
|
1587
|
+
interface ScenarioIndexJsonOptions {
|
|
1588
|
+
pretty?: boolean;
|
|
1589
|
+
filters?: ScenarioIndexFilters;
|
|
1590
|
+
}
|
|
1591
|
+
declare class ScenarioIndexJsonFormatter {
|
|
1592
|
+
private options;
|
|
1593
|
+
constructor(options?: ScenarioIndexJsonOptions);
|
|
1594
|
+
toIndex(run: TestRunResult): ScenarioIndex;
|
|
1595
|
+
format(run: TestRunResult): string;
|
|
1596
|
+
}
|
|
1597
|
+
declare function toScenarioIndex(report: StoryReport, filters?: ScenarioIndexFilters): ScenarioIndex;
|
|
1598
|
+
|
|
1599
|
+
interface BehaviorManifest {
|
|
1600
|
+
schemaVersion: "1.0";
|
|
1601
|
+
runId: string;
|
|
1602
|
+
generatedAtMs: number;
|
|
1603
|
+
summary: ScenarioIndex["summary"];
|
|
1604
|
+
sourceFiles: BehaviorSourceFile[];
|
|
1605
|
+
tags: BehaviorTag[];
|
|
1606
|
+
docCoverage: {
|
|
1607
|
+
scenariosWithDocs: number;
|
|
1608
|
+
scenariosWithoutDocs: number;
|
|
1609
|
+
docKinds: string[];
|
|
1610
|
+
};
|
|
1611
|
+
debugger: BehaviorDebuggerIssue[];
|
|
1612
|
+
}
|
|
1613
|
+
interface BehaviorSourceFile {
|
|
1614
|
+
path: string;
|
|
1615
|
+
scenarioCount: number;
|
|
1616
|
+
failed: number;
|
|
1617
|
+
tags: string[];
|
|
1618
|
+
}
|
|
1619
|
+
interface BehaviorTag {
|
|
1620
|
+
name: string;
|
|
1621
|
+
scenarioCount: number;
|
|
1622
|
+
}
|
|
1623
|
+
interface BehaviorDebuggerIssue {
|
|
1624
|
+
severity: "warning";
|
|
1625
|
+
code: "missing-docs" | "missing-tags" | "missing-covers" | "missing-source-line";
|
|
1626
|
+
scenarioId: string;
|
|
1627
|
+
title: string;
|
|
1628
|
+
message: string;
|
|
1629
|
+
}
|
|
1630
|
+
interface BehaviorManifestJsonOptions {
|
|
1631
|
+
pretty?: boolean;
|
|
1632
|
+
}
|
|
1633
|
+
declare class BehaviorManifestJsonFormatter {
|
|
1634
|
+
private pretty;
|
|
1635
|
+
constructor(options?: BehaviorManifestJsonOptions);
|
|
1636
|
+
toManifest(run: TestRunResult): BehaviorManifest;
|
|
1637
|
+
format(run: TestRunResult): string;
|
|
1638
|
+
}
|
|
1639
|
+
declare function toBehaviorManifest(report: StoryReport): BehaviorManifest;
|
|
1640
|
+
|
|
1641
|
+
/**
|
|
1642
|
+
* Return scenarios whose declared `covers` globs match any of the given paths.
|
|
1643
|
+
* Accepts many paths so callers can pass a whole changed-file list (e.g. a git diff).
|
|
1644
|
+
* Results are deduped (filter preserves index order, so each scenario appears once).
|
|
1645
|
+
*/
|
|
1646
|
+
declare function scenariosCoveringPaths(index: ScenarioIndex, paths: string[]): ScenarioIndexItem[];
|
|
1647
|
+
|
|
1648
|
+
interface WatchOptions {
|
|
1649
|
+
/** Path to the raw-run (or canonical) JSON the framework adapter writes. */
|
|
1650
|
+
input: string;
|
|
1651
|
+
outputDir: string;
|
|
1652
|
+
outputName: string;
|
|
1653
|
+
formats: OutputFormat[];
|
|
1654
|
+
/** Input is "raw" (default) or already-canonical "canonical". */
|
|
1655
|
+
inputType?: "raw" | "canonical";
|
|
1656
|
+
/** Synthesize story metadata for plain tests (raw input only). Default true. */
|
|
1657
|
+
synthesize?: boolean;
|
|
1658
|
+
/** Coalesce rapid change events. Default 150ms. */
|
|
1659
|
+
debounceMs?: number;
|
|
1660
|
+
}
|
|
1661
|
+
interface RegenerateDeps {
|
|
1662
|
+
readFile?: (filePath: string) => string;
|
|
1663
|
+
}
|
|
1664
|
+
/**
|
|
1665
|
+
* Read a raw-run (or canonical) file and regenerate the requested agent
|
|
1666
|
+
* artifacts via the canonical {@link ReportGenerator}. Returns the written
|
|
1667
|
+
* file paths. This is the unit of work the watcher repeats; it is also useful
|
|
1668
|
+
* standalone for a one-shot regenerate.
|
|
1669
|
+
*/
|
|
1670
|
+
declare function regenerateArtifacts(options: WatchOptions, deps?: RegenerateDeps): Promise<string[]>;
|
|
1671
|
+
interface WatchDeps extends RegenerateDeps {
|
|
1672
|
+
/** Watch a path, calling the listener on every change. Injectable for tests. */
|
|
1673
|
+
watch?: (filePath: string, listener: () => void) => {
|
|
1674
|
+
close: () => void;
|
|
1675
|
+
};
|
|
1676
|
+
/** Override the regenerate step (tests). */
|
|
1677
|
+
regenerate?: (input: string) => Promise<string[]>;
|
|
1678
|
+
log?: (message: string) => void;
|
|
1679
|
+
}
|
|
1680
|
+
interface WatchHandle {
|
|
1681
|
+
close: () => void;
|
|
1682
|
+
}
|
|
1683
|
+
/**
|
|
1684
|
+
* Keep the agent artifacts fresh: regenerate them whenever the framework
|
|
1685
|
+
* rewrites its raw-run file. Language-agnostic — any adapter that emits a
|
|
1686
|
+
* raw-run drives it. Pair with the host framework's own `--watch` to get a
|
|
1687
|
+
* behavior index that tracks the code.
|
|
1688
|
+
*/
|
|
1689
|
+
declare function startWatch(options: WatchOptions, deps?: WatchDeps): WatchHandle;
|
|
1690
|
+
|
|
1691
|
+
interface BehaviorDiffEntry {
|
|
1692
|
+
id: string;
|
|
1693
|
+
title: string;
|
|
1694
|
+
sourceFile: string;
|
|
1695
|
+
kind: ScenarioChangeKind;
|
|
1696
|
+
baselineStatus?: TestStatus;
|
|
1697
|
+
currentStatus?: TestStatus;
|
|
1698
|
+
}
|
|
1699
|
+
interface BehaviorDiff {
|
|
1700
|
+
schemaVersion: "1.0";
|
|
1701
|
+
summary: {
|
|
1702
|
+
added: number;
|
|
1703
|
+
removed: number;
|
|
1704
|
+
regressed: number;
|
|
1705
|
+
fixed: number;
|
|
1706
|
+
changed: number;
|
|
1707
|
+
unchanged: number;
|
|
1708
|
+
};
|
|
1709
|
+
scenarios: BehaviorDiffEntry[];
|
|
1710
|
+
}
|
|
1711
|
+
/**
|
|
1712
|
+
* Classify a single scenario's status transition between two runs.
|
|
1713
|
+
* Shares the `ScenarioChangeKind` vocabulary with the full compare engine.
|
|
1714
|
+
*/
|
|
1715
|
+
declare function classifyStatusChange(baseline: TestStatus | undefined, current: TestStatus | undefined): ScenarioChangeKind;
|
|
1716
|
+
/**
|
|
1717
|
+
* Scenario-level diff of two StoryReports, keyed by scenario id. Reports status
|
|
1718
|
+
* transitions (the agent triage signal), not the full field-by-field diff that
|
|
1719
|
+
* the human-facing compare engine produces.
|
|
1720
|
+
*/
|
|
1721
|
+
declare function diffStoryReports(baseline: StoryReport, current: StoryReport): BehaviorDiff;
|
|
1722
|
+
|
|
1534
1723
|
/**
|
|
1535
1724
|
* toStoryReport — convert a canonical TestRunResult into the public
|
|
1536
1725
|
* StoryReport shape consumed by UI renderers.
|
|
@@ -2448,7 +2637,7 @@ interface SendNotificationsDeps {
|
|
|
2448
2637
|
logger: {
|
|
2449
2638
|
warn(msg: string): void;
|
|
2450
2639
|
};
|
|
2451
|
-
toCIInfo: (raw?: RawCIInfo) => CIInfo
|
|
2640
|
+
toCIInfo: (raw?: RawCIInfo) => CIInfo | undefined;
|
|
2452
2641
|
env?: Record<string, string | undefined>;
|
|
2453
2642
|
}
|
|
2454
2643
|
/**
|
|
@@ -2701,6 +2890,104 @@ declare function createPrCommentSummary(diff: RunDiffResult, maxScenarios?: numb
|
|
|
2701
2890
|
|
|
2702
2891
|
declare function diffRuns(baseline: TestRunResult, current: TestRunResult): RunDiffResult;
|
|
2703
2892
|
|
|
2893
|
+
/**
|
|
2894
|
+
* Review domain — `buildReview(run, context)` mirrors `diffRuns(baseline, current)`.
|
|
2895
|
+
*
|
|
2896
|
+
* A pure function that enriches a canonical run into a {@link ReviewResult}:
|
|
2897
|
+
* each test case becomes a graded claim, and (when diff context is supplied)
|
|
2898
|
+
* changed source files are correlated to claims and banded
|
|
2899
|
+
* uncovered → weak → covered. The review formatters render the result.
|
|
2900
|
+
*/
|
|
2901
|
+
|
|
2902
|
+
/**
|
|
2903
|
+
* Grade how credible a claim's proof is.
|
|
2904
|
+
*
|
|
2905
|
+
* A passing self-authored test is the weakest evidence. Strength climbs as
|
|
2906
|
+
* tamper-resistant or constraint-proving signals appear: a screenshot/trace, a
|
|
2907
|
+
* decent mutation score, and — strongest — failing-first verification.
|
|
2908
|
+
*/
|
|
2909
|
+
declare function gradeEvidence(testCase: TestCaseResult, audience: ReviewAudience): {
|
|
2910
|
+
strength: EvidenceStrength;
|
|
2911
|
+
reasons: string[];
|
|
2912
|
+
};
|
|
2913
|
+
/**
|
|
2914
|
+
* Build the review model from a canonical run and optional diff context.
|
|
2915
|
+
*
|
|
2916
|
+
* With no `changedFiles`, the report degrades gracefully to "claims only"
|
|
2917
|
+
* (no banding). With diff context, changed source files are correlated and
|
|
2918
|
+
* banded — the 🔴 uncovered band being the reviewer's first stop.
|
|
2919
|
+
*/
|
|
2920
|
+
declare function buildReview(run: ReviewResult["run"], context?: ReviewContext): ReviewResult;
|
|
2921
|
+
|
|
2922
|
+
/**
|
|
2923
|
+
* Convention-based derivation for the review report.
|
|
2924
|
+
*
|
|
2925
|
+
* Audience and change-type are derived with ZERO authoring burden: audience
|
|
2926
|
+
* from the test file's name/location, change-type from a `change:*` tag. This
|
|
2927
|
+
* keeps the review capability a formatter concern — no new story API, no
|
|
2928
|
+
* adapter changes (see the Evidence-Driven Review design).
|
|
2929
|
+
*/
|
|
2930
|
+
|
|
2931
|
+
/**
|
|
2932
|
+
* Derive the audience for a claim.
|
|
2933
|
+
*
|
|
2934
|
+
* An explicit `audience:<value>` tag always wins; otherwise the file convention
|
|
2935
|
+
* decides (e2e/spec → stakeholder, everything else → engineer).
|
|
2936
|
+
*/
|
|
2937
|
+
declare function deriveAudience(sourceFile: string, tags: string[]): ReviewAudience;
|
|
2938
|
+
/** Derive the change-type from a `change:*` tag (defaults to `unknown`). */
|
|
2939
|
+
declare function deriveChangeType(tags: string[]): ChangeType;
|
|
2940
|
+
/** Whether a path looks like a test file. */
|
|
2941
|
+
declare function isTestFile(path: string): boolean;
|
|
2942
|
+
/**
|
|
2943
|
+
* Whether a changed file is reviewable application code — i.e. code we expect a
|
|
2944
|
+
* claim to back. Excludes test files, type decls, and non-code (docs, config,
|
|
2945
|
+
* locks). Only these files are eligible for the 🔴 uncovered alarm.
|
|
2946
|
+
*/
|
|
2947
|
+
declare function isReviewableSource(path: string): boolean;
|
|
2948
|
+
|
|
2949
|
+
/**
|
|
2950
|
+
* Review markdown formatter — renders a {@link ReviewResult} as a PR-comment-friendly
|
|
2951
|
+
* review of AI-authored changes.
|
|
2952
|
+
*
|
|
2953
|
+
* Reading order matches reviewer attention: the 🔴 uncovered-change band first
|
|
2954
|
+
* (what changed with no evidence), then 🟡 weak evidence, then claims grouped by
|
|
2955
|
+
* audience (stakeholder behaviour, then engineer detail), each showing graded
|
|
2956
|
+
* proof. Mirrors {@link RunDiffMarkdownFormatter}.
|
|
2957
|
+
*/
|
|
2958
|
+
|
|
2959
|
+
interface ReviewMarkdownOptions {
|
|
2960
|
+
title?: string;
|
|
2961
|
+
}
|
|
2962
|
+
declare class ReviewMarkdownFormatter {
|
|
2963
|
+
private title;
|
|
2964
|
+
constructor(options?: ReviewMarkdownOptions);
|
|
2965
|
+
format(review: ReviewResult): string;
|
|
2966
|
+
}
|
|
2967
|
+
|
|
2968
|
+
/**
|
|
2969
|
+
* Review HTML formatter — the audience-segmented deep-dive artifact for an
|
|
2970
|
+
* Evidence Review. Standalone themed HTML (mirrors {@link RunDiffHtmlFormatter}):
|
|
2971
|
+
* a banded changed-files list (uncovered → weak → covered), then claim cards
|
|
2972
|
+
* grouped by audience with graded evidence, intent, inline screenshots, and a
|
|
2973
|
+
* filter toolbar. No CDN dependencies required.
|
|
2974
|
+
*/
|
|
2975
|
+
|
|
2976
|
+
interface ReviewHtmlOptions {
|
|
2977
|
+
title?: string;
|
|
2978
|
+
/** Theme name or custom theme object. Default: "default" */
|
|
2979
|
+
theme?: string | HtmlTheme;
|
|
2980
|
+
/** Enable dark mode toggle. Default: true */
|
|
2981
|
+
darkMode?: boolean;
|
|
2982
|
+
}
|
|
2983
|
+
declare class ReviewHtmlFormatter {
|
|
2984
|
+
private title;
|
|
2985
|
+
private theme;
|
|
2986
|
+
private darkMode;
|
|
2987
|
+
constructor(options?: ReviewHtmlOptions);
|
|
2988
|
+
format(review: ReviewResult): string;
|
|
2989
|
+
}
|
|
2990
|
+
|
|
2704
2991
|
interface BundleOptions {
|
|
2705
2992
|
/** If true, warn about missing assets instead of throwing. Default: false. */
|
|
2706
2993
|
allowMissing?: boolean;
|
|
@@ -2820,4 +3107,4 @@ declare function normalizeVitestResults(testModules: Parameters<typeof adaptVite
|
|
|
2820
3107
|
*/
|
|
2821
3108
|
declare function normalizePlaywrightResults(testResults: Parameters<typeof adaptPlaywrightRun>[0], adapterOptions?: Parameters<typeof adaptPlaywrightRun>[1], canonicalizeOptions?: CanonicalizeOptions): TestRunResult;
|
|
2822
3109
|
|
|
2823
|
-
export { type AstroAssetResult, AstroFormatter, type AstroFormatterOptions as AstroFormatterOpts, type
|
|
3110
|
+
export { type AstroAssetResult, AstroFormatter, type AstroFormatterOptions as AstroFormatterOpts, Attachment, type BehaviorDebuggerIssue, type BehaviorDiff, type BehaviorDiffEntry, type BehaviorManifest, BehaviorManifestJsonFormatter, type BehaviorManifestJsonOptions, type BehaviorSourceFile, type BehaviorTag, type BundleOptions, type BundleResult, CIProvider, type CanonicalizeOptions, type ChangeType, type ChangedFile, type ChangedFileReview, type ColocatedStyle, type CompareFormat, type CompareFormatterOptions, type ConfluenceAuth, ConfluenceFormatter, type ConfluenceFormatterOptions as ConfluenceFormatterOpts, type CopyMarkdownAssetsOptions, CucumberHtmlFormatter, type CucumberHtmlOptions, CucumberJsonFormatter, type CucumberJsonOptions, CucumberMessagesFormatter, type CucumberMessagesOptions, DocEntry, DocPhase, ES_THEME_TOKENS_CSS, ES_THEME_TOKEN_VALUES, type EvidenceStrength, type ExecutableStoriesConfig, type FetchFn, type FileChangeKind, type FlakinessLevel, type Formatter, type FormatterOptions, type GenerateArgs, type GenerateCompareResult, type GenerateDeps, type GenerateResult, type GenericWebhookNotifierOptions, type HistoryEntry, type HistoryStore, HtmlFormatter, type HtmlOptions, type HtmlTheme, type HtmlThemeName, type IJsonDataTable, type IJsonDocString, type IJsonEmbedding, type IJsonFeature, type IJsonScenario, type IJsonStep, type IJsonStepArgument, type IJsonStepResult, type IJsonTableRow, type IJsonTag, JUnitFormatter, type JUnitOptions, type JiraAuth, type JiraPublishMode, type ListScenariosArgs, type ListScenariosDeps, type Logger, MIN_FLAKINESS_SAMPLES, MIN_METRIC_SAMPLES, MIN_PERF_SAMPLES, MarkdownFormatter, type MarkdownFormatterOptions, type MarkdownOptions, type MarkdownRenderers, NormalizedTicket, type NotificationSummary, type NotifyCondition, OtelSpan, type OtelTraceContext, type OutputConfig, type OutputFormat, type OutputMode, type OutputRule, type PerformanceTrend, type PublishConfluenceArgs, type PublishConfluenceDeps, type PublishConfluenceResult, type PublishJiraArgs, type PublishJiraDeps, type PublishJiraResult, RawAttachment, RawCIInfo, RawRun, RawStatus, type ReportAttachment, type ReportCIInfo, type ReportCoverageSummary, type ReportDocCode, type ReportDocCustom, type ReportDocEntry, type ReportDocKv, type ReportDocLink, type ReportDocMermaid, type ReportDocNote, type ReportDocScreenshot, type ReportDocSection, type ReportDocTable, type ReportDocTag, type ReportFeature, ReportGenerator, type ReportScenario, type ReportStep, type ReportSummary, type ReportTicket, type ResolvedFormatterOptions, type ReviewAudience, type ReviewBand, type ReviewClaim, type ReviewContext, ReviewHtmlFormatter, type ReviewHtmlOptions, ReviewMarkdownFormatter, type ReviewMarkdownOptions, type ReviewResult, type ReviewSummary, RunDiffHtmlFormatter, type RunDiffHtmlOptions, RunDiffMarkdownFormatter, type RunDiffMarkdownOptions, type RunDiffResult, type RunDiffSummary, STORY_REPORT_SCHEMA_MAJOR, STORY_REPORT_SCHEMA_VERSION, type ScenarioChangeFlags, type ScenarioChangeKind, type ScenarioDiff, type ScenarioIndex, type ScenarioIndexFilters, type ScenarioIndexItem, ScenarioIndexJsonFormatter, type ScenarioIndexJsonOptions, type ScenarioIndexStep, type ScenarioSnapshot, type SortTestCasesMode, type StabilityGrade, type StarlightBadge, StepResult, type StoryReport, StoryReportJsonFormatter, type StoryReportJsonOptions, type StoryReportSchemaVersion, StoryStep, TestCaseResult, type TestHistory, type TestMetrics, TestRunResult, TestStatus$1 as TestStatus, CIInfo as TypedCIInfo, type ValidationResult, type WatchDeps, type WatchHandle, type WatchOptions, type WebhookPayload, type WebhookSignerHmac, type WriteFile, adaptJestRun, adaptPlaywrightRun, adaptVitestRun, assertValidRun, buildReview, bundleAssets, calculateFlakiness, calculateStability, canonicalizeRun, classifyStatusChange, clearVersionCache, computeTestMetrics, copyMarkdownAssets, createPrCommentSummary, createReportGenerator, deriveAudience, deriveChangeType, deriveStepResults, detectCI, detectPerformanceTrend, diffRuns, diffStoryReports, findGitDir, formatDuration, generateRunComparison, generateRunId, generateTestCaseId, getAvailableThemes, getCssOnlyThemes, gradeEvidence, hasSufficientHistory, isReviewableSource, isTestFile, listScenarios, loadHistory, mergeStepResults, msToNanoseconds, nanosecondsToMs, normalizeJestResults, normalizePlaywrightResults, normalizeStatus, normalizeVitestResults, parseEnvelopes, parseNdjson, publishConfluencePage, publishJiraIssue, readBranchName, readGitSha, readPackageVersion, regenerateArtifacts, resolveAttachment, resolveAttachments, resolveTheme, resolveTraceUrl, rewriteAssetPaths, saveHistory, scenariosCoveringPaths, sendNotifications, sendSlackNotification, sendTeamsNotification, sendWebhookNotification, signBody, slugify, startWatch, stripAnsi, toBehaviorManifest, toScenarioIndex, toStoryReport, tryGetActiveOtelContext, updateHistory, validateCanonicalRun };
|