writing / post19 nov 2026

Boards that assert

I have a script that writes the boards of Durandal's new home screen and stops when a drawing breaks a rule of the design, and with six checks and a lint it still let three problems through.

this post

published
2026-11-19
reading
08 min
parts
7
the exhibit: ~ / work / durandal

A script that says no

A script writes the boards of the new home screen of Durandal, my iPhone training coach. Before it writes a board, it checks the drawing against the rules of the design. Break a rule and the script stops with an error. No board gets written.

The rules were in the brief first. I didn't want to check 65 drawings against them by eye.

The design was locked on 17 November 2026. Locked is the brief's word for the structure of the home screen that I chose, and the brief is the document with the rules. The home screen is built now, and it's on my phone. There's no data in the app yet, so it doesn't look as rich as the mockup. But the boards are what the script guards: each board is a file that draws one screen, with invented data.

The folder of the boards has 69 files: 65 boards and 4 parts that boards share. Two of the parts are used only by earlier options. Twenty of the boards are earlier options too, and the brief marks those as not the design.

Three Python scripts write 21 of the boards. One of them writes the eight boards of the locked home screen, and seven of those eight go through its checks.

What the wall has to hold

The design calls the home screen the wall. One screen, no scroll, made of rooms. A room is a box that draws its own data. Most rooms are one area of life, such as train, papers or money, and an area can be turned on or off. Two rooms aren't areas: now, for the moment, and day, for the day.

A room has one of three sizes. The lead is the largest of the area rooms. The band holds the areas with something that waits today, each as a room or as one line. The rest are small. The band has a cap: two rooms and one line at most.

At the foot, a count says how many things need me today: the ones that failed and the ones of today.

And the same wall has to be right at several moments: before a training session, in a session, on a day with no session, in the evening, on a busy morning, on day one, and on the first open of the day. Each moment is a board.

Six assertions

The script has one function, check, with six assertions. Each one is a line that says "this must be true here", and ends the program when it isn't.

What check asserts
It assertsWhat it protects
The board has a link to each area that is onEach area is reached from the wall
The board has a link to + areaAn area that is off can be turned on
Each row of rooms adds up to 12 units of the gridThe layout of the script, 12 to a row
The heights of the rows add up to 614 points at mostThe wall has no scroll
The band has two rooms and one line at mostThe cap
The areas that wait, plus the failed jobs, are the countThe count is the true number

Points are the unit of an iPhone layout. On the board of a Thursday at 05:52 the count is 4: papers and projects as rooms, house as a line, and one upload that failed. On the busy morning it's 6: five areas and the failed upload. Two of the five are over the cap, so they stay small.

When an assertion fails, the error names the board and the reason, like too tall with the height, or the band is over its cap.

Two limits are in the code, and they have to be said out loud. The checks use the sizes that the script declares, not sizes measured on a drawn screen. And no file says where 614 comes from. The tallest board adds up to 608.

The last assertion has the same kind of limit. It compares two values inside the script: the count that a board is given, and the list of areas that wait. The number drawn at the foot is typed in a third place, and the assertion never reads it.

One invented day

A set of boards also has to agree with itself. A review of 16 November, of the earlier home boards, is the source of a list of facts that the boards keep:

  • In most boards, today is Thursday 19 November 2026, week 47, and Thursday is a push day, at 06:10.
  • The week has five sessions, and Monday to Wednesday are logged.
  • Nine things wait: one failed, three today, five soon. Only one of them is late.
  • The count is 4 on that morning at 05:52. The busy morning is the one board of that time with 6.

All of it is invented. The brief says so in a line of its own: no real health numbers, no real names of people, no real addresses.

Three boards of that morning take the week and the sentence of the now room from one place in the scripts: the plain one, the first open and the busy one. The other moments have their own. The script file for those moments says why in its first lines. Each room takes its state for the moment, so that no room keeps the facts of Thursday 05:52.

And then the lint

Every board has a second check, a lint. It's 47 lines of Python that read a file and list what's wrong in it. And no script asserts anything about the boards that are drawn by hand. Only the lint reads them.

Most of what it checks is format. The guide for writing a board has a heading that gives the reason: "The file format (each rule fails silently if you break it)". A wrong board shows no error. It shows a screen with something missing. So the lint hunts mistakes of that kind: an element that isn't closed, a number passed as text, a control that isn't a real button or link. An element is one tag of the file.

Two of its checks are rules of the design system:

two messages of the lint (the second with n = 3)text
literal red; use var(--signal) and only for the one primary action or a failure
3 signal buttons; one at most

The design system has one red. The lint lets it be the one primary action of a board, or a failure. A board with a second red button doesn't pass.

A separate script keeps a map. The design started as a page of 60 entries: 51 ideas and 9 parts that the page calls the spine. The map says which boards show each entry. The script prints the entries that are missing from the map, and the boards that have no entry.

What got through

Three things walked past all of this.

The preview took class, and the canvas didn't. The boards have a local preview, and a canvas where they're published, a shared page for designs. One rule of the format says that a part gets its class, the name of its style, with the attribute class-name. The boards used class. The review notes of 17 November tell the rest: the local preview treated both the same and hid the fault, and on the real canvas class isn't passed.

The notes record the correction: "the preview now follows the real runtime", and all boards use class-name. They record two more faults that only the real canvas showed: scroll bars on every board, and phone boards that were 2 pixels smaller than the frame of the device.

A preview that agrees with everything is a poor reviewer.

That annoyed me.

The rule changed, and the script draws the old one. On the day of the lock, one rule of the wall changed: an area that is off no longer leaves an empty place among the small rooms. The brief says in the same paragraph that the wall boards still show the earlier rule. No assertion covers that rule, so nothing stopped.

An open item about height. The build order, the list of steps from the design to the app, has an item that is open for me. With eight areas on and the worst day ("the session window, two late band rooms and one line"), the + area row is under the screen, against the rule of no scroll.

The boards of the worst day have all eleven areas on, add up to 608 points and pass. The item doesn't say what it was measured on, so the two may count different things. No file says why they differ.

What's not settled

  • The script and the brief differ on one rule, the one about areas that are off. One of them has to move.
  • The map of ideas is written by hand. Its script doesn't read a board. Its list still has the boards of the earlier home options and none of the wall.
  • Seven boards of 65 go through the assertions. In a session, the assertion about the count is skipped, because that board shows no count.

So the script says no to a drawing that's too tall, a band that's over its cap, a count that's wrong. But the + area row of the worst day is still under the screen in the build order, and nothing in the folder says why the boards disagree.

Does the height item worry me? It's too early to say. I don't know yet if it's a real problem. I feel fine about the script.