# Quality

An audit of accessibility and of what Blossom costs while it sits in the notch. It says what was checked, how, what was found, what was fixed and what is left. Each fix touches one thing; they are listed at the end.

## How it was checked

Nothing here touched the pointer, the keyboard, VoiceOver or a setting of the system.

- **Reading the code** of every surface: the ear, live, the toast, the request panel, peek, detail, the context menu, the command bar, the settings window with its four panes, and first launch.
- **The accessibility tree** cannot be read from inside the tests. A SwiftUI view hosted in a window, laid out, displayed and even ordered in off screen exposes one empty `AXGroup`: SwiftUI builds its tree only for an assistive client, and reading the app as a client needs the Accessibility permission, which was not asked for. So the rule "every control has a label" is held by reading, not by a test. The sentences the announcements say are computed, and those have tests.
- **The String Catalog**, checked with one build that extracts the strings of the code, `SWIFT_EMIT_LOC_STRINGS`, into a scratch folder, compared with `Localizable.xcstrings`.
- **Contrast** computed with the WCAG 2.1 formula from the values of `theme/colors.swift` and `theme/window.swift`, translucent fills composed over the surface they sit on.
- **The app at rest**, measured with read-only tools: the Debug build started with a configuration in a scratch folder, left alone for 15 to 20 seconds, then 60 seconds of `ps` for the processor time used and `top -l` for the processor share and the count of idle wake-ups, and a `sample` of five seconds. `powermetrics` was not used: it asks for a password. Every process started was ended, and the only file the app wrote was its configuration in the scratch folder. The machine was busy with other work during the measures, a load average near 20, which the processor time of one process does not depend on much. The count of idle wake-ups depends on it more: a processor that is seldom idle is seldom woken from idle.
- **The Rust core**, read and timed with throwaway programs outside the repository at three sizes of state: 5 sessions, 2 adapters and 2 plugins; 50, 5 and 10; 200, 10 and 30.

## Accessibility

### By surface

| Surface | What holds | Found and fixed | Left |
|---|---|---|---|
| Ear | Each tile is named by its agent, `+N` reads "N more agents", the badge says its state in words | It was read in pieces, a tile at a time. It is one element now | It is not a control: only the pointer opens peek from it. The command bar is the way in from the keyboard |
| Live | One element: the agent, the activity, the time or "N of M", the badge | | |
| Toast | One element with the title and the second line | It never takes focus or the pointer, so VoiceOver never heard it. It is announced when it appears | |
| Request | The header is one heading with the chip in words; the description is text; each answer is a button named by its option; the keycaps are hidden; the waiting row says "Show the request of" the agent | The panel opens without focus and said nothing. Each request it shows is announced: who asks, from which adapter and what | Whether VoiceOver speaks the keys the buttons answer to is not tried by hand |
| Peek | Each group is a heading with its count in words; each row is one button with its state in words, its title, its reason and its time or chip, and the trait selected; the hidden key buttons are hidden from VoiceOver | `↓` and `↑` moved the selection in the core while VoiceOver stayed where it was, and the new row was not spoken. A row the arrows select is now announced: its title, its state and its second line as drawn, "Refactor the parser. Needs you. Run the tests" | Whether the announcement is cut short by what VoiceOver was saying is not tried by hand |
| Detail | The header is one heading | Its middle dot was spoken. It is hidden | |
| Context menu | Each item is a button with its label; the count and the check "On" are part of it; the selected item has the trait | | The on state is part of the label, not a value or a toggle trait |
| Command bar | The field is "Search commands"; group captions are headings; each result is one button with the trait selected | As in peek, the selection the arrows move was not spoken while the focus stayed in the field. A result the arrows select is now announced: its agent or plugin and its words, "Claude Code. Run the tests" | As in peek |
| First launch | Headings, the mark hidden, each agent a checkbox with its name and whether it was found, the shortcut said as words | | It opens by itself like the request panel, so each step is announced as it appears, "Welcome · 1 of 3. Blossom lives up here". Its checkboxes, "Find my agents", "Continue" and "Skip" act when VoiceOver activates them, without the pointer, after the pause of a new step. To check by hand: with VoiceOver on and the pointer away from the notch, start without a configuration, move to the panel with VO-arrows, press VO-Space on "Find my agents", on a checkbox and on "Continue"; each acts, and a plain `↩` does not |
| Settings | Sidebar items with the trait selected and their icon hidden; pane titles and group captions are headings; each row hides its own label, which its control carries through its accessible representation, a toggle, a segmented picker or a radio group; the recorder has a label, a value and a hint; the buttons of an agent name the agent; the field has a label; "Not saved" and a refused login item are announced | A shortcut refused or taken showed its note without a word. It is announced like the other two | The sidebar reads the number of agents as a bare number, "Agents, 3" |

