executable-stories-formatters 1.0.0 → 1.1.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/index.d.ts CHANGED
@@ -1,27 +1,33 @@
1
- import { TestRunResult, TestCaseResult, TestStatus, Attachment } from 'executable-stories-core/types/test-result';
2
- export { Attachment, CIInfo, CoverageSummary, StepResult, TestCaseAttempt, TestCaseEvidence, TestCaseResult, TestRunResult, TestStatus } from 'executable-stories-core/types/test-result';
3
- import { StoryStep, DocEntry, NormalizedTicket, StepKeyword } from 'executable-stories-core/types/story';
4
- export { DocEntry, DocPhase, NormalizedTicket, STORY_META_KEY, StepKeyword, StepMode, StoryMeta, StoryStep } from 'executable-stories-core/types/story';
5
- import { CIInfo, CIProvider } from 'executable-stories-core/types/ci';
6
- export { CIProvider, CIInfo as TypedCIInfo, toCIInfo, toRawCIInfo } from 'executable-stories-core/types/ci';
7
- import { adaptJestRun, adaptPlaywrightRun, adaptVitestRun } from './adapters.js';
8
- export { JestAdapterOptions, JestAggregatedResult, JestFileResult, JestTestResult, PlaywrightAdapterOptions, PlaywrightAnnotation, PlaywrightAttachment, PlaywrightError, PlaywrightLocation, PlaywrightStatus, PlaywrightTestCase, PlaywrightTestResult, StoryFileReport, VitestAdapterOptions, VitestSerializedError, VitestState, VitestTestCase, VitestTestModule, VitestTestResult } from './adapters.js';
9
- export { OtelAttributeValue, OtelSpan } from 'executable-stories-core/types/otel';
10
- import { RawCIInfo } from 'executable-stories-core/types/raw';
11
- export { RawAttachment, RawCIInfo, RawRun, RawStatus, RawStepEvent, RawTestCase } from 'executable-stories-core/types/raw';
12
- import { StoryReport, TestStatus as TestStatus$1, ReportStep } from 'executable-stories-core/types/story-report';
13
- export { ReportAttachment, ReportCIInfo, ReportCoverageSummary, ReportDocCode, ReportDocCustom, ReportDocEntry, ReportDocKv, ReportDocLink, ReportDocMermaid, ReportDocNote, ReportDocScreenshot, ReportDocSection, ReportDocTable, ReportDocTag, ReportFeature, ReportScenario, ReportStep, ReportSummary, ReportTicket, STORY_REPORT_SCHEMA_MAJOR, STORY_REPORT_SCHEMA_VERSION, StoryReport, StoryReportSchemaVersion } from 'executable-stories-core/types/story-report';
14
- export { ES_THEME_TOKENS_CSS, ES_THEME_TOKEN_VALUES } from 'executable-stories-core/theme/tokens';
15
- export { canonicalizeRun, deriveStepResults, generateRunId, generateTestCaseId, mergeStepResults, normalizeStatus, resolveAttachment, resolveAttachments, slugify } from 'executable-stories-core/converters/acl/index';
16
- export { ValidationResult, assertValidRun, validateCanonicalRun } from 'executable-stories-core/converters/acl/validate';
17
- export { RunState, advanceState, initialRunState } from 'executable-stories-core';
18
- export { toStoryReport } from 'executable-stories-core/converters/story-report';
19
- import { Envelope } from 'executable-stories-core/types/cucumber-messages';
20
- export { parseEnvelopes, parseNdjson } from 'executable-stories-core/converters/ndjson-parser';
21
- export { formatDuration, msToNanoseconds, nanosecondsToMs } from 'executable-stories-core/utils/duration';
22
- export { HtmlDocOptions, buildHtmlDocEntry } from 'executable-stories-core/utils/doc-builders';
23
- import { CanonicalizeOptions } from 'executable-stories-core/types/canonicalize';
24
- export { CanonicalizeOptions } from 'executable-stories-core/types/canonicalize';
1
+ import { C as CIInfo$1, a as CIProvider, T as TestRunResult, b as TestCaseResult, S as StoryStep, D as DocEntry, c as TestStatus$1, N as NormalizedTicket, A as Attachment, d as DocPhase, O as OtelSpan, R as RawStatus, e as StepResult, f as RawAttachment, g as RawRun, h as RawCIInfo, i as StepKeyword$1, j as adaptJestRun, k as adaptPlaywrightRun, l as adaptVitestRun } from './index-Cfs2L3di.js';
2
+ export { m as CIInfo, n as CoverageSummary, J as JestAdapterOptions, o as JestAggregatedResult, p as JestFileResult, q as JestTestResult, r as OtelAttributeValue, P as PlaywrightAdapterOptions, s as PlaywrightAnnotation, t as PlaywrightAttachment, u as PlaywrightError, v as PlaywrightLocation, w as PlaywrightStatus, x as PlaywrightTestCase, y as PlaywrightTestResult, z as RawStepEvent, B as RawTestCase, E as STORY_META_KEY, 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-Cfs2L3di.js';
3
+
4
+ /**
5
+ * Configuration options for ACL and formatters.
6
+ */
7
+ /** Options for canonicalizing raw run data */
8
+ interface CanonicalizeOptions {
9
+ /** Attachment handling options */
10
+ attachments?: {
11
+ /** Max bytes before attachment becomes external link. Default: 512KB (524288) */
12
+ maxEmbedBytes?: number;
13
+ /** Directory for external attachments */
14
+ externalDir?: string;
15
+ };
16
+ /** Cucumber compatibility options */
17
+ cucumber?: {
18
+ /** Include trailing space in keywords (e.g., "Given "). Default: true */
19
+ keywordSpacing?: boolean;
20
+ /** Generate deterministic line numbers. Default: true */
21
+ deterministicLines?: boolean;
22
+ };
23
+ /** Default timestamps if not provided in raw data */
24
+ defaults?: {
25
+ /** Default start time (epoch ms). Default: Date.now() */
26
+ startedAtMs?: number;
27
+ /** Default finish time (epoch ms). Default: Date.now() */
28
+ finishedAtMs?: number;
29
+ };
30
+ }
25
31
 
26
32
  /**
27
33
  * Notification types for webhook integrations (Slack, Teams).
@@ -39,7 +45,7 @@ interface NotificationSummary {
39
45
  name: string;
40
46
  error?: string;
41
47
  }>;
42
- ci?: CIInfo;
48
+ ci?: CIInfo$1;
43
49
  reportUrl?: string;
44
50
  }
45
51
  /** When to send notifications. */
@@ -71,6 +77,51 @@ interface WebhookPayload {
71
77
  summary: NotificationSummary;
72
78
  }
73
79
 
80
+ /**
81
+ * Types for history tracking and test metrics.
82
+ */
83
+
84
+ interface HistoryEntry {
85
+ runId: string;
86
+ timestamp: number;
87
+ status: "passed" | "failed" | "skipped" | "pending";
88
+ durationMs: number;
89
+ ci?: {
90
+ provider?: CIProvider;
91
+ branch?: string;
92
+ commitSha?: string;
93
+ };
94
+ }
95
+ interface TestHistory {
96
+ testId: string;
97
+ testName: string;
98
+ sourceFile: string;
99
+ sourceLine?: number;
100
+ entries: HistoryEntry[];
101
+ }
102
+ interface HistoryStore {
103
+ version: 1;
104
+ maxRuns: number;
105
+ tests: Record<string, TestHistory>;
106
+ lastUpdated: number;
107
+ }
108
+ type StabilityGrade = "A" | "B" | "C" | "D" | "F";
109
+ type FlakinessLevel = "stable" | "unstable" | "flaky";
110
+ type PerformanceTrend = "improving" | "stable" | "regressing";
111
+ interface TestMetrics {
112
+ testId: string;
113
+ flakinessLevel: FlakinessLevel;
114
+ flakinessScore: number;
115
+ failureRate: number;
116
+ stabilityGrade: StabilityGrade;
117
+ performanceTrend: PerformanceTrend;
118
+ avgDurationMs: number;
119
+ passRate: number;
120
+ longestPassStreak: number;
121
+ consecutiveFailures: number;
122
+ sampleSize: number;
123
+ }
124
+
74
125
  /**
75
126
  * Confluence (ADF) Formatter — Layer 3.
76
127
  *
@@ -256,7 +307,16 @@ interface FormatterOptions {
256
307
  syntaxHighlighting?: boolean;
257
308
  /** Enable live Mermaid diagram rendering (via Mermaid.js CDN). Default: true */
258
309
  mermaidEnabled?: boolean;
310
+ /** Days before the report shows a stale warning. 0 disables. Default: 7 */
311
+ staleAfterDays?: number;
259
312
  };
