Skip to content

Commit 0377300

Browse files
committed
feat: Track and display build failures during a11y repair
1 parent e0aa394 commit 0377300

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
@@ -273,6 +273,12 @@ <h2>Generated applications</h2>
273273
@if (initialAttempt?.buildResult?.status === 'error') {
274274
<span class="status-badge error">Initial build failed</span>
275275
}
276+
277+
@if (hasBuildFailureDuringA11yRepair(result)) {
278+
<span class="status-badge error"
279+
>Build failed after a11y repair</span
280+
>
281+
}
276282
</div>
277283
</div>
278284
</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
@@ -419,4 +419,8 @@ export class ReportViewer {
419419

420420
return `wcs run --prompt=${result.promptDef.name} --env=<path to ${report.details.summary.environmentId} config>`;
421421
}
422+
423+
protected hasBuildFailureDuringA11yRepair(result: AssessmentResult): boolean {
424+
return result.attemptDetails.some(attempt => attempt.buildFailedDuringA11yRepair);
425+
}
422426
}

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)