Skip to content

feat(accessibility): reach the Accessibility dashboard's own views with a minted token - #570

Merged
Dave3130 merged 52 commits into
mainfrom
feat/a11y-dashboard-oauth-capabilities
Nov 25, 2026
Merged

Dave3130 merged 52 commits into
mainfrom
feat/a11y-dashboard-oauth-capabilities

Conversation

@rohitsahu-bstack

@rohitsahu-bstack rohitsahu-bstack commented Nov 10, 2026 •

Copy link
Copy Markdown
Collaborator

Jira: ATA-1590

Why

Agents can list web Accessibility reports (#524) but can't read what the Accessibility dashboard shows: custom dashboards and their scores, a build's issues by rule or WCAG guideline, affected components, report comparisons, bulk review. Those routes sit behind the dashboard's session door (authenticate_user!), which never reads Basic auth, so a username and access key alone get 401.

That door does admit a central-auth Bearer JWT carrying the ai_agent scope, for the exact routes the backend allowlists (SCOPED_BEARER_SCOPE_POLICIES in browserstack/accessibility, added for Atlas). The registry already mints that token for oauth2 products (TRA uses it): the user's own username and access key are exchanged at auth.browserstack.com for a JWT with ai_agent oauth_user_profile. So exposing the dashboard is mostly a new index plus one registration line.

What

capability/web_accessibility.capability-index.json: 40 new capabilities (33 reads, 7 writes) in the existing Web Accessibility product, each declaring "host": "dashboard" and "auth": {"type": "oauth2"}. The product's 6 public-API lists keep Basic. All are reached through searchCapability / invokeCapability.

Registry: per-capability auth (types.ts, one line in resolve.ts invoke()): a capability may sign in differently from its product, the same reasoning as the existing per-capability host. Unset means the product's own auth, so every other index is unaffected. A first version shipped these as a separate web_accessibility_dashboard product; real agent sessions showed why that was wrong (below).

Area Capabilities
Custom dashboards list, get, its scans, issue / category / score summaries
Build report pages (Automated Tests builds, Website Scanner runs) list + search builds, metadata, overview, test cases, test-case overview, page logs, issues by rule / by guideline, rule / guideline components, one issue, list-updates check
Report comparison meta, summary, rules, guidelines, issues
Website Scanner scan overview, scan trends, re-run a scan (write)
Issues (writes) hide / un-hide, bulk hide components, settle a needs-review issue
Bulk review categories, component, component pages, page review (reads); submit / undo (writes)
Other WCAG guidelines, Workflow Analyzer consolidated report, unified reports list, current user profile, link issues to a ticket (write)

Left out on purpose:

  • GET /api/website-scanner/v1/auth_configs: returns saved login data (authData) raw. getAccessibilityAuthConfig deliberately strips it, and the registry can't redact a response field.
  • POST /api/tcg-proxy/search, GET /api/website-scanner/v1/scans, POST /api/website-scanner/v1/scans: already served by accessibilityExpert, list_website_scanner_scans and startAccessibilityScan.

capability-registry/config.ts: Web Accessibility's dashboard host follows the account's region (accessibilityDashboard), so EU and IN accounts reach their own dashboard. The region tests fail without it (checked by reverting it).

Two fixes to the existing fetchAccessibilityIssues (report-parser.ts), found by the agent sessions:

  • the Workflow Analyzer export writes needs-review flags as True/False, but the parser accepted only "Yes", so every needs-review flag was dropped (a report with 21 pending review answered "none");
  • issues a reviewer marked "Not an issue" (Issue status non-issue) were still counted (110 issues, 20 critical, where the dashboard shows 105 and 19).

A regression test reproduces both and fails on the old parser. (Build comparison via compareWith is handled by main's own build compare, so this PR no longer touches it.)

Dashboard drill-downs, mark preferred and Assisted Tests (36 more; each needs its route on the backend's agent allowlist):

  • custom dashboards: conformance summary, score and issue trends, pages, issues by rule and guideline, rule components, one issue, duplicates, scan tags, WCAG versions;
  • builds: page trends, issue filters, test-case list filters, test-case search, test-case details, test-case issue filters;
  • comparisons: filters, scan logs, rule and guideline components;
  • Workflow Analyzer suppressed issues (hidden / "Not an issue"): rules, guidelines, components, one issue, duplicates;
  • mark_preferred_behavior (write, approval first): picks the preferred variant on the three consistency rules; reversible.
  • Assisted Tests: get_assisted_test_report reads one report in full (tests, issues by rule, elements). Before this, an agent could list Assisted Test reports but not read one.
  • Screen Reader automation: list runs, read one run (each element in focus order with what the screen reader announced and its violations), and its per-page scan log.
  • Screen Reader Agent: list runs, read one (narrowable, since a full run is about 50k characters), start a run (approval first; the dashboard's New Test guidance), hide and unhide a violation (approval first).
  • startAccessibilityScan takes screenReader (NVDA or VO) to also run a screen reader on a Website Scanner scan.
  • Follow-up, not in this PR: PDF Scanner reads (one document, its failing rules), once the backend allows them for the agent token.

Tested on preprod: each read through an isolated agent session and a direct call (all return 200 where the test account has data; suppressed issues answer 403 until that view is enabled for a group), and the write made, then undone.

Review fixes (from a review of this PR):

  • a capability that signs in with oauth2 under a Basic-auth product now uses that scheme for its 401 retry too;
  • data.meta.nextPage marks a page as incomplete;
  • any "Confirmed …" review status counts as confirmed;
  • issue_status uses the backend's non-issue value; confirmed is required on the review call (null resets to pending);
  • "accessibility score" routes to App or Web by the user's words;
  • a product URL override without a matching named-host override is refused instead of reaching the production host;
  • describeCapability no longer shows per-capability auth, and discovery never probes with a capability on another host or auth scheme;
  • web-only notes stay off App answers.

Routing: merged aliases are web-specific ("web accessibility issue", not "accessibility issue"), so App Accessibility and TRA questions still settle on their own products, and every existing routing test passes.

docs/TOOLS.md lists the capabilities.

How a call is authenticated

  1. invokeCapability → the host for the account's region (accessibility{,-eu,-in}.browserstack.com).
  2. The oauth2 scheme mints a JWT from the user's username + access key (scope ai_agent oauth_user_profile). It is cached per user until 60 s before expiry, and not cached in remote mode.
  3. The call is sent with Authorization: Bearer … and request-source: ai-chatbot.
  4. The backend verifies the signature (JWKS), the scope, and that VERB:controller#action is on the ai_agent allowlist. A route not on the list gets 403 ACTION_NOT_ALLOWED_FOR_SCOPE. After that, the user's own RBAC, plan, flags and ownership rules apply, exactly as in the browser.
  5. Writes are mode: write, so invokeCapability refuses them until the user confirms (user_permission='granted').

Where the API differs from what you'd expect

Every capability was written from the controllers on accessibility main. The traps are in each capability's guidance and parameter text, for example:

  • Report routes under /projects/{p}/test_runs/{t}/… pick the build by th_build_id alone; the two path segments are not checked.
  • central_scanner=false returns 404 on an Automated Tests build; for those it must be left out. On /api/v3/test_runs/{rules,guidelines} the body keys must be snake_case.
  • Custom-dashboard summaries return 500 on a dashboard with no scans; guidance says to check hasTests first.
  • A build with no test cases returns 500 from test_cases.
  • Bulk-review reads also check build ownership (Build does not belong to the user) unless team report management is on.
  • /api/projects ignores query and pages internally. /api/compare/* takes product + two comma-joined build uuids, and the older run is always the base.
  • link_ticket_to_issue answers 201. A ticket link can't be undone through this scope, because the delete route isn't allowlisted.

Verified

  • npm run build: lint, prettier, 2134 tests, tsc. scripts/check-contract.py: 0 unbacked fields, every capability declares its 2xx.
  • Live test suite: 476 cases, 476 pass, on a non-production dashboard with a test account (account owner approved the writes). Every case went through the built server's invokeCapability (stdio MCP client → dist/index.js). On every 2xx the runner checked that each returns field is in the live body and that live types match the declared schema.
Group Capabilities Cases First full run Final
Dashboards, projects, reports, profile 10 73 59 73
Build report pages (Automated Tests + Website Scanner) 16 157 119 157
Report comparison + Website Scanner (incl. one real re-run) 8 78 30 of 48 78
Writes: hide, bulk hide, needs-review, bulk review, ticket link 10 168 168 168

Every capability has at least one happy path, its parameters and filters, its negative cases, and a check of each claim in its guidance. Every write was refused without approval, then run, read back, undone, and read back again.

  • The second commit holds the 45 index corrections these tests forced. The ones that matter most:

    • The Workflow Analyzer filter was declared as an object, which fetchTransport sends as [object Object] (422). It is now flat filter[impact|status|rule|url|component|tag], and live counts match a direct call. A test now refuses object-typed query params.
    • review_needs_review_issue's documented undo corrupted the issue (confirmed=false, visible, gone from the report). The undo now goes through undo_bulk_review_decisions.
    • hide_issues' scope narrows nothing; the ids decide.
    • Guidance described backend leniency the registry never lets through: out-of-range values, unknown enums, camelCase keys, filled single-value params.
    • Website Scanner comparisons only count pages that loaded.
    • Nullable fields and returns were corrected against live shapes.
  • Real agent sessions: all 15 prompts at ≥4/5. 15 plain-English prompts, 5 for each of Website Scanner, Workflow Analyzer and Automated Tests, including traps (an empty dashboard, an unknown report, a comparison where no page loaded) and writes (hide then undo, re-run a scan). Each ran 5 times as a headless Claude Code session (Claude Sonnet 5.5) with only this server attached, on a test account; the model picked every tool and argument. A hit means the answer carries the live ground-truth facts and any write was really made with approval, then undone and checked.

Round 1 (first version) Final
Automated Tests 3 of 5 prompts at ≥4/5 5 of 5
Workflow Analyzer 3 of 5 5 of 5
Website Scanner 3 of 5 5 of 5

An agent may ask the user one clarifying question, as in a real session, because the router asks when words like "build" or "report" fit several products. Strict rates (no question) are in the report. Round 1's failures are what produced the merge and the two reader fixes above.

Not verified

  • Website Scanner writes (hide / needs-review / bulk review on a scan run): no scan finished with issues on the test environment during testing. New scans stayed processing for 40+ minutes. The cases are written and ready.
  • Website Scanner comparison with real issue content: no scan there had two runs whose pages loaded.
  • link_ticket_to_issue success path: deliberately not run, because it writes into a real tracker. Only the refusal and error paths were run.
  • The EU and IN hosts (unit-tested) and grouped builds.

Backend findings for the Accessibility team (not changed here)

Reported separately. In short: some dashboard reads answer 500 where an empty answer is expected; comparison metadata swaps two settings. None of these block this PR; the guidance tells agents how to read each one.

Load

Writes on these routes have limited capacity on the backend. Global limits need a backend rate limit, because only the backend sees every caller. A per-session limit here would only stop one runaway agent. Discussed with the Accessibility team; tracked outside this PR.

Before merging

  • The ai_agent allowlist is shared with Atlas: confirmed. The accessibility part of this scope is owned by the Accessibility AI team, not central Atlas, so sharing its allowlist with MCP is that team's call and no separate sign-off is needed. The allowlist lives in the accessibility backend and only admits accessibility dashboard routes, so nothing outside accessibility is exposed. This PR adds no backend route; any route added to the list later is reviewed by the same team. A separate scope stays possible through auth.scopes if that ever changes.
  • Dashboard routes are not a versioned API. A frontend-driven change can alter a shape; the capability tests check this file, not the live shapes.

🤖 Generated with Claude Code

…th a minted token

Agents could list web Accessibility reports but not read what the dashboard shows:
custom dashboards, a build's issues by rule or guideline, report comparisons, bulk
review. Those routes sit behind the dashboard's session door, which never reads Basic
auth, so the access key alone answers 401. The door does admit a central-auth Bearer
carrying the ai_agent scope, for the routes its allowlist names
(SCOPED_BEARER_SCOPE_POLICIES in browserstack/accessibility), and the registry
already mints exactly that token for oauth2 products.

- capability/web_accessibility_dashboard.capability-index.json: a new product with
  "auth": {"type": "oauth2"} and 44 capabilities, one per allowlisted route except
  those served elsewhere (tcg-proxy search = accessibilityExpert, the scan list,
  scan create = startAccessibilityScan) and the scan login-config list, which
  returns raw authData the registry cannot redact. 37 reads, 7 writes (approval).
  Authored from the controllers on accessibility main and checked live on preprod;
  every capability declares its 2xx schema, built from live responses.
- capability-registry/config.ts: register the product on the regional
  accessibilityDashboard host, so EU and IN accounts reach their own dashboard.
- tests: auth, region, writes-are-writes, exclusions, no dangling capability names,
  and routing that leaves web_accessibility's questions with web_accessibility.
- docs/TOOLS.md: list the capabilities.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@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 (fallback from Default branch)
  • 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: b399b48b-7a8b-4c66-8ebe-e8777934ab60

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

rohitsahu-bstack and others added 9 commits November 10, 2026 17:09
…ve preprod cases

Every capability was driven through the built server's invokeCapability on preprod,
with returns and declared 2xx types checked on each answer and every write undone and
read back. 41 index corrections came out of it; the suites pass 474/474 after them.

- get_workflow_analyzer_consolidated_report: the `filter` object could never reach
  the backend (fetchTransport sends String(value), "[object Object]" -> 422). Declared
  as flat filter[impact|status|rule|url|component|tag] strings instead, which bind.ts
  matches by exact name; live counts now match a direct call.
- review_needs_review_issue: the documented undo (hidden false, confirmed omitted)
  leaves an issue confirmed=false and visible, dropping it from the report. Guidance
  now sends the undo to undo_bulk_review_decisions and warns that repeating a decision
  decrements needsReviewCount again.
- hide_issues: scope does not narrow anything; the ids sent decide what changes.
- Guidance that described backend leniency the registry never lets through (out-of-
  range page_size, unknown enums, camelCase keys, filled single-value params) is
  rewritten to what an agent actually sees.
- Website Scanner comparisons count only pages that loaded; say so and point at
  scanStability.
- Schemas: nullable fields declared nullable, returns trimmed to fields every answer
  carries, list_build_test_cases gains central_scanner, issue_status values fixed.
- tests: no object-typed query parameter; no undo advice the backend cannot perform.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…er bugs agent sessions found

75 headless agent sessions on preprod (15 prompts across Website Scanner, Workflow
Analyzer and Automated Tests, 5 runs each, the model choosing every tool) failed 6 of
15 prompts on the first round. The causes, and the fixes:

- Two products for one. The dashboard capabilities were a second product only because
  they sign in differently, so the router asked users to pick between
  "web_accessibility" and "web_accessibility_dashboard", and a search in one could not
  find the other's capabilities (an agent told a user there was no way to re-run a
  scan). They now live in web_accessibility, each with `host: dashboard` and a new
  per-capability `auth` (oauth2) that overrides the product's Basic. The registry
  change is one line in invoke(); every existing index is unaffected.
- fetchAccessibilityIssues read every needs-review flag as "no": the Workflow Analyzer
  export writes True/False where the parser accepted only "Yes", so a report with 21
  issues pending review was answered "none need review". It also counted issues a
  reviewer marked "Not an issue" (Issue status non-issue), 110 issues and 20 critical
  where the dashboard shows 105 and 19. Both fixed, with a regression test that fails
  on the old parser.
- A scan run's null issue count read as zero ("no run found issues" for a scan with a
  306-issue run): guidance now says null is unrecorded and points at the trends.
- compareWith on an Automated Tests build now points at get_report_comparison_summary;
  without it an agent diffed two builds itself and reported 16 resolved, not 9.
- Merged entity aliases made web-specific and routing terms tuned, so App Accessibility
  and TRA questions still settle where they did.

Round 2, same 75 sessions: every prompt at 4/5 or better (14 at 5/5).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… Workflow Analyzer nodes

Replayed 10 intents from the Ask AI harness's own evals (axe-3826 workflow intents and the
W2 hide/review set) through this server, 5 agent sessions each, graded by an independent
judge against the eval's expected behaviour. 8 of 10 passed first time; the two that did
not were guidance gaps:

- "We do not need SC 1.4.3 - hide everything under it": the agent asked for approval
  before reading the report, so the preview never said how many findings would change.
  hide_issues, bulk_hide_issue_components and review_needs_review_issue now say to read
  the exact findings first and put the count, rule and report in the preview. 1/5 -> 5/5.
- "Mark the fieldset legend finding as not an issue": nodeFields was described as "extra"
  node fields, but the backend replaces the defaults with it, so asking for
  html,failureSummary dropped issueId and the finding could not be addressed. The
  description now says it replaces the defaults and to keep issueId. 1/5 -> 5/5.

All 10 intents now pass at 4/5 or better; no session wrote without approval.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The backend undoes a single-issue review with `confirmed: null, hidden: false`,
but bind refused null for every boolean, and the guidance sent the agent to
undo_bulk_review_decisions instead. That only reverses decisions stored by bulk
review, so an issue with no review category could be confirmed and never undone.

Add a `nullable` flag for request parameters: null passes only where the
contract sets it, and stays refused everywhere else. Mark `confirmed` nullable
and document the undo on both capabilities.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
An agent asked the user for a hide reason before reading the contract,
invented options ("Not an issue"), and had to ask again once it found the API
takes only six. The allowed values lived only in describeCapability.

Name the six reasons in the first guidance line of hide_issues and
bulk_hide_issue_components, which rides on every search row, and tell
describeCapability's callers to read it before asking the user to choose a
value (still within the 201-character description budget). A test keeps the
guidance in step with the enum.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Asked to open a Workflow Analyzer report, an agent had no link: the reports
list returns none, and nothing described the dashboard routes, so it fell back
to clicking through a browser. Every list that returns a report now says how to
link it on its first guidance line (which rides on each search row): Workflow
Analyzer, Assisted Test, Automated Tests builds, Website Scanner runs, custom
dashboards and comparisons. The dashboard address is the same in every region.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
get_legacy_scan_report_build_id and get_legacy_scan_config_project_name only
back the dashboard's redirects for pre-2026 Website Scanner links
(DeprecatedScanReports, useScanDetails). They give an agent nothing a browser
does not already do, and sit close enough to current scan questions to be
picked for a current id and answer 404. Removed; the backend is unchanged.

get_current_user_profile stays, with guidance to answer from plan, features,
permissions and role, and never surface internal rollout or billing flags.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A dashboard's issue, category and score summaries are merged and
de-duplicated across its scans by the product. Say so on the first guidance
line of each, so an agent never "double-checks" by adding up the underlying
reports and reports a higher, wrong number.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Every Web Accessibility capability was driven by a real agent in an isolated
session; these are the fixes for what failed.

- Approval first: each of the 7 writes now leads its guidance with "show what
  will change and wait for an explicit yes; a request is not that yes". 3 of 6
  sessions had written on a plain request; on re-run all 3 asked first.
- fetchAccessibilityIssues points web results at the dashboard views (test
  cases, by guideline, components, one issue, merged reports) and says never to
  call them unavailable. It had told a user test cases "aren't available".
- Routing: website, web page, web app and browser extension are now Web
  Accessibility words too, so "the Workflow Analyzer browser extension, web
  pages" no longer routes to Device Control.
- Removed list_accessibility_projects (a twin of list_automated_tests_projects
  that agents picked instead) and check_build_list_updates (a UI polling check
  no natural request reached). Rule views point to the WCAG guideline views.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@rohitsahu-bstack
rohitsahu-bstack marked this pull request as ready for review November 12, 2026 11:42
rohitsahu-bstack and others added 9 commits November 12, 2026 17:17
Conflicts resolved:
- capability/web_accessibility.capability-index.json: kept this branch's index
  and added main's false-positive memory additions unchanged (3 capabilities,
  the false_positive_feedback entity, 3 responses, 3 routing terms); the summary
  names the memory within its 900-character cap.
- src/tools/accessibility.ts: main now compares two Automated Tests builds
  itself (compareWebBuilds), so the branch's "use get_report_comparison_summary"
  pointer is dropped; WEB_MORE_VIEWS_NOTE kept beside main's false-positive and
  Ask AI notes.
- tests: the lists test keeps the branch's six-list helper; the writes list
  includes main's two false-positive writes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ties

- resolve: a capability's own auth scheme drives headers AND the 401 replay
  (oauth2 capability under a Basic product now re-mints on 401)
- resolve: data.meta.nextPage marks a response as incomplete
- report: any "confirmed …" review status counts as confirmed, not needs-review
- index: issue_status uses the backend's "non-issue" value
- index: review_needs_review_issue requires `confirmed` (null still allowed)
- index: "accessibility score" routes app vs web by the user's words
- config: a product override without a named-host override refuses instead
  of reaching the production host
- describeCapability no longer exposes per-capability auth
- discovery never probes with a capability on another host or auth scheme
- web-only notes ("more views", "Not an issue") stay off app answers and
  off when the registry is disabled
- docs/TOOLS.md: drop rows for capabilities that were removed
- tests for each of the above

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…haviour

Adds 27 Web Accessibility dashboard capabilities, each on a route the
backend's ai_agent allowlist now includes:

- custom dashboards: conformance summary, score and issue trends, pages,
  issues by rule and guideline, rule components, one issue, duplicates,
  scan tags and WCAG versions
- builds: page trends, issue filters, test-case list filters, test-case
  search, test-case details and test-case issue filters
- comparisons: filters, scan logs, rule and guideline components
- Workflow Analyzer suppressed issues (hidden / Not an issue): rules,
  guidelines, components, one issue, duplicates
- mark_preferred_behavior (write, approval first): picks the preferred
  variant on the three consistency rules; reversible

Each was exercised on preprod, in isolated agent sessions and by direct
calls; the write was made and undone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Adds get_assisted_test_report (GET /api/assistive_reports/{id}): the report's
meta, each assisted test with its page and counts, and every issue grouped
by rule with the affected elements. Until now an agent could list Assisted
Test reports but not read one; list_assisted_test_reports now points at it.

Hiding an Assisted Test issue already works through hide_issues and
bulk_hide_issue_components (test_type AssistiveTest).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Adds list_screen_reader_automation_reports, get_screen_reader_automation_report
(each element in focus order with what the screen reader announced and its
violations, one page per call) and get_screen_reader_automation_scan_logs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… Website Scanner scans

Screen Reader Agent: list_screen_reader_agent_runs, get_screen_reader_agent_run,
start_screen_reader_agent_run, hide_screen_reader_agent_violation and
unhide_screen_reader_agent_violation. The three writes ask first. Start carries
the dashboard's New Test guidance (URL to Test, a numbered Workflow Description
of 10 to 500 characters with its example journey, Report Name filled in from
the URL, NVDA as the only screen reader today).

startAccessibilityScan takes screenReader ("NVDA" or "VO"), forwarded as the
scan's screen reader setting; the backend refuses it for a plan without it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… the 50k-character body

A full run is about 54,000 characters (steps and per-violation screenshots) and
isolated agent sessions could not read its violations, so hide and unhide had no
id to act on. get_screen_reader_agent_run is now narrowable as one record
(select fields), its guidance says to always narrow, and hide/unhide point at
the violations field. Real field names from preprod: violations[].id,
violationType, severity Critical/Serious/Major/Minor.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…eader_agent_run

The backend does not add a role check there; the agent has the user's
dashboard access.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… Reader Agent run and linking a ticket

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Aaryan430
Aaryan430 previously approved these changes Nov 17, 2026

@sarve-shreyas sarve-shreyas left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the full PR at e2b713a (head already contains main @ 305ee66).

Build: tsc --noEmit, eslint and prettier --check are clean, and all 2468 tests in 159 files pass locally.

Checked and fine:

  • Per-capability auth: every invoke path (invokeCapability, callCapability, fallback steps) goes through invoke(), where capability.auth ?? auth decides the headers, and the 401 replay invalidates the token for that same scheme. Discovery skips capabilities with their own host/auth. describeCapability strips auth.
  • Index shape: 76 dashboard capabilities, all host: dashboard + oauth2, no host/auth mismatches, no duplicate names. All 11 non-GET writes are mode: write. The POST reads are filter/search bodies. I found no field that returns saved login data (auth_configs stays out).
  • report-parser.ts: the True/False flags, the non-issue exclusion and the "Confirmed …" status match the export formats described, and the web-only note stays off app answers.

Blocking (a question to answer before deploy):

  1. Sign-off on sharing the ai_agent scope. The PR's own Before merging section asks for confirmation from the Atlas/AIC owners that MCP may reuse the ai_agent allowlist. I can't find that confirmation on the PR. Once this ships, every local and remote MCP user mints ai_agent tokens against the dashboard, and anything Atlas adds to the allowlist later reaches MCP too. Please link the sign-off, or switch to a separate scope through auth.scopes.

Non-blocking: inline comments on (2) the contract gap in the later 36 capabilities, (3) nullable now changing TM's folder_id, (4) the "never tell the user they are unavailable" note, and (5) the new named-host refusal.

Not verified by me: the EU/IN dashboard hosts accepting a token minted at auth.browserstack.com, and screenReader being the key the scan API reads under scanSettings. The PR lists both as not run live.

"intent": "Attach an existing tracker ticket (e.g. a Jira key) to an accessibility issue, report or test case so it shows as linked on the dashboard. It does not create the ticket.",
"guidance": [
"APPROVAL FIRST: before calling, tell the user exactly what will change (what, where, how many) and wait for an explicit yes in their own words ('yes', 'go ahead', 'approved'). A request to make the change, however specific, is not that yes: ask first, and send user_permission granted only after it.",
"Confirm with the user before every call, naming the ticket and the issue. There is no unlink capability here: removing the link needs the

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Non-blocking: the contract for the later 36 capabilities is weaker than the PR description says.

python3 scripts/check-contract.py capability/web_accessibility.capability-index.json now reports 13 capabilities with 46 returns fields that no 2xx schema backs. The description's "0 unbacked fields" predates the drill-down, Assisted Test and Screen Reader commits. Most of these have a description-only 200, and several returns name top-level fields while the documented body nests them under data:

  • here, status/summary/violations/steps vs {success, data: {…}}
  • list_screen_reader_automation_reports (reports, total)
  • get_assisted_test_report (meta, assistiveTests)
  • start_screen_reader_agent_run, hide_/unhide_screen_reader_agent_violation

Narrowing is unaffected because narrowable.path is data. But returns is what describeCapability shows as the contract and what search ranks on, so an agent reading it looks for status at the top level.

Scenario: an agent describes get_screen_reader_agent_run, sees returns: [status, …], and reads body.status from a 200 → undefined, then reports the run's status as unknown.

Suggestion: prefix these with data. (and data.issues.… etc. where it applies), and add the web_accessibility index to npm run check:contract with a baseline so CI catches the next one. The suppressed-issue reads (403 on preprod) and search_build_test_cases with filters have also never answered 200 live, so a line in the release notes would help.

Comment thread src/tools/capability-registry/bind.ts Outdated
*/
export function coerce(value: unknown, param: WireParam): unknown {
// Only where the contract says null is a value: elsewhere it stays refused by its type.
if (value === null && param.nullable) return null;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Non-blocking: this also changes Test Management behaviour.

tm.capability-index.json already marks folder_id as nullable: true on create_shared_component and update_shared_component. On main, folder_id: null is refused (String(null) → NaN → "must be a number"). With this line, both now send an explicit null.

For create that is a fix, because its description says "Omit or send null for the Unassigned root". For update_shared_component, folder_id: null will now move the component to Unassigned, and that endpoint's description doesn't say null is accepted.

Suggestion: confirm that's what TM does for update, or drop the flag there. Add one TM case next to the new constraints test, and a line in the PR description, since the PR otherwise reads as web-accessibility-only.

Comment thread src/tools/accessibility.ts Outdated
// cases, issues by WCAG guideline, the elements behind a rule, one issue's detail, merging
// reports) and once told the user test cases "aren't available". Point at the dashboard views.
const WEB_MORE_VIEWS_NOTE =
"This answer is the issue list only. For a build's or scan run's test cases, its issues grouped by rule or by WCAG guideline, the elements behind a rule or guideline, one issue's full detail, or several Workflow Analyzer reports merged into one, call searchCapability with product web_accessibility: those are separate dashboard views, so never tell the user they are unavailable.";

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Non-blocking (wording): "never tell the user they are unavailable" is too absolute. These views can really be unavailable to a caller: 403 ACTION_NOT_ALLOWED_FOR_SCOPE for a route not on the allowlist, plan or RBAC refusals, SR_AGENT_ACCESS_DENIED, and suppressed issues answering 403 until enabled. An agent that follows this note literally may keep retrying, or avoid relaying a real 403.

Suggestion: "…call searchCapability with product web_accessibility before telling the user they are unavailable."

Comment thread src/tools/capability-registry/config.ts Outdated
// An override of the product's own host says "not production", but it does not say where
// this host lives. Falling through to the regional (production) host would send a preprod
// session's dashboard calls to production.
if (process.env[`CAPABILITY_REGISTRY_BASE_URL_${key}`]) {

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Non-blocking (release note): this refusal applies to every product with a named host, not only web_accessibility. Setting only CAPABILITY_REGISTRY_BASE_URL_DEVICECONTROL or _MOBILEDEVICECONTROL now makes their api-host capabilities throw, where before they fell through to the regional host.

I agree it's the safer behaviour. I found no deployment that sets those variables (the remote server only sets _TM). It's still worth a line in the release notes for anyone who points a product at a non-prod host locally.

- Null pass-through is now an explicit `accepts_null` opt-in on a parameter.
  OpenAPI `nullable` stays documentation only, so tm's folder_id keeps
  refusing null exactly as before. A test pins that.
- The named-host refusal (product override set, named host not) applies to
  web_accessibility only; devicecontrol and mobiledevicecontrol fall through
  as on main, and main's named-host test is restored unchanged.
- Correct the `returns` paths of nine web_accessibility capabilities to the
  bodies the server renders (`data.*`), drop a field that only appears on 409,
  and add the index to `check:contract` with a baseline.
- The dashboard-views note now says to check searchCapability before calling
  a view unavailable, and to relay a real refusal as it came.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
SavioBS629
SavioBS629 previously approved these changes Nov 17, 2026

@sarve-shreyas sarve-shreyas left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-reviewed e2b713a..12ec45f. tsc, eslint and prettier --check are clean, npm run check:contract passes (web_accessibility is now baselined at 12 capabilities / 47 fields), and all 2470 tests pass locally.

Resolved from my last round:

  1. ai_agent scope. Confirmed in the backend. SCOPED_BEARER_SCOPE_POLICIES lives in browserstack/accessibility (config/initializers/constants.rb), and CODEOWNERS for that repo is a11y-dev. Recent allowlist changes come from the same team, and A11Y-14325 (#5865) already names MCP as a caller and adds a per-user/group kill switch for agent writes. My first comment also overstated this: MCP only calls routes declared in its index, so a later allowlist entry doesn't reach MCP by itself.
  2. returns paths. The nine capabilities now point at data.*. I checked list_screen_reader_agent_runs against SrAgent::ReportFetchService#list ({reports, total, limit, offset}, items carry id/name/status) and it matches. existingId is dropped, and web_accessibility is in check:contract with a baseline. Description-only 200s remain as a tracked follow-up, which is fine.
  3. nullable. Null pass-through is now the explicit accepts_null opt-in, used only by review_needs_review_issue.confirmed. TM's folder_id still refuses null as on main, and a test pins that.
  4. Dashboard-views note. Reworded to check searchCapability first and to relay a real 403 as it came.
  5. Named-host refusal. Now scoped to web_accessibility. capabilityRegistryNamedHost.test.ts is identical to main again, and a devicecontrol test covers the fall-through.

One leftover nit inline. Nothing blocking from my side.

"intent": "Attach an existing tracker ticket (e.g. a Jira key) to an accessibility issue, report or test case so it shows as linked on the dashboard. It does not create the ticket.",
"guidance": [
"APPROVAL FIRST: before calling, tell the user exactly what will change (what, where, how many) and wait for an explicit yes in their own words ('yes', 'go ahead', 'approved'). A request to make the change, however specific, is not that yes: ask first, and send user_permission granted only after it.",
"Confirm with the user before every call, naming the ticket and the issue. There is no unlink capability here: removing the link needs

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: this 200 description still says {success, data: the runs}, but returns (correctly) says data.reports.* / data.total. ReportFetchService#list returns {reports, total, limit, offset}. Suggest {success, data: {reports: [runs], total, limit, offset}} so the two agree.

sarve-shreyas
sarve-shreyas previously approved these changes Nov 17, 2026

@sarve-shreyas sarve-shreyas left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved at 12ec45f. All five points from my first round are resolved and verified (build, check:contract and 2470 tests pass locally). One open non-blocking nit: the 200 description on list_screen_reader_agent_runs still says data: the runs; the real shape is {reports, total, limit, offset}. Response schemas for the description-only 200s are the tracked follow-up.

@rohitsahu-bstack
rohitsahu-bstack marked this pull request as draft November 18, 2026 08:05
Parth-browserstack and others added 3 commits November 23, 2026 12:19
Both routes read page 30 when page is left out (the project controller's
default), so a call without it returned an empty list for every project on
rengg even though count said otherwise. page is now required, with the reason
in its description.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…needs an explanation

On rengg the manual hide and unhide answered affected_count as a list of rule
ids at hide_level component, not a number; the contract now says so. The
backend accepted reason Others with no explanation, so the guidance tells the
agent to ask for one and send it, as the dashboard requires.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
app-accessibility now answers 403 AGENT_REPORT_ACTIONS_DISABLED when ops
switch off agent writes for a user or group. Say so on the six write
capabilities and in DashboardForbidden, so an agent sends the user to
the dashboard instead of retrying.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Parth-browserstack and others added 7 commits November 24, 2026 12:56
…sts to the dashboard

The last three capabilities on the access-key API now use the dashboard
host and a minted ai_agent token like the rest. Projects and builds keep
their routes; manual reports move from the Reports API's /api/v1/reports
to the dashboard's /api/v1/app_scanner (report_name, os, created_after,
page and page_size, both sent so the list is paged).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… from the dashboard

App Accessibility builds and manual reports are read from the dashboard
host with a minted ai_agent token (re-minted once on a 401), through the
same host override and regional rules as the registry capabilities.
Manual reports use meta_data, overview and snapshot; the Reports API
(/api/v1/reports, /reports/{id}, /reports/{id}/issues) and its
occurrence-count fallback are gone. App Automate's own API keeps Basic.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…hboard host

Answers link to the dashboard host this deployment reads (a preprod or
staging override included), so a link copied from one now resolves too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Each dashboard row carries the report's whole test configuration, so an
agent can keep only the fields it needs with select.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…t tests

A best-practice WCAG row has level null and a recording report has
end_time null, so both schemas allow null. The dashboard host tests now
clear CAPABILITY_REGISTRY_ENV with the URL overrides, so a developer's
settings cannot fail them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…is unknown

The report reads resolved the regional dashboard host before checking the
override, so an unknown account region failed them even with
CAPABILITY_REGISTRY_BASE_URL_APP_ACCESSIBILITY_HOST_DASHBOARD set. The
declared host is now looked up only when nothing answers first, as in the
registry. Also: the hide/unhide approval steps name the issue-level count
(1 + duplication_count), and a test pins each write to its own route.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
feat(accessibility): move the accessibility reads off the External API onto the dashboard's routes (stacked on #570)
@chikara1608
chikara1608 dismissed stale reviews from sarve-shreyas and SavioBS629 via 0b6f232 November 25, 2026 11:23
@chikara1608
chikara1608 marked this pull request as ready for review November 25, 2026 11:24
Resolve conflicts with main:
- startAccessibilityScan: keep both screenReader (this branch) and scanScope (main) in the schema, settings note, rerun check and ScanSettings.
- fetchAccessibilityIssues: take main's webIssuesAnswer/withinResultLimit refactor and carry over this branch's "Not an issue" flag and WEB_MORE_VIEWS_NOTE.
- docs/TOOLS.md: apply main's scanScope text to the re-sorted startAccessibilityScan row.

Follow-ups so the merged tree builds:
- Flag the 7 bulk web_accessibility capabilities disabled, per main's rule that no bulk operation is published (#602).
- Trim startAccessibilityScan parameter descriptions to stay within the 21,500-char total description ceiling with both new params.
- Reword WEB_MORE_VIEWS_NOTE's "403 for scope" so a whole-page scan answer does not mention a scope.
- Resize the FP-memory size-limit fixture to leave room for the new note.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
SavioBS629
SavioBS629 previously approved these changes Nov 25, 2026
Parth-browserstack and others added 7 commits November 25, 2026 17:33
…cp-issue-actions-sr

Two test conflicts, both the apiClient mock: kept the base's egress
authHeaders stub for web builds. In the app report test the stub now
passes app_accessibility through to the real minting, so the ai_agent
token tests still check it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…on budget

The base's new tools leave 15 characters under the 21,500 total, and
the two option descriptions took 132. The names say what they do, the
run turns accessibility on itself, and the run's answer explains where
the report is listed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…navigation turns it on

Takes the shorter option descriptions from the main-based branch, which
trims three neighbouring options so both fit the description budget.
screenReaderLinearNavigation alone was ignored; it now turns the screen
reader (and so accessibility) on.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…an't be read

A failed overview call turned the duplicate and hidden counts into 0,
so the duplicates note just disappeared. They are now null and the
answer says the counts could not be read.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…-actions-sr

feat(app-accessibility): move App Accessibility to the dashboard API (reads, issue actions, Screen Reader Automation)
SavioBS629
SavioBS629 previously approved these changes Nov 25, 2026
@Dave3130
Dave3130 merged commit 5c1db2b into main Nov 25, 2026
7 checks passed
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.

7 participants