Skip to content

Commit 9ea739e

Browse files
tjshiucrisbeto
authored andcommitted
feat: Track and display build failures during a11y repair
1 parent 927a718 commit 9ea739e

File tree

4 files changed

+16
-3
lines changed

4 files changed

+16
-3
lines changed

report-app/src/app/pages/report-viewer/report-viewer.html

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -270,6 +270,12 @@ <h2>Generated applications</h2>
270270
@if (initialAttempt?.buildResult?.status === 'error') {
271271
<span class="status-badge error">Initial build failed</span>
272272
}
273+
274+
@if (hasBuildFailureDuringA11yRepair(result)) {
275+
<span class="status-badge error"
276+
>Build failed after a11y repair</span
277+
>
278+
}
273279
</div>
274280
</div>
275281
</expansion-panel-header>

report-app/src/app/pages/report-viewer/report-viewer.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -426,4 +426,8 @@ export class ReportViewer {
426426

427427
return `wcs run --prompt=${result.promptDef.name} --env=<path to ${report.details.summary.environmentId} config>`;
428428
}
429+
430+
protected hasBuildFailureDuringA11yRepair(result: AssessmentResult): boolean {
431+
return result.attemptDetails.some(attempt => attempt.buildFailedDuringA11yRepair);
432+
}
429433
}

runner/orchestration/build-serve-loop.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -170,15 +170,15 @@ export async function attemptBuild(
170170
progress,
171171
);
172172

173+
let hasBuildFailure = attempt.buildResult.status !== BuildResultStatus.SUCCESS;
174+
attempt.buildFailedDuringA11yRepair = hasBuildFailure;
173175
attemptDetails.push(attempt);
174176
lastAttempt = attempt;
175177

176178
// If we somehow introduced build errors via the Axe repair loop, we abort
177179
// further a11y repairs and capture the failed build. This is useful insight
178180
// as LLMs seem to regress when asked to repair a11y violations.
179-
if (attempt.buildResult.status !== BuildResultStatus.SUCCESS) {
180-
break;
181-
}
181+
if (hasBuildFailure) break;
182182

183183
// Re-run serving & tests after Axe repair.
184184
// This allows us to check if we fixed the violations.

runner/shared-interfaces.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,9 @@ export interface AttemptDetails {
220220
/** LLM reasoning messages for generating these files. */
221221
// Note: May not be set in older reports.
222222
reasoning?: string;
223+
224+
/** Whether the build failed during an accessibility repair attempt. */
225+
buildFailedDuringA11yRepair?: boolean;
223226
}
224227

225228
/** Statistics related to the build process of the generated applications. */

0 commit comments

Comments
 (0)