diff --git a/report-app/src/app/pages/report-viewer/report-viewer.html b/report-app/src/app/pages/report-viewer/report-viewer.html index 5b8d605..a5a219b 100644 --- a/report-app/src/app/pages/report-viewer/report-viewer.html +++ b/report-app/src/app/pages/report-viewer/report-viewer.html @@ -273,6 +273,12 @@

Generated applications

@if (initialAttempt?.buildResult?.status === 'error') { Initial build failed } + + @if (hasBuildFailureDuringA11yRepair(result)) { + Build failed after a11y repair + } diff --git a/report-app/src/app/pages/report-viewer/report-viewer.ts b/report-app/src/app/pages/report-viewer/report-viewer.ts index 42dd379..d434c22 100644 --- a/report-app/src/app/pages/report-viewer/report-viewer.ts +++ b/report-app/src/app/pages/report-viewer/report-viewer.ts @@ -419,4 +419,8 @@ export class ReportViewer { return `wcs run --prompt=${result.promptDef.name} --env=`; } + + protected hasBuildFailureDuringA11yRepair(result: AssessmentResult): boolean { + return result.attemptDetails.some(attempt => attempt.buildFailedDuringA11yRepair); + } } diff --git a/runner/orchestration/build-serve-loop.ts b/runner/orchestration/build-serve-loop.ts index 4e8e897..9bbd849 100644 --- a/runner/orchestration/build-serve-loop.ts +++ b/runner/orchestration/build-serve-loop.ts @@ -170,15 +170,15 @@ export async function attemptBuild( progress, ); + let hasBuildFailure = attempt.buildResult.status !== BuildResultStatus.SUCCESS; + attempt.buildFailedDuringA11yRepair = hasBuildFailure; attemptDetails.push(attempt); lastAttempt = attempt; // If we somehow introduced build errors via the Axe repair loop, we abort // further a11y repairs and capture the failed build. This is useful insight // as LLMs seem to regress when asked to repair a11y violations. - if (attempt.buildResult.status !== BuildResultStatus.SUCCESS) { - break; - } + if (hasBuildFailure) break; // Re-run serving & tests after Axe repair. // This allows us to check if we fixed the violations. diff --git a/runner/shared-interfaces.ts b/runner/shared-interfaces.ts index 597d807..c8ac2ea 100644 --- a/runner/shared-interfaces.ts +++ b/runner/shared-interfaces.ts @@ -220,6 +220,9 @@ export interface AttemptDetails { /** LLM reasoning messages for generating these files. */ // Note: May not be set in older reports. reasoning?: string; + + /** Whether the build failed during an accessibility repair attempt. */ + buildFailedDuringA11yRepair?: boolean; } /** Statistics related to the build process of the generated applications. */