executable-stories-formatters 0.12.0 → 0.14.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/README.md +20 -0
- package/dist/adapters.d.cts +1 -1
- package/dist/adapters.d.ts +1 -1
- package/dist/cli.js +991 -111
- package/dist/cli.js.map +1 -1
- package/dist/{index-mrT6-JSt.d.cts → index-CXrzCk9p.d.cts} +1 -1
- package/dist/{index-mrT6-JSt.d.ts → index-CXrzCk9p.d.ts} +1 -1
- package/dist/index.cjs +466 -54
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +252 -4
- package/dist/index.d.ts +252 -4
- package/dist/index.js +458 -54
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/schemas/raw-run.schema.json +9 -0
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
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
|
|
2
|
-
export {
|
|
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 StepKeyword$1, j as adaptJestRun, k as adaptPlaywrightRun, l as adaptVitestRun } from './index-CXrzCk9p.cjs';
|
|
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-CXrzCk9p.cjs';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Notification types for webhook integrations (Slack, Teams).
|
|
@@ -150,7 +150,7 @@ interface CanonicalizeOptions {
|
|
|
150
150
|
};
|
|
151
151
|
}
|
|
152
152
|
/** Output format for report generation */
|
|
153
|
-
type OutputFormat = "astro" | "behavior-manifest-json" | "confluence" | "cucumber-json" | "cucumber-messages" | "cucumber-html" | "html" | "junit" | "markdown" | "release-manifest" | "scenario-index-json" | "story-report-json";
|
|
153
|
+
type OutputFormat = "astro" | "behavior-manifest-json" | "confluence" | "cucumber-json" | "cucumber-messages" | "cucumber-html" | "html" | "junit" | "markdown" | "release-manifest" | "scenario-index-json" | "story-report-json" | "traceability-matrix";
|
|
154
154
|
/** Sort order for test cases in reports (deterministic for diff-friendly output) */
|
|
155
155
|
type SortTestCasesMode = "id" | "source" | "none";
|
|
156
156
|
/** Output mode for report routing */
|
|
@@ -360,6 +360,10 @@ interface MarkdownFormatterOptions {
|
|
|
360
360
|
includeSourceLinks?: boolean;
|
|
361
361
|
/** Custom renderers for doc entries */
|
|
362
362
|
customRenderers?: MarkdownRenderers;
|
|
363
|
+
/** Emit a stable per-scenario anchor for deep-linking. Returns the id, or undefined to skip. */
|
|
364
|
+
scenarioAnchor?: (tc: TestCaseResult) => string | undefined;
|
|
365
|
+
/** Render a badge line under a scenario heading (e.g. a what's-changed marker). Undefined to skip. */
|
|
366
|
+
scenarioBadge?: (tc: TestCaseResult) => string | undefined;
|
|
363
367
|
}
|
|
364
368
|
|
|
365
369
|
/** Astro/Starlight formatter options */
|
|
@@ -487,6 +491,8 @@ interface ResolvedFormatterOptions {
|
|
|
487
491
|
ticketUrlTemplate?: string;
|
|
488
492
|
traceUrlTemplate?: string;
|
|
489
493
|
customRenderers?: MarkdownRenderers;
|
|
494
|
+
scenarioAnchor?: (tc: TestCaseResult) => string | undefined;
|
|
495
|
+
scenarioBadge?: (tc: TestCaseResult) => string | undefined;
|
|
490
496
|
};
|
|
491
497
|
};
|
|
492
498
|
assetMode: "none" | "copy";
|
|
@@ -1924,6 +1930,19 @@ interface MarkdownOptions {
|
|
|
1924
1930
|
includeSourceLinks?: boolean;
|
|
1925
1931
|
/** Custom renderers for doc entries */
|
|
1926
1932
|
customRenderers?: MarkdownRenderers;
|
|
1933
|
+
/**
|
|
1934
|
+
* Emit a stable in-page anchor before each scenario heading, so external tools
|
|
1935
|
+
* can deep-link to a scenario by fragment. Given a test case, return the anchor
|
|
1936
|
+
* id (without `#`), or undefined to skip. Off by default — only the living-docs
|
|
1937
|
+
* site opts in, so plain markdown output is unchanged.
|
|
1938
|
+
*/
|
|
1939
|
+
scenarioAnchor?: (tc: TestCaseResult) => string | undefined;
|
|
1940
|
+
/**
|
|
1941
|
+
* Render a short badge line directly under a scenario heading (e.g. a
|
|
1942
|
+
* what's-changed marker like "🆕 New" / "⚠️ Regressed"). Return the markdown
|
|
1943
|
+
* line, or undefined to skip. Off by default — only the living-docs site opts in.
|
|
1944
|
+
*/
|
|
1945
|
+
scenarioBadge?: (tc: TestCaseResult) => string | undefined;
|
|
1927
1946
|
}
|
|
1928
1947
|
/**
|
|
1929
1948
|
* Markdown Formatter.
|
|
@@ -2959,6 +2978,176 @@ interface ListScenariosArgs {
|
|
|
2959
2978
|
type ListScenariosDeps = Record<string, never>;
|
|
2960
2979
|
declare function listScenarios(args: ListScenariosArgs, _deps: ListScenariosDeps): string;
|
|
2961
2980
|
|
|
2981
|
+
/**
|
|
2982
|
+
* `check` — context-efficient backpressure for coding agents.
|
|
2983
|
+
*
|
|
2984
|
+
* The principle (from "Stop Babysitting Your Coding Agent. Give It Backpressure."):
|
|
2985
|
+
* compress success, expand failure. Passing scenarios collapse to a single count
|
|
2986
|
+
* line. Each failing scenario expands to its Given/When/Then narrative, the step
|
|
2987
|
+
* that broke, the error, and the product code it `covers` — so the agent gets an
|
|
2988
|
+
* actionable, intent-carrying signal instead of a wall of green.
|
|
2989
|
+
*
|
|
2990
|
+
* When a baseline run is supplied, the report also folds in what *regressed* and
|
|
2991
|
+
* what got *fixed* since the last run — the "retained" property of effective
|
|
2992
|
+
* feedback. Reuses the same status-transition vocabulary as {@link classifyStatusChange}.
|
|
2993
|
+
*/
|
|
2994
|
+
|
|
2995
|
+
interface CheckArgs {
|
|
2996
|
+
testCases: TestCaseResult[];
|
|
2997
|
+
/** Baseline scenario statuses keyed by scenario id, for regressed/fixed deltas. */
|
|
2998
|
+
baseline?: Map<string, TestStatus$1>;
|
|
2999
|
+
format: "text" | "json";
|
|
3000
|
+
}
|
|
3001
|
+
type CheckDeps = Record<string, never>;
|
|
3002
|
+
/** A single rendered step inside a failing scenario. */
|
|
3003
|
+
interface CheckStep {
|
|
3004
|
+
keyword: StepKeyword$1;
|
|
3005
|
+
text: string;
|
|
3006
|
+
/** True when this step is the one that failed. */
|
|
3007
|
+
failed: boolean;
|
|
3008
|
+
}
|
|
3009
|
+
/** Expanded detail for one failing scenario — the actionable payload. */
|
|
3010
|
+
interface CheckFailure {
|
|
3011
|
+
id: string;
|
|
3012
|
+
scenario: string;
|
|
3013
|
+
/** `sourceFile:sourceLine` */
|
|
3014
|
+
location: string;
|
|
3015
|
+
steps: CheckStep[];
|
|
3016
|
+
/** Failing step's error if isolated, else the scenario-level error. */
|
|
3017
|
+
errorMessage?: string;
|
|
3018
|
+
/** Product-code paths/globs this scenario exercises (what to fix). */
|
|
3019
|
+
covers: string[];
|
|
3020
|
+
tickets: string[];
|
|
3021
|
+
/** True when this scenario was passing in the baseline run. */
|
|
3022
|
+
regressed: boolean;
|
|
3023
|
+
}
|
|
3024
|
+
interface CheckReport {
|
|
3025
|
+
summary: {
|
|
3026
|
+
total: number;
|
|
3027
|
+
passed: number;
|
|
3028
|
+
failed: number;
|
|
3029
|
+
skipped: number;
|
|
3030
|
+
pending: number;
|
|
3031
|
+
};
|
|
3032
|
+
failures: CheckFailure[];
|
|
3033
|
+
/** Count of scenarios that went passed → failed vs. the baseline. */
|
|
3034
|
+
regressed: number;
|
|
3035
|
+
/** Count of scenarios that went failed → passed vs. the baseline. */
|
|
3036
|
+
fixed: number;
|
|
3037
|
+
/** Whether a baseline was supplied (so callers know if deltas are meaningful). */
|
|
3038
|
+
comparedToBaseline: boolean;
|
|
3039
|
+
}
|
|
3040
|
+
/**
|
|
3041
|
+
* Build a structured check report from canonical test cases.
|
|
3042
|
+
* Pure: no IO. Callers render it as text or JSON and decide the exit code.
|
|
3043
|
+
*/
|
|
3044
|
+
declare function buildCheck(args: CheckArgs, _deps?: CheckDeps): CheckReport;
|
|
3045
|
+
/**
|
|
3046
|
+
* Render the check report. Text is the default agent/human surface
|
|
3047
|
+
* (compressed success, expanded failure); JSON is the machine contract.
|
|
3048
|
+
*/
|
|
3049
|
+
declare function renderCheck(report: CheckReport, format: "text" | "json"): string;
|
|
3050
|
+
|
|
3051
|
+
/**
|
|
3052
|
+
* `goal` — a behavioral definition-of-done for autonomous agent loops.
|
|
3053
|
+
*
|
|
3054
|
+
* A `/goal`-style loop keeps working until a verifiable condition holds. This
|
|
3055
|
+
* expresses that condition in behavior, not "tests green and lint clean": the
|
|
3056
|
+
* required scenarios pass, nothing regressed, and nobody weakened a scenario to
|
|
3057
|
+
* fake done (the ratchet). It returns a clear met / not-met verdict and what is
|
|
3058
|
+
* left, so the loop and the human reading after it can both trust "done".
|
|
3059
|
+
*/
|
|
3060
|
+
|
|
3061
|
+
/** Result of one required selector (a tag, ticket, or scenario that must pass). */
|
|
3062
|
+
interface GoalRequirementResult {
|
|
3063
|
+
/** Human-readable selector, e.g. "tag:US-101", "ticket:CART-9", "all scenarios". */
|
|
3064
|
+
selector: string;
|
|
3065
|
+
matched: number;
|
|
3066
|
+
passed: number;
|
|
3067
|
+
/** Titles of matched scenarios that did not pass. */
|
|
3068
|
+
failing: string[];
|
|
3069
|
+
/** matched > 0 and every matched scenario passed. */
|
|
3070
|
+
met: boolean;
|
|
3071
|
+
}
|
|
3072
|
+
/** A scenario that was removed or weakened versus the baseline (anti-fake-done). */
|
|
3073
|
+
interface RatchetViolation {
|
|
3074
|
+
id: string;
|
|
3075
|
+
title: string;
|
|
3076
|
+
kind: "removed" | "disabled" | "weakened";
|
|
3077
|
+
detail: string;
|
|
3078
|
+
}
|
|
3079
|
+
interface GoalReport {
|
|
3080
|
+
/** True only when every requirement is met and no enforced guard fired. */
|
|
3081
|
+
met: boolean;
|
|
3082
|
+
requirements: GoalRequirementResult[];
|
|
3083
|
+
/** Scenarios that went passed -> failed versus baseline (when --no-regressions). */
|
|
3084
|
+
regressions: Array<{
|
|
3085
|
+
id: string;
|
|
3086
|
+
title: string;
|
|
3087
|
+
}>;
|
|
3088
|
+
regressionsEnforced: boolean;
|
|
3089
|
+
ratchet: {
|
|
3090
|
+
enforced: boolean;
|
|
3091
|
+
violations: RatchetViolation[];
|
|
3092
|
+
};
|
|
3093
|
+
}
|
|
3094
|
+
interface GoalArgs {
|
|
3095
|
+
run: TestRunResult;
|
|
3096
|
+
baseline?: TestRunResult;
|
|
3097
|
+
requireTags: string[];
|
|
3098
|
+
requireTickets: string[];
|
|
3099
|
+
requireScenarios: string[];
|
|
3100
|
+
enforceNoRegressions: boolean;
|
|
3101
|
+
enforceRatchet: boolean;
|
|
3102
|
+
format: "text" | "json";
|
|
3103
|
+
}
|
|
3104
|
+
type GoalDeps = Record<string, never>;
|
|
3105
|
+
declare function buildGoal(args: GoalArgs, _deps?: GoalDeps): GoalReport;
|
|
3106
|
+
declare function renderGoal(report: GoalReport, format: "text" | "json"): string;
|
|
3107
|
+
|
|
3108
|
+
/**
|
|
3109
|
+
* `triage` — the discovery-phase worklist for an agent loop.
|
|
3110
|
+
*
|
|
3111
|
+
* The automation that runs on a schedule needs a ranked queue of what to work
|
|
3112
|
+
* on, not a full report. This emits failing scenarios, regressions first, each
|
|
3113
|
+
* carrying the product code it `covers` (where to send the fixer), the error,
|
|
3114
|
+
* and its tickets. Failures with no `covers` are flagged: the loop can't route
|
|
3115
|
+
* them to code, so a human or a covers annotation is needed first.
|
|
3116
|
+
*/
|
|
3117
|
+
|
|
3118
|
+
interface TriageItem {
|
|
3119
|
+
rank: number;
|
|
3120
|
+
id: string;
|
|
3121
|
+
scenario: string;
|
|
3122
|
+
status: TestStatus$1;
|
|
3123
|
+
/** `sourceFile:sourceLine` */
|
|
3124
|
+
location: string;
|
|
3125
|
+
/** Product-code paths to fix. Empty when the scenario declared no `covers`. */
|
|
3126
|
+
covers: string[];
|
|
3127
|
+
tickets: string[];
|
|
3128
|
+
errorMessage?: string;
|
|
3129
|
+
/** Passed in the baseline, failing now. Ranked first. */
|
|
3130
|
+
regressed: boolean;
|
|
3131
|
+
reason: "regression" | "failing";
|
|
3132
|
+
}
|
|
3133
|
+
interface TriageReport {
|
|
3134
|
+
total: number;
|
|
3135
|
+
failing: number;
|
|
3136
|
+
regressions: number;
|
|
3137
|
+
/** Failing scenarios with no `covers` — the loop can't route them to code. */
|
|
3138
|
+
needsCovers: number;
|
|
3139
|
+
items: TriageItem[];
|
|
3140
|
+
}
|
|
3141
|
+
interface TriageArgs {
|
|
3142
|
+
testCases: TestCaseResult[];
|
|
3143
|
+
/** Baseline statuses by scenario id, to flag regressions and rank them first. */
|
|
3144
|
+
baseline?: Map<string, TestStatus$1>;
|
|
3145
|
+
format: "text" | "json";
|
|
3146
|
+
}
|
|
3147
|
+
type TriageDeps = Record<string, never>;
|
|
3148
|
+
declare function buildTriage(args: TriageArgs, _deps?: TriageDeps): TriageReport;
|
|
3149
|
+
declare function renderTriage(report: TriageReport, format: "text" | "json"): string;
|
|
3150
|
+
|
|
2962
3151
|
declare function createPrCommentSummary(diff: RunDiffResult, maxScenarios?: number): string;
|
|
2963
3152
|
|
|
2964
3153
|
declare function diffRuns(baseline: TestRunResult, current: TestRunResult): RunDiffResult;
|
|
@@ -3165,6 +3354,65 @@ declare class ReleaseManifestFormatter {
|
|
|
3165
3354
|
}
|
|
3166
3355
|
declare function toReleaseManifest(run: TestRunResult): ReleaseManifest;
|
|
3167
3356
|
|
|
3357
|
+
/**
|
|
3358
|
+
* Requirement-first view of a run. Groups scenarios under the ticket/user-story
|
|
3359
|
+
* they verify, rolls up the code each requirement covers and whether it passed,
|
|
3360
|
+
* and surfaces two gaps a scenario-keyed index hides: requirements with a failing
|
|
3361
|
+
* scenario, and scenarios linked to no requirement at all (untraced behavior).
|
|
3362
|
+
*
|
|
3363
|
+
* The set of requirements is derived from the tickets found on scenarios — the
|
|
3364
|
+
* tests are the source of truth, so a requirement only appears once a scenario
|
|
3365
|
+
* claims it.
|
|
3366
|
+
*/
|
|
3367
|
+
interface TraceabilityRequirement {
|
|
3368
|
+
/** Ticket / user-story id (e.g. "US-101", "JIRA-42"). */
|
|
3369
|
+
ticket: string;
|
|
3370
|
+
/** Direct URL when a scenario supplied one. */
|
|
3371
|
+
url?: string;
|
|
3372
|
+
/** "verified" = every scenario passed; "failing" = at least one failed; "incomplete" = only skipped/pending. */
|
|
3373
|
+
status: "verified" | "failing" | "incomplete";
|
|
3374
|
+
scenarios: Array<{
|
|
3375
|
+
id: string;
|
|
3376
|
+
title: string;
|
|
3377
|
+
status: TestStatus$1;
|
|
3378
|
+
sourceFile: string;
|
|
3379
|
+
sourceLine: number;
|
|
3380
|
+
covers: string[];
|
|
3381
|
+
}>;
|
|
3382
|
+
/** Union of every covered path across this requirement's scenarios. */
|
|
3383
|
+
covers: string[];
|
|
3384
|
+
}
|
|
3385
|
+
interface TraceabilityMatrix {
|
|
3386
|
+
schemaVersion: "1.0";
|
|
3387
|
+
generatedAt: string;
|
|
3388
|
+
run: {
|
|
3389
|
+
startedAt: string;
|
|
3390
|
+
finishedAt: string;
|
|
3391
|
+
gitSha?: string;
|
|
3392
|
+
branch?: string;
|
|
3393
|
+
};
|
|
3394
|
+
summary: {
|
|
3395
|
+
requirements: number;
|
|
3396
|
+
requirementsVerified: number;
|
|
3397
|
+
requirementsFailing: number;
|
|
3398
|
+
scenarios: number;
|
|
3399
|
+
untracedScenarios: number;
|
|
3400
|
+
};
|
|
3401
|
+
requirements: TraceabilityRequirement[];
|
|
3402
|
+
/** Scenarios with no ticket — behavior verified but not linked to a requirement. */
|
|
3403
|
+
untraced: Array<{
|
|
3404
|
+
id: string;
|
|
3405
|
+
title: string;
|
|
3406
|
+
status: TestStatus$1;
|
|
3407
|
+
sourceFile: string;
|
|
3408
|
+
sourceLine: number;
|
|
3409
|
+
}>;
|
|
3410
|
+
}
|
|
3411
|
+
declare class TraceabilityMatrixFormatter {
|
|
3412
|
+
format(run: TestRunResult): string;
|
|
3413
|
+
}
|
|
3414
|
+
declare function toTraceabilityMatrix(run: TestRunResult): TraceabilityMatrix;
|
|
3415
|
+
|
|
3168
3416
|
/**
|
|
3169
3417
|
* @executable-stories/formatters
|
|
3170
3418
|
*
|
|
@@ -3274,4 +3522,4 @@ declare function normalizeVitestResults(testModules: Parameters<typeof adaptVite
|
|
|
3274
3522
|
*/
|
|
3275
3523
|
declare function normalizePlaywrightResults(testResults: Parameters<typeof adaptPlaywrightRun>[0], adapterOptions?: Parameters<typeof adaptPlaywrightRun>[1], canonicalizeOptions?: CanonicalizeOptions): TestRunResult;
|
|
3276
3524
|
|
|
3277
|
-
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, 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 HistoryEntry, type HistoryStore, type HtmlDocOptions, 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 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, 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, buildHtmlDocEntry, 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, getDeploymentStatus, getEnvironmentDrift, gradeEvidence, hasSufficientHistory, isReviewableSource, isTestFile, joinNameAndExt, listScenarios, loadHistory, mergeStepResults, msToNanoseconds, nanosecondsToMs, normalizeJestResults, normalizePlaywrightResults, normalizeStatus, normalizeVitestResults, parseEnvelopes, parseNdjson, publishConfluencePage, publishJiraIssue, readBranchName, readGitSha, readPackageVersion, recordDeployment, regenerateArtifacts, resolveAttachment, resolveAttachments, resolveTheme, resolveTraceUrl, rewriteAssetPaths, saveHistory, scenariosCoveringPaths, sendNotifications, sendSlackNotification, sendTeamsNotification, sendWebhookNotification, signBody, slugify, startWatch, stripAnsi, toBehaviorManifest, toReleaseManifest, toScenarioIndex, toStoryReport, tryGetActiveOtelContext, updateHistory, validateCanonicalRun };
|
|
3525
|
+
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, 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, 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, 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, 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 as TypedCIInfo, type ValidationResult, type WatchDeps, type WatchHandle, type WatchOptions, type WebhookPayload, type WebhookSignerHmac, type WriteFile, adaptJestRun, adaptPlaywrightRun, adaptVitestRun, 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, getAvailableThemes, getCssOnlyThemes, getDeploymentStatus, getEnvironmentDrift, gradeEvidence, hasSufficientHistory, isReviewableSource, isTestFile, joinNameAndExt, listScenarios, loadHistory, mergeStepResults, msToNanoseconds, nanosecondsToMs, normalizeJestResults, normalizePlaywrightResults, normalizeStatus, normalizeVitestResults, parseEnvelopes, parseNdjson, publishConfluencePage, publishJiraIssue, readBranchName, readGitSha, readPackageVersion, recordDeployment, regenerateArtifacts, renderCheck, renderGoal, renderTriage, resolveAttachment, resolveAttachments, resolveTheme, resolveTraceUrl, rewriteAssetPaths, saveHistory, scenariosCoveringPaths, sendNotifications, sendSlackNotification, sendTeamsNotification, sendWebhookNotification, signBody, slugify, startWatch, stripAnsi, toBehaviorManifest, toReleaseManifest, toScenarioIndex, toStoryReport, toTraceabilityMatrix, tryGetActiveOtelContext, updateHistory, validateCanonicalRun };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
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
|
|
2
|
-
export {
|
|
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 StepKeyword$1, j as adaptJestRun, k as adaptPlaywrightRun, l as adaptVitestRun } from './index-CXrzCk9p.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-CXrzCk9p.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Notification types for webhook integrations (Slack, Teams).
|
|
@@ -150,7 +150,7 @@ interface CanonicalizeOptions {
|
|
|
150
150
|
};
|
|
151
151
|
}
|
|
152
152
|
/** Output format for report generation */
|
|
153
|
-
type OutputFormat = "astro" | "behavior-manifest-json" | "confluence" | "cucumber-json" | "cucumber-messages" | "cucumber-html" | "html" | "junit" | "markdown" | "release-manifest" | "scenario-index-json" | "story-report-json";
|
|
153
|
+
type OutputFormat = "astro" | "behavior-manifest-json" | "confluence" | "cucumber-json" | "cucumber-messages" | "cucumber-html" | "html" | "junit" | "markdown" | "release-manifest" | "scenario-index-json" | "story-report-json" | "traceability-matrix";
|
|
154
154
|
/** Sort order for test cases in reports (deterministic for diff-friendly output) */
|
|
155
155
|
type SortTestCasesMode = "id" | "source" | "none";
|
|
156
156
|
/** Output mode for report routing */
|
|
@@ -360,6 +360,10 @@ interface MarkdownFormatterOptions {
|
|
|
360
360
|
includeSourceLinks?: boolean;
|
|
361
361
|
/** Custom renderers for doc entries */
|
|
362
362
|
customRenderers?: MarkdownRenderers;
|
|
363
|
+
/** Emit a stable per-scenario anchor for deep-linking. Returns the id, or undefined to skip. */
|
|
364
|
+
scenarioAnchor?: (tc: TestCaseResult) => string | undefined;
|
|
365
|
+
/** Render a badge line under a scenario heading (e.g. a what's-changed marker). Undefined to skip. */
|
|
366
|
+
scenarioBadge?: (tc: TestCaseResult) => string | undefined;
|
|
363
367
|
}
|
|
364
368
|
|
|
365
369
|
/** Astro/Starlight formatter options */
|
|
@@ -487,6 +491,8 @@ interface ResolvedFormatterOptions {
|
|
|
487
491
|
ticketUrlTemplate?: string;
|
|
488
492
|
traceUrlTemplate?: string;
|
|
489
493
|
customRenderers?: MarkdownRenderers;
|
|
494
|
+
scenarioAnchor?: (tc: TestCaseResult) => string | undefined;
|
|
495
|
+
scenarioBadge?: (tc: TestCaseResult) => string | undefined;
|
|
490
496
|
};
|
|
491
497
|
};
|
|
492
498
|
assetMode: "none" | "copy";
|
|
@@ -1924,6 +1930,19 @@ interface MarkdownOptions {
|
|
|
1924
1930
|
includeSourceLinks?: boolean;
|
|
1925
1931
|
/** Custom renderers for doc entries */
|
|
1926
1932
|
customRenderers?: MarkdownRenderers;
|
|
1933
|
+
/**
|
|
1934
|
+
* Emit a stable in-page anchor before each scenario heading, so external tools
|
|
1935
|
+
* can deep-link to a scenario by fragment. Given a test case, return the anchor
|
|
1936
|
+
* id (without `#`), or undefined to skip. Off by default — only the living-docs
|
|
1937
|
+
* site opts in, so plain markdown output is unchanged.
|
|
1938
|
+
*/
|
|
1939
|
+
scenarioAnchor?: (tc: TestCaseResult) => string | undefined;
|
|
1940
|
+
/**
|
|
1941
|
+
* Render a short badge line directly under a scenario heading (e.g. a
|
|
1942
|
+
* what's-changed marker like "🆕 New" / "⚠️ Regressed"). Return the markdown
|
|
1943
|
+
* line, or undefined to skip. Off by default — only the living-docs site opts in.
|
|
1944
|
+
*/
|
|
1945
|
+
scenarioBadge?: (tc: TestCaseResult) => string | undefined;
|
|
1927
1946
|
}
|
|
1928
1947
|
/**
|
|
1929
1948
|
* Markdown Formatter.
|
|
@@ -2959,6 +2978,176 @@ interface ListScenariosArgs {
|
|
|
2959
2978
|
type ListScenariosDeps = Record<string, never>;
|
|
2960
2979
|
declare function listScenarios(args: ListScenariosArgs, _deps: ListScenariosDeps): string;
|
|
2961
2980
|
|
|
2981
|
+
/**
|
|
2982
|
+
* `check` — context-efficient backpressure for coding agents.
|
|
2983
|
+
*
|
|
2984
|
+
* The principle (from "Stop Babysitting Your Coding Agent. Give It Backpressure."):
|
|
2985
|
+
* compress success, expand failure. Passing scenarios collapse to a single count
|
|
2986
|
+
* line. Each failing scenario expands to its Given/When/Then narrative, the step
|
|
2987
|
+
* that broke, the error, and the product code it `covers` — so the agent gets an
|
|
2988
|
+
* actionable, intent-carrying signal instead of a wall of green.
|
|
2989
|
+
*
|
|
2990
|
+
* When a baseline run is supplied, the report also folds in what *regressed* and
|
|
2991
|
+
* what got *fixed* since the last run — the "retained" property of effective
|
|
2992
|
+
* feedback. Reuses the same status-transition vocabulary as {@link classifyStatusChange}.
|
|
2993
|
+
*/
|
|
2994
|
+
|
|
2995
|
+
interface CheckArgs {
|
|
2996
|
+
testCases: TestCaseResult[];
|
|
2997
|
+
/** Baseline scenario statuses keyed by scenario id, for regressed/fixed deltas. */
|
|
2998
|
+
baseline?: Map<string, TestStatus$1>;
|
|
2999
|
+
format: "text" | "json";
|
|
3000
|
+
}
|
|
3001
|
+
type CheckDeps = Record<string, never>;
|
|
3002
|
+
/** A single rendered step inside a failing scenario. */
|
|
3003
|
+
interface CheckStep {
|
|
3004
|
+
keyword: StepKeyword$1;
|
|
3005
|
+
text: string;
|
|
3006
|
+
/** True when this step is the one that failed. */
|
|
3007
|
+
failed: boolean;
|
|
3008
|
+
}
|
|
3009
|
+
/** Expanded detail for one failing scenario — the actionable payload. */
|
|
3010
|
+
interface CheckFailure {
|
|
3011
|
+
id: string;
|
|
3012
|
+
scenario: string;
|
|
3013
|
+
/** `sourceFile:sourceLine` */
|
|
3014
|
+
location: string;
|
|
3015
|
+
steps: CheckStep[];
|
|
3016
|
+
/** Failing step's error if isolated, else the scenario-level error. */
|
|
3017
|
+
errorMessage?: string;
|
|
3018
|
+
/** Product-code paths/globs this scenario exercises (what to fix). */
|
|
3019
|
+
covers: string[];
|
|
3020
|
+
tickets: string[];
|
|
3021
|
+
/** True when this scenario was passing in the baseline run. */
|
|
3022
|
+
regressed: boolean;
|
|
3023
|
+
}
|
|
3024
|
+
interface CheckReport {
|
|
3025
|
+
summary: {
|
|
3026
|
+
total: number;
|
|
3027
|
+
passed: number;
|
|
3028
|
+
failed: number;
|
|
3029
|
+
skipped: number;
|
|
3030
|
+
pending: number;
|
|
3031
|
+
};
|
|
3032
|
+
failures: CheckFailure[];
|
|
3033
|
+
/** Count of scenarios that went passed → failed vs. the baseline. */
|
|
3034
|
+
regressed: number;
|
|
3035
|
+
/** Count of scenarios that went failed → passed vs. the baseline. */
|
|
3036
|
+
fixed: number;
|
|
3037
|
+
/** Whether a baseline was supplied (so callers know if deltas are meaningful). */
|
|
3038
|
+
comparedToBaseline: boolean;
|
|
3039
|
+
}
|
|
3040
|
+
/**
|
|
3041
|
+
* Build a structured check report from canonical test cases.
|
|
3042
|
+
* Pure: no IO. Callers render it as text or JSON and decide the exit code.
|
|
3043
|
+
*/
|
|
3044
|
+
declare function buildCheck(args: CheckArgs, _deps?: CheckDeps): CheckReport;
|
|
3045
|
+
/**
|
|
3046
|
+
* Render the check report. Text is the default agent/human surface
|
|
3047
|
+
* (compressed success, expanded failure); JSON is the machine contract.
|
|
3048
|
+
*/
|
|
3049
|
+
declare function renderCheck(report: CheckReport, format: "text" | "json"): string;
|
|
3050
|
+
|
|
3051
|
+
/**
|
|
3052
|
+
* `goal` — a behavioral definition-of-done for autonomous agent loops.
|
|
3053
|
+
*
|
|
3054
|
+
* A `/goal`-style loop keeps working until a verifiable condition holds. This
|
|
3055
|
+
* expresses that condition in behavior, not "tests green and lint clean": the
|
|
3056
|
+
* required scenarios pass, nothing regressed, and nobody weakened a scenario to
|
|
3057
|
+
* fake done (the ratchet). It returns a clear met / not-met verdict and what is
|
|
3058
|
+
* left, so the loop and the human reading after it can both trust "done".
|
|
3059
|
+
*/
|
|
3060
|
+
|
|
3061
|
+
/** Result of one required selector (a tag, ticket, or scenario that must pass). */
|
|
3062
|
+
interface GoalRequirementResult {
|
|
3063
|
+
/** Human-readable selector, e.g. "tag:US-101", "ticket:CART-9", "all scenarios". */
|
|
3064
|
+
selector: string;
|
|
3065
|
+
matched: number;
|
|
3066
|
+
passed: number;
|
|
3067
|
+
/** Titles of matched scenarios that did not pass. */
|
|
3068
|
+
failing: string[];
|
|
3069
|
+
/** matched > 0 and every matched scenario passed. */
|
|
3070
|
+
met: boolean;
|
|
3071
|
+
}
|
|
3072
|
+
/** A scenario that was removed or weakened versus the baseline (anti-fake-done). */
|
|
3073
|
+
interface RatchetViolation {
|
|
3074
|
+
id: string;
|
|
3075
|
+
title: string;
|
|
3076
|
+
kind: "removed" | "disabled" | "weakened";
|
|
3077
|
+
detail: string;
|
|
3078
|
+
}
|
|
3079
|
+
interface GoalReport {
|
|
3080
|
+
/** True only when every requirement is met and no enforced guard fired. */
|
|
3081
|
+
met: boolean;
|
|
3082
|
+
requirements: GoalRequirementResult[];
|
|
3083
|
+
/** Scenarios that went passed -> failed versus baseline (when --no-regressions). */
|
|
3084
|
+
regressions: Array<{
|
|
3085
|
+
id: string;
|
|
3086
|
+
title: string;
|
|
3087
|
+
}>;
|
|
3088
|
+
regressionsEnforced: boolean;
|
|
3089
|
+
ratchet: {
|
|
3090
|
+
enforced: boolean;
|
|
3091
|
+
violations: RatchetViolation[];
|
|
3092
|
+
};
|
|
3093
|
+
}
|
|
3094
|
+
interface GoalArgs {
|
|
3095
|
+
run: TestRunResult;
|
|
3096
|
+
baseline?: TestRunResult;
|
|
3097
|
+
requireTags: string[];
|
|
3098
|
+
requireTickets: string[];
|
|
3099
|
+
requireScenarios: string[];
|
|
3100
|
+
enforceNoRegressions: boolean;
|
|
3101
|
+
enforceRatchet: boolean;
|
|
3102
|
+
format: "text" | "json";
|
|
3103
|
+
}
|
|
3104
|
+
type GoalDeps = Record<string, never>;
|
|
3105
|
+
declare function buildGoal(args: GoalArgs, _deps?: GoalDeps): GoalReport;
|
|
3106
|
+
declare function renderGoal(report: GoalReport, format: "text" | "json"): string;
|
|
3107
|
+
|
|
3108
|
+
/**
|
|
3109
|
+
* `triage` — the discovery-phase worklist for an agent loop.
|
|
3110
|
+
*
|
|
3111
|
+
* The automation that runs on a schedule needs a ranked queue of what to work
|
|
3112
|
+
* on, not a full report. This emits failing scenarios, regressions first, each
|
|
3113
|
+
* carrying the product code it `covers` (where to send the fixer), the error,
|
|
3114
|
+
* and its tickets. Failures with no `covers` are flagged: the loop can't route
|
|
3115
|
+
* them to code, so a human or a covers annotation is needed first.
|
|
3116
|
+
*/
|
|
3117
|
+
|
|
3118
|
+
interface TriageItem {
|
|
3119
|
+
rank: number;
|
|
3120
|
+
id: string;
|
|
3121
|
+
scenario: string;
|
|
3122
|
+
status: TestStatus$1;
|
|
3123
|
+
/** `sourceFile:sourceLine` */
|
|
3124
|
+
location: string;
|
|
3125
|
+
/** Product-code paths to fix. Empty when the scenario declared no `covers`. */
|
|
3126
|
+
covers: string[];
|
|
3127
|
+
tickets: string[];
|
|
3128
|
+
errorMessage?: string;
|
|
3129
|
+
/** Passed in the baseline, failing now. Ranked first. */
|
|
3130
|
+
regressed: boolean;
|
|
3131
|
+
reason: "regression" | "failing";
|
|
3132
|
+
}
|
|
3133
|
+
interface TriageReport {
|
|
3134
|
+
total: number;
|
|
3135
|
+
failing: number;
|
|
3136
|
+
regressions: number;
|
|
3137
|
+
/** Failing scenarios with no `covers` — the loop can't route them to code. */
|
|
3138
|
+
needsCovers: number;
|
|
3139
|
+
items: TriageItem[];
|
|
3140
|
+
}
|
|
3141
|
+
interface TriageArgs {
|
|
3142
|
+
testCases: TestCaseResult[];
|
|
3143
|
+
/** Baseline statuses by scenario id, to flag regressions and rank them first. */
|
|
3144
|
+
baseline?: Map<string, TestStatus$1>;
|
|
3145
|
+
format: "text" | "json";
|
|
3146
|
+
}
|
|
3147
|
+
type TriageDeps = Record<string, never>;
|
|
3148
|
+
declare function buildTriage(args: TriageArgs, _deps?: TriageDeps): TriageReport;
|
|
3149
|
+
declare function renderTriage(report: TriageReport, format: "text" | "json"): string;
|
|
3150
|
+
|
|
2962
3151
|
declare function createPrCommentSummary(diff: RunDiffResult, maxScenarios?: number): string;
|
|
2963
3152
|
|
|
2964
3153
|
declare function diffRuns(baseline: TestRunResult, current: TestRunResult): RunDiffResult;
|
|
@@ -3165,6 +3354,65 @@ declare class ReleaseManifestFormatter {
|
|
|
3165
3354
|
}
|
|
3166
3355
|
declare function toReleaseManifest(run: TestRunResult): ReleaseManifest;
|
|
3167
3356
|
|
|
3357
|
+
/**
|
|
3358
|
+
* Requirement-first view of a run. Groups scenarios under the ticket/user-story
|
|
3359
|
+
* they verify, rolls up the code each requirement covers and whether it passed,
|
|
3360
|
+
* and surfaces two gaps a scenario-keyed index hides: requirements with a failing
|
|
3361
|
+
* scenario, and scenarios linked to no requirement at all (untraced behavior).
|
|
3362
|
+
*
|
|
3363
|
+
* The set of requirements is derived from the tickets found on scenarios — the
|
|
3364
|
+
* tests are the source of truth, so a requirement only appears once a scenario
|
|
3365
|
+
* claims it.
|
|
3366
|
+
*/
|
|
3367
|
+
interface TraceabilityRequirement {
|
|
3368
|
+
/** Ticket / user-story id (e.g. "US-101", "JIRA-42"). */
|
|
3369
|
+
ticket: string;
|
|
3370
|
+
/** Direct URL when a scenario supplied one. */
|
|
3371
|
+
url?: string;
|
|
3372
|
+
/** "verified" = every scenario passed; "failing" = at least one failed; "incomplete" = only skipped/pending. */
|
|
3373
|
+
status: "verified" | "failing" | "incomplete";
|
|
3374
|
+
scenarios: Array<{
|
|
3375
|
+
id: string;
|
|
3376
|
+
title: string;
|
|
3377
|
+
status: TestStatus$1;
|
|
3378
|
+
sourceFile: string;
|
|
3379
|
+
sourceLine: number;
|
|
3380
|
+
covers: string[];
|
|
3381
|
+
}>;
|
|
3382
|
+
/** Union of every covered path across this requirement's scenarios. */
|
|
3383
|
+
covers: string[];
|
|
3384
|
+
}
|
|
3385
|
+
interface TraceabilityMatrix {
|
|
3386
|
+
schemaVersion: "1.0";
|
|
3387
|
+
generatedAt: string;
|
|
3388
|
+
run: {
|
|
3389
|
+
startedAt: string;
|
|
3390
|
+
finishedAt: string;
|
|
3391
|
+
gitSha?: string;
|
|
3392
|
+
branch?: string;
|
|
3393
|
+
};
|
|
3394
|
+
summary: {
|
|
3395
|
+
requirements: number;
|
|
3396
|
+
requirementsVerified: number;
|
|
3397
|
+
requirementsFailing: number;
|
|
3398
|
+
scenarios: number;
|
|
3399
|
+
untracedScenarios: number;
|
|
3400
|
+
};
|
|
3401
|
+
requirements: TraceabilityRequirement[];
|
|
3402
|
+
/** Scenarios with no ticket — behavior verified but not linked to a requirement. */
|
|
3403
|
+
untraced: Array<{
|
|
3404
|
+
id: string;
|
|
3405
|
+
title: string;
|
|
3406
|
+
status: TestStatus$1;
|
|
3407
|
+
sourceFile: string;
|
|
3408
|
+
sourceLine: number;
|
|
3409
|
+
}>;
|
|
3410
|
+
}
|
|
3411
|
+
declare class TraceabilityMatrixFormatter {
|
|
3412
|
+
format(run: TestRunResult): string;
|
|
3413
|
+
}
|
|
3414
|
+
declare function toTraceabilityMatrix(run: TestRunResult): TraceabilityMatrix;
|
|
3415
|
+
|
|
3168
3416
|
/**
|
|
3169
3417
|
* @executable-stories/formatters
|
|
3170
3418
|
*
|
|
@@ -3274,4 +3522,4 @@ declare function normalizeVitestResults(testModules: Parameters<typeof adaptVite
|
|
|
3274
3522
|
*/
|
|
3275
3523
|
declare function normalizePlaywrightResults(testResults: Parameters<typeof adaptPlaywrightRun>[0], adapterOptions?: Parameters<typeof adaptPlaywrightRun>[1], canonicalizeOptions?: CanonicalizeOptions): TestRunResult;
|
|
3276
3524
|
|
|
3277
|
-
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, 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 HistoryEntry, type HistoryStore, type HtmlDocOptions, 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 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, 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, buildHtmlDocEntry, 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, getDeploymentStatus, getEnvironmentDrift, gradeEvidence, hasSufficientHistory, isReviewableSource, isTestFile, joinNameAndExt, listScenarios, loadHistory, mergeStepResults, msToNanoseconds, nanosecondsToMs, normalizeJestResults, normalizePlaywrightResults, normalizeStatus, normalizeVitestResults, parseEnvelopes, parseNdjson, publishConfluencePage, publishJiraIssue, readBranchName, readGitSha, readPackageVersion, recordDeployment, regenerateArtifacts, resolveAttachment, resolveAttachments, resolveTheme, resolveTraceUrl, rewriteAssetPaths, saveHistory, scenariosCoveringPaths, sendNotifications, sendSlackNotification, sendTeamsNotification, sendWebhookNotification, signBody, slugify, startWatch, stripAnsi, toBehaviorManifest, toReleaseManifest, toScenarioIndex, toStoryReport, tryGetActiveOtelContext, updateHistory, validateCanonicalRun };
|
|
3525
|
+
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, 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, 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, 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, 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 as TypedCIInfo, type ValidationResult, type WatchDeps, type WatchHandle, type WatchOptions, type WebhookPayload, type WebhookSignerHmac, type WriteFile, adaptJestRun, adaptPlaywrightRun, adaptVitestRun, 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, getAvailableThemes, getCssOnlyThemes, getDeploymentStatus, getEnvironmentDrift, gradeEvidence, hasSufficientHistory, isReviewableSource, isTestFile, joinNameAndExt, listScenarios, loadHistory, mergeStepResults, msToNanoseconds, nanosecondsToMs, normalizeJestResults, normalizePlaywrightResults, normalizeStatus, normalizeVitestResults, parseEnvelopes, parseNdjson, publishConfluencePage, publishJiraIssue, readBranchName, readGitSha, readPackageVersion, recordDeployment, regenerateArtifacts, renderCheck, renderGoal, renderTriage, resolveAttachment, resolveAttachments, resolveTheme, resolveTraceUrl, rewriteAssetPaths, saveHistory, scenariosCoveringPaths, sendNotifications, sendSlackNotification, sendTeamsNotification, sendWebhookNotification, signBody, slugify, startWatch, stripAnsi, toBehaviorManifest, toReleaseManifest, toScenarioIndex, toStoryReport, toTraceabilityMatrix, tryGetActiveOtelContext, updateHistory, validateCanonicalRun };
|