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.
@@ -8,7 +8,7 @@
8
8
  */
9
9
 
10
10
  type CIProvider = "github" | "gitlab" | "circleci" | "jenkins" | "azure" | "buildkite" | "travis" | "unknown";
11
- interface CIInfo {
11
+ interface CIInfo$1 {
12
12
  provider: CIProvider;
13
13
  displayName: string;
14
14
  url?: string;
@@ -18,9 +18,9 @@ interface CIInfo {
18
18
  prNumber?: string;
19
19
  }
20
20
  /** Convert RawCIInfo (legacy transport) to canonical CIInfo. */
21
- declare function toCIInfo(raw?: RawCIInfo): CIInfo | undefined;
21
+ declare function toCIInfo(raw?: RawCIInfo): CIInfo$1 | undefined;
22
22
  /** Convert canonical CIInfo back to RawCIInfo (for serialization). */
23
- declare function toRawCIInfo(ci?: CIInfo): RawCIInfo | undefined;
23
+ declare function toRawCIInfo(ci?: CIInfo$1): RawCIInfo | undefined;
24
24
 
25
25
  /**
26
26
  * OTel span types for trace waterfall rendering.
@@ -159,6 +159,8 @@ interface StoryMeta {
159
159
  tags?: string[];
160
160
  /** Ticket/issue references (normalized to array) */
161
161
  tickets?: NormalizedTicket[];
162
+ /** Product-code paths/globs this scenario exercises (project-root-relative). */
163
+ covers?: string[];
162
164
  /** User-defined metadata */
163
165
  meta?: Record<string, unknown>;
164
166
  /** Parent describe/suite names for hierarchical grouping */
@@ -234,6 +236,12 @@ interface RawTestCase {
234
236
  attachments?: RawAttachment[];
235
237
  /** Framework-specific metadata (kept for debugging) */
236
238
  meta?: Record<string, unknown>;
239
+ /**
240
+ * Evidence ingested from external tools (mutation/coverage/failing-first).
241
+ * Not produced by framework adapters — injected at ingestion time and passed
242
+ * through to the canonical {@link TestCaseResult.evidence}.
243
+ */
244
+ evidence?: TestCaseEvidence;
237
245
  /** Retry attempt number (0-based) */
238
246
  retry?: number;
239
247
  /** Total retry count configured */
@@ -273,6 +281,155 @@ interface RawRun {
273
281
  ci?: RawCIInfo;
274
282
  }
275
283
 
284
+ /** Canonical test status (Cucumber-compatible) */
285
+ type TestStatus = "passed" | "failed" | "skipped" | "pending";
286
+ /** Step result with status and timing */
287
+ interface StepResult {
288
+ /** Step index (0-based) */
289
+ index: number;
290
+ /** Stable step ID when available */
291
+ stepId?: string;
292
+ /** Step status */
293
+ status: TestStatus;
294
+ /** Duration in milliseconds (default 0) */
295
+ durationMs: number;
296
+ /** Error message if step failed */
297
+ errorMessage?: string;
298
+ }
299
+ /** Resolved attachment (always has body) */
300
+ interface Attachment {
301
+ /** Attachment name */
302
+ name: string;
303
+ /** MIME type */
304
+ mediaType: string;
305
+ /** Content (base64-encoded or URL) */
306
+ body: string;
307
+ /** Content encoding */
308
+ contentEncoding: "BASE64" | "IDENTITY";
309
+ }
310
+ /** Single test attempt for retry tracking */
311
+ interface TestCaseAttempt {
312
+ /** Attempt number (0-based) */
313
+ attempt: number;
314
+ /** Status of this attempt */
315
+ status: TestStatus;
316
+ /** Duration of this attempt in milliseconds */
317
+ durationMs: number;
318
+ /** Error message if this attempt failed */
319
+ errorMessage?: string;
320
+ /** Error stack trace if this attempt failed */
321
+ errorStack?: string;
322
+ }
323
+ /** Canonical test case result */
324
+ interface TestCaseResult {
325
+ /** Unique deterministic ID */
326
+ id: string;
327
+ /** Story metadata (required) */
328
+ story: StoryMeta;
329
+ /** Source file path (required) */
330
+ sourceFile: string;
331
+ /** Source line number (required, default 1) */
332
+ sourceLine: number;
333
+ /** Test status (required) */
334
+ status: TestStatus;
335
+ /** Original adapter/framework status (preserved for diagnostics). */
336
+ rawStatus?: RawStatus;
337
+ /** Duration in milliseconds (required, default 0) */
338
+ durationMs: number;
339
+ /** Error message if failed */
340
+ errorMessage?: string;
341
+ /** Error stack trace if failed */
342
+ errorStack?: string;
343
+ /** Attachments (required, empty array if none) */
344
+ attachments: Attachment[];
345
+ /** Step results (required, always populated via fallback rules) */
346
+ stepResults: StepResult[];
347
+ /** Full title path from suite/describe blocks (required, empty array if none) */
348
+ titlePath: string[];
349
+ /** Playwright project name (optional) */
350
+ projectName?: string;
351
+ /** Retry attempt number (required, default 0) */
352
+ retry: number;
353
+ /** Total retries configured (required, default 0) */
354
+ retries: number;
355
+ /** Normalized tags from story (required, empty array if none) */
356
+ tags: string[];
357
+ /** All retry attempts (optional, includes details per attempt) */
358
+ attempts?: TestCaseAttempt[];
359
+ /**
360
+ * Ingested evidence (mutation/coverage/failing-first) used by the review
361
+ * formatter to grade proof strength. Populated at the ACL/ingestion layer,
362
+ * never by adapters. Optional and additive.
363
+ */
364
+ evidence?: TestCaseEvidence;
365
+ }
366
+ /**
367
+ * Evidence ingested from external tools to harden the "the test passes" claim.
368
+ *
369
+ * Populated at the ACL/ingestion layer from the host project's own tooling
370
+ * (Stryker/PITest mutation runs, coverage reports, base-ref re-verification).
371
+ * The packages never RUN these tools — same ingestion shape as {@link StoryMeta.otelSpans}.
372
+ * Consumed by the review formatter to grade how credible a claim's proof is.
373
+ */
374
+ interface TestCaseEvidence {
375
+ /** Mutation score (0-100) attributed to this test/file, from Stryker/PITest/etc. */
376
+ mutationScorePct?: number;
377
+ /** Mutants killed by this test's covered code (when the tool reports it). */
378
+ mutantsKilled?: number;
379
+ /** Total mutants in this test's covered code (when the tool reports it). */
380
+ mutantsTotal?: number;
381
+ /**
382
+ * True when the test was verified red on the base ref and green on head
383
+ * (the failing-first regression lock for bugfixes).
384
+ */
385
+ failingFirstVerified?: boolean;
386
+ /** Coverage of the changed lines this test exercises (0-100), when computable. */
387
+ changedLineCoveragePct?: number;
388
+ }
389
+ /** CI environment info */
390
+ interface CIInfo {
391
+ name: string;
392
+ url?: string;
393
+ buildNumber?: string;
394
+ branch?: string;
395
+ commitSha?: string;
396
+ prNumber?: string;
397
+ }
398
+ /** Coverage summary for the test run */
399
+ interface CoverageSummary {
400
+ /** Line coverage percentage (0-100) */
401
+ linesPct?: number;
402
+ /** Branch coverage percentage (0-100) */
403
+ branchesPct?: number;
404
+ /** Function coverage percentage (0-100) */
405
+ functionsPct?: number;
406
+ /** Statement coverage percentage (0-100) */
407
+ statementsPct?: number;
408
+ }
409
+ /** Canonical test run result */
410
+ interface TestRunResult {
411
+ /** All test case results */
412
+ testCases: TestCaseResult[];
413
+ /** Run start time (epoch ms, required) */
414
+ startedAtMs: number;
415
+ /** Run finish time (epoch ms, required) */
416
+ finishedAtMs: number;
417
+ /** Total duration in milliseconds (required) */
418
+ durationMs: number;
419
+ /** Project root directory (required) */
420
+ projectRoot: string;
421
+ /** Unique run ID (required, generated) */
422
+ runId: string;
423
+ /** Package version */
424
+ packageVersion?: string;
425
+ /** Git commit SHA */
426
+ gitSha?: string;
427
+ /** CI environment info */
428
+ ci?: CIInfo;
429
+ /** Coverage summary for the run */
430
+ coverage?: CoverageSummary;
431
+ }
432
+
276
433
  /**
277
434
  * Jest Adapter - Layer 1.
278
435
  *
@@ -452,4 +609,4 @@ interface PlaywrightAdapterOptions {
452
609
  */
453
610
  declare function adaptPlaywrightRun(testResults: Array<[PlaywrightTestCase, PlaywrightTestResult]>, options?: PlaywrightAdapterOptions): RawRun;
454
611
 
455
- export { type VitestSerializedError as A, type VitestState as B, type CIInfo as C, type DocEntry as D, type VitestTestCase as E, type VitestTestModule as F, type VitestTestResult as G, toCIInfo as H, toRawCIInfo as I, type JestAdapterOptions as J, type NormalizedTicket as N, type OtelSpan as O, type PlaywrightAdapterOptions as P, type RawStatus as R, type StoryMeta as S, type VitestAdapterOptions as V, type StoryStep as a, type DocPhase as b, type CIProvider as c, type RawAttachment as d, type RawRun as e, type RawCIInfo as f, adaptJestRun as g, adaptPlaywrightRun as h, adaptVitestRun as i, type JestAggregatedResult as j, type JestFileResult as k, type JestTestResult as l, type OtelAttributeValue as m, type PlaywrightAnnotation as n, type PlaywrightAttachment as o, type PlaywrightError as p, type PlaywrightLocation as q, type PlaywrightStatus as r, type PlaywrightTestCase as s, type PlaywrightTestResult as t, type RawStepEvent as u, type RawTestCase as v, STORY_META_KEY as w, type StepKeyword as x, type StepMode as y, type StoryFileReport as z };
612
+ export { type Attachment as A, STORY_META_KEY as B, type CIInfo$1 as C, type DocEntry as D, type StepKeyword as E, type StepMode as F, type StoryFileReport as G, type StoryMeta as H, type TestCaseAttempt as I, type JestAdapterOptions as J, type TestCaseEvidence as K, type VitestSerializedError as L, type VitestState as M, type NormalizedTicket as N, type OtelSpan as O, type PlaywrightAdapterOptions as P, type VitestTestCase as Q, type RawStatus as R, type StoryStep as S, type TestRunResult as T, type VitestTestModule as U, type VitestAdapterOptions as V, type VitestTestResult as W, toCIInfo as X, toRawCIInfo as Y, type TestCaseResult as a, type TestStatus as b, type DocPhase as c, type StepResult as d, type CIProvider as e, type RawAttachment as f, type RawRun as g, type RawCIInfo as h, adaptJestRun as i, adaptPlaywrightRun as j, adaptVitestRun as k, type CIInfo as l, type CoverageSummary as m, type JestAggregatedResult as n, type JestFileResult as o, type JestTestResult as p, type OtelAttributeValue as q, type PlaywrightAnnotation as r, type PlaywrightAttachment as s, type PlaywrightError as t, type PlaywrightLocation as u, type PlaywrightStatus as v, type PlaywrightTestCase as w, type PlaywrightTestResult as x, type RawStepEvent as y, type RawTestCase as z };
@@ -8,7 +8,7 @@
8
8
  */
9
9
 
10
10
  type CIProvider = "github" | "gitlab" | "circleci" | "jenkins" | "azure" | "buildkite" | "travis" | "unknown";
11
- interface CIInfo {
11
+ interface CIInfo$1 {
12
12
  provider: CIProvider;
13
13
  displayName: string;
14
14
  url?: string;
@@ -18,9 +18,9 @@ interface CIInfo {
18
18
  prNumber?: string;
19
19
  }
20
20
  /** Convert RawCIInfo (legacy transport) to canonical CIInfo. */
21
- declare function toCIInfo(raw?: RawCIInfo): CIInfo | undefined;
21
+ declare function toCIInfo(raw?: RawCIInfo): CIInfo$1 | undefined;
22
22
  /** Convert canonical CIInfo back to RawCIInfo (for serialization). */
23
- declare function toRawCIInfo(ci?: CIInfo): RawCIInfo | undefined;
23
+ declare function toRawCIInfo(ci?: CIInfo$1): RawCIInfo | undefined;
24
24
 
25
25
  /**
26
26
  * OTel span types for trace waterfall rendering.
@@ -159,6 +159,8 @@ interface StoryMeta {
159
159
  tags?: string[];
160
160
  /** Ticket/issue references (normalized to array) */
161
161
  tickets?: NormalizedTicket[];
162
+ /** Product-code paths/globs this scenario exercises (project-root-relative). */
163
+ covers?: string[];
162
164
  /** User-defined metadata */
163
165
  meta?: Record<string, unknown>;
164
166
  /** Parent describe/suite names for hierarchical grouping */
@@ -234,6 +236,12 @@ interface RawTestCase {
234
236
  attachments?: RawAttachment[];
235
237
  /** Framework-specific metadata (kept for debugging) */
236
238
  meta?: Record<string, unknown>;
239
+ /**
240
+ * Evidence ingested from external tools (mutation/coverage/failing-first).
241
+ * Not produced by framework adapters — injected at ingestion time and passed
242
+ * through to the canonical {@link TestCaseResult.evidence}.
243
+ */
244
+ evidence?: TestCaseEvidence;
237
245
  /** Retry attempt number (0-based) */
238
246
  retry?: number;
239
247
  /** Total retry count configured */
@@ -273,6 +281,155 @@ interface RawRun {
273
281
  ci?: RawCIInfo;
274
282
  }
275
283
 
284
+ /** Canonical test status (Cucumber-compatible) */
285
+ type TestStatus = "passed" | "failed" | "skipped" | "pending";
286
+ /** Step result with status and timing */
287
+ interface StepResult {
288
+ /** Step index (0-based) */
289
+ index: number;
290
+ /** Stable step ID when available */
291
+ stepId?: string;
292
+ /** Step status */
293
+ status: TestStatus;
294
+ /** Duration in milliseconds (default 0) */
295
+ durationMs: number;
296
+ /** Error message if step failed */
297
+ errorMessage?: string;
298
+ }
299
+ /** Resolved attachment (always has body) */
300
+ interface Attachment {
301
+ /** Attachment name */
302
+ name: string;
303
+ /** MIME type */
304
+ mediaType: string;
305
+ /** Content (base64-encoded or URL) */
306
+ body: string;
307
+ /** Content encoding */
308
+ contentEncoding: "BASE64" | "IDENTITY";
309
+ }
310
+ /** Single test attempt for retry tracking */
311
+ interface TestCaseAttempt {
312
+ /** Attempt number (0-based) */
313
+ attempt: number;
314
+ /** Status of this attempt */
315
+ status: TestStatus;
316
+ /** Duration of this attempt in milliseconds */
317
+ durationMs: number;
318
+ /** Error message if this attempt failed */
319
+ errorMessage?: string;
320
+ /** Error stack trace if this attempt failed */
321
+ errorStack?: string;
322
+ }
323
+ /** Canonical test case result */
324
+ interface TestCaseResult {
325
+ /** Unique deterministic ID */
326
+ id: string;
327
+ /** Story metadata (required) */
328
+ story: StoryMeta;
329
+ /** Source file path (required) */
330
+ sourceFile: string;
331
+ /** Source line number (required, default 1) */
332
+ sourceLine: number;
333
+ /** Test status (required) */
334
+ status: TestStatus;
335
+ /** Original adapter/framework status (preserved for diagnostics). */
336
+ rawStatus?: RawStatus;
337
+ /** Duration in milliseconds (required, default 0) */
338
+ durationMs: number;
339
+ /** Error message if failed */
340
+ errorMessage?: string;
341
+ /** Error stack trace if failed */
342
+ errorStack?: string;
343
+ /** Attachments (required, empty array if none) */
344
+ attachments: Attachment[];
345
+ /** Step results (required, always populated via fallback rules) */
346
+ stepResults: StepResult[];
347
+ /** Full title path from suite/describe blocks (required, empty array if none) */
348
+ titlePath: string[];
349
+ /** Playwright project name (optional) */
350
+ projectName?: string;
351
+ /** Retry attempt number (required, default 0) */
352
+ retry: number;
353
+ /** Total retries configured (required, default 0) */
354
+ retries: number;
355
+ /** Normalized tags from story (required, empty array if none) */
356
+ tags: string[];
357
+ /** All retry attempts (optional, includes details per attempt) */
358
+ attempts?: TestCaseAttempt[];
359
+ /**
360
+ * Ingested evidence (mutation/coverage/failing-first) used by the review
361
+ * formatter to grade proof strength. Populated at the ACL/ingestion layer,
362
+ * never by adapters. Optional and additive.
363
+ */
364
+ evidence?: TestCaseEvidence;
365
+ }
366
+ /**
367
+ * Evidence ingested from external tools to harden the "the test passes" claim.
368
+ *
369
+ * Populated at the ACL/ingestion layer from the host project's own tooling
370
+ * (Stryker/PITest mutation runs, coverage reports, base-ref re-verification).
371
+ * The packages never RUN these tools — same ingestion shape as {@link StoryMeta.otelSpans}.
372
+ * Consumed by the review formatter to grade how credible a claim's proof is.
373
+ */
374
+ interface TestCaseEvidence {
375
+ /** Mutation score (0-100) attributed to this test/file, from Stryker/PITest/etc. */
376
+ mutationScorePct?: number;
377
+ /** Mutants killed by this test's covered code (when the tool reports it). */
378
+ mutantsKilled?: number;
379
+ /** Total mutants in this test's covered code (when the tool reports it). */
380
+ mutantsTotal?: number;
381
+ /**
382
+ * True when the test was verified red on the base ref and green on head
383
+ * (the failing-first regression lock for bugfixes).
384
+ */
385
+ failingFirstVerified?: boolean;
386
+ /** Coverage of the changed lines this test exercises (0-100), when computable. */
387
+ changedLineCoveragePct?: number;
388
+ }
389
+ /** CI environment info */
390
+ interface CIInfo {
391
+ name: string;
392
+ url?: string;
393
+ buildNumber?: string;
394
+ branch?: string;
395
+ commitSha?: string;
396
+ prNumber?: string;
397
+ }
398
+ /** Coverage summary for the test run */
399
+ interface CoverageSummary {
400
+ /** Line coverage percentage (0-100) */
401
+ linesPct?: number;
402
+ /** Branch coverage percentage (0-100) */
403
+ branchesPct?: number;
404
+ /** Function coverage percentage (0-100) */
405
+ functionsPct?: number;
406
+ /** Statement coverage percentage (0-100) */
407
+ statementsPct?: number;
408
+ }
409
+ /** Canonical test run result */
410
+ interface TestRunResult {
411
+ /** All test case results */
412
+ testCases: TestCaseResult[];
413
+ /** Run start time (epoch ms, required) */
414
+ startedAtMs: number;
415
+ /** Run finish time (epoch ms, required) */
416
+ finishedAtMs: number;
417
+ /** Total duration in milliseconds (required) */
418
+ durationMs: number;
419
+ /** Project root directory (required) */
420
+ projectRoot: string;
421
+ /** Unique run ID (required, generated) */
422
+ runId: string;
423
+ /** Package version */
424
+ packageVersion?: string;
425
+ /** Git commit SHA */
426
+ gitSha?: string;
427
+ /** CI environment info */
428
+ ci?: CIInfo;
429
+ /** Coverage summary for the run */
430
+ coverage?: CoverageSummary;
431
+ }
432
+
276
433
  /**
277
434
  * Jest Adapter - Layer 1.
278
435
  *
@@ -452,4 +609,4 @@ interface PlaywrightAdapterOptions {
452
609
  */
453
610
  declare function adaptPlaywrightRun(testResults: Array<[PlaywrightTestCase, PlaywrightTestResult]>, options?: PlaywrightAdapterOptions): RawRun;
454
611
 
455
- export { type VitestSerializedError as A, type VitestState as B, type CIInfo as C, type DocEntry as D, type VitestTestCase as E, type VitestTestModule as F, type VitestTestResult as G, toCIInfo as H, toRawCIInfo as I, type JestAdapterOptions as J, type NormalizedTicket as N, type OtelSpan as O, type PlaywrightAdapterOptions as P, type RawStatus as R, type StoryMeta as S, type VitestAdapterOptions as V, type StoryStep as a, type DocPhase as b, type CIProvider as c, type RawAttachment as d, type RawRun as e, type RawCIInfo as f, adaptJestRun as g, adaptPlaywrightRun as h, adaptVitestRun as i, type JestAggregatedResult as j, type JestFileResult as k, type JestTestResult as l, type OtelAttributeValue as m, type PlaywrightAnnotation as n, type PlaywrightAttachment as o, type PlaywrightError as p, type PlaywrightLocation as q, type PlaywrightStatus as r, type PlaywrightTestCase as s, type PlaywrightTestResult as t, type RawStepEvent as u, type RawTestCase as v, STORY_META_KEY as w, type StepKeyword as x, type StepMode as y, type StoryFileReport as z };
612
+ export { type Attachment as A, STORY_META_KEY as B, type CIInfo$1 as C, type DocEntry as D, type StepKeyword as E, type StepMode as F, type StoryFileReport as G, type StoryMeta as H, type TestCaseAttempt as I, type JestAdapterOptions as J, type TestCaseEvidence as K, type VitestSerializedError as L, type VitestState as M, type NormalizedTicket as N, type OtelSpan as O, type PlaywrightAdapterOptions as P, type VitestTestCase as Q, type RawStatus as R, type StoryStep as S, type TestRunResult as T, type VitestTestModule as U, type VitestAdapterOptions as V, type VitestTestResult as W, toCIInfo as X, toRawCIInfo as Y, type TestCaseResult as a, type TestStatus as b, type DocPhase as c, type StepResult as d, type CIProvider as e, type RawAttachment as f, type RawRun as g, type RawCIInfo as h, adaptJestRun as i, adaptPlaywrightRun as j, adaptVitestRun as k, type CIInfo as l, type CoverageSummary as m, type JestAggregatedResult as n, type JestFileResult as o, type JestTestResult as p, type OtelAttributeValue as q, type PlaywrightAnnotation as r, type PlaywrightAttachment as s, type PlaywrightError as t, type PlaywrightLocation as u, type PlaywrightStatus as v, type PlaywrightTestCase as w, type PlaywrightTestResult as x, type RawStepEvent as y, type RawTestCase as z };