Skip to content

feat(accessibility): give a report's score, and send report questions to BrowserStack AI - #568

Merged
gaurav-singh-9227 merged 2 commits into
fix/a11y-land-541-553from
feat/a11y-report-score
Nov 11, 2026
Merged

gaurav-singh-9227 merged 2 commits into
fix/a11y-land-541-553from
feat/a11y-report-score

Conversation

@Aaryan430

@Aaryan430 Aaryan430 commented Nov 10, 2026 •

Copy link
Copy Markdown
Collaborator

Stacked on #566: merge that first, then this PR's base moves to main.

Why

  • The score was dropped. Asked for a scan's accessibility score, or for a plan to raise it, the agent said the report has no score. The scan run summary does return one (scoreData). The MCP already reads that summary, but kept only the run settings and the changes since the last run.
  • Plans came from the agent, not BrowserStack AI. With nothing pointing it to askBrowserStackAI, the agent made up its own plan from one page of issues. BrowserStack AI answers from the whole report and the product's own knowledge, so report questions should go there.

What changed

The score is given with the issues

  • On the first page of fetchAccessibilityIssues and on a finished startAccessibilityScan (a new scan or a re-run), a line gives:
    • the whole report's score, as the dashboard shows it;
    • the share of points each severity lost, and the passed/failed checks per severity;
    • how the score is worked out, from the backend's scoring code:
      • a check is one rule on one page, and best practices are not scored;
      • a check fails when any element on the page fails the rule;
      • points per check by severity: critical 10, serious 7, moderate 3, minor 1;
      • a failed check counts double, and the score is the passed share of all points.
  • Read from the report's own summary (GET …/scan_runs/{id}, …/builds/{id}, …/reports/{id}) for Website Scanner runs, Automated Tests builds and Workflow Analyzer reports.
  • A scanner run read by its build id has no scan ids, so it is found in the scan list first. That list knows only a scan's latest run, so an earlier run read by its link has no score.
  • No line when the report has no score: the plan has none, the report is not finished, the summary cannot be read, or it is an app build or report.
  • Later pages don't read the score again.

Report questions go to BrowserStack AI

  • The same first-page results end with a line telling the agent to call askBrowserStackAI with product: a11y, the user's question and the report, for anything beyond listing its issues (a plan, what to fix first, why it scored as it did), and not to work out the plan itself.
  • If BrowserStack AI says it is not enabled for the account, the agent tells the user and answers from the issues and score.
  • The line is in the tool's result, not a description, so no description budget changes.

Verified

  • tsc, eslint and prettier (src) pass; vitest passes (151 files, 2269 tests), on top of fix(accessibility): land #541 and #553 on main #566.
    • New tests: the score for each report type, a scanner run found by its build id, no score (missing, unreadable, app reports), the score and BrowserStack AI lines on the first page only, and on startAccessibilityScan.
  • Live, in isolated claude -p sessions against a real scan scoring 52, two runs of each question:
Question Before After
"What's the accessibility score of my scan?" "I couldn't get an accessibility score" "52 out of 100", with the per-severity breakdown
"How can I improve the accessibility score for my scan? Make me a plan." The agent's own plan; "the report doesn't give a score number" Calls askBrowserStackAI with the question and the report
  • Not verified end to end: BrowserStack AI's answer through the MCP. Every askBrowserStackAI call currently fails with a CDN 503 first byte timeout after about 60 s, on this branch and on the released 2.6.1 alike, while the dashboard's Ask AI answers the same question for the same account. That is being raised separately. Until it is fixed, the agent tells the user BrowserStack AI failed and falls back to its own plan from the issues and score.

🤖 Generated with Claude Code

@coderabbitai

coderabbitai Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Central YAML (base), Organization UI (inherited), Workspace UI (inherited); Enforced overrides: Organization
  • Review profile: ASSERTIVE
  • Plan: Enterprise
  • Run ID: 3b8dc23b-a1aa-4998-8377-d1d65ee006a6

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

… to BrowserStack AI

- fetchAccessibilityIssues (first page) and startAccessibilityScan now give the
  report's accessibility score as the dashboard shows it: the share of points
  each severity lost, the passed/failed checks per severity, and how the score
  is worked out (a check is one rule on one page; critical 10, serious 7,
  moderate 3, minor 1; a failed check counts double).
- Read from the report's own summary for Website Scanner runs, Automated Tests
  builds and Workflow Analyzer reports. A scanner run read by its build id is
  found in the scan list first. App builds and reports have no score here.
- The same results tell the agent to call askBrowserStackAI (product a11y) for
  anything about the report beyond listing its issues, such as a plan or what
  to fix first, instead of working out a plan itself.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Aaryan430
Aaryan430 force-pushed the feat/a11y-report-score branch from ad12d0d to 05352e0 Compare November 10, 2026 08:26
@Aaryan430
Aaryan430 changed the base branch from main to fix/a11y-land-541-553 November 10, 2026 08:26
…es only

For a Website Scanner link, the score finds the scan's ids by walking the
scan list, up to 25 pages at ~1.2 s a page. The list has only each scan's
latest run, so a link to an earlier run is never found: the walk ran in full
on every first page, after the export's wait of up to 45 s, and could push
the issue list past the client's 60 s timeout.

The score now searches the newest 2 pages, which still find a scan that was
just run. Reading issues and comparing runs keep the full 25-page walk.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@gaurav-singh-9227
gaurav-singh-9227 merged commit 2b30f1e into fix/a11y-land-541-553 Nov 11, 2026
2 checks passed
Aaryan430 added a commit that referenced this pull request Nov 11, 2026
Resolves the conflicts with #566 and #568:
- accessibilityExpert answers start with the deprecation note, then main's
  "question was shortened" note when the question was cut, then the answer.
- docs/TOOLS.md keeps main's re-run wording for startAccessibilityScan and
  marks accessibilityExpert deprecated.
- accessibilityExpertQuery tests now expect the deprecation note first.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants