(ctx: CliFailureContext)
| 288 | * or when the existing window already matches. |
| 289 | */ |
| 290 | export function applyFailedOnly(ctx: CliFailureContext): CliFailureContext { |
| 291 | const failedIdx = ctx.result.failedStepIndex; |
| 292 | if (failedIdx === null) return ctx; |
| 293 | const inWindow = (idx: number) => Math.abs(idx - failedIdx) <= FAILED_ONLY_RADIUS; |
| 294 | const filteredSteps = ctx.steps.filter(s => inWindow(s.stepIndex)); |
| 295 | const filteredEvidence = ctx.failure.evidence.filter(e => inWindow(e.stepIndex)); |
| 296 | return { |
| 297 | ...ctx, |
| 298 | steps: filteredSteps, |
| 299 | failure: { ...ctx.failure, evidence: filteredEvidence }, |
| 300 | }; |
| 301 | } |
| 302 | |
| 303 | /** |
| 304 | * Resolve the user-supplied `--out` path into an absolute directory. |
no test coverage detected