M4 evidence: the board in the browser
On this page
Date: 2026-11-18. Machine: macOS 26.3, Apple silicon, Node 22.17.1, npm 11.5.2, Playwright
1.65.1 with Chromium 1255 (in .playwright-browsers/). Commits 7b3215f to 1bb6c7a; then
the fixes from the fresh-eyes review; then the commits that close CLA-55 and M4's epic.
The brief's work for M4: "D7's board, backlog, ticket, sprint, activity, idea, settings, needs-you and palette; the local server; live updates; DESIGN.md and the screenshot rounds." Its proof: "browser journeys, axe, the bundle gate."
Acceptance
| Check | Result |
|---|---|
| The local server, on this machine only (D15) | clara serve binds 127.0.0.1, refuses a foreign Host, cross-site writes, anything but JSON and a body over 1 MiB, and asks every API call for a key made at start (D-088). test/security/server.test.ts, 16 tests, most of them over every route; see The local server |
| Every view in D7 against a real board | The board, the backlog, a ticket, the sprint, the activity, the idea, settings, what needs you and the palette, each driven by the browser journeys against a board made with the CLI and a real clara serve |
| Live updates | The server sends the whole board, then each change as a patch (D-088); a page that missed one asks for the whole board again. A change made in a terminal reaches an open page within a second, and words being typed survive a change to the same ticket |
| The browser journeys of E1 | 41 journeys in Chromium, all passing; see Browser journeys |
| axe on every view | No serious or critical violation on any of the seven views, the ticket panel, or any of the four dialogs, in the light theme and the dark, nor on any view on a phone |
| The bundle gate (C2) | First load 69.4 KB gzipped (budget 100 KB); the one lazy chunk, Markdown, 26.7 KB (budget 60 KB) |
| DESIGN.md and two screenshot rounds | docs/DESIGN.md; 54 pictures in docs/screenshots/, every view, a ticket and the palette at 1440, 1024 and 390, light and dark. What each round changed is below |
| Markdown sanitised, a strict policy (D15) | Raw HTML is text, links go to the web or mail only, images become links, and DOMPurify checks it all again; the page runs only its own scripts. test/unit/web/markdown.test.ts and test/e2e/markdown.spec.ts; docs/SECURITY-MODEL.md, Content |
npm run ci exits 0 in a clean checkout |
yes, the browser journeys included, before every push |
Tests and coverage
$ npm run ci
Test Files 133 passed (133)
Tests 3252 passed | 1 skipped (3253)
Statements : 98.14% ( 5350/5451 )
Branches : 95% ( 3382/3560 )
Functions : 98.48% ( 1042/1058 )
Lines : 98.76% ( 4492/4548 )
first load 69.6 KB gzipped (budget 100 KB)
lazy lib/markdown.ts 26.8 KB gzipped (budget 60 KB)
41 passed (31.1s)
M3 ended at 2,906 tests in 95 files; M4 added 346 in 38 files, and the 41 journeys. This
run is the clean checkout of 850bef3, after the fresh-eyes review's fixes.
The coverage gate covers library/. The server and the web are outside it. Measured once
for this file, with the same suite:
| Folder | Lines | Branches | What runs it |
|---|---|---|---|
server/ |
97.9% | 88.4% | test/security/server.test.ts, test/unit/server/, test/integration/server.test.ts |
web/client/ (HTTP, the key, the event stream) |
100% | 91.0% | test/unit/web/ |
web/lib/ (Markdown, events, format, suggestions) |
96.7% | 92.6% | test/unit/web/ |
web/state/ (store, actions, router) |
90.9% | 79.5% | test/unit/web/ |
The plans behind the views (backlog/plan.ts, board/plan.ts, sprint/chart.ts, sprint/facts.ts, activity/facts.ts) |
100% | 83% to 96% | test/unit/web/ |
The components and views (.tsx) |
low, by design | the browser journeys |
Every decision a view makes (what a column holds, where a drop lands, which rows of ten
thousand to draw, what a sprint's chart plots, what an event says) lives in a plain module
with unit tests. The .tsx files draw what those modules decide, and are run by the
journeys in a real browser, which vitest's coverage does not count.
Measuring this found server/live.ts at 83% of lines, and the lines no test ran were not
rare ones: a page that goes away, the server stopping with pages open, a change that lands
while the board is being read, polling where the storage cannot be watched, a bug while
reading, and the comment that keeps an idle connection open. test/unit/server/live.test.ts
now runs each of them, and it is 100% of lines. The test of a change landing mid-read was
first written so that it passed with the re-read taken out; it now holds the read on the
files listed before the change, and fails without the re-read.
| File | Tests | What they hold |
|---|---|---|
test/security/server.test.ts |
16 | Every D15 rule for the server, on every route; see below |
test/integration/server.test.ts |
13 | Every REST operation answers with a code and a hint; the live stream sends the whole board, then each change; a bug's details stay out of the answer |
test/integration/cli-serve.test.ts |
7 | clara serve on a real port, from the printed link to Ctrl-C; --open hands the browser no secret |
test/unit/server/ |
25, in 3 files | Headers, the guard's order, docs/REST.md generated from the registry, and the live board's bookkeeping (live.test.ts) |
test/unit/web/ |
232, in 26 files | The store (patches, optimistic changes and their rollback, undo by change, a missed patch, an event pulled from elsewhere), what is left in a box after a send, the key, the event stream, the router, the keyboard map, the filter's suggestions, Markdown, every plan behind a view, and the style sheet (styles.test.ts: no colour or size that is not a token, no token that does not exist, no class without a rule, nothing that moves after the reduced-motion block) |
| Library additions | in test/unit/ |
Board patches a page can apply; ticket.update refusing a body edited from older text; one rank order for the whole board; a sprint day by day for its charts |
The local server
The rules and their tests are in docs/SECURITY-MODEL.md, Local server.
In short, each check runs before anything reads the board, in this order: this machine only
(127.0.0.1), its own name only (a foreign Host, look-alikes included, gets 403), writes
from its own page only (Origin exactly its own, Sec-Fetch-Site same-origin), JSON only
(the three content types a form can send without asking are refused, and a preflight gets no
CORS header), at most 1 MiB counted as it arrives, and a 256-bit key made at each start that
travels after # in the link and in a header after that, never in a cookie, a query or a
program's arguments (D-088, and df3f484 for --open).
docs/REST.md lists every operation the server offers, generated from the registry and
checked by the docs gate.
Browser journeys
npm run e2e (D-097). Each test gets its own copy of a board the CLI made, as people and
agents would (an agent working, one blocked on a question, work in review, a sprint and a
backlog), served by its own clara serve on a free port with its own CLARA_HOME. What a
journey changes is read back from disk with the CLI, not from the page.
| File | Journeys | What they do |
|---|---|---|
board.spec.ts |
8 | Add a ticket from the board, and it is on disk; drag a card to another column; carry one by keyboard, and Escape puts it back; a change made in a terminal is on the page within a second; words being typed survive a change to the ticket from elsewhere, and words typed while a comment sends stay in the box; a refusal is said at once to a screen reader and a change done waits its turn; a wide board fades the edge with columns past it |
work.spec.ts |
6 | Answer a blocker from what needs you; approve work in review; send it back with a note; reject it with a reason; close a sprint with its unfinished work carried over, and start the next; the palette goes to a view and opens a ticket |
keyboard.spec.ts |
4 | A morning on the board by keyboard alone; the focus always visible; the comment box names the send key of the system, Ctrl on Linux and ⌘ on a Mac |
phone.spec.ts |
3 | At 390 wide: the views behind the menu, a ticket opened and changed by touch; a blocker answered; every control on every view at least 40 by 40, no field that makes the phone zoom, and axe on every view |
markdown.spec.ts |
3 | A ticket of hostile text runs nothing and its boxes still tick into the file; a hostile comment arriving live runs nothing; the page's content security policy refuses script put in by hand |
axe.spec.ts |
13 | Every view, the ticket panel and every dialog, in both themes; with reduced motion, the panel, a dialog and a toast do not move |
visual.spec.ts |
4 | Every view compared with its baseline in both themes, and on a phone the board, what needs you and a ticket |
A failure runs once more, with a trace. The comparison allows a per-pixel threshold of 0.02 and 10 pixels, measured rather than guessed (see the second round).
The journeys found four bugs before any screenshot was looked at:
| Found by | Problem | Fixed in |
|---|---|---|
| The keyboard journey | showModal() focused the dialog's close button, so pressing c and typing a title typed into nothing |
2c0fd35: each dialog opens on the field it asks for |
| axe | The assignee button was named "Assignee: codex. Change" but showed "C codex", so its visible text was not in its name (WCAG 2.5.3) | cca5a93: initials drawn by CSS, out of the name |
| axe, measuring the panel's text mid-fade | The reduced-motion block came before the panel's rule, so the panel slid in anyway | c25c89f (D-096): the block ends the style sheet, and a unit test and a journey hold it there |
| The phone journey | Small controls sat inside each other's reach, and fields under 16 pixels made the phone zoom on focus | 53e332e (D-095): an invisible 40 by 40 reach for each control; fields 40 tall with 16-pixel text |
Screenshot rounds
npm run screenshots takes 54 pictures against the journeys' board: the board, a ticket,
what needs you, the backlog, the sprint, the activity, the idea, settings and the palette, at
1440, 1024 and 390, light and dark. Each round was read picture by picture against
docs/DESIGN.md and the brief's D7.
Round one
| Seen | Fixed in |
|---|---|
| At 1440 the board's fifth column began off screen with nothing to say it was there | c2a37a0: a fade marks each edge with more past it, following scroll and resize, in either writing direction |
| Ids were set in mono in the needs list, the panel, the sprint and the activity, and in sans on the board and backlog; DESIGN.md keeps mono for code and paths | 0cc09b2: sans everywhere, with tabular figures so a column of ids lines up |
| "All 1 acceptance criteria met." The approval journey asserted that sentence, so it had pinned the mistake | b3da2d2: one sentence for each count in format.ts, with a test; the journey asserts the new one |
| Two pictures of the same view differed: the needs counter arrives a moment after the board | 1df914d: views.ts says when each view is ready, the counter included |
Round two
| Seen | Fixed in |
|---|---|
| The backlog said "5 tickets, 17 points, 1 done" over five tickets, none of them done: the done one is counted, not listed | 5732a83: "; 1 more done" |
| On a phone the sprint's Starts and Ends wrap, and their dates did not line up | 5732a83: both names take one width |
| A field whose value wraps had its name centred between the lines | 5732a83: the name sits beside the first line |
| The visual comparison had passed the first round's backlog wording against an old baseline | 1df914d (D-097): the tolerance, measured as below |
The comparison is pixelmatch. Measured on this machine, in pixels that differ:
| Pair of pictures | Threshold 0 | 0.02 | 0.2 (Playwright's default) |
|---|---|---|---|
| The same view, two runs | 2 | 0 | 0 |
| A sentence reworded | 166 | 154 | 87 |
| The board against the backlog | 848,078 | 837,453 | 14,998 |
At the default threshold with 100 pixels of slack, a reworded sentence passed, and so did the board with its columns' pale fill gone, which differs from a white page by less than the default threshold. At 0.02 with 10 pixels, two runs still agree, and both changes fail.
Fresh-eyes review
A reviewer that had not seen the work read M4's code (server/, web/, the journeys) against
the brief, docs/DESIGN.md and docs/SECURITY-MODEL.md, asked for the ten most serious
problems. It ran a throwaway clara serve and confirmed what it could with curl and with the
modules run directly. It reported nine. All nine held up, and each fix came with a test that
failed before it.
| # | Problem | Severity | Fixed in |
|---|---|---|---|
| 1 | Undo on a toast took back the person's newest change, not the one the toast named: a move, then a comment, then Undo on the move's toast undid the comment. The unit tests only counted undo calls | high | 6b8d961: the server's answer names the events a change recorded, and activity.undo (and clara undo --change) takes back the change named by its first event, or refuses |
| 2 | A task box was placed by searching the text for its line, so ticking a real box below a code example with the same words ticked the example | medium | 2c10e48: boxes are placed from the Markdown tokens' own positions; a property test ticks random boxes in random awkward documents and checks only that box changes |
| 3 | The live stream sent only events newer than the newest sent, so a teammate's events pulled in by git, older than one made here, never reached an open page | medium-low | b3221f8: an event is new by not having been seen; the page puts events in id order, each once |
| 4 | Words typed while a comment was sending were wiped when it was taken | low | 8570633: only the words that went leave the box; the answer and reply boxes do the same |
| 5 | A bulk change refused part way left the steps already done with no Undo | low | 6b8d961: the refusal is followed by an Undo for what was done |
| 6 | A % not followed by two hex digits in the address threw before the page drew anything |
low | 555ccc0 |
| 7 | The body-limit test passed without the limit: a body that said it was 20 bytes was read whole, and refused only by a ticket field's own limit. Over a socket Node holds a body to its stated length; a host that mounts Clara (C4.9) may not | low | 2cfa0df: the server counts every body's bytes, whatever it states, and the test asks for TOO_LARGE |
| 8 | Error toasts were announced politely, against the code's own comment | low | f3a7bb2: errors have their own assertive region |
| 9 | The comment box said ⌘ Enter on every system |
low | aa37e0d |
Found along the way: clara undo --help, once --change existed, cut the flag's name to
--cha… to fit its description. Help's tables now never cut a name or a description
(996ee29).
What it checked and found sound: every local-server guard over TCP (a foreign Host, the
exact Origin, Sec-Fetch-Site, JSON only, 413 for a body over 1 MiB chunked or stated, no
CORS on a preflight, every spelling of an /api path asking for the key, the key compared in
constant time, the headers on refusals too, no path out of the web build); the key after #,
cleared from the address bar, and the --open file's permissions; Markdown escaped, links and
images limited, DOMPurify after, no inline script; the C2 budgets; edits saved against the
text they began from; drafts kept per ticket; single-key shortcuts that ignore text fields;
and the backlog drawing only the rows on screen.
Clara on its own board
M4 was worked on Clara's own board, as agent:claude, with review.mode set to gates
(D-043): claim, commit the work, checkpoint with the criteria ticked, clara verify, then
clara complete, which Clara approved because the checks passed on that commit.
| Ticket | What |
|---|---|
| CLA-49 | The local server: clara serve on this machine only |
| CLA-50 | Live updates: the board changes on its own |
| CLA-51 | The web app's shell: tokens, routes, palette, keys and needs you |
| CLA-52 | The board view |
| CLA-53 | The ticket, backlog and sprint views |
| CLA-54 | The activity, idea and settings views |
| CLA-55 | The web and e2e gates, and the screenshot rounds (this file) |
Hosted CI
Started by hand when the milestone's work was done (D-028).
| Run | Commit | Result |
|---|---|---|
| 44306460104 | d5eee4c |
Passed on all nine jobs: Ubuntu on Node 22 (118 s), 24 (123 s) and 26 (132 s), macOS (134 s) and Windows (275 s) on Node 24, the browser journeys on Ubuntu (95 s), Bun running the CLI (13 s), the plan job and the summary. |
Test totals: Ubuntu 3,251 passed and 2 skipped, macOS 3,252 and 1, Windows 3,248 and 5. The skips are the same as M3's: shells a system lacks for parsing completion scripts, and on Windows the tests of POSIX file modes. The browser journeys passed 41 of 41 in Chromium on Linux (1.1 minutes).
It was the first run with the journeys in a job of their own, so it wrote Linux screenshot
baselines instead of comparing them. All 22 were looked at, and they show what the macOS ones
show, in Linux's fonts; they are committed in 896a635, and later runs compare against them.