Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

The lint

Nothing reaches a site until it checks out. The lint reads a content repo the way the site does and says what is wrong, and where to fix it.

iris check --path questions                       # a local checkout
iris check --repo https://project.uhhm.no/uhhm/questions
iris replay --path questions --cases cases.jsonl

What it says reads like this (a machine hire’s, with the long line wrapped), each finding with what to do about it:

OK: 17 question(s), 16 bucket(s) of the site's own and 8 built in, valid
OK: access policy, 140 rule(s), validates
OK: 19 card(s) to act on, 3 only lead to another page (2 to a page with one thing to do), 1 page(s) only lead on
WARN: bucket "deliveries": the move "loaded" -> "cancelled" is declared but no desk,
  link or clock offers it - fix: add `{ from: loaded, to: cancelled, label: ... }` to
  the transitions on /counter/hire/[key], or drop the edge from aggregates.yaml
OK: 13 need(s) structurally met, 0 planned, 0 paused, 0 persona(s)

The third line counts how much of the site only passes a visitor along. A card that leads to another page is no fault in itself; one that leads to a page with a single thing to do could have been that thing, and a page whose every card leads on is a menu to read before anything can be chosen. The lint says the count and fails nothing on it; --leads lists the cards and the pages.

iris is the lint on its own, a small binary in every release (iris in the tarball, portal-x86_64-linux-iris on its own). portal lint, or portal iris, is the same code in the site’s binary. A content repo’s CI downloads the one of its site’s release and runs it:

      - run: |
          curl -sfL "https://project.uhhm.no/uhhm/portal/releases/download/$PORTAL_RELEASE/portal-x86_64-linux-iris" -o iris
          chmod +x iris && ./iris check --path questions

check loads a content repo exactly the way the running site does, validates it (every key is one portal reads, every action lands on a page, every transition is one the state machine allows, every recorded bucket is read back somewhere), and then holds it to the business needs the repo declares in needs.yaml, when it has one:

  • a path of submissions gets each kind of visitor’s answer into the bucket it names, within a submission and required-field budget;
  • the handling group holds a desk over that bucket, and every finished state is reachable through the buttons it (and any also_moved_by group) offers; no record strands on the way;
  • every stage the business named is a state of the machine, and each working stage can follow the one before it;
  • across each bucket, whichever need brought a record in: every state is somewhere a record can get to, no state a record gets to holds it with no way on (before done or after), every declared move is a button, a visitor’s own link or a clock (a move nobody offers warns), no desk is gated to one group on the page and another on its list, and every mail goes out from a state records reach and names only fields the forms collect.

Every finding says what to change and where: the missing { from, to, label } and the desk page it goes on, the group that already has the button, or the edge aggregates.yaml lacks. A schema error no longer hides the needs findings - both are printed, so one round can fix them together.

--findings <out.jsonl> writes the same findings one JSON object per line: id, level (fail/warn), code, scope (need, bucket, alternative, or repo for a schema error), need (the need’s id, the bucket’s name, or the alternative’s id: its page and its place there, counted from 1, as /kitchen#2), subject (the state, the move as from>to, the page, or the feature), message and fix. The file is written empty when the content is clean. id hashes scope, need, code and subject and nothing of the wording, so the same gap keeps its id from one run to the next: a trainer can tell what a round closed, what is still open and what it broke. The codes:

code
schemacontent the site would refuse to load, and an invite with no group on a site with no account to make
need-duplicate, persona-unknown-needneeds.yaml itself
entry-missing, entry-gated, entry-no-responsiblethe page a visitor arrives on
path-missing, path-closed, path-over-budget, path-no-actiongetting the answer recorded
machine-missing, desk-missing, desk-gated-twicewho works the bucket
done-unknown, done-unreachable, success-not-donefinishing a case
stage-unknown, stage-unreachable, stage-orderthe business’s own stages
state-unreached, strand, edge-unofferedevery state and move of the bucket
mail-unreachable, mail-unknown-fieldwhat a state mails
feature-actsa feature with no form or list that gives an order, asks a question or names a button; it should inform (a warning)
invite-no-addressan invite: whose form asks for no email: no invitation can be sent, and only a sign-in that proves the phone number lets the person in (a warning: a site with such a provider is fine)
anchor-missingan in-site link or action: whose # names no card on its page; it still opens the page, at the top (a warning)

A need marked planned warns instead of failing. Exit status is the verdict, so a content repo’s CI is one line.

Beyond the verdict, check exports what a trainer needs to grade the wording: --needs-tasks writes the personas as typed choice tasks (--skim for headings only), --needs-score grades an engine’s answers (several per task, one line per seed, are scored by how they split; a card that takes the visitors of several needs is named as a DRAW), and --needs-sim writes a resolved model of the whole site. iris replay runs simulated cases through the site’s real aggregate engine on a store of its own and reports every bucket by state; --report-only takes the same scorecard from a live site’s buckets. See Training a site for what sits around those.

A map of the site

iris map --path questions [--out map.svg] [--score answers.jsonl]

iris map draws the whole of a site’s work on one page, for the person whose business it is: one SVG, landscape, that prints on A4. It reads a checkout the way iris check --path does (site.yaml, aggregates.yaml and needs.yaml one level above the pages) and draws nothing the content and the lint do not say:

  • one lane per need in needs.yaml: who comes (who), the door they take (the via card on the enters page, and the group they must hold, enters_as), the required fields on the way against max_fields, the bucket it lands in, and that bucket’s states with the moves between them: the buttons on the desks of handled_by and also_moved_by (with their labels), the sender’s own link (dashed) and the clocks (dotted). States are in the need’s stage_words; finished states (done_when) stand last with a double ring, success filled, an envelope on a state that sends mail;
  • the proof, per lane, from the same needs::check the lint runs: a path within budget, a desk for the handler, every finished state reachable, nothing strands. A check that fails shows the lint’s code in red (amber for a planned or paused need), and what the lint did not get to is marked not checked. With --score, the answers file --needs-score reads: how many of the need’s personas picked a right door on every page of their path;
  • roles: every principal the compiled access policy names (anyone, whoever sent a record by their own link, each group), with how many pages it opens, which buckets it sees and moves, and whom it invites. Portal’s own lists are counted, not named;
  • onboarding: every invite: as “group X invites into group Y”, from which desk, and every state that grants: or revokes: a group;
  • a footer with the site’s title, the content commit (and whether the checkout has changes on top of it), the date and the portal release.

The fixed words follow site.yaml’s lang (Languages); every other word is the content’s. A repo with no needs.yaml gets roles and onboarding only. Content the site would refuse is not mapped: the command fails as the lint would.

The same reading, in sentences and with the map on a sheet of its own, is iris manual: a handbook for the people who run the site (see A manual for the people who run the site).

Matching the site

The lint and the site are built from one source and released together, so a shape the site reads is a shape the lint knows. A content repo pins PORTAL_RELEASE to what its site runs and lints with that release’s iris.