### Rules across surfaces

- **Focus ring.** Every control of the settings window draws a 2 point ring in the accent through `FocusRing`, and turns the system's off. The notch has no ring: its keys select a row, and the selected row takes the accent border. Whether Full Keyboard Access moves through the settings window as expected is not tried by hand.
- **Reduce Motion.** Every animation and transition of the notch comes from `ThemeMotion`, either with the setting passed in or as a cross-fade already: a spring becomes nothing and content a 100 ms cross-fade. Nothing animates outside it, and the settings window has no animation. The digits of a time or a count roll with its curve, and with the setting change in place.
- **String Catalog.** Every sentence goes through it. The build that extracts the strings found 149 keys in the code, every one of them in the catalog; the four entries of the catalog it did not find are `⌃`, `⌥`, `⇧` and `⌘`, which the Shortcuts pane looks up by value. What is drawn verbatim is data: names, titles, commands, reasons, the version. One composed label, the switch of an agent in the Agents pane, joins its name and its command with a comma written in code.
- **Increase Contrast.** Borders and tertiary text take the stronger tokens of [design/tokens.md](design/tokens.md#increase-contrast), read from `colorSchemeContrast` of SwiftUI; the rest keeps its values.
- **Not handled.** Bold Text: the weights are fixed tokens. Reduce Transparency does not apply: no surface shows what is behind it, with no vibrancy and no blur.

### Contrast

WCAG AA asks 4.5 to 1 for text of this size and 3 to 1 for the parts of a control that show its state, such as a focus ring.

| Text on | Primary | Secondary | Tertiary |
|---|---|---|---|
| Notch, `#000000` | 19.29 | 8.16 | 5.14 |
| Raised fill on the notch, `#121212` | 17.21 | 7.28 | 4.59 |
| Dark window, `#131315` | 17.04 | 7.21 | 4.55 |
| Dark sidebar, `#0C0C0E` | 17.95 | 7.60 | 4.79 |
| Dark control fill, `#262628` | 13.87 | 5.87 | **3.70** |
| Light window, `#FBFBFA` | 16.61 | 5.76 | 4.82 |
| Light sidebar, `#F1F1F0` | 15.22 | 5.27 | **4.41** |
| Light container, `#FFFFFF` | 17.20 | 5.96 | 4.99 |
| Light control fill on a container, `#EDEDED` | 14.69 | 5.09 | **4.26** |

The state colors on the notch pass: needs you 11.58, failed 6.84, done 9.34, and on the raised fill 10.33, 6.10 and 8.34. Text on the primary button is 17.71.

What fails, with the least value that would pass. No token was changed: they are the maintainer's to change.

| Where | Measured | Least that passes |
|---|---|---|
| Tertiary on the light sidebar: "Preferences", the version, the sentence of "Not saved" | 4.41 | `#6D6D74` for 4.54 |
| Tertiary on a control fill: the prompt of the field that adds an agent | 4.26 light, 3.70 dark | `#6B6B72` light, `#8C8C93` dark |
| Failed, `#F0685C`, as text in the light theme: "Stopped", "Not saved" | 3.07 on a white container, 2.97 on the window, 2.72 on the sidebar | `#C2544B` on white, `#B44E45` on the sidebar |
| Graphite, `#8E8E93`, as the focus ring on the light sidebar | 2.88 | `#8B8B8F` for 3.00 |
| The switch when off, against a light container | 1.45, 1.61 on dark | Its knob position tells on from off; the track alone does not |

The other accents pass as a focus ring everywhere: the lowest is sky on the light sidebar, 3.25.

With Increase Contrast, tertiary text takes `#909097` in the notch and the dark window and `#68686F` in the light window, at least 4.73 on any surface, so the first two rows of "What fails" pass with the setting on; borders reach 3.38 at the least. The other three rows do not change with it. See [design/tokens.md](design/tokens.md#increase-contrast).

## Cost at rest

### What runs when nothing happens

- **The app.** No timer runs without something visible that counts or moves. A working session in live or peek shows a time that SwiftUI updates once a second while it is drawn, and whose digits roll for 300 ms when they change, in live only when its minutes do. The ring of a working session in peek, detail and a plugin panel breathes, and the waiting ring of first launch turns: each redraws at most 30 times a second, `loopFrameInterval`. The time, the breath and the waiting ring all stop while the notch cannot be seen. The toast sleeps once for its time, the shell once for the hold of a cue, and the panel once for a dwell. With "Hide over apps that fill the screen" on, which is off by default, the window list of the system is read once a second while the notch can be seen; with it off nothing reads it and no timer runs. Not measured. The pointer is watched with two event monitors only while the ear, a toast or a panel is drawn and the window can be seen: every movement of the mouse anywhere then reaches Blossom, which is work only while the mouse moves. What Blossom does with each movement is measured below, under "Watching the pointer".
- **While the window cannot be seen.** The Mac or its displays asleep, another session in front, the screen locked or the window covered whole: the pointer monitors are removed and the dwell does not wait, and the platform layer says so with `canBeSeen` of `ScreenVisibility`, which the presentation model takes as its own `canBeSeen`: the time, the breath and the waiting ring stop with it. Not measured: it needs the displays put to sleep, which this audit does not do. To measure by hand: with dev and one session working in live, take the processor time of Blossom with `ps -o time= -p <pid>`, put the displays to sleep with `pmset displaysleepnow`, wake them after 60 seconds, and take it again; the difference should be close to nothing, and the notch should be where it was.
- **Observers that stay.** The stream of snapshots, the changes of full screen, the changes of screens, sleep, waking, the lock and the session, the occlusion of the window, and the activations of other apps, which the settings window follows to give the keyboard back, are observed for the life of the app. Each costs nothing until its event. A change of screens sleeps once, 100 ms after the last notice, before the notch is placed again.
- **Adapters.** The Claude Code, Codex, Gemini CLI, Cursor CLI, Copilot CLI, Antigravity CLI, Grok Build, Kiro CLI, Kimi Code, Mistral Vibe, Qoder CLI, Qwen Code, ZCode, Devin CLI, CodeBuddy Code, Droid, Codewhale, Hermes Agent, Trae, QoderWork, QwenWork, Pi, Oh My Pi, Gajae-Code, Amp and MiMoCode adapters check every five seconds whether the process of each session is alive, one `kill` of signal zero per session; the check runs even with no session. The OpenCode adapter looks for the registration file of the service every two seconds while no service runs, and otherwise waits on its stream. GitHub Actions starts `gh` once a minute per repository. Those are the only polls; none is measured, since each needs the real tool or a signed-in `gh`. The module of Pi, Oh My Pi, Gajae-Code, Amp and MiMoCode runs inside the agent, or for Amp in the process of its plugin, and costs it, at each event it reports, one line of JSON and a post over a Unix socket in the background, one at a time; not measured either.
- **The core.** No loop, no poll and no sleep but the two seconds before an ended adapter is killed. Each adapter has a thread that waits for its next line, and, since the plugins can be called, each plugin that was asked has one that waits for its next question; none of them wakes by itself. The measures below were taken before plugins could be called, and no plugin was installed.

### Measured

Three builds: the one the audit began on, `bab40bb`; the one it ended on, `ec201d8`; and that one with the five fixes below. Processor time of each process over 60 seconds once the scenario had settled, and the idle wake-ups `top` counted in that time.

| Scenario | Blossom, at the start | Blossom, at the end | With the fixes | Its adapter |
|---|---|---|---|---|
| No adapter | 0.00 s, 0 wake-ups | 0.00 s, 0 | 0.00 s, 0 | |
| Two sessions working, the ear with no time shown | 0.00 s, 0 | 0.00 s, 0 | 0.00 s, 0 | 0.01 to 0.02 s, 0 to 3 wake-ups |
| One session working, live with its time | 0.11 s, 0 | 0.12 s, 1 | 0.12 s, 0 | 0.02 s, 0 to 6 wake-ups |
| A request panel open, the mock with two agents | 0.00 s, 0 | 0.00 s, 0 | 0.00 s, 0 | 0.01 to 0.02 s, 0 or 1 wake-up |

At rest Blossom costs nothing that these tools can see, and a time that counts costs about 0.2% of one core while it is shown. The sample of each scenario showed every thread waiting: 3 or 4 threads with no adapter, 5 or 6 with one, 8 with the mock.

An adapter that reports often is where the cost was. Two sessions and an adapter that says "working" for each twenty times a second, which changes nothing, over 30 seconds:

| | Blossom |
|---|---|
| At the start | 0.14 s and 0.12 s, in two runs |
| At the end | 0.10 s |
| With the fixes | 0.07 s, in three runs: two with the stream fix alone, one with all five |

### The loops of the notch

Measured off screen, in the window of the tests at minus 30000 points, with the processor time of the test process over 6 to 10 seconds and the times its main loop woke, on a Debug build and a machine with a load average near 100. A window that is on no screen redraws on a timer of its own instead of the refresh of a display, much faster, so these numbers are upper bounds of their kind and not what the notch costs on a screen; Blossom was not started on the screen of the maintainer to measure it there.

| What is drawn | Processor | Main loop woke |
|---|---|---|
| The ear, nothing moving | 0.0% | 2 times in 10 s |
| Live, a working session with its time | 0.1 to 0.2% | 12 to 13 times in 10 s |
| Peek, three working sessions with their times and breathing rings | 15 to 21% | 400 to 570 times a second |
| Peek, three working sessions with a progress, so only the rings breathe | 17 to 22% | 2300 to 3300 times a second |
| Peek, three working sessions without the breath | 15% | 425 times a second |
| Peek, three finished sessions | 0.0% | 2 times in 6 s |
| Peek or live with `canBeSeen` off | 0.0% | 1 or 2 times in 10 s |

Counted in a separate program, a `TimelineView` limited to 30 updates a second, the schedule the rings use, redraws its content 23 to 26 times a second; unlimited, 79. So the limit holds, and what is left of the cost off screen is the timer of a window with no display. With the notch out of sight the loops cost nothing. The rolling seconds of the rows of peek are the larger part: three rows roll their seconds for 300 ms every second, at the refresh of the display.

To measure it on a screen, as the rest of this section was: `bun run dev`, open peek while the two sessions of the mock work and keep the pointer on it, and read `ps` and `top -l` for 60 seconds as above; then lock the screen and read them again.

### Watching the pointer

While the ear or a panel is drawn, every movement of the mouse anywhere reaches Blossom through a global monitor, and its panel works out whether the pointer entered, left, rested or armed.

- **Blossom's work per movement:** 0.9 µs. Measured in the Debug build with a throwaway test that sent 200,000 movements to a panel with a region, once with the pointer outside the region and once inside, where each movement also starts again the wait for the rest: 0.89 and 0.95 µs. A trackpad reports a moving pointer about 60 to 120 times a second, so a pointer that never stops costs Blossom about 0.1 ms of processor a second, 0.01% of one core. A pointer that does not move costs nothing: no movement, no work.
- **Delivering each movement to Blossom** is the window server's work and a wake of Blossom's main thread, and it was not measured. A throwaway program that only installs the same global monitor, with a twin that installs none, ran for 2 and for 15 minutes next to each other, and counted no movement: nobody moved the pointer meanwhile, and this audit does not move it. Both used 0.02 s of processor. To measure by hand: run such a program for a minute while moving the pointer the whole time, and divide its processor time, less the twin's, by the movements it counted.
- **Nothing changed.** The figure does not ask for a tracking area in place of the global monitor. An area would see only the movements over the window, but a window that ignores the mouse, which this one does until the pointer moves inside, may not get the events of its areas, and the monitor is what sees the pointer enter. Monitors are removed whenever there is no region and while the window cannot be seen.

### Found and fixed

- **A logo was read again every time its tile was evaluated.** Reading the path data of the catalog takes, in an optimized build, 44 µs for GitLab and 494 µs for Jenkins, up to 535 µs for Argo; in the Debug build that `bun run dev` runs, up to 3.2 ms. The catalog now keeps each outline it read; a lookup takes 0.3 to 2.6 µs.
- **Every event reached the main thread, also one that changed nothing.** The core calls its observers after every event. Observation already skipped equal values, so nothing was drawn again; a probe test with the Swift 6.3 toolchain showed that an equal snapshot changes nothing that a view reads. The hop and the work around it were still paid. The stream now leaves out a snapshot equal to the last one it streamed, which took the busy adapter above from 0.10 to 0.14 s down to 0.07 s.

### Left

From the core, measured with throwaway programs at the three sizes above. A whole event, sent as an intent and observed, costs about 2 µs at the size of a real day, the first, 51 µs at the middle size and 359 µs at the largest, so nothing here is urgent.

- **Every event clones the requests, the preferences, the adapters and the plugins**, with their logos, to compare before and after, and builds the list of configured adapters twice: 4 to 10 µs each at the middle size, 17 to 32 µs at the largest. Comparing only what changed needs no redesign but touches the running notch, so it was left.
- **Forgetting the sessions that left scans adapters, claims and sessions** on every event: 14.8 µs at the middle size and 133 µs at the largest, of which a set of the claimed sessions would remove most.
- **The dismissed sessions were only forgotten when their adapter closed them, or was turned off, removed or started again.** Closed since: the core remembers the hundred dismissed last.
- **Observers ran while the state was locked**, so the snapshot was built and lowered across the boundary under the lock: about half of each whole event above. Closed since: they run after the state is released, in order, on the one thread that notifies.
- **A configuration write holds the state lock**: about 5 ms each, with a sync to disk, only when the user changes something. Decided and documented.
- **Writes to an adapter blocked the thread that writes**, which could be the one that sends an intent. Closed since: a thread of each launch writes from a queue.
- **Nothing ended the adapters when Blossom quit.** Closed since: the app asks the core to shut down when it terminates, and each adapter runs in a process group of its own that the host ends. A Blossom that is killed still ends nothing, a known gap.

- **The rolling seconds of peek and detail are the costly part of an open peek with working sessions.** Rolling them only when the minutes change, as live does, would cut it; it is the maintainer's to decide.

## Manual checks

A pass with VoiceOver; Blossom is not tried with VoiceOver. With `bun run dev`, which writes to `adapters/mock/configuration.json` when a setting changes, so restore it afterwards, VoiceOver on (`⌘F5`) and the VoiceOver cursor in another app:

1. Wait for the first toast, about four seconds in. Expect to hear "Claude Code is done. Refactor the reducer", or its own words if the mock changed.
2. Wait for the request, eight seconds in. Expect "Codex needs permission. From adapter 1 in Agents settings, “Mock”. Run the test suite". Check that VoiceOver says it although the panel took no focus, and that the keys of the app in front still go there.
3. Open the window chooser (`VO-F2` twice) and find Blossom's panel. The panel calls itself a window of no known kind, so tiling window managers leave it alone; check that the chooser still lists it, and that the request of step 2 was still said. Move through it: expect a heading "Codex needs permission, Needs you", the description, a button per answer, "Show the request of" when two wait, and "later". Note whether the buttons say their keys.
4. Answer it with its key after a click inside. Rest the pointer on the ear and find peek: expect a heading per agent with "N sessions", and each row as one button that says its state.
5. Press `↓` after a click in peek: VoiceOver says the selected row, its title, its state and its second line as drawn, while its cursor stays where it was. Opening peek and coming back from detail say nothing.
6. Find the ear itself with the panel closed: expect one element, "Claude Code, Codex, An agent needs you" or as many as run.
7. Open the command bar with `⌥ Space`, type, and press `↓`: VoiceOver says the selected result, with its agent or its plugin when it has one, and the focus stays in the field. Typing drops the selection and says nothing.
8. Open settings with `⌘,`. Move through every pane with `VO-→`: each switch, segmented control, swatch and button should say what it does and its state. In Shortcuts, record a shortcut that macOS or another app already uses and that reaches Blossom, as the Shortcuts bullet of [roadmap/settings.md](roadmap/settings.md) explains: expect its note to be spoken.
9. Turn on Reduce Motion, then Increase Contrast, and watch the ear grow and a panel open: expect cross-fades. With Increase Contrast, expect stronger hairlines, chip and keycap borders and tertiary text in the notch and in settings, and nothing else to change.

## Fixes

| Change | What |
|---|---|
| `perf(macos): read the outline of a logo once` | The cache of outlines |
| `perf(macos): stream a snapshot only when it differs from the last` | The stream that leaves out equal snapshots |
| `fix(macos): say a toast and a request to voiceover when they appear` | The two announcements |
| `fix(macos): read the ear and the header of detail whole in voiceover` | One element for the ear, no dot in detail |
| `fix(macos): tell voiceover when a recorded shortcut is refused or taken` | The third note announced |