313
+ /**
314
+ * Run history store (see loadHistory/updateHistory). When set, the HTML
315
+ * report embeds each scenario's recent run history so cards can show a
316
+ * run-over-run timeline. Update the store with the current run before
317
+ * passing it so the report includes this run as the latest entry.
318
+ */
319
+ historyStore?: HistoryStore;
260
320
  /** JUnit XML specific options */
261
321
  junit?: {
262
322
  /** Test suite name. Default: "Test Suite" */
@@ -419,7 +479,9 @@ interface ResolvedFormatterOptions {
419
479
  title: string;
420
480
  syntaxHighlighting: boolean;
421
481
  mermaidEnabled: boolean;
482
+ staleAfterDays: number;
422
483
  };
484
+ historyStore: HistoryStore | undefined;
423
485
  junit: {
424
486
  suiteName: string;
425
487
  includeOutput: boolean;
@@ -498,7 +560,7 @@ interface ScenarioSnapshot {
498
560
  scenario: string;
499
561
  sourceFile: string;
500
562
  sourceLine: number;
501
- status: TestStatus;
563
+ status: TestStatus$1;
502
564
  durationMs: number;
503
565
  tags: string[];
504
566
  titlePath: string[];
@@ -546,7 +608,7 @@ interface RunDiffResult {
546
608
  summary: RunDiffSummary;
547
609
  scenarios: ScenarioDiff[];
548
610
  }
549
- type CompareFormat = "html" | "markdown";
611
+ type CompareFormat = "html" | "markdown" | "changelog";
550
612
  interface CompareFormatterOptions {
551
613
  title?: string;
552
614
  }
@@ -665,6 +727,207 @@ interface ExecutableStoriesConfig {
665
727
  formatters?: Record<string, Formatter>;
666
728
  }
667
729
 
730
+ /**
731
+ * StoryReport — public, frozen contract for UI renderers.
732
+ *
733
+ * Distinct from internal TestRunResult. Pre-grouped feature → scenario tree,
734
+ * with pre-computed summaries at every level. Adapter concerns (rawStatus,
735
+ * projectName, titlePath) are stripped at the toStoryReport boundary.
736
+ *
737
+ * Versioning: semver-style "<major>.<minor>". Additive-only within a major.
738
+ * Source of truth: schemas/story-report-v1.json. Types here must stay in sync.
739
+ */
740
+
741
+ type StoryReportSchemaVersion = `1.${number}`;
742
+ type TestStatus = "passed" | "failed" | "skipped" | "pending";
743
+ type StepKeyword = "Given" | "When" | "Then" | "And" | "But";
744
+ type StepMode = "normal" | "skip" | "only" | "todo" | "fails" | "concurrent";
745
+ interface ReportSummary {
746
+ total: number;
747
+ passed: number;
748
+ failed: number;
749
+ skipped: number;
750
+ pending: number;
751
+ durationMs: number;
752
+ }
753
+ interface ReportTicket {
754
+ id: string;
755
+ url?: string;
756
+ }
757
+ interface ReportAttachment {
758
+ name: string;
759
+ mediaType: string;
760
+ body: string;
761
+ contentEncoding: "BASE64" | "IDENTITY";
762
+ }
763
+ interface ReportCIInfo {
764
+ name: string;
765
+ url?: string;
766
+ buildNumber?: string;
767
+ branch?: string;
768
+ commitSha?: string;
769
+ prNumber?: string;
770
+ }
771
+ interface ReportCoverageSummary {
772
+ linesPct?: number;
773
+ branchesPct?: number;
774
+ functionsPct?: number;
775
+ statementsPct?: number;
776
+ }
777
+ type ReportDocEntry = ReportDocNote | ReportDocTag | ReportDocKv | ReportDocCode | ReportDocTable | ReportDocLink | ReportDocSection | ReportDocMermaid | ReportDocScreenshot | ReportDocVideo | ReportDocHtml | ReportDocCustom;
778
+ interface ReportDocNote {
779
+ kind: "note";
780
+ text: string;
781
+ phase: DocPhase;
782
+ children?: ReportDocEntry[];
783
+ }
784
+ interface ReportDocTag {
785
+ kind: "tag";
786
+ names: string[];
787
+ phase: DocPhase;
788
+ children?: ReportDocEntry[];
789
+ }
790
+ interface ReportDocKv {
791
+ kind: "kv";
792
+ label: string;
793
+ value: unknown;
794
+ phase: DocPhase;
795
+ children?: ReportDocEntry[];
796
+ }
797
+ interface ReportDocCode {
798
+ kind: "code";
799
+ label: string;
800
+ content: string;
801
+ lang?: string;
802
+ phase: DocPhase;
803
+ children?: ReportDocEntry[];
804
+ }
805
+ interface ReportDocTable {
806
+ kind: "table";
807
+ label: string;
808
+ columns: string[];
809
+ rows: string[][];
810
+ phase: DocPhase;
811
+ children?: ReportDocEntry[];
812
+ }
813
+ interface ReportDocLink {
814
+ kind: "link";
815
+ label: string;
816
+ url: string;
817
+ phase: DocPhase;
818
+ children?: ReportDocEntry[];
819
+ }
820
+ interface ReportDocSection {
821
+ kind: "section";
822
+ title: string;
823
+ markdown: string;
824
+ phase: DocPhase;
825
+ children?: ReportDocEntry[];
826
+ }
827
+ interface ReportDocMermaid {
828
+ kind: "mermaid";
829
+ code: string;
830
+ title?: string;
831
+ phase: DocPhase;
832
+ children?: ReportDocEntry[];
833
+ }
834
+ interface ReportDocScreenshot {
835
+ kind: "screenshot";
836
+ path: string;
837
+ alt?: string;
838
+ phase: DocPhase;
839
+ children?: ReportDocEntry[];
840
+ }
841
+ interface ReportDocVideo {
842
+ kind: "video";
843
+ path: string;
844
+ caption?: string;
845
+ poster?: string;
846
+ phase: DocPhase;
847
+ children?: ReportDocEntry[];
848
+ }
849
+ interface ReportDocHtml {
850
+ kind: "html";
851
+ /** Local HTML file path (exactly one of path/url/content) */
852
+ path?: string;
853
+ /** Remote URL rendered via iframe src (exactly one of path/url/content) */
854
+ url?: string;
855
+ /** Inline HTML content rendered via iframe srcdoc (exactly one of path/url/content) */
856
+ content?: string;
857
+ title?: string;
858
+ /** Iframe height: number → px, string passed through (e.g. "60vh"). Default 400px. */
859
+ height?: number | string;
860
+ phase: DocPhase;
861
+ children?: ReportDocEntry[];
862
+ }
863
+ interface ReportDocCustom {
864
+ kind: "custom";
865
+ type: string;
866
+ data: unknown;
867
+ phase: DocPhase;
868
+ children?: ReportDocEntry[];
869
+ }
870
+ interface ReportStep {
871
+ id: string;
872
+ index: number;
873
+ keyword: StepKeyword;
874
+ text: string;
875
+ status: TestStatus;
876
+ durationMs: number;
877
+ errorMessage?: string;
878
+ mode?: StepMode;
879
+ docEntries: ReportDocEntry[];
880
+ }
881
+ interface ReportScenario {
882
+ id: string;
883
+ title: string;
884
+ status: TestStatus;
885
+ /**
886
+ * True for scenarios authored with the framework's todo modifier
887
+ * (e.g. `it.todo`): specified behavior with no implementation yet.
888
+ * Canonical status stays "pending"; this flags why.
889
+ */
890
+ planned?: boolean;
891
+ durationMs: number;
892
+ tags: string[];
893
+ tickets?: ReportTicket[];
894
+ /** Product-code paths/globs this scenario exercises (project-root-relative). */
895
+ covers?: string[];
896
+ sourceLine?: number;
897
+ errorMessage?: string;
898
+ errorStack?: string;
899
+ retry: number;
900
+ retries: number;
901
+ docEntries: ReportDocEntry[];
902
+ steps: ReportStep[];
903
+ attachments: ReportAttachment[];
904
+ /** OTel spans for the trace waterfall (carried through from the run). */
905
+ otelSpans?: OtelSpan[];
906
+ }
907
+ interface ReportFeature {
908
+ id: string;
909
+ title: string;
910
+ sourceFile: string;
911
+ summary: ReportSummary;
912
+ scenarios: ReportScenario[];
913
+ }
914
+ interface StoryReport {
915
+ schemaVersion: StoryReportSchemaVersion;
916
+ runId: string;
917
+ startedAtMs: number;
918
+ finishedAtMs: number;
919
+ durationMs: number;
920
+ projectRoot: string;
921
+ packageVersion?: string;
922
+ gitSha?: string;
923
+ ci?: ReportCIInfo;
924
+ coverage?: ReportCoverageSummary;
925
+ summary: ReportSummary;
926
+ features: ReportFeature[];
927
+ }
928
+ declare const STORY_REPORT_SCHEMA_VERSION: StoryReportSchemaVersion;
929
+ declare const STORY_REPORT_SCHEMA_MAJOR: 1;
930
+
668
931
  /**
669
932
  * Review types — the model behind the Evidence-Driven Review report.
670
933
  *
@@ -726,7 +989,7 @@ interface ReviewClaim {
726
989
  sourceFile: string;
727
990
  sourceLine: number;
728
991
  /** Test outcome. */
729
- status: TestStatus;
992
+ status: TestStatus$1;
730
993
  /** Derived from file convention / `audience:` tag. */
731
994
  audience: ReviewAudience;
732
995
  /** Declared via `change:*` tag (defaults to `unknown`). */
@@ -777,6 +1040,239 @@ interface ReviewResult {
777
1040
  changedFiles: ChangedFileReview[];
778
1041
  }
779
1042
 
1043
+ /**
1044
+ * Canonical executable-stories theme tokens (--es-*).
1045
+ *
1046
+ * Source of truth for the `--es-color-*`, `--es-space-*`, `--es-font-*`,
1047
+ * `--es-size-*`, `--es-radius`, `--es-line`, and `--es-measure` CSS custom
1048
+ * properties consumed by:
1049
+ *
1050
+ * - executable-stories-react (styles.css)
1051
+ * - executable-stories-formatters HTML report (CSS_STYLES, via this module)
1052
+ *
1053
+ * Consumer-side overrides on `:root` or any ancestor of the report cascade
1054
+ * through both: setting `--es-color-failed: red` on body re-colors failures
1055
+ * in both the standalone HTML report and the React component.
1056
+ *
1057
+ * The HTML formatter's pre-existing tokens (--success, --error, etc.)
1058
+ * remain in place for backward compatibility; the --es-* tokens are emitted
1059
+ * alongside them as the public override surface.
1060
+ */
1061
+ declare const ES_THEME_TOKENS_CSS: string;
1062
+ /**
1063
+ * JS-level mirror of the token values (for cases where TypeScript code needs
1064
+ * to read them — e.g., dynamic style injection or theme generators).
1065
+ */
1066
+ declare const ES_THEME_TOKEN_VALUES: {
1067
+ readonly light: {
1068
+ readonly "--es-color-bg": "#ffffff";
1069
+ readonly "--es-color-fg": "#111827";
1070
+ readonly "--es-color-muted": "#6b7280";
1071
+ readonly "--es-color-border": "#e5e7eb";
1072
+ readonly "--es-color-surface": "#f9fafb";
1073
+ readonly "--es-color-link": "#2563eb";
1074
+ readonly "--es-color-passed": "#16a34a";
1075
+ readonly "--es-color-failed": "#dc2626";
1076
+ readonly "--es-color-skipped": "#9ca3af";
1077
+ readonly "--es-color-pending": "#d97706";
1078
+ };
1079
+ readonly dark: {
1080
+ readonly "--es-color-bg": "#0b0f17";
1081
+ readonly "--es-color-fg": "#e5e7eb";
1082
+ readonly "--es-color-muted": "#9ca3af";
1083
+ readonly "--es-color-border": "#1f2937";
1084
+ readonly "--es-color-surface": "#111827";
1085
+ readonly "--es-color-link": "#60a5fa";
1086
+ readonly "--es-color-passed": "#4ade80";
1087
+ readonly "--es-color-failed": "#f87171";
1088
+ readonly "--es-color-skipped": "#6b7280";
1089
+ readonly "--es-color-pending": "#fbbf24";
1090
+ };
1091
+ };
1092
+
1093
+ /**
1094
+ * Status mapping from raw framework statuses to canonical TestStatus.
1095
+ */
1096
+
1097
+ /**
1098
+ * Convert a raw status to canonical TestStatus.
1099
+ *
1100
+ * @param raw - The raw status from a framework
1101
+ * @returns The canonical TestStatus
1102
+ */
1103
+ declare function normalizeStatus(raw: RawStatus): TestStatus$1;
1104
+
1105
+ /**
1106
+ * ID generation and slug helpers for deterministic, Cucumber-compatible IDs.
1107
+ */
1108
+ /**
1109
+ * Generate a deterministic test case ID from source file and scenario name.
1110
+ *
1111
+ * @param sourceFile - The source file path
1112
+ * @param scenario - The scenario name
1113
+ * @returns A 12-character hex ID
1114
+ */
1115
+ declare function generateTestCaseId(sourceFile: string, scenario: string): string;
1116
+ /**
1117
+ * Generate a deterministic run ID from timestamp and project root.
1118
+ *
1119
+ * @param startedAtMs - Run start timestamp
1120
+ * @param projectRoot - Project root directory
1121
+ * @returns A 16-character hex ID
1122
+ */
1123
+ declare function generateRunId(startedAtMs: number, projectRoot: string): string;
1124
+ /**
1125
+ * Slugify a string for Cucumber JSON IDs.
1126
+ *
1127
+ * Converts to lowercase, replaces path separators/spaces with hyphens,
1128
+ * removes other special chars, and trims leading/trailing hyphens.
1129
+ *
1130
+ * @param text - The text to slugify
1131
+ * @returns A URL-safe slug
1132
+ */
1133
+ declare function slugify(text: string): string;
1134
+
1135
+ /**
1136
+ * Step fallback rules for deriving step results from scenario status.
1137
+ *
1138
+ * When frameworks don't provide step-level results, we derive them
1139
+ * from the overall scenario status using these rules.
1140
+ */
1141
+
1142
+ /**
1143
+ * Derive step results from story steps and scenario status.
1144
+ *
1145
+ * Rules:
1146
+ * - Passed: All steps are passed
1147
+ * - Skipped/Pending: All steps are skipped/pending
1148
+ * - Failed: Steps up to failure are passed, failing step is failed, rest are skipped
1149
+ * (Heuristic: last step is the failure, or use error info if available)
1150
+ *
1151
+ * @param steps - Story steps with keywords and text
1152
+ * @param scenarioStatus - Overall scenario status
1153
+ * @param error - Optional error information to help identify failing step
1154
+ * @returns Array of step results
1155
+ */
1156
+ declare function deriveStepResults(steps: StoryStep[], scenarioStatus: TestStatus$1, error?: {
1157
+ message?: string;
1158
+ stack?: string;
1159
+ }): StepResult[];
1160
+ /**
1161
+ * Merge raw step events with derived step results.
1162
+ *
1163
+ * When we have partial step data from the framework, merge it with
1164
+ * the derived results, preferring actual data over derived.
1165
+ *
1166
+ * @param derived - Derived step results from fallback rules
1167
+ * @param events - Raw step events from framework (if any)
1168
+ * @returns Merged step results
1169
+ */
1170
+ declare function mergeStepResults(derived: StepResult[], events?: Array<{
1171
+ index?: number;
1172
+ stepId?: string;
1173
+ status?: string;
1174
+ durationMs?: number;
1175
+ errorMessage?: string;
1176
+ }>): StepResult[];
1177
+
1178
+ /**
1179
+ * Attachment resolution: embed vs link decision.
1180
+ *
1181
+ * Attachments can either be embedded inline (base64) or linked to
1182
+ * external files based on size thresholds.
1183
+ */
1184
+
1185
+ /** Options for attachment resolution */
1186
+ interface AttachmentOptions {
1187
+ /** Max bytes before attachment becomes external link. Default: 512KB */
1188
+ maxEmbedBytes?: number;
1189
+ /** Directory for external attachments */
1190
+ externalDir?: string;
1191
+ /** Project root for relative paths */
1192
+ projectRoot?: string;
1193
+ }
1194
+ /**
1195
+ * Resolve a raw attachment to a canonical attachment.
1196
+ *
1197
+ * Decision logic:
1198
+ * 1. If body is already provided, use it (check size for encoding decision)
1199
+ * 2. If path is provided, read file and decide embed vs link
1200
+ * 3. For large files, return a URL reference instead of embedding
1201
+ *
1202
+ * @param raw - Raw attachment from framework
1203
+ * @param options - Resolution options
1204
+ * @returns Resolved canonical attachment
1205
+ */
1206
+ declare function resolveAttachment(raw: RawAttachment, options?: AttachmentOptions): Attachment;
1207
+ /**
1208
+ * Resolve multiple attachments.
1209
+ *
1210
+ * @param attachments - Raw attachments array
1211
+ * @param options - Resolution options
1212
+ * @returns Resolved canonical attachments
1213
+ */
1214
+ declare function resolveAttachments(attachments: RawAttachment[] | undefined, options?: AttachmentOptions): Attachment[];
1215
+
1216
+ /**
1217
+ * Anti-Corruption Layer (ACL) - Layer 2.
1218
+ *
1219
+ * Transforms permissive RawRun data from framework adapters into
1220
+ * strict canonical TestRunResult for formatters.
1221
+ */
1222
+
1223
+ /**
1224
+ * Canonicalize a raw run into a strict TestRunResult.
1225
+ *
1226
+ * This is the main entry point for the ACL. It:
1227
+ * - Enforces required fields with defaults
1228
+ * - Normalizes statuses to TestStatus enum
1229
+ * - Applies step fallback rules
1230
+ * - Resolves attachments (embed vs link)
1231
+ * - Generates deterministic IDs
1232
+ *
1233
+ * @param raw - Raw run data from a framework adapter
1234
+ * @param options - Canonicalization options
1235
+ * @returns Strict canonical TestRunResult
1236
+ */
1237
+ declare function canonicalizeRun(raw: RawRun, options?: CanonicalizeOptions): TestRunResult;
1238
+
1239
+ /**
1240
+ * Validation helpers for canonical TestRunResult.
1241
+ *
1242
+ * Used in tests to verify ACL output meets all invariants.
1243
+ */
1244
+
1245
+ /** Validation result */
1246
+ interface ValidationResult {
1247
+ /** Whether the run is valid */
1248
+ valid: boolean;
1249
+ /** List of validation errors */
1250
+ errors: string[];
1251
+ }
1252
+ /**
1253
+ * Validate a canonical TestRunResult.
1254
+ *
1255
+ * Checks:
1256
+ * - All required fields are present
1257
+ * - stepResults length matches story.steps length
1258
+ * - stepResults indexes are valid and unique
1259
+ * - Durations are non-negative
1260
+ * - Timestamps are valid
1261
+ *
1262
+ * @param run - The TestRunResult to validate
1263
+ * @returns Validation result with errors if any
1264
+ */
1265
+ declare function validateCanonicalRun(run: TestRunResult): ValidationResult;
1266
+ /**
1267
+ * Assert that a run is valid, throwing if not.
1268
+ *
1269
+ * Useful in tests.
1270
+ *
1271
+ * @param run - The TestRunResult to validate
1272
+ * @throws Error if validation fails
1273
+ */
1274
+ declare function assertValidRun(run: TestRunResult): void;
1275
+
780
1276
  /**
781
1277
  * Cucumber JSON Formatter - Layer 3.
782
1278
  *
@@ -896,7 +1392,7 @@ interface ScenarioIndex {
896
1392
  interface ScenarioIndexItem {
897
1393
  id: string;
898
1394
  title: string;
899
- status: TestStatus$1;
1395
+ status: TestStatus;
900
1396
  feature: string;
901
1397
  sourceFile: string;
902
1398
  sourceLine?: number;
@@ -919,13 +1415,13 @@ interface ScenarioIndexStep {
919
1415
  index: number;
920
1416
  keyword: ReportStep["keyword"];
921
1417
  text: string;
922
- status: TestStatus$1;
1418
+ status: TestStatus;
923
1419
  durationMs: number;
924
1420
  errorMessage?: string;
925
1421
  docKinds: string[];
926
1422
  }
927
1423
  interface ScenarioIndexFilters {
928
- statuses?: TestStatus$1[];
1424
+ statuses?: TestStatus[];
929
1425
  tags?: string[];
930
1426
  sourceFiles?: string[];
931
1427
  }
@@ -1039,13 +1535,367 @@ interface WatchHandle {
1039
1535
  */
1040
1536
  declare function startWatch(options: WatchOptions, deps?: WatchDeps): WatchHandle;
1041
1537
 
1538
+ /**
1539
+ * Cucumber Messages types for NDJSON output.
1540
+ *
1541
+ * Minimal own types (no @cucumber/messages dependency) — consistent with
1542
+ * the project's zero-external-deps-at-runtime approach.
1543
+ *
1544
+ * Based on the Cucumber Messages protocol:
1545
+ * https://github.com/cucumber/messages
1546
+ */
1547
+ /** Protobuf-style timestamp { seconds, nanos } */
1548
+ interface Timestamp {
1549
+ seconds: number;
1550
+ nanos: number;
1551
+ }
1552
+ /** Protobuf-style duration { seconds, nanos } */
1553
+ interface Duration {
1554
+ seconds: number;
1555
+ nanos: number;
1556
+ }
1557
+ /** Location in a source file */
1558
+ interface Location {
1559
+ line: number;
1560
+ column?: number;
1561
+ }
1562
+ interface Meta {
1563
+ protocolVersion: string;
1564
+ implementation: {
1565
+ name: string;
1566
+ version: string;
1567
+ };
1568
+ runtime: {
1569
+ name: string;
1570
+ version: string;
1571
+ };
1572
+ os: {
1573
+ name: string;
1574
+ };
1575
+ cpu: {
1576
+ name: string;
1577
+ };
1578
+ }
1579
+ interface Source {
1580
+ uri: string;
1581
+ data: string;
1582
+ mediaType: "text/x.cucumber.gherkin+plain";
1583
+ }
1584
+ interface Tag {
1585
+ location: Location;
1586
+ name: string;
1587
+ id: string;
1588
+ }
1589
+ type KeywordType = "Unknown" | "Context" | "Action" | "Outcome" | "Conjunction";
1590
+ interface DocString {
1591
+ location: Location;
1592
+ mediaType?: string;
1593
+ content: string;
1594
+ delimiter: string;
1595
+ }
1596
+ interface TableCell {
1597
+ location: Location;
1598
+ value: string;
1599
+ }
1600
+ interface TableRow {
1601
+ location: Location;
1602
+ cells: TableCell[];
1603
+ id: string;
1604
+ }
1605
+ interface DataTable {
1606
+ location: Location;
1607
+ rows: TableRow[];
1608
+ }
1609
+ interface Step {
1610
+ location: Location;
1611
+ keyword: string;
1612
+ keywordType: KeywordType;
1613
+ text: string;
1614
+ id: string;
1615
+ docString?: DocString;
1616
+ dataTable?: DataTable;
1617
+ }
1618
+ interface Scenario {
1619
+ location: Location;
1620
+ tags: Tag[];
1621
+ keyword: string;
1622
+ name: string;
1623
+ description: string;
1624
+ steps: Step[];
1625
+ id: string;
1626
+ }
1627
+ interface Background {
1628
+ location: Location;
1629
+ keyword: string;
1630
+ name: string;
1631
+ description: string;
1632
+ steps: Step[];
1633
+ id: string;
1634
+ }
1635
+ type FeatureChild = {
1636
+ background: Background;
1637
+ scenario?: undefined;
1638
+ } | {
1639
+ scenario: Scenario;
1640
+ background?: undefined;
1641
+ };
1642
+ interface Feature {
1643
+ location: Location;
1644
+ tags: Tag[];
1645
+ language: string;
1646
+ keyword: string;
1647
+ name: string;
1648
+ description: string;
1649
+ children: FeatureChild[];
1650
+ }
1651
+ interface GherkinDocument {
1652
+ uri: string;
1653
+ feature: Feature;
1654
+ }
1655
+ type PickleStepType = "Unknown" | "Context" | "Action" | "Outcome";
1656
+ interface PickleDocString {
1657
+ mediaType?: string;
1658
+ content: string;
1659
+ }
1660
+ interface PickleTableCell {
1661
+ value: string;
1662
+ }
1663
+ interface PickleTableRow {
1664
+ cells: PickleTableCell[];
1665
+ }
1666
+ interface PickleTable {
1667
+ rows: PickleTableRow[];
1668
+ }
1669
+ interface PickleStepArgument {
1670
+ docString?: PickleDocString;
1671
+ dataTable?: PickleTable;
1672
+ }
1673
+ interface PickleStep {
1674
+ astNodeIds: string[];
1675
+ id: string;
1676
+ type: PickleStepType;
1677
+ text: string;
1678
+ argument?: PickleStepArgument;
1679
+ }
1680
+ interface PickleTag {
1681
+ name: string;
1682
+ astNodeId: string;
1683
+ }
1684
+ interface Pickle {
1685
+ id: string;
1686
+ uri: string;
1687
+ name: string;
1688
+ language: string;
1689
+ steps: PickleStep[];
1690
+ tags: PickleTag[];
1691
+ astNodeIds: string[];
1692
+ }
1693
+ type TestStepResultStatus = "UNKNOWN" | "PASSED" | "SKIPPED" | "PENDING" | "UNDEFINED" | "AMBIGUOUS" | "FAILED";
1694
+ interface TestStepResult {
1695
+ duration: Duration;
1696
+ status: TestStepResultStatus;
1697
+ message?: string;
1698
+ }
1699
+ interface TestStep {
1700
+ id: string;
1701
+ pickleStepId?: string;
1702
+ stepDefinitionIds?: string[];
1703
+ }
1704
+ interface TestCase {
1705
+ id: string;
1706
+ pickleId: string;
1707
+ testSteps: TestStep[];
1708
+ }
1709
+ interface TestRunStarted {
1710
+ timestamp: Timestamp;
1711
+ }
1712
+ interface TestCaseStarted {
1713
+ id: string;
1714
+ testCaseId: string;
1715
+ timestamp: Timestamp;
1716
+ attempt: number;
1717
+ }
1718
+ interface TestStepStarted {
1719
+ testCaseStartedId: string;
1720
+ testStepId: string;
1721
+ timestamp: Timestamp;
1722
+ }
1723
+ interface TestStepFinished {
1724
+ testCaseStartedId: string;
1725
+ testStepId: string;
1726
+ testStepResult: TestStepResult;
1727
+ timestamp: Timestamp;
1728
+ }
1729
+ interface TestCaseFinished {
1730
+ testCaseStartedId: string;
1731
+ timestamp: Timestamp;
1732
+ willBeRetried: boolean;
1733
+ }
1734
+ interface TestRunFinished {
1735
+ timestamp: Timestamp;
1736
+ success: boolean;
1737
+ }
1738
+ type AttachmentContentEncoding = "IDENTITY" | "BASE64";
1739
+ interface CucumberAttachment {
1740
+ testCaseStartedId: string;
1741
+ testStepId?: string;
1742
+ body: string;
1743
+ mediaType: string;
1744
+ contentEncoding: AttachmentContentEncoding;
1745
+ }
1746
+ /**
1747
+ * Each NDJSON line is one Envelope with exactly one field set.
1748
+ */
1749
+ type Envelope = {
1750
+ meta: Meta;
1751
+ } | {
1752
+ source: Source;
1753
+ } | {
1754
+ gherkinDocument: GherkinDocument;
1755
+ } | {
1756
+ pickle: Pickle;
1757
+ } | {
1758
+ testRunStarted: TestRunStarted;
1759
+ } | {
1760
+ testCase: TestCase;
1761
+ } | {
1762
+ testCaseStarted: TestCaseStarted;
1763
+ } | {
1764
+ testStepStarted: TestStepStarted;
1765
+ } | {
1766
+ testStepFinished: TestStepFinished;
1767
+ } | {
1768
+ testCaseFinished: TestCaseFinished;
1769
+ } | {
1770
+ testRunFinished: TestRunFinished;
1771
+ } | {
1772
+ attachment: CucumberAttachment;
1773
+ };
1774
+
1775
+ /**
1776
+ * Convert a canonical TestRunResult into a frozen-shape StoryReport for UI renderers.
1777
+ */
1778
+ declare function toStoryReport(run: TestRunResult): StoryReport;
1779
+
1780
+ /**
1781
+ * NDJSON-to-TestRunResult parser.
1782
+ *
1783
+ * Parses Cucumber Messages NDJSON (one JSON envelope per line) back into
1784
+ * a TestRunResult suitable for rendering by HtmlFormatter or other formatters.
1785
+ *
1786
+ * This is the NDJSON compat path: it produces a minimal but sufficient
1787
+ * TestRunResult. Fields not present in the NDJSON stream are given
1788
+ * sensible defaults.
1789
+ */
1790
+
1791
+ /**
1792
+ * Parse an NDJSON string into a TestRunResult.
1793
+ *
1794
+ * @param ndjson - NDJSON string (one JSON envelope per line)
1795
+ * @returns TestRunResult reconstructed from the envelopes
1796
+ */
1797
+ declare function parseNdjson(ndjson: string): TestRunResult;
1798
+ /**
1799
+ * Parse an array of Envelope objects into a TestRunResult.
1800
+ *
1801
+ * @param envelopes - Array of Cucumber Messages envelopes
1802
+ * @returns TestRunResult reconstructed from the envelopes
1803
+ */
1804
+ declare function parseEnvelopes(envelopes: Envelope[]): TestRunResult;
1805
+
1806
+ /**
1807
+ * Session trajectory primitive — the valuable part of the old `serve.ts`.
1808
+ *
1809
+ * Pins a session baseline (the first run observed) and folds each subsequent run
1810
+ * forward, so a docs/agent loop can show "how this run compares to where the
1811
+ * session started" rather than just the noise between adjacent runs. Pure (no
1812
+ * I/O, no diff engine) so it lives in core and is consumable by the Astro
1813
+ * integration and the CLI alike. Diffing the runs is layered on top by the
1814
+ * consumer (the diff engine lives in the formatters package).
1815
+ */
1816
+
1817
+ /**
1818
+ * The realtime state a live view renders. The session baseline is pinned to the
1819
+ * first run observed after boot, so the headline tracks the whole loop's
1820
+ * trajectory rather than the noise between any two adjacent iterations.
1821
+ */
1822
+ interface RunState {
1823
+ /** First run observed this session — the trajectory anchor. */
1824
+ sessionBaseline: TestRunResult | null;
1825
+ /** The run immediately before {@link RunState.current} — the per-iteration anchor. */
1826
+ previous: TestRunResult | null;
1827
+ /** Latest run. */
1828
+ current: TestRunResult | null;
1829
+ /** How many runs have been observed since boot. */
1830
+ runCount: number;
1831
+ }
1832
+ /** The empty state before any run has been observed. */
1833
+ declare const initialRunState: RunState;
1834
+ /**
1835
+ * Fold a freshly-read run into the prior state. The first run pins the session
1836
+ * baseline; later runs shift `previous`/`current` forward. Pure.
1837
+ */
1838
+ declare function advanceState(prev: RunState, run: TestRunResult): RunState;
1839
+
1840
+ /**
1841
+ * Canonical builders for doc entries whose construction carries a rule worth
1842
+ * keeping in one place. Adapters import these instead of re-implementing the
1843
+ * logic (the `html` exactly-one-of-source rule was previously copied verbatim
1844
+ * across the Vitest, Jest, Cypress, and Playwright adapters).
1845
+ */
1846
+
1847
+ /** Source/presentation options for an `html` doc entry. */
1848
+ interface HtmlDocOptions {
1849
+ /** Local HTML file path (inlined into the report by default). */
1850
+ path?: string;
1851
+ /** Remote URL rendered via iframe src. */
1852
+ url?: string;
1853
+ /** Inline HTML content rendered via iframe srcdoc. */
1854
+ content?: string;
1855
+ title?: string;
1856
+ /** Iframe height: number → px, string passed through (e.g. '60vh'). Default 400px. */
1857
+ height?: number | string;
1858
+ }
1859
+ /**
1860
+ * Build an `html` DocEntry, enforcing that exactly one of path/url/content is
1861
+ * set. Throws otherwise — this is the single source of that rule.
1862
+ */
1863
+ declare function buildHtmlDocEntry(options: HtmlDocOptions): DocEntry;
1864
+
1865
+ /**
1866
+ * Duration formatting utilities.
1867
+ */
1868
+ /**
1869
+ * Format milliseconds as human-readable duration.
1870
+ *
1871
+ * @param ms - Duration in milliseconds
1872
+ * @returns Formatted string (e.g., "123 ms", "1.5 s", "2m 30s")
1873
+ */
1874
+ declare function formatDuration(ms: number): string;
1875
+ /**
1876
+ * Convert milliseconds to nanoseconds.
1877
+ *
1878
+ * Used for Cucumber JSON format which expects nanoseconds.
1879
+ *
1880
+ * @param ms - Duration in milliseconds
1881
+ * @returns Duration in nanoseconds
1882
+ */
1883
+ declare function msToNanoseconds(ms: number): number;
1884
+ /**
1885
+ * Convert nanoseconds to milliseconds.
1886
+ *
1887
+ * @param ns - Duration in nanoseconds
1888
+ * @returns Duration in milliseconds
1889
+ */
1890
+ declare function nanosecondsToMs(ns: number): number;
1891
+
1042
1892
  interface BehaviorDiffEntry {
1043
1893
  id: string;
1044
1894
  title: string;
1045
1895
  sourceFile: string;
1046
1896
  kind: ScenarioChangeKind;
1047
- baselineStatus?: TestStatus$1;
1048
- currentStatus?: TestStatus$1;
1897
+ baselineStatus?: TestStatus;
1898
+ currentStatus?: TestStatus;
1049
1899
  }
1050
1900
  interface BehaviorDiff {
1051
1901
  schemaVersion: "1.0";
@@ -1063,7 +1913,7 @@ interface BehaviorDiff {
1063
1913
  * Classify a single scenario's status transition between two runs.
1064
1914
  * Shares the `ScenarioChangeKind` vocabulary with the full compare engine.
1065
1915
  */
1066
- declare function classifyStatusChange(baseline: TestStatus$1 | undefined, current: TestStatus$1 | undefined): ScenarioChangeKind;
1916
+ declare function classifyStatusChange(baseline: TestStatus | undefined, current: TestStatus | undefined): ScenarioChangeKind;
1067
1917
  /**
1068
1918
  * Scenario-level diff of two StoryReports, keyed by scenario id. Reports status
1069
1919
  * transitions (the agent triage signal), not the full field-by-field diff that
@@ -1529,6 +2379,22 @@ declare class RunDiffMarkdownFormatter {
1529
2379
  format(diff: RunDiffResult): string;
1530
2380
  }
1531
2381
 
2382
+ interface RunDiffChangelogOptions {
2383
+ title?: string;
2384
+ }
2385
+ /**
2386
+ * Behavior changelog between two runs: release-notes-style Markdown built
2387
+ * from the same RunDiffResult as `compare`'s review outputs, but written for
2388
+ * the reader of a release ("what can the product do now") rather than the
2389
+ * reviewer of a diff. New behaviors include their Given/When/Then steps so
2390
+ * the entry reads as a specification, not a test name.
2391
+ */
2392
+ declare class RunDiffChangelogFormatter {
2393
+ private readonly title;
2394
+ constructor(options?: RunDiffChangelogOptions);
2395
+ format(diff: RunDiffResult): string;
2396
+ }
2397
+
1532
2398
  /**
1533
2399
  * Git information utilities.
1534
2400
  *
@@ -1653,7 +2519,7 @@ interface SendNotificationsDeps {
1653
2519
  logger: {
1654
2520
  warn(msg: string): void;
1655
2521
  };
1656
- toCIInfo: (raw?: RawCIInfo) => CIInfo | undefined;
2522
+ toCIInfo: (raw?: RawCIInfo) => CIInfo$1 | undefined;
1657
2523
  env?: Record<string, string | undefined>;
1658
2524
  }
1659
2525
  /**
@@ -1799,51 +2665,6 @@ declare function signBody(args: {
1799
2665
  /** Strip ANSI escape sequences. Regex: \x1B\[[0-?]*[ -/]*[@-~] */
1800
2666
  declare function stripAnsi(text: string): string;
1801
2667
 
1802
- /**
1803
- * Types for history tracking and test metrics.
1804
- */
1805
-
1806
- interface HistoryEntry {
1807
- runId: string;
1808
- timestamp: number;
1809
- status: "passed" | "failed" | "skipped" | "pending";
1810
- durationMs: number;
1811
- ci?: {
1812
- provider?: CIProvider;
1813
- branch?: string;
1814
- commitSha?: string;
1815
- };
1816
- }
1817
- interface TestHistory {
1818
- testId: string;
1819
- testName: string;
1820
- sourceFile: string;
1821
- sourceLine?: number;
1822
- entries: HistoryEntry[];
1823
- }
1824
- interface HistoryStore {
1825
- version: 1;
1826
- maxRuns: number;
1827
- tests: Record<string, TestHistory>;
1828
- lastUpdated: number;
1829
- }
1830
- type StabilityGrade = "A" | "B" | "C" | "D" | "F";
1831
- type FlakinessLevel = "stable" | "unstable" | "flaky";
1832
- type PerformanceTrend = "improving" | "stable" | "regressing";
1833
- interface TestMetrics {
1834
- testId: string;
1835
- flakinessLevel: FlakinessLevel;
1836
- flakinessScore: number;
1837
- failureRate: number;
1838
- stabilityGrade: StabilityGrade;
1839
- performanceTrend: PerformanceTrend;
1840
- avgDurationMs: number;
1841
- passRate: number;
1842
- longestPassStreak: number;
1843
- consecutiveFailures: number;
1844
- sampleSize: number;
1845
- }
1846
-
1847
2668
  /**
1848
2669
  * History store: load, save, update (fn(args, deps) pattern).
1849
2670
  */
@@ -1966,13 +2787,13 @@ declare function listScenarios(args: ListScenariosArgs, _deps: ListScenariosDeps
1966
2787
  interface CheckArgs {
1967
2788
  testCases: TestCaseResult[];
1968
2789
  /** Baseline scenario statuses keyed by scenario id, for regressed/fixed deltas. */
1969
- baseline?: Map<string, TestStatus>;
2790
+ baseline?: Map<string, TestStatus$1>;
1970
2791
  format: "text" | "json";
1971
2792
  }
1972
2793
  type CheckDeps = Record<string, never>;
1973
2794
  /** A single rendered step inside a failing scenario. */
1974
2795
  interface CheckStep {
1975
- keyword: StepKeyword;
2796
+ keyword: StepKeyword$1;
1976
2797
  text: string;
1977
2798
  /** True when this step is the one that failed. */
1978
2799
  failed: boolean;
@@ -2090,7 +2911,7 @@ interface TriageItem {
2090
2911
  rank: number;
2091
2912
  id: string;
2092
2913
  scenario: string;
2093
- status: TestStatus;
2914
+ status: TestStatus$1;
2094
2915
  /** `sourceFile:sourceLine` */
2095
2916
  location: string;
2096
2917
  /** Product-code paths to fix. Empty when the scenario declared no `covers`. */
@@ -2112,7 +2933,7 @@ interface TriageReport {
2112
2933
  interface TriageArgs {
2113
2934
  testCases: TestCaseResult[];
2114
2935
  /** Baseline statuses by scenario id, to flag regressions and rank them first. */
2115
- baseline?: Map<string, TestStatus>;
2936
+ baseline?: Map<string, TestStatus$1>;
2116
2937
  format: "text" | "json";
2117
2938
  }
2118
2939
  type TriageDeps = Record<string, never>;
@@ -2342,7 +3163,7 @@ interface TraceabilityRequirement {
2342
3163
  scenarios: Array<{
2343
3164
  id: string;
2344
3165
  title: string;
2345
- status: TestStatus;
3166
+ status: TestStatus$1;
2346
3167
  sourceFile: string;
2347
3168
  sourceLine: number;
2348
3169
  covers: string[];
@@ -2371,7 +3192,7 @@ interface TraceabilityMatrix {
2371
3192
  untraced: Array<{
2372
3193
  id: string;
2373
3194
  title: string;
2374
- status: TestStatus;
3195
+ status: TestStatus$1;
2375
3196
  sourceFile: string;
2376
3197
  sourceLine: number;
2377
3198
  }>;
@@ -2469,7 +3290,7 @@ declare function createReportGenerator(options?: FormatterOptions, deps?: Partia
2469
3290
  declare function generateRunComparison(args: {
2470
3291
  baseline: TestRunResult;
2471
3292
  current: TestRunResult;
2472
- formats: Array<"html" | "markdown">;
3293
+ formats: Array<"html" | "markdown" | "changelog">;
2473
3294
  outputDir?: string;
2474
3295
  outputName?: string;
2475
3296
  title?: string;
@@ -2494,4 +3315,4 @@ declare function normalizeVitestResults(testModules: Parameters<typeof adaptVite
2494
3315
  */
2495
3316
  declare function normalizePlaywrightResults(testResults: Parameters<typeof adaptPlaywrightRun>[0], adapterOptions?: Parameters<typeof adaptPlaywrightRun>[1], canonicalizeOptions?: CanonicalizeOptions): TestRunResult;
2496
3317
 
2497
- export { type AstroAssetResult, AstroFormatter, type AstroFormatterOptions as AstroFormatterOpts, type BehaviorDebuggerIssue, type BehaviorDiff, type BehaviorDiffEntry, type BehaviorManifest, BehaviorManifestJsonFormatter, type BehaviorManifestJsonOptions, type BehaviorSourceFile, type BehaviorTag, type BundleOptions, type BundleResult, type ChangeType, type ChangedFile, type ChangedFileReview, type CheckArgs, type CheckDeps, type CheckFailure, type CheckReport, type CheckStep, type ColocatedStyle, type CompareFormat, type CompareFormatterOptions, type ConfluenceAuth, ConfluenceFormatter, type ConfluenceFormatterOptions as ConfluenceFormatterOpts, type CopyMarkdownAssetsOptions, CucumberHtmlFormatter, type CucumberHtmlOptions, CucumberJsonFormatter, type CucumberJsonOptions, CucumberMessagesFormatter, type CucumberMessagesOptions, type DeploymentEntry, type DeploymentLedger, type DeploymentStatus, type EnvironmentDrift, 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 GoalArgs, type GoalDeps, type GoalReport, type GoalRequirementResult, type HistoryEntry, type HistoryStore, 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, type NotificationSummary, type NotifyCondition, type OtelTraceContext, type OutputConfig, type OutputFormat, type OutputMode, type OutputRule, type PerformanceTrend, type PublishConfluenceArgs, type PublishConfluenceDeps, type PublishConfluenceResult, type PublishJiraArgs, type PublishJiraDeps, type PublishJiraResult, type RatchetViolation, type RecordDeploymentArgs, type RecordDeploymentResult, type ReleaseManifest, ReleaseManifestFormatter, ReportGenerator, 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, 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, StoryReportJsonFormatter, type StoryReportJsonOptions, type TestHistory, type TestMetrics, type TraceabilityMatrix, TraceabilityMatrixFormatter, type TraceabilityRequirement, type TriageArgs, type TriageDeps, type TriageItem, type TriageReport, type WatchDeps, type WatchHandle, type WatchOptions, type WebhookPayload, type WebhookSignerHmac, type WriteFile, adaptJestRun, adaptPlaywrightRun, adaptVitestRun, buildCheck, buildGoal, buildReview, buildTriage, bundleAssets, calculateFlakiness, calculateStability, classifyStatusChange, clearVersionCache, computeTestMetrics, copyMarkdownAssets, createPrCommentSummary, createReportGenerator, deriveAudience, deriveChangeType, detectCI, detectPerformanceTrend, diffRuns, diffStoryReports, findGitDir, generateRunComparison, getDeploymentStatus, getEnvironmentDrift, gradeEvidence, hasSufficientHistory, isReviewableSource, isTestFile, joinNameAndExt, listScenarios, loadHistory, normalizeFormats, normalizeJestResults, normalizePlaywrightResults, normalizeVitestResults, publishConfluencePage, publishJiraIssue, readBranchName, readGitSha, readPackageVersion, recordDeployment, regenerateArtifacts, regenerateRun, renderCheck, renderGoal, renderTriage, resolveTraceUrl, rewriteAssetPaths, saveHistory, scenariosCoveringPaths, sendNotifications, sendSlackNotification, sendTeamsNotification, sendWebhookNotification, signBody, startWatch, stripAnsi, toBehaviorManifest, toReleaseManifest, toScenarioIndex, toTraceabilityMatrix, tryGetActiveOtelContext, updateHistory };
3318
+ 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 CheckArgs, type CheckDeps, type CheckFailure, type CheckReport, type CheckStep, type ColocatedStyle, type CompareFormat, type CompareFormatterOptions, type ConfluenceAuth, ConfluenceFormatter, type ConfluenceFormatterOptions as ConfluenceFormatterOpts, type CopyMarkdownAssetsOptions, CucumberHtmlFormatter, type CucumberHtmlOptions, CucumberJsonFormatter, type CucumberJsonOptions, CucumberMessagesFormatter, type CucumberMessagesOptions, type DeploymentEntry, type DeploymentLedger, type DeploymentStatus, DocEntry, DocPhase, ES_THEME_TOKENS_CSS, ES_THEME_TOKEN_VALUES, type EnvironmentDrift, 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 GoalArgs, type GoalDeps, type GoalReport, type GoalRequirementResult, type HistoryEntry, type HistoryStore, type HtmlDocOptions, 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, type RatchetViolation, RawAttachment, RawCIInfo, RawRun, RawStatus, type RecordDeploymentArgs, type RecordDeploymentResult, type ReleaseManifest, ReleaseManifestFormatter, 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, RunDiffChangelogFormatter, type RunDiffChangelogOptions, RunDiffHtmlFormatter, type RunDiffHtmlOptions, RunDiffMarkdownFormatter, type RunDiffMarkdownOptions, type RunDiffResult, type RunDiffSummary, type RunState, 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, StepKeyword$1 as StepKeyword, StepResult, type StoryReport, StoryReportJsonFormatter, type StoryReportJsonOptions, type StoryReportSchemaVersion, StoryStep, TestCaseResult, type TestHistory, type TestMetrics, TestRunResult, TestStatus$1 as TestStatus, type TraceabilityMatrix, TraceabilityMatrixFormatter, type TraceabilityRequirement, type TriageArgs, type TriageDeps, type TriageItem, type TriageReport, CIInfo$1 as TypedCIInfo, type ValidationResult, type WatchDeps, type WatchHandle, type WatchOptions, type WebhookPayload, type WebhookSignerHmac, type WriteFile, adaptJestRun, adaptPlaywrightRun, adaptVitestRun, advanceState, assertValidRun, buildCheck, buildGoal, buildHtmlDocEntry, buildReview, buildTriage, bundleAssets, calculateFlakiness, calculateStability, canonicalizeRun, classifyStatusChange, clearVersionCache, computeTestMetrics, copyMarkdownAssets, createPrCommentSummary, createReportGenerator, deriveAudience, deriveChangeType, deriveStepResults, detectCI, detectPerformanceTrend, diffRuns, diffStoryReports, findGitDir, formatDuration, generateRunComparison, generateRunId, generateTestCaseId, getDeploymentStatus, getEnvironmentDrift, gradeEvidence, hasSufficientHistory, initialRunState, isReviewableSource, isTestFile, joinNameAndExt, listScenarios, loadHistory, mergeStepResults, msToNanoseconds, nanosecondsToMs, normalizeFormats, normalizeJestResults, normalizePlaywrightResults, normalizeStatus, normalizeVitestResults, parseEnvelopes, parseNdjson, publishConfluencePage, publishJiraIssue, readBranchName, readGitSha, readPackageVersion, recordDeployment, regenerateArtifacts, regenerateRun, renderCheck, renderGoal, renderTriage, resolveAttachment, resolveAttachments, resolveTraceUrl, rewriteAssetPaths, saveHistory, scenariosCoveringPaths, sendNotifications, sendSlackNotification, sendTeamsNotification, sendWebhookNotification, signBody, slugify, startWatch, stripAnsi, toBehaviorManifest, toReleaseManifest, toScenarioIndex, toStoryReport, toTraceabilityMatrix, tryGetActiveOtelContext, updateHistory, validateCanonicalRun };