Skip to content

test(a11y): cover the K-2 instant quiz in the ActivityPlayer accessibility suite (#965) - #966

Merged
BrightBoost-Tech merged 1 commit into
Bright-Bots-Initiative:mainfrom
jgoetzmann-bot:harness/fix-162-add-one-narrowly-scoped-k-2-page-level-a
Nov 18, 2026
Merged

BrightBoost-Tech merged 1 commit into
Bright-Bots-Initiative:mainfrom
jgoetzmann-bot:harness/fix-162-add-one-narrowly-scoped-k-2-page-level-a

Conversation

@jgoetzmann-bot

Copy link
Copy Markdown
Contributor

Closes #965

Opened by the Bright Bots Harness from jgoetzmann-bot. It cannot merge this and will not push again unless you ask it to. Work item: jgoetzmann/bright-bots-harness#162.

Review requested from @BrightBoost-Tech, @jgoetzmann.

Steering it from here

Put one of these on its own line in a comment on this pull request:

comment what happens
/harness revise <notes> one more implementation pass, your notes as the brief
/harness rebase rebase onto this repository's current main, then push again
/harness stop close this and park the work item; /harness go puts it back
/harness status usage, queue, and when the next thing happens

Honoured only from @BrightBoost-Tech, @jgoetzmann, and only when GitHub also reports you as an owner, member or collaborator here, or .harness/trust.txt vouches for your exact account. Everyone else's comments are read and ignored. A command is acted on once — editing a comment does not re-fire it, so post a new one.

If the checks are not running

GitHub holds workflow runs from an account with no merged contribution here, so the first pull request from this one needs a maintainer to press Approve and run in the checks list on this page. Later ones start on their own.

Review checklist

From CONTRIBUTING.md. The harness ran the first three itself, on this branch:

  • Does it build? — npm run build, on this branch
  • Does it pass lint? — npm run lint
  • Does it pass tests? — npm run test:unit
  • Hardcoded English rather than i18n keys — yours to check
  • Mobile responsive — yours to check
  • Matches existing code patterns — yours to check
  • Agent prompt logged — the prompt is prompts/implement.md in the harness repository, pinned by content hash; the full transcript is transcript.jsonl in the review package
What this change is, and why

Diagnosis

The K-2 quiz's accessibility contract is tested only at component level. No test mounts it through ActivityPlayer and checks the contract a K-2 student actually gets.

  • Page routing to the K-2 variant:
    • A k2 band freezes the "instant" variant at quiz entry (src/pages/ActivityPlayer.tsx:330-332,787-791).
    • "instant" mounts K2InstantFeedbackQuiz (ActivityPlayer.tsx:820-831).
    • A course list with no g3_5 course resolves to k2 (src/hooks/useGradeBand.ts:48-54). So do the pending and failed states (useGradeBand.ts:18,163).
  • The contract under test:
    • QuestionScreen renders the choices in role="group" with aria-labelledby pointing at the prompt (src/components/activities/quiz/QuestionScreen.tsx:85-89). resolveText passes a plain-string prompt through unchanged.
    • Each choice is a Button whose text sits in nested spans, with aria-hidden icons and no aria-pressed (QuestionScreen.tsx:102-131).
    • Choices are disabled outside the answering phase (QuestionScreen.tsx:71,105).
    • After an answer, FeedbackPanel renders a role="status" aria-live="polite" banner (FeedbackPanel.tsx:34-36) and an autoFocus button. That button reads "Next", or "See how I did!" on the last question (FeedbackPanel.tsx:67-76; src/locales/en/common.json:1084,1098).
  • Existing coverage, all at component level:
    • QuestionScreen.test.tsx:52 (AC-3.1, labelled group) and :135-148 (AC-3.3, no aria-pressed).
    • FeedbackPanel.test.tsx:18 (AC-1.2, status region) and :61 (AC-1.4, auto-focus).
    • K2InstantFeedbackQuiz.test.tsx:409-421 (status region) and :423-435 (focus).
  • At page level, ActivityPlayerQuizGate.test.tsx:170-184,233-257,288-301 checks that a k2 student gets the instant quiz, but only by data-testid="instant-quiz", with no accessibility assertion.
  • ActivityPlayerA11y.test.tsx checks only the g3_5 legacy list quiz, whose contract includes aria-pressed (ActivityPlayerA11y.test.tsx:104-115; LegacyListQuiz.tsx:63-67,75-96). After test(a11y): un-quarantine the GameShell and ActivityPlayer accessibility suites (#951) #952 its beforeEach pins getStudentCourses to g3_5.

Issue

Harness issue #162 (jgoetzmann/bright-bots-harness#162) is a /harness work request with no product issue. It follows up Bright Boost #952 and was the first open question in proposal #90. It asks for one narrowly scoped, page-level K-2 accessibility test for the ActivityPlayer quiz. The test stubs a K-2 course list so K2InstantFeedbackQuiz mounts, then checks four things:

  • The choices sit in a group labelled by the prompt.
  • Each choice is a button named by its text.
  • Answering shows the role="status" feedback and moves focus to the feedback panel's Next button.
  • The choices carry no aria-pressed (AC-3.3).

The request also sets these limits:

  • The change is test-only.
  • The existing g3_5 case in ActivityPlayerA11y.test.tsx stays unchanged.
  • If the test exposes a product defect, implementation stops and reports it for a separate decision.

The plan is checked against Bright Boost main at 1a2437d. On that commit ActivityPlayerA11y.test.tsx is still quarantined (describe.skip at line 68). #952 un-quarantines it and pins it to g3_5, so this item waits for #952.

Approach

  • Wait for test(a11y): un-quarantine the GameShell and ActivityPlayer accessibility suites (#951) #952 (harness item Fix dbtest endpoint module syntax for Azure Functions compatibility #90) and Create Profile.tsx #161 to merge. Then work in ActivityPlayerA11y.test.tsx as test(a11y): un-quarantine the GameShell and ActivityPlayer accessibility suites (#951) #952 leaves it.

  • Add a second top-level describe("ActivityPlayer Accessibility — K-2 instant quiz", ...) beside the existing one. Leave the existing describe and its it byte-identical.

  • Give the new describe its own beforeEach, mirroring test(a11y): un-quarantine the GameShell and ActivityPlayer accessibility suites (#951) #952's:

    • call vi.resetAllMocks(), __resetGradeBandCache() and localStorage.clear();
    • resolve api.getStudentCourses to [{ gradeBand: "k2" }]. That makes the K-2 intent explicit, though k2 is also the fallback;
    • resolve api.getModule to a module whose activity a-1 is a story_quiz with one slide and two questions. With two questions, the first feedback button reads "Next".
  • Add one it that:

    1. renders the same route as the existing case;
    2. waits for the slide, then clicks "Start Quiz";
    3. waits for data-testid="instant-quiz";
    4. finds getByRole("group", { name: <first prompt> });
    5. for every choice text, asserts within(group).getByRole("button", { name: <text> }) exists and has no aria-pressed attribute;
    6. clicks the correct choice;
    7. asserts one role="status" element with aria-live="polite", and that getByRole("button", { name: "Next" }) has focus;
    8. asserts again that every choice in the group has no aria-pressed, now in the feedback phase.
  • Do not answer the last question or finish the quiz. Completion is covered elsewhere, and finishing would add a completeActivity call this test does not need.

  • Two-phase proof, with nothing committed. First run the file and record it green, with 2 passed and 0 skipped. Then make each temporary break below on its own, run the file, record the failing assertion, and revert:

    • Add aria-pressed={false} to the QuestionScreen choice Button. Step 5 fails.
    • Add aria-pressed={phase === "feedback" ? origIdx === selectedChoiceIndex : undefined} instead. Only step 8 fails.
    • Drop aria-labelledby from the group. Step 4 fails.
    • Replace the choice label span's text with a fixed string. Step 5 fails on the button name.
    • Remove aria-live="polite" from FeedbackPanel. Step 7 fails on the live region.
    • Remove autoFocus from FeedbackPanel. Step 7 fails on focus.

    End by showing the file green again.

Risks

  • Start Quiz race. If this is built before Create Profile.tsx #161 merges, the Start Quiz click can be undone by the play effect's reset, which is why the item depends on Create Profile.tsx #161. If the new case is flaky after Create Profile.tsx #161 merges, stop and report it against Create Profile.tsx #161. Do not add a wait or a timeout.
  • Shared button name. Another button named "Next" on the page would make the focus assertion ambiguous. In quiz mode the page renders only the quiz component (ActivityPlayer.tsx:820-831), and the toast is mocked, but the implementer should confirm getByRole finds exactly one.
  • The i18n mock. enMock does not interpolate, so "Question {{current}} of {{total}}" renders with its placeholders (common.json:1095). The case must not assert on that text. Item Create Profile.tsx #163 is the place to change it.
  • Product defect. If a reproduced failure shows a real gap, for example focus not reaching Next at page level, stop and report it. Product files are out of scope.
  • Unrun plan. No test was run for this proposal, because this session could not install dependencies. Line numbers are from 1a2437d, and test(a11y): un-quarantine the GameShell and ActivityPlayer accessibility suites (#951) #952's version of the test file must be re-read at implementation time.
  • Issue body. The request contains no instructions aimed at the agent beyond the task itself.
Gate results — this repository's own sequence, run on the branch
  • Base commit: b63535497587d39cfea6e6c15ead45dda2e7295a
  • Branch: harness/fix-162-add-one-narrowly-scoped-k-2-page-level-a
  • Captured: 2026-11-18T03:06:11Z
when gate exit
Preparation prepare: npm ci 0 PASS
Preparation prepare: backend npm ci 0 PASS
Baseline npx prisma generate 0 PASS
Baseline npm run lint 0 PASS
Baseline npm run typecheck 0 PASS
Baseline backend: npm run typecheck 0 PASS
Baseline bash scripts/check-prisma-drift.sh 0 PASS
Baseline npm run test:unit 0 PASS
Baseline npm run build 0 PASS
Post-change npx prisma generate 0 PASS
Post-change npm run lint 0 PASS
Post-change npm run typecheck 0 PASS
Post-change backend: npm run typecheck 0 PASS
Post-change bash scripts/check-prisma-drift.sh 0 PASS
Post-change npm run test:unit 0 PASS
Post-change npm run build 0 PASS

Every gate passed. The verbatim output of each is in the review package (EVIDENCE.md), attached to the run and rebuildable with the commands below.

Self-audit at 9d0204bd8cdd: no blocking findings, 1 note.

Every finding, notes included, is in the review package's DECISIONS.md.

The review package, verbatim

Review package — test(a11y): cover the K-2 instant quiz in the ActivityPlayer accessibility suite

Work item 162 (request:ee0d6b33b567) on Bright-Bots-Initiative/brightboost.
Produced by bright-bots-harness 1.0.0 on the cli backend
at 2026-11-18T03:06:11Z.

What this is

A change proposed by an automated harness running at permission tier 2. It holds one
credential, belonging to a machine account that owns jgoetzmann-bot/brightboost. It pushes this branch
to that fork and opens the pull request from there; it never pushes to Bright-Bots-Initiative/brightboost
itself, and it can neither merge a pull request nor act on a review (I-12). It never
publishes a change under .github/ (I-15). That is the harness's own check, not a
limit of the credential: it refuses to push any commit of its own that touches
.github/. It is yours to accept, amend, or discard; merging it is a human action.

What changed

  • Base commit: b63535497587d39cfea6e6c15ead45dda2e7295a
  • Branch: harness/fix-162-add-one-narrowly-scoped-k-2-page-level-a
  • Patches: 1
    • patches/0001-test-a11y-cover-the-K-2-instant-quiz-in-the-Activity.patch
  • Paths the work package expected to change:
    • src/pages/__tests__/ActivityPlayerA11y.test.tsx

How to verify

Reconstruct the exact tree the harness had. This needs nothing but this directory
and the public product repository:

git clone https://github.com/Bright-Bots-Initiative/brightboost.git r && cd r
git checkout "$(cat ../BASE)"
git am ../patches/*.patch

Or fetch the branch straight out of the bundle, with no network at all:

git clone bundle.gitbundle -b harness/fix-162-add-one-narrowly-scoped-k-2-page-level-a r

Then read EVIDENCE.md, which carries the verbatim output of the repository's own
gate sequence, baseline and post-change, with exit codes.

What is in here

File Contents
README.md This file
DIAGNOSIS.md What is wrong, with citations
DECISIONS.md Every decision taken, including the fullsend-gate outcome
EVIDENCE.md Verbatim gate output, baseline and post-change, with exit codes
ACCEPTANCE.md Each acceptance criterion, marked met or not, with evidence
BASE The 40-character base commit sha
manifest.json Machine-readable summary
patches/ The patch series, applying cleanly to BASE
bundle.gitbundle The branch, fetchable without a remote
transcript.jsonl Full redacted model transcript
Rebuild this exact tree yourself

Base commit b63535497587d39cfea6e6c15ead45dda2e7295a exists here in Bright-Bots-Initiative/brightboost; the branch harness/fix-162-add-one-narrowly-scoped-k-2-page-level-a on jgoetzmann-bot/brightboost was rebased onto the fork's main, which is a fast-forward of this repository (B105).

git -c core.autocrlf=false clone https://github.com/Bright-Bots-Initiative/brightboost.git r && cd r
git checkout b63535497587d39cfea6e6c15ead45dda2e7295a
git fetch https://github.com/jgoetzmann-bot/brightboost.git harness/fix-162-add-one-narrowly-scoped-k-2-page-level-a
git checkout FETCH_HEAD

With the review package on disk instead (docs/PACKAGE-FORMAT.md §3):

git -c core.autocrlf=false clone https://github.com/Bright-Bots-Initiative/brightboost.git r && cd r
git checkout "$(cat ../BASE)"
git am ../patches/*.patch

Or from the bundle, with no network at all:

git bundle verify bundle.gitbundle
git clone bundle.gitbundle -b harness/fix-162-add-one-narrowly-scoped-k-2-page-level-a r
About the harness

Posted by the Bright Bots Harness, an automated agent that turns issues on Bright-Bots-Initiative/brightboost into reviewable pull requests.

It never merges anything: a person approves the plan by merging the proposal, and the change by merging the delivery. A committed kill switch stops it.

Where things are. Start here · Every command · What it will and will not do · When something is wrong · What is in a review package

Repositories. harness jgoetzmann/bright-bots-harness · fork jgoetzmann-bot/brightboost · product Bright-Bots-Initiative/brightboost

…ility suite

- Wait for Bright-Bots-Initiative#952 (harness item Bright-Bots-Initiative#90) and Bright-Bots-Initiative#161 to merge. Then work in `ActivityPlayerA11y.test.tsx` as
Bright-Bots-Initiative#952 leaves it. - Add a second top-level `describe("ActivityPlayer Accessibility — K-2 instant
quiz", ...)` beside the existing one. Leave the existing `describe` and its `it` byte-identical. -
Give the new `describe` its own `beforeEach`, mirroring Bright-Bots-Initiative#952's: - call `vi.resetAllMocks()`,
`__resetGradeBandCache()` and `localStorage.clear()`; - resolve `api.getStudentCourses` to `[{
gradeBand: "k2" }]`. That makes the K-2 intent explicit, though `k2` is also the fallback; - resolve
`api.getModule` to a module whose activity `a-1` is a `story_quiz` with one slide and two questions.
With two questions, the first feedback button reads "Next". - Add one `it` that: 1. renders the same
route as the existing case; 2. waits for the slide, then clicks "Start Quiz"; 3. waits for
`data-testid="instant-quiz"`; 4. finds `getByRole("group", { name: <first prompt> })`; 5. for every
choice text, asserts `within(group).getByRole("button", { name: <text> })` exists and has no
`aria-pressed` attribute; 6. clicks the correct choice; 7. asserts one `role="status"` element with
`aria-live="polite"`, and that `getByRole("button", { name: "Next" })` has focus; 8. asserts again
that every choice in the group has no `aria-pressed`, now in the feedback phase. - Do not answer the
last question or finish the quiz. Completion is covered elsewhere, and finishing would add a
`completeActivity` call this test does not need. - Two-phase proof, with nothing committed. First
run the file and record it green, with 2 passed and 0 skipped. Then make each temporary break below
on its own, run the file, record the failing assertion, and revert: - Add `aria-pressed={false}` to
the `QuestionScreen` choice `Button`. Step 5 fails. - Add `aria-pressed={phase === "feedback" ?
origIdx === selectedChoiceIndex : undefined}` instead. Only step 8 fails. - Drop `aria-labelledby`
from the group. Step 4 fails. - Replace the choice label span's text with a fixed string. Step 5
fails on the button name. - Remove `aria-live="polite"` from `FeedbackPanel`. Step 7 fails on the
live region. - Remove `autoFocus` from `FeedbackPanel`. Step 7 fails on focus.

End by showing the file green again.

Co-authored-by: jgoetzmann <95732896+jgoetzmann@users.noreply.github.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.

harness-tracking(#162): Add one narrowly scoped K-2 page-level accessibility test for the Activ…

2 participants