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

portal

Write down what your organisation does. Portal runs it as a site.

A machine hire, a housing co-op, a planning office, a club: each is a handful of questions people come with, the forms that answer them, and the stages a case goes through until someone decides. In portal you write that down in YAML, in a Git repo, and the repo is the site.

What you write

A page asks a question. Each answer a visitor can give is an alternative, and what they fill in becomes a record:

# questions/hire.yaml
name: When do you need a machine?
alternatives:
  - name: Book a machine
    record_as: hires
    action: /hire/thanks
    features:
      - name: Free on your days
        resource:
          source: { bucket: machines }
          public: true
        requirements:
          - { name: from, label: First day, type: date }
          - { name: until, label: Last day, type: date }
          - { name: machine, label: The machine, type: record, of: machines }

The stages a record goes through, and what it keeps busy on the way, are one more file, beside a machines bucket of what you hire out:

# aggregates.yaml
aggregates:
  - bucket: hires
    initial: confirmed
    attended_by: the counter
    states:
      confirmed: { event: confirmed, text: Confirmed }
      out: { event: out, text: Out with the customer }
      returned: { event: returned, text: Returned }
    transitions:
      confirmed: [out]
      out: [returned]
    holds: { what: machine, from: from, until: until, while: [confirmed, out] }

That is a booking site:

The list shows only machines free on the days asked for, two people can never book the same machine for the same day, and a machine brought back early is free again at once. The whole site, with a counter desk, a calendar of who has which machine when and a confirmation mail, is in docs/examples/machine-hire. Try it on your own machine in a few minutes.

What you get

  • Forms with the browser’s own fields: dates, times, how long, numbers with units, patterns, checkboxes, files, a place on a map.
  • Records that remember everything: every move is in the record’s log, with who made it and when.
  • Desks: a page for a group (qualifies:) lists the cases waiting for them, and its buttons move them on. “Desk” is only what we call such a page.
  • Nothing waits unseen: a signed-in person’s name in the header says when something waits for them (a question a program asks, a change waiting for their yes) and opens onto the list.
  • Programs ask people: a program beside the site asks the owners, or one person, a question with alternatives to pick between, and gets the answer, secrets sealed for it alone.
  • Lists the way the work looks: rows, cards, a table, a board, a calendar, a map, or a count; live as records change.
  • Mail out, and replies back onto the case they answer.
  • Payments asked for with a state, and the case moving on when the money comes.
  • A conversation per case for the people working on it.
  • Search in plain words: a visitor says what they need and is shown which option is theirs.
  • Access from the content itself: who may open, read and move what is compiled from the pages, and the lint shows it as a table.
  • Owners change their own words: whoever answers for a page says what should read differently, sees exactly what would change, and it is live on their yes. A change to how the work goes is drafted the same way and handed to whoever maintains the site.
  • Programs that help: a scanner at the counter or an automation moves records the way a desk does, only the moves you allow.
  • Cases handed on: a state can read its record through a template and hand it to a program beside the site (a model that sorts, a courier that files), and the answer moves the case, with what was sent and what came back kept beside it.
  • A handbook to hand over: a PDF of how the site works, every need and role, written from the content itself for the board, and one for each group, linked from its invite and its desk.
  • In your language: everything portal says itself, in English, Bokmål, Nynorsk, Swedish, Danish or German.
  • Sealed backups every six hours, to storage you choose.
  • No third parties in the page: scripts, fonts, maps and icons all come from the site itself, so a visitor’s browser talks to nobody else unless your own content links out.

How it runs

One process and one file per site. The process serves the pages, and the file keeps every record, every log and the work waiting to go out, each change written whole or not at all. Mail, payments, search and chat are small programs beside the site; each dials it with a key of its own and does only what that key is named for. Anything else, n8n or a script, talks to it over HTTPS with a token.

Content is checked before it reaches a site: the lint refuses what the site could not serve honestly, and a site loads new content only once all of it checks, keeping the last good content until then.

Writing a site

Try itA site on your own machine in a few minutes: a folder of YAML and one command.
Bringing your people inFrom an empty sign-in to everyone at their own desk.
Content referenceEvery key a content repo may write.
State machinesStages, who moves a case, mail, deadlines, holds, payments.
AccessWho may do what, as the content says it.
StorylinesOne site told several ways, one way per visitor.
MembershipsGroups portal keeps itself: a membership as a case.
MailWhat a site sends, and the replies it keeps.
RoomsA conversation for each case and each group.
The lintWhat a content repo’s CI runs before anything reaches a site.
The handbookThe site’s own manual as a PDF, for the people who run it and for each group.
LanguagesThe six languages portal speaks, and how to add one.

Running a site

OperationsReleasing, deploying, adding a site, the environment, backups.
ArchitectureWhat the engine is made of and where each piece lives.

Building a site from a description

Training a sitebratac plan and bratac build: a business in plain words becomes a content repo.
LearningHow the search box’s model is trained and measured, for whoever retrains it.

Programs in the same family carry their own docs: gdo delivers mail and brings replies back, kron asks for money and says when it came, kino is the chat, a room per group and a thread per case, and varde keeps copies with trusted peers.

Designs not yet built are issues on this repo: a proposal is opened as an issue and closed when it is built, with a note on what differed.

Try it

A site on your own machine in a few minutes: a folder of YAML, one command, a browser. Nothing else to run: no database, no broker, no sign-in server.

1. Get portal

Download the newest portal-v1.…tar.gz from the releases: 1.0.0 or later. A 0.x release has none of what this page uses. Unpack it into a folder of its own:

mkdir portal && tar xzf portal-v1.*.tar.gz -C portal && cd portal

It holds portal, iris (the lint), bratac and learn, the site/ folder portal serves its pages’ scripts and styles from, and a whole example site (examples/).

Or build it from this repo: cargo leptos build --release gives target/release/portal and target/site.

2. Write a site

A folder with a page, a thank-you, and what becomes of what people send, is a site. Make it beside the portal folder:

my-site/
  site.yaml
  aggregates.yaml
  questions/
    index.yaml
    thanks.yaml
# my-site/site.yaml
title: The allotment
# my-site/questions/index.yaml
name: What brings you here?
alternatives:
  - name: Ask for a plot
    description: We have twelve; say what you would grow.
    record_as: requests
    action: /thanks
    features:
      - name: About you
        requirements:
          - { name: name, label: Your name }
          - { name: email, label: Your email, type: email }
          - { name: crops, label: What you would grow, type: textarea }
# my-site/questions/thanks.yaml: where a visitor lands after sending
name: Thank you
followup: true
description: The board reads every request and writes back within a week.
# my-site/aggregates.yaml: the requests, and who answers them
aggregates:
  - bucket: requests
    initial: new
    attended_by: the board
    states:
      new: { event: received, text: New }

Check it the way a site’s CI does:

./iris check --path ../my-site/questions

The lint says what is wrong in plain words, or that it is ready.

3. Run it

From the unpacked release:

CONTENT_DIR=../my-site PORTAL_STORE=../my-site.redb ./portal

Open http://127.0.0.1:3010 (LEPTOS_SITE_ADDR moves it). Every request sent is a record in my-site.redb, with its history; restart, and it is all still there. Change a page and restart to see it.

Or start from a whole site

examples/machine-hire in the release (docs/examples in the repo) is a machine hire: a front door, machines narrowed to the days a visitor asks for, a booking that holds its machine, a confirmation mail with a calendar entry, and a counter desk with a calendar of who has which machine when. Bring its machines in, then run it:

E=examples/machine-hire
PORTAL_STORE=hire.redb ./portal import --path $E/questions $E/import/machines.yaml
CONTENT_DIR=$E PORTAL_STORE=hire.redb ./portal

Book a machine, then try to book it again over the same days.

The hires land on the counter’s desk, /counter, which is for the counter group. There is no sign-in to run here, so give yourself a session in that group:

  1. Stop the site.

  2. Run:

    PORTAL_STORE=hire.redb ./portal session --as Kari --groups counter
    
  3. Start the site again, and paste the line step 2 printed into the browser’s console on the site.

This is for trying a site out: where a sign-in provider is set, portal session refuses, and people sign in.

Where next

  • Give the requests somewhere to go: a desk for the people who answer them, and the stages a request goes through (State machines).
  • Let people sign in: Kanidm or any OpenID provider, and the groups that decide who sees what (Bringing your people in).
  • Mail, payments, search, chat: the programs beside a site (Operations).
  • Put it online: a content repo, a release pinned in its CI, and a host (Operations).
  • Every key a page may use: Content reference.

Bringing your people in

A site is run by a handful of people: whoever answers for each question it asks, and whoever works each desk. This is how they get in, from nobody to everyone signed in at their own desk, without anyone handing out passwords or running an admin tool per person.

The idea in one line: the content says who is involved, and portal lets them in. A page names who is responsible for it, a directory is gated on a group, a desk may invite into groups. Portal reads that and does the rest.

Two ways to sign people in

people sign in withwho keeps the groupsyou set up
A provider you already haveVipps Login, Rauthy, a Kanidm shared with others: any OpenID providerportal itself (Memberships)one sign-in client
A Kanidm of the site’s ownthe Kanidm, with accounts portal makesKanidmKanidm, once (step 2 below)

The first is less to run. The content is the same either way, and which one a site uses is one variable (PEOPLE_BACKEND). The second makes the accounts too: someone with no way to sign in yet gets a one-time link to set a password or a passkey.

What you need

  • A content repo, and a portal instance running it (Operations has adding a site).
  • One of the two above.
  • Mail: mail: { from } in site.yaml, and gdo beside the site, its key named in DHD_KEYS (Operations). Without it people are still let in, but nobody hears about it.

1. Say who is involved, in the content

Four things in the content decide who needs to get in:

contentwhowhat they get
responsible: { name, contact } on a pagethe person answering for that questionthe box at the foot of the page to change it; on Kanidm, an account and a mail saying they are listed as responsible
responsible: { name, contact, group }a group answering for itnothing of its own: the group’s members have the page, and each may suggest changes to it
qualifies: board on a page or _section.yamlmembers of that groupthe pages and desks under it
invite: { group: treasurer } on a desk pagethe desk’s own groupthe right to bring people into treasurer

The desk whose group may invite into the most groups is the site’s most privileged one; for an association that is the board. Portal works that out from the content (see step 4).

2. Set up sign-in

A provider you already have

Make a client at the provider for the site: the authorization_code flow, the scopes openid profile email, and <PUBLIC_URL>/auth/callback as its redirect. Then portal’s environment:

variablevalue
OIDC_ISSUERthe provider’s issuer, exactly as its discovery document says it
OAUTH2_CLIENT_ID, OAUTH2_CLIENT_SECRETthe client
PEOPLE_BACKENDmemberships
OIDC_EXTRA_SCOPESphoneNumber for Vipps, so a person is known by their number

That is all: whoever can sign in with the provider can sign in to the site, and what they see comes from the places portal keeps for them.

A Kanidm of the site’s own

Group names below are exactly the ones the content uses, with no prefix; that is only safe when the Kanidm serves this site alone. Portal needs four things from it, set up once as idm_admin:

K="kanidm -D idm_admin -H https://id.example.no"

# An onboarding account: may create people and issue a first password
# link, nothing more. pii_read lets an invite find someone who already
# has an account by their email instead of making a second one.
$K service-account create portal-onboarding "Portal onboarding" idm_admin
$K group add-members idm_people_on_boarding portal-onboarding
$K group add-members idm_people_pii_read portal-onboarding

# One group per `qualifies:` in the content, managed by that account:
# adding a member to a group takes the right to manage it.
for g in board treasurer traffic; do
  $K group create "$g" portal-onboarding
done

# The sign-in client. Everyone in this Kanidm may sign in; what they
# see comes from their groups, in the `groups` claim.
$K system oauth2 create portal "My site" https://site.example.no
$K system oauth2 add-redirect-url portal https://site.example.no/auth/callback
$K system oauth2 update-scope-map portal idm_all_persons openid profile email
for g in board treasurer traffic; do
  $K system oauth2 update-claim-map portal groups "$g" "$g"
done
$K system oauth2 update-claim-map-join portal groups array

# The onboarding token, read-write, shown once: into portal's env.
$K service-account api-token generate portal-onboarding portal --readwrite

Then portal’s environment:

variablevalue
KANIDM_URLhttps://id.example.no
OAUTH2_CLIENT_ID, OAUTH2_CLIENT_SECRETthe client above (show-basic-secret)
KANIDM_API_TOKENthe onboarding token

3. Name the first person

Someone has to be first: every later person is invited from a desk, and before anyone is in, there is no desk anyone can open.

variablevalue
SEED_ADMIN_EMAILthe first person’s address (or SEED_ADMIN_PHONE, their number, with a provider that verifies numbers)
SEED_ADMIN_NAMEtheir name, as it should appear (optional)
SEED_GROUPa group to put them in, if not the most privileged one (optional)
RESPONSIBLE_GROUPa group every responsible person joins, e.g. editors (optional)

4. Start portal

At start, portal:

  1. Invites the first person into SEED_GROUP, or the most privileged group, and mails them: the one-time link on Kanidm, the way to sign in otherwise. Once: it is remembered in the portal_seed bucket, so restarts and upgrades never send a second link.
  2. On Kanidm, makes an account for everyone named responsible who has none, and mails them that they are listed as responsible for asking those questions, with their link. With RESPONSIBLE_GROUP they all join it; someone who already had an account is added without a mail. On memberships they get a place in RESPONSIBLE_GROUP, where one is named.

The two run side by side. Kanidm may still be starting beside portal, so each is tried again a minute apart, up to twenty times. The log says what happened, per person.

The second happens again whenever the content changes, so a new page naming a new person sets them up without a restart. And it works both ways: someone the content has stopped naming leaves RESPONSIBLE_GROUP in the same pass, and with it whatever else that group opens. Only if portal is who put them there - a person who was in the group before is left in it - and their account stays, since it is theirs.

5. The rest come in from the desks

From here nobody sets anyone up by hand:

  • At a desk, whoever may invite fills in a name and an address. Portal holds them a place in the group and mails them: a one-time link on Kanidm, the way to sign in otherwise.
  • A decision can be the invitation. A state with grants: group in aggregates.yaml puts the person a case is about into that group when the case arrives there - an approved committee application that is the membership.
  • A new page with a new responsible person gets them an account when the page goes live.

An invite that nobody used

A link lives a day. On a site with Kanidm as the people backend every invite - a desk’s, and the ones portal made at start for someone new - is a case in portal_invites, and keeps itself current. (On memberships a desk’s invite into a group is a place, its case in portal_memberships; only the ones made at start and an invite with no group are here. See Memberships.)

statemeanshow it gets there
openthe link is waitingthe invite was sent, or sent again
donethe person is inthey signed in to the site; or a desk says so
expiredthe link ran out unuseda sweep, every ten minutes

A desk that lists the bucket offers the way back with a transition from expired to open. Pressing it makes a fresh link and mails it, unless they have found a way to sign in meanwhile. Inviting again someone whose account, by address, has nothing to sign in with does the same, and that link is in the mail only, not on the record, since the account may already hold places:

resource:
  source: { bucket: portal_invites }
  requires_group: board
  transitions:
    - { from: open, to: done, label: Is in }
    - { from: expired, to: open, label: Send again }
    - { from: expired, to: done, label: Is in }

6. What the people who ask the questions can do

Signed in, a person a page names as responsible sees a card at the foot of their own pages to suggest a change. The server checks it is really them.

On an instance that may change the content repo (EDIT_GITEA_TOKEN), the card is a conversation: they say what should read differently, see exactly what would change, and it is live on their yes. A change to how the work goes, beyond the words on their page, is drafted the same way and handed to whoever maintains the site (Training).

Without it, the card is a plain form: the suggestion is mailed to the site’s inbox with them as reply-to, so answering it answers them.

It is also a case, in the built-in portal_edit_suggestions bucket, so it does not depend on somebody reading that inbox. Give a desk the list, and whoever sits there takes it up and settles it:

resource:
  source: { bucket: portal_edit_suggestions }
  requires_group: board
  transitions:
    - { from: open, to: discussed, label: Looking at it }
    - { from: open, to: done, label: Changed }
    - { from: open, to: declined, label: Will not change }
    - { from: discussed, to: done, label: Changed }
    - { from: discussed, to: declined, label: Will not change }

The person who suggested it is mailed at each move, in the site’s language, and the card on their page lists what they have sent and where each one stands. A content repo that declares the bucket itself in aggregates.yaml, with a mail: on a state, sends that instead.

A group can be the way into other tools too: a second OAuth2 client in Kanidm, scoped to the group alone, lets its members sign in to a Gitea (say) with the same account.

When it does not work

what you seewhy
an invite fails with 404 adding to a groupthe group is not managed by portal-onboarding: group set-entry-manager <group> portal-onboarding
Item not found setting the login page’s name or logothose are system settings only admin may change, not idm_admin - or the CLI and server versions differ
accounts are made but nobody is mailedsite.yaml has no mail.from, or gdo is not running beside the site with its key in DHD_KEYS
someone responsible never got a mailthey can already sign in (they are only added to RESPONSIBLE_GROUP), or their contact is not an email address
someone invited again got no linkthey have something to sign in with, or their address is not on the account that has the name: only an account found by its address, with nothing to sign in with, gets a new link
“send again” is not on the deskthe list has no { from: expired, to: open } transition, or the content declares portal_invites itself without an expired state
someone left a page and is still in RESPONSIBLE_GROUPthey were in the group before portal added them, so it is not portal’s to undo
the first person was invited twiceit cannot be, per address and group; changing SEED_ADMIN_EMAIL or SEED_GROUP invites the new pair

Content reference

A content repo is the site. This is everything it may say.

site.yaml                 branding, language, mail, the search box
aggregates.yaml           the state machine of every bucket
needs.yaml                what the site is for (read by iris, never by portal)
questions/
  index.yaml              the front page, served at /
  about.yaml              served at /about
  review/
    _section.yaml         applies to everything under /review
    index.yaml            served at /review
    [record].yaml         serves /review/<anything>

Nothing here is required except a questions/ tree with something in it. Portal’s lint refuses content it cannot serve honestly: in CI (iris check), as the site starts, and at every Load.

What a visitor sees, and the YAML that makes it:

on the pagein the YAML
a pagea file under questions/ (a question)
a card on itan entry of alternatives:
a part of a card: an icon, a heading, a linean entry of features:
a fieldan entry of requirements:
a list of recordsresource: on a feature
a desk: our name for a page a group opens to work its casesa page with qualifies: whose list over a bucket has transitions:
what a form sendsa record, kept in a bucket (record_as:)
the stages a record goes throughthe bucket’s states: and transitions: in aggregates.yaml

The lint names things the same way: “card 1 › feature 3 › field 4”.

site.yaml

title: Vestmark kommune          # the browser title and the header
wordmark: /site/logo.svg         # an image instead of the title
wordmark_ink: true               # a one-colour SVG mark drawn in the page's own ink
wordmark_invert: true            # flip it in dark mode
wordmark_height: 2.4             # rem
lang: no                         # portal's own words: en, nb (or no), nn, sv, da, de
stylesheet: theme.css            # a file in the repo, served at /site/theme.css
favicon: icon.svg                # likewise: .svg, .png or .ico
hero: { kind: module, module: hero.js }   # or { kind: plain }, or { kind: map }
mail:
  from: Vestmark kommune <post@vestmark.example>
  reply_to: post@vestmark.example
  invite: { subject: "...", body: "..." }   # rewords the built-in invite mail
search: { pages: [/] }           # a search box above the options; see below
nav: bar                         # the way round the site in the header, by who the cards are for; or foot. See below
player: { streams: [{ name: Radio, url: /live.opus }] }   # a bar on every page for the site's stream and its audio files; see below
mfa_groups: [board, treasurer]   # these count only after a strong sign-in; see operations, "Groups that need a strong sign-in"
account_url: https://id.example.no/account   # where a person adds a passkey; Rauthy's own page when unset
editor: { repo_cards: true }     # the rich-text editor's "Repo" button and pasted repo links as cards, for the content's own Gitea; off unless set
timezone: Europe/Oslo            # what a time typed in a form is in, for calendars; the default (CET/WET/EET zones or UTC)
addresses: kartverket             # who suggests addresses in a `type: address` field: kartverket or off. Left out: kartverket for nb/nn, nobody otherwise
programs:                        # programs beside the site that move records; see below
  scanner:
    moves: [{ bucket: hires, from: out, to: returned }]

mail.from is required as soon as any state declares a mail.

A date (2026-10-06) or a date and time (2026-10-06T15:00) in a record reads in the site’s language wherever portal shows it: in a list’s or a desk’s row and in a state mail’s {field}, “tirsdag 6. oktober 2026”, “tirsdag 6. oktober kl. 15:00” (“Tuesday 6 October at 15:00” in English). A time with an offset, or anything else, is shown as it was written. A calendar (.ics) gives a time typed in a form in timezone (TZID=Europe/Oslo, with the zone’s rules for the Central European zones), and one with an offset in UTC.

Any text a person reads (name, description, label, placeholder, a mail’s subject and body, consequence, encouragements) may be a list instead of one string: one entry per storyline, all lists the same length.

A map of the site’s places

hero: { kind: map } makes the front page’s header a map with a pin for every place the site’s pages are about: quick ways in for a site whose pages are somewhere (a river path, a playground, a yard).

# site.yaml
hero: { kind: map }

# questions/riverpath.yaml: a page that says where it is
name: Where does the river path go?
place: { lat: 59.6631, lon: 11.0084, zoom: 15, name: The river path }
  • Which pages. Every first-level page (/riverpath, not /groups/path) with a place:. Or the ones the site names, at any depth and in that order: hero: { kind: map, pages: [/riverpath, /groups/playground] }.

  • Records too. resource: puts a bucket’s records on the map, beside the pages or alone. It is a list as any other: who may read it (public: true or requires_group:), states:, where: and limit: mean what they mean on a feature.

    hero:
      kind: map
      resource:
        source: { bucket: playgrounds }
        public: true
        states: [open]
        title: name              # the field a pin is named by
        to: /playgrounds         # the page a pin opens; /playgrounds/{id} for a page each
    

    A record’s pin stands at the first place its answers hold (a type: location, or a type: address that was found); a record that says nowhere has none. Without to: a pin is a name on the map. The newest come first, which is what limit: keeps.

  • A pin is a link to its page, named by the place’s name, else by the page’s question. A place of several pins (points:) has a pin at each, named by the point’s own name where it has one. An area or a path has its pin in the middle of its points. The map fits them all; one pin alone opens at its place’s own zoom.

  • Names that would overlap. Where two pins’ names would lie over one another, one is shown: a record’s before a page’s, and otherwise the earlier pin’s. The others show under the pointer or the keyboard’s focus, and on a touch screen at the first touch of their pin, the second opening its page. A name comes back as soon as the map is moved or zoomed to where there is room for it.

  • Who sees what. A page the visitor may not open has no pin.

  • Room around the pins. The map fills its box, and the pins keep the box’s padding from its edges: .hero-map { padding: 8rem 3rem 6rem; } in the site’s stylesheet: for a header that lies over the top of the map, with a media query for narrow screens if it wants another there. .hero-map .maplibregl-ctrl-top-right { display: none; } takes the zoom buttons away.

  • Under the map the same places stand as links, for a keyboard, a screen reader, and an instance with no map tiles (MAPBOX_TOKEN unset), where the links are all there is.

The lint refuses a map with no place to show, a page named in pages that is not there or has no place:, and a resource: whose bucket no form asks a place for, that nobody may read, or whose to: is no page.

A marker on any map portal draws in the browser (this one, a shows: map list, the pin of a type: location field) is in the site’s --accent, so a site’s stylesheet: that sets its palette has set its maps too. The map under them is the instance’s (MAPBOX_STYLE, operations).

A hero module

hero: { kind: module, module: hero.js } lets a JavaScript module the repo ships (served at /site/hero.js) draw the front page’s header. It exports mount(container), returning a handle with stop(), which portal calls when the page is left, and optionally ready, a promise for the first frame where that takes a while. Portal mounts it as the HTML is parsed and again on every return to the front page.

Between pages the header’s words and the drawing move separately (view-transition-name: hero-copy and hero-piece): the words glide to their new place while the drawing slides with the page, and the new page shows once the drawing is ready, so nothing pops in late. The drawing holds --hero-piece-height (55svh) until it draws; set that on .hero-module to size it, or give .hero a min-height to keep the same room on every page.

A visitor who does not want to read every card can say what they need in their own words, and is shown which option is theirs.

search:
  pages: [/, /apply]                  # where the box shows; [/] when left out
  label: Say what you need            # optional; a list is one per storyline
  placeholder: For example, the roof leaks when it rains   # optional
  model: route                        # optional; a model's name beside learn

search: with nothing under it is the box on the front door, in the interface’s own words in the site’s lang. No search: at all is no box anywhere, which is how every site reads until it adds one.

A visitor writes a few words and presses Enter. When the model is sure, the card that fits gets a strong ring, the page scrolls to it, and the box says This looks like yours: Roof repairs. When it is not, the nearest gets a faint ring and Closest match: Roof repairs. Pick the one that fits best., with a Show it button. Only cards a visitor can act on are marked; nothing is reordered or hidden, and typing again clears the ring. The words answer this visitor and are never kept (see Learning).

Content asks for a box; the instance draws it only while its learn answers (Operations), as a site without a map token draws no maps. If learn stops answering, the box is gone from the next page until it is back.

One box for the whole site

search:
  scope: site                         # page (the default, as above) | site
  placeholder: What do you need?      # optional; label too, as above

With scope: site the box sits in every page’s header and ranks every card on the site this visitor may act on: pages they can open directly, and a group’s pages only for its members, so someone signed out is never sent to a desk. pages: is refused beside it.

Enter goes to the nearest card, on this page or another. The nearest three stay listed under the box, and Enter again goes to the next; Escape closes the list. Across a whole site the right card is first less often than on one page, but in the top three about as often, which is why it lists three.

Refused at load, at every reload and by the lint: a listed page that does not exist, a page that serves many URLs ([record].yaml), a page that offers fewer than two options to most visitors (a card that only describes, one shown as not open yet, and one only a link shows do not count), an empty pages, any key the block does not know, a model that is a path rather than a name (a path on one host is that instance’s LEARN_MODEL), and search_ready, which only the instance may say. A site’s own stylesheet: can restyle the box (.search-box) and the rings (.search-match, .search-closest).

The way round the site

nav: bar      # a row in the header, by who the cards are for
nav: foot     # the lists of other pages at the foot of each page, alone

nav: bar puts, on the wordmark’s line after the mark, one tab for each name the site’s cards are for (for:). A tab opens onto its cards wherever on the site they are, each page’s under the question it asks, and a click lands on the card on its page. On a narrow screen the tabs take a line of their own. A group’s tab carries the group’s label, the same its room has; a word for people is the tab as it is written. Read across, the row says who the site is for, and each tab what they do here.

Any tab is anyone’s to open, signed in or not: the bar is a way of looking at the site, and the pages stay as they are for everyone. A card kept from the person looking is listed with the line it carries on its page (“For Artists”, “Opens after Newcomers”).

What is everyone’s has no tab, so the top of a page stays light. A card that says nothing of who it is for, on a page anyone opens, is reached from its page, and the foot of every page goes on listing those pages (“Also worth asking”). A group’s own pages (qualifies) move from the foot into the group’s tab: their cards, the ones that say nothing included, and a page with no card to go to by its question. They are told of to that group alone; to anyone else only a card there that says who it is for.

nav: foot draws no bar and keeps both lists at the foot, as every site had them; a site may use for: and stay on the foot. Left out, a site whose cards say who they are for has the bar, and any other site the foot.

The bar is <nav class="roles">, each tab a <details class="role">, so it opens without a script and a stylesheet: can restyle or hide it.

A player

A site with something to listen to gets one bar along the bottom of every page: its stream, and any audio file a page shows.

player:
  streams:
    - name: Radio                 # what the bar calls it
      url: /live.opus             # where the sound is, a path on this site
      now: /now.json              # optional: what is playing, and whether anything is

The bar plays one sound at a time, and keeps playing while the visitor moves through the site. The first stream is the one it offers; with several, the visitor picks.

An audio file in a list or on a record (a type: file field holding an .mp3, .flac, .wav, .ogg, .opus, .m4a, .aac or .weba) gets a Play button beside its name. Playing a file pauses the stream; when the file ends, or is stopped, the stream comes back if it was playing. Back to Radio in the bar does the same at once.

now answers JSON: { "on_air": true, "title": "…", "by": "…" }, asked every fifteen seconds. The bar shows the title and who it is by beside the stream’s name, and with on_air: false says the stream is off the air and offers nothing to play. A stream with no now is shown by its name alone and taken to be on the air.

Both addresses are paths on this site (/live.opus), since a page plays sound from its own address only: whatever serves the stream is routed under the site’s own name by the host. Refused at load and by the lint: no stream, a stream with no name, an address on another host, and any key the block does not know. A site’s own stylesheet: can restyle the bar (.site-player-bar, its data-state one of ready, stream, file, off) and the buttons (.answer-play).

A question

One YAML file is one page.

id: /apply              # defaults to the file's path
name: Apply to build
description: What we need from you.
qualifies: case_officers        # a Kanidm group may open this page
requires_chain: /start          # or: an answer they must already have given
followup: true                  # keep it out of the nav until earned
responsible: { name: Solveig, contact: post@vestmark.example }
# or a group's: no account is made for the inbox, and any signed-in
# member of the group may suggest a change to the page
responsible: { name: The board, contact: board@vestmark.example, group: board }
# and the page's own words above its suggest-a-change form
responsible:
  name: The board
  contact: board@vestmark.example
  group: board
  suggest: Only the annual meeting can change the bylaws. Say what you would change, and the board helps you word it.
# a locked page takes no suggested changes, from anyone, whoever answers
# for it: no form is drawn and the server refuses one. In a directory's
# _section.yaml it locks every page under it; `locked: false` on a page
# opens that one. A locked page is changed in the content repo
locked: true
event:                          # this page announces an occasion
  starts: 2026-10-14T18:00
  duration: 2h
  place: The town hall
place:                          # this page is about somewhere
  lat: 59.8938
  lon: 11.0332
  zoom: 15
  name: The town hall
alternatives: [ ... ]

qualifies, requires_chain and responsible are inherited from the nearest _section.yaml.

The person responsible names, signed in, finds “Suggest a change to this page” at its foot. Where the instance has a token for the content repo (EDIT_GITEA_TOKEN) that is a conversation: a model asks until the change is clear, a larger one drafts it as edits to this repo, and the read-back shows what would change, who would gain or lose access, which links would stop landing, and the map before and after. On their yes the change is checked, committed in their name on a branch, and merged once this repo’s own check passes; “Undo my last change” turns it round the same way. Without the token it is a plain form whose words become a case for whoever keeps the site (see Training). The form opens with the interface’s own line, You are listed as responsible for this question…; responsible.suggest puts the page’s own in its place (and above the conversation, which has none of its own), for a page a change to which means something else: bylaws that only an annual meeting may change, a text someone else wrote. A list is one per storyline. event makes a page an occasion with a time; place makes it a place, drawing its maps under the question and opening any type: location field on the page at its first point rather than on the whole world. One point is place: { lat, lon, zoom, name }; several are points: with a type:

place:
  type: path                 # pins (the default), area or path
  name: The river path
  follow: walking            # a path only: along the ways, as Mapbox's directions go
  points:                    # at most 25
    - { lat: 59.6631, lon: 11.0084, name: The pump house }
    - { lat: 59.6662, lon: 11.0101, zoom: 16 }

Pins are a map per point, each a slide in a strip the visitor swipes, one pin as much as several, named by the point’s name or the place’s. An area (three points or more) is one map with the points as its outline, shaded; a path (two or more) one map with a line through them in order. Both are framed to fit. follow: walking, cycling or driving draws the path along the ways instead of in straight lines, asking Mapbox’s directions once per route and keeping the answer. A page with a slideshow too has the map as the strip’s first slide instead, the strip’s full width, with the pictures after it.

The foot of a page

Every page ends the same way, whatever shape it has: a question, a gate, or the nothing-here a wrong address gets.

The question nav lists where else the visitor may go, in up to two lines. “Also worth asking” holds the pages open to anyone. “For your group” holds the ones they see because of a group they hold, the pages that qualifies for it; when one group applies the line names it by its label, the same label the group’s room has (“For Board”). A signed-out visitor only ever has the first line, and a line with nothing on it is not drawn. On a site with the bar in its header (nav:) a group’s pages are under its tab there, and the foot keeps the first line, the way back and a group’s handbook.

Under the nav, on a site with sign-in (OIDC_ISSUER or KANIDM_URL), comes a quiet last line in <footer class="session-foot">. Signed out it is a link to sign in that comes back to the same place: “Log in for questions your role can answer”. Signed in it says who is here and offers the way out: “Signed in as Kari · Log out”. A site without sign-in has no such line. It is a spare to the header’s .session nav, with a class of its own, so a stylesheet: that hides .session keeps this way in. A site that wants neither hides .session-foot as well.

Pictures across the page

slideshow lays a strip of pictures under the question, the full width of the screen: every picture as tall as the strip and as wide as its own shape, swiped or arrowed through, its caption over its foot.

slideshow:
  max_height: 60               # svh; 60 unless set, between 20 and 100
  slides:
    - image: images/built/01.webp     # a path in the content repo, or https://
      caption: The canteen at the theatre, renewed
      width: 3207                     # the picture's own size, optional:
      height: 1400                    # holds its place before it has loaded

Pictures in the content repo are served from this origin under /site/; webp, avif and jpeg may be kept by the browser for an hour. Keep them web-sized: around 1400 pixels tall is plenty.

Programs that move records

A barcode scanner at the counter, a script, n8n: a program beside the site can move a record the way a desk button does. site.yaml names it and the moves it may make:

programs:
  scanner:
    moves:
      - { bucket: hires, from: out, to: returned }   # scanned back in

The instance gives the program’s key that name (DHD_KEYS=<key>=scanner, or a token in DHD_TOKENS for one over HTTPS; see operations, “Programs that dial the site”). The program then sends a Move on a record, and the site makes it as it makes a desk’s: the same states, the state’s mail, the same row for the automations, the log saying scanner moved it. It may make only the moves listed, from where the record is now, and a move decided on a record that has moved since is refused. A move carries no fields.

Refused at load, at every reload and by the lint: a move aggregates.yaml does not declare, a bucket with no states, a program with no moves, a name that is not lowercase letters, digits and -, and a name a key is already named for (mail, payments, note, may, watch, submit, credentials, asks, answers, rooms, rank, load, read).

Files at the site root

A repo’s .well-known/ directory is served at the root of the site, at the same paths it has in the repo:

.well-known/security.txt      -> https://<site>/.well-known/security.txt
.well-known/assetlinks.json   -> https://<site>/.well-known/assetlinks.json
.well-known/matrix/server     -> https://<site>/.well-known/matrix/server

This is the one part of the URL space a repo may write into directly. RFC 8615 reserves /.well-known/, and a question’s id comes from a file name under questions/, which cannot begin with a dot - so nothing shipped here can shadow a page. A path that is not in the repo answers 404, not the app shell, so a program looking for one of these can tell a missing file from a present one.

A file with no extension is served as JSON, which is what the extensionless well-known files are. .txt, .xml, .webmanifest and .mobileconfig are typed as themselves; the last matters because iOS only offers to install a configuration profile that arrives as application/x-apple-aspen-config.

Paths a reverse proxy claims in front of portal never reach the repo - mail autoconfiguration (/.well-known/autoconfig/) and the CalDAV and CardDAV redirects are usually handed to a mail server that generates them.

A configuration profile

An iPhone can’t find a mail server’s settings by itself, and an account added by hand often fails as if the password were wrong. A configuration profile states the hosts and ports, and sets up mail, calendars and contacts in one install. Portal serves one at /profile.mobileconfig when site.yaml says where its values come from:

profile:
  pacc: https://mail.example.no/.well-known/user-agent-configuration.json
  name: Example            # what the accounts are called on the device
  organization: Example AS # the profile's publisher, defaults to name

pacc is the mail server’s PACC document (Stalwart serves one). Every host, port and path comes from it, so the profile follows the server; where it gives no port, the standard TLS one is used (993, 465, 443). The profile holds no address or username, since iOS asks for those at install, so one file serves everyone. Reinstalling replaces the accounts rather than adding a second set.

The profile is unsigned, so iOS calls it Unverified but installs it. A PACC document iOS can’t use (JMAP only, or no outgoing server) is an error, not a half-empty profile. Without profile:, the address is a 404.

An alternative

One choice. Never two actions behind one heading: if two things can be done, they are two alternatives.

alternatives:
  - name: Send the drawings
    description: We answer within twelve weeks.
    action: /sent                  # the page to go to; /shape/{field} templates
    record_as: applications        # the bucket the answer lands in
    disabled: false
    consequence: [What happens next]
    encouragements: [It takes two minutes]
    images: [/site/drawing.png]
    features: [ ... ]

Three things an alternative may do instead of, or beside, recording an answer:

    self_transition:               # the person moves their own record
      bucket: applications
      to: complete
      from: [open, incomplete]     # defaults to the initial state alone
      label: Send them
    invite: { group: case_officers }   # bring someone into a group
    # or with words of its own, using any field of the form:
    # invite:
    #   group: guests
    #   mail: { subject: "...", body: "... {arrival} ... {link} ..." }
    # or with no group: the account and the one-time link, and no more
    # invite: {}

An alternative may instead hold a conversation (see Training):

  - name: Get something built
    anchor: project                # for links: an interview has no action
    description: Tell us about your business ...
    interview: { model: qwen3:8b, lang: en }   # both optional

A model asks the visitor about their business one question at a time, reads back what it understood, and on their yes the brief is queued for the kit. interview: alone is the instance’s model in the site’s lang. It is the card’s one action: no form fields, no record_as, action, self_transition or invite beside it; features that inform are welcome. model is a name (letters, digits and . _ : / -), never a path or a command, and lang a code such as en or nb; both are refused at load otherwise.

self_transition.from is what keeps a person in dialogue with their case: an applicant written to for a missing drawing answers from incomplete, and may withdraw from wherever the case has got to. Omitted, it is the initial state alone, which is what a one-shot unsubscribe link means. Each state listed becomes its own access rule, and the lint refuses a from -> to the state machine does not declare.

An invite needs a required name and email (or, with a group, phone) on the same alternative, sits on a page gated by qualifies, and the inviting group must be allowed to invite that group by the policy.

With no group (invite: {}, or only mail:), the invite makes the account, sends the mail with the one-time link, and joins no group. Someone who has an account already keeps it and is told to sign in. Its own mail, if any, must name {link} and cannot name {group}. It needs a Kanidm to make the account: on a site on memberships with no Kanidm beside it, it cannot mean anything, and the lint refuses it (see Memberships).

Every card has an id, so a link can land on it: uhhm.no’s front door has /#project, /#subscribed, /#applied and /#joined. The id is anchor: when the alternative sets one (lowercase letters, digits and single dashes, its own on the page); else the last segment of its action: when that is a plain site path no other card on the page also ends in (/board/case gives case; /, [record], {field}, a query or a # do not count); else its heading, lowercased with æ, ø, å as ae, o, a and dashes between the words. A later card with an id already taken gets -2, -3. Set anchor: where links point at a card whose action or heading may change. The lint refuses a bad or repeated anchor: and warns on an in-site link or action: whose # names no card on its page.

An action: may land on a card the same way: action: /#join is the front door, at the card join; action: board#case a card on the sibling page board; action: "#case" a card on the page itself. The page must be there, as for any action; the card is the warning above.

Who a card is for

for: says who a card is for, in one name or a list:

  - name: Put a mix in rotation
    for: artists                   # a sign-in group: the card is theirs
  - name: Go on air
    for: !newcomers                # everyone signed in outside that group
  - name: Plan the week
    for: [hosts, artists, "!newcomers"]
  - name: Send a message
    for: Listeners                 # a word for people: it guards nothing

A group’s id (lowercase letters, digits and underscores, as groups are written everywhere else) makes the card that group’s. Everyone who opens the page sees the card, its description and what it takes. Its members get the form, the lists and the button; everyone else reads “For artists” where the button would be. The server holds the same line: a form of the card, a file for it, its conversation and its lists are taken from, and shown to, the card’s groups alone, and the search box offers the card to them alone. On a page that is itself a group’s (qualifies), a card for another group takes both.

! before a group turns it round, the way a systemd condition is turned round: the card is for everyone signed in who is outside that group. Groups without ! are any one of them; every group with ! holds as well. A card that names only ! groups takes signing in, since what someone is outside is only known of someone known. To a member of such a group the card reads “Opens after newcomers”. A state’s revokes: is how someone leaves a group (see State machines).

YAML reads a bare !newcomers as a tag, and portal reads that tag as the name it looks like. Alone and in a - list it takes no quotes; inside [ ], write "!newcomers".

Use ! to steer people along and a group to lock. Wherever portal cannot tell what someone is in, a card for a group stays closed and a card kept from a group opens. The lint refuses ! on a group in mfa_groups for that reason: held back from a sign-in that was not strong, the group is one its members then seem to be outside.

Any other word (“Listeners”, “Venues and promoters”) is a word for the people the card is for, and guards nothing. The lint refuses a word that is a group’s name but for its spelling (for: Artists where artists is a group), which would read as closed and be open.

A feature

What an alternative offers, explained. A feature that is only layout is a feature wasted: each one says something true about the choice.

    features:
      - name: What you need
        description: The case number from the letter.
        icon: lucide:file-text     # an Iconify icon, prefix:name
        color: "#8ec2c0"
        requirements: [ ... ]      # form fields; beside a resource, what narrows it
        resource: { ... }          # live data

icon names an Iconify icon as prefix:name, such as lucide:file-text or mdi:home: lowercase letters, digits and hyphens on either side of the colon. The site fetches it from Iconify once, keeps it, and serves it itself at /icons/<prefix>/<name>.svg, so a visitor’s browser asks no one else; it is painted in the feature’s colour. A name without a prefix, or one the set does not have, shows nothing.

A feature with no form and no list informs; the button acts. It says what is so about the choice: what it costs, how long it takes, who it is not for, what to have ready. “Most kitchens take three to five weeks” informs. “Bring the last two energy bills”, “Is this for you?” and “Press Send below” act, and the lint warns on each, naming the alternative as its page and its place there (/kitchen#2). A plan’s facts become features of this kind, word for word, and bratac build refuses a fact that acts.

A requirement (a form field)

        requirements:
          - name: email            # snake_case; this is the stored key
            label: Your email
            placeholder: you@example.no
            type: email
            optional: false
            value: "{key}"         # a preset; a dynamic page's segment fills it
          - { name: from, label: First day, type: date, min: today, max: today+365 }
          - { name: weight, label: Weight, type: number, min: 0, step: 0.5, unit: kg }
          - { name: postcode, label: Postcode, inputmode: numeric, pattern: "[0-9]{4}", pattern_says: Four digits }
          - { name: story, label: Tell us, type: textarea, rows: 8, maxlength: 2000 }
          - { name: agree, label: I accept the terms, type: checkbox }
          - { name: name, label: Your name, autocomplete: name }

Each attribute is held twice: the browser stops at it, and the server refuses an answer that breaks it as it refuses one of the wrong kind.

attributeonwhat it does
min, maxnumber, range, moneythe least and the most. A place’s count says min: 1 and max: its at_most, so nobody signs up minus one guest
min, maxdate, datetime-localthe first and last day: 2026-12-01, today, today+365, today-7. A booking says min: today
min, maxtimethe earliest and latest time of day: "17:00"
stepnumber, rangethe steps a value goes in, counted from min
unitnumber, range, moneywhat it is counted in, beside the field and with its name in a list (“Weight (kg)”)
unitsdurationthe units offered, of minutes, hours, days, weeks, months, years; [days] unless said
from, countcollectionthe browser’s list it sends, and whether each line has a count (max is then the most of one thing)
minlength, maxlengthtext, textareathe fewest and most characters
pattern, pattern_saystext, tel, email, url, searchthe shape of the whole answer as a regular expression, and the words the person is told when theirs does not have it. Always both
inputmodeany typed fieldthe keyboard a phone offers: numeric, decimal, tel, email, url, search, text, none
autocompleteany typed fieldwhat the browser may fill it from: name, email, tel, street-address, postal-code, organization, bday, off and the rest of HTML’s list. Left out, an email is email, a tel is tel and a field named name is name
rowstextareahow many lines tall

The lint refuses an attribute on a type it means nothing for, a min above its max, a pattern that is not a regular expression or comes without pattern_says, and a type portal does not draw.

value: "{user.email}" or "{user.name}" is the signed-in person’s own, and a field it fills is carried rather than asked: someone the site knows is not asked who they are. A visitor gets the field, empty.

profile: starts a field from what the person’s provider says of them and leaves it asked, so it can be put right: profile: phone_number, street_address, postal_code, locality, country, birthdate, given_name, family_name, name or email, OIDC’s standard claims. Sign-in asks the provider for the scope a claim needs (phone, address) only where its discovery lists the scope, so a provider that lacks one is never refused a sign-in for it; the field is then empty, as it is for a visitor. A value the content gives wins over profile.

profile_save: true beside it saves what is given on the person’s account too, where what makes the accounts keeps it (Rauthy: the names, the phone number, the address and the birth date); the field says so (“saved on your account”). Signed in only, after the answer is filed, and never email or name, which are who the account is.

type is one of:

typewhat it is
textthe default: one line
textareaseveral lines
email, tel, url, searchone line, checked as the browser checks it
number, rangea number; a range is a slider
moneya number of whole kroner, none below zero: what a state’s payment: { amount: { field } } reads
date, datetime-local, time, month, weeka day, a day and a time, a time of day, a month, a week
durationa length of time, as a count and a unit; kept as ISO 8601 (P7D) and said in the site’s language (“7 days”). units: [days, weeks] says what may be picked between, days alone unless said. What a hold runs for (State machines)
colora colour, as #rrggbb
checkboxone tick, stored as true or false. Not optional, it must be ticked (the terms accepted). A list shows it as yes or no
selectone choice, or multiple: true for any number
filean upload, with accept:. With roll: true, several, picked or shot, put in order before sending (A roll)
prosekita rich-text editor. Holds HTML, cleaned against one allow-list when it is written and when it is shown: paragraphs, headings, lists, emphasis, and https, mailto and tel links (rel="nofollow ugc"). Anything else goes, its text kept; a script goes with what is in it. A picture is a type: file field beside it
locationa pin on a map, stored as {lat, lon, zoom}; two number inputs, stored as {lat, lon}, where the instance has no MAPBOX_TOKEN or the map will not load
addressa street address on one line. Where the site has a register to ask (addresses: in site.yaml), the browser’s own list suggests addresses as the person types, and one picked is kept with its street, postcode, town, municipality, place (lat, lon) and the register’s id; one only typed is kept as its words. A list and a mail say the line ({field}). The browser asks the site and the site asks the register, so no third party sees the visitor
recorda record of another bucket: the one this belongs to, carried in, or a row picked from a list beside it
collectionthe rows a visitor gathered from a list elsewhere (collect:), kept in their browser until this form sends them: ids, or with count: true each with how many (gathering from a list)
gesture, voicea drawn stroke or a recording, through a redoal relay
hiddena carrier value, no label row

The server holds a submission to the same rules as the form: a field that is not optional must have a value, and a value must be what its type says (email, number, date, time, datetime-local, url, one of a select’s options, a point for location, a tick for a checkbox), inside its bounds, steps, length and pattern. What the content never gave a value (a hidden field with no value) cannot be asked for. A select drawn from a resource: is checked to be a choice, not that the resource still offers it.

A select takes either inline options: [...] or a resource: to draw them from, with id_field: naming each item’s stable id.

collaborative: a text written together

          - name: wording
            label: The proposal as it will be put
            type: prosekit
            collaborative: true

Where a list opens the form to change a record (edit:, see “A resource”), everyone who may change that record writes in the same text at once, sees who else has it open, and sees their cursors. Saving is as for any field: the text as it stands goes in the record’s log as one edit, and someone else’s save of the same text is not a change made meanwhile, since what you save has it already. A new submission has nobody to write with, and is an editor as before.

The first person in starts the shared text from what the record says. It is kept between saves, across a restart, and dropped when nobody has had the record open for ten minutes; the next person starts it again from the record. Only on a type: prosekit field, and only on a form some list’s edit: opens: the lint refuses anything else. The editor loads a large script (about 0.8 MB) on the pages that have such a field, and on no others.

A roll of files

A file field takes one file. A roll takes several, and lets the person look them over before anything is sent:

          - name: pictures
            type: file
            accept: image/jpeg,image/png,image/webp
            roll: true        # the strip
            camera: true      # offer the device's camera too
            at_most: 12       # how many it takes; left out, 12

What is picked lands in a strip of thumbnails that scrolls sideways. Each can be taken out or moved earlier or later, and the order of the strip is the order kept: the first picture is the one a gallery card shows. Picking again adds to the strip. With camera, a button turns on a live view with a button that puts a still in the strip; the camera is off until that button is pressed, off again when it is pressed once more, and the button is not there on a device with no camera to offer. Nothing leaves the browser until the form is sent, so a shot taken out was never uploaded.

A picture longer than 2400 points on its long side is scaled down to that, as a JPEG, before it is sent; every file goes up by itself, each within the 20 MB an upload may be. The field holds the files’ keys as a list. A list shows them side by side, pictures as thumbnails that open, and each is fetched at /attachment/<bucket>/<record>/<field>/<n>, counted from nothing, under the same rule as any file: through a record the reader may see. On a form opened on a record that has a roll, leaving the strip empty keeps what is there, and filling it replaces all of it.

camera and at_most belong to a roll, and a roll to a file field; the lint refuses them anywhere else, and an at_most outside 1 to 50. multiple: true without roll still sends one file, the first.

type: record

How one case belongs to another — an objection to the application it objects to, an appeal to the decision it appeals.

          - name: case
            type: record
            of: applications       # the bucket the other record is in
            value: "{key}"         # arrives on the link, on a dynamic page

Nobody types one of these: the stored value is the parent’s record id, which is a chain hash. It arrives the way it was given out, so the field carries rather than asks, and renders hidden. A submission naming a record that is not there is refused, so a reference in a stored record is one that resolved at least once.

The other half is a listing that asks for the children:

        resource:
          source: { bucket: objections }
          requires_group: case_officers
          where: { field: case, equals: "{key}" }

And the way there from a list: link puts a link on every listed record to a page about it, with {id} for the record’s id and {field} for any of its fields. A notice on a public board links to /notices/{id}, the dynamic page /notices/[key] whose form carries the notice’s id back in with value: "{key}":

        resource:
          source: { bucket: notices }
          public: true
          link: { to: "/notices/{id}", label: I can lend or borrow this }

A resource

Live data, declared by content and read by the server. What a resource reads is never a client-supplied parameter.

        resource:
          source: { bucket: applications }
          key: abc123              # one record instead of the list
          public: true             # or requires_group: case_officers
          states: [approved, refused]      # only these; empty means all
          where: { field: case, equals: "{key}" }
          jq: ".[] | {name, url: .html_url}"
          limit: 1                 # at most this many, after jq
          empty: Nothing decided yet.
          title: name              # the field that is the record's heading
          show: [summary, lead]    # a row is its title and these fields; the rest stay on the record
          meta: false              # no state, no time on a row (default true)
          link: { to: "/notices/{id}", label: Answer this }   # a page per record
          collect: { into: cart, label: Add to my list }       # a button per row, into a list the browser keeps
          # or only on records with a field filled in:
          # link: { to: "/events/{id}", label: Sign up, when: places }
          calendar: Put them in your calendar   # a board's /ics/<bucket>.ics, while the list has rows
          transitions:             # the desk's buttons
            - { from: complete, to: on_hearing, label: Send it out }

source: { bucket: b } lists the site’s own records in bucket b (it was written kind: kv before 1.0, which still reads the same). Every other source says its kind: gitea_starred, gitea_releases, url (someone else’s page or feed) or ledger. What the programs beside the site ask its people needs no list: it waits in their header (Operations).

source: { kind: ledger, account: "dues:{year}" } reads the ledger (State machines): one account’s balance, with what came in and went out; account: "stock:*" every balance under a prefix, one row each; statement: true the account’s lines, newest first, each with its text, amount, the two accounts and the record it came from; bucket: orders, record: "{key}", statement: true a record’s own lines, what one job cost. unit: pcs reads in a unit other than kroner; since and until (YYYY-MM-DD) bound a statement to a period. {key} is the page’s and {year} this year’s. The read needs public: true or a requires_group, as any resource does; who sees a balance is the page’s to say. A balance is rendered as a card with its amount written out (250,00 NOK, 7,5 hours); jq: reshapes either as it does any resource.

title: name names the field that is each record’s heading. A committee is its name, an event too, and a name read as one small field among equals is not read first: with title, that field comes first and larger, with no field name over it, and is left out of the fields under it. On a card (a record with a picture) it is the heading instead of the first text. It is plain words: the lint refuses a prosekit, file or location field here, and a field no form filing into the bucket has.

show: [summary, lead] makes a row its title and those fields, in the records’ own order, and leaves the rest out of the row; the record, and the page about it (link:), keep them. A list of committees on a page about the association is each committee’s name, one line and its leader, not the long text its own page has. meta: false leaves a row’s state and time out, for a public list where neither means anything to a reader (“active”, the moment a record was imported). The lint refuses a show field no form filing into the bucket has - or, for a bucket portal fills itself (portal_payments, portal_asks), one portal does not write on its records (state machines, “fields”).

link: { ..., when: places } puts the link only on a record whose places holds something: not missing, blank, false or an empty list. A list of events where some take sign-ups reads as one list, with “Sign up” on those that have places and nothing on the rest. The lint refuses a when no form filing into the bucket has.

calendar: Put them in your calendar is a link under the list to the bucket’s calendar, /ics/<bucket>.ics, and it is there only while the list has something in it: nobody is offered a calendar with nothing in it. The bucket must be a board with a plan, which is who may subscribe (A board, a plan and a calendar); the lint refuses it otherwise.

limit: 1 shows only the first item — for a feed where only the newest matters. A releases card wants the cut someone should run, not every cut there has ever been, and a page that grows by one card per release gets longer forever. It applies after jq, so a filter can reorder and the limit takes the top of that ordering. A source that yields a single record has no length and ignores it; limit: 0 on a list shows nothing, and the empty line speaks instead.

A spec with neither public: true nor requires_group is unreachable: reads fail closed, and mutations always need a group whatever public says. The one exception is a list of records that are their sender’s own (owned_by:, see State machines): it needs neither, and shows each person what is theirs or shared with them.

A field with several choices (a multiple select) holds each of them: where: { field: topic, equals: traffic } finds a record that chose traffic among others, and where: { field: topic, any_of: [traffic, paths] } one that chose either. any_of takes the page’s {key} as equals does. none_of: [archived, spam] is the rest: a record holding none of them, which one with nothing in the field is.

where: { field: email, equals: "{user.email}" } is “my cases”: the records carrying the signed-in person’s own address, read from the session. A file on such a record is theirs alone to open.

A record that carries a picture (a type: file field holding a JPEG, PNG, WebP, AVIF or GIF) is shown rather than read when the list has no transitions: a card with the picture on top, the first field as its heading, and the other fields under it, with no field names, state or time. The cards appear in the order the records were put up. That is how a site shows the people who work there, or a gallery of what it has built. On a desk, the same picture is a thumbnail that opens. accept: image/jpeg,image/png,image/webp on the field makes a phone send a JPEG whatever it keeps its photos as. What the person wrote is shown as markdown on stricter rules than the site’s own: paragraphs, line breaks as typed, lists, emphasis and links to https, mailto or tel (marked nofollow ugc); no images, no raw HTML.

A desk (a list with transitions) shows every record still moving, and of those in a final state - one the state machine has no move out of - only the three most recently decided, newest first. “Show older” under the list brings three more each time it is pressed. The desk stays about the work in hand however long the site has run; nothing is hidden from a read-only list, and leaves_after still takes a record out of every list altogether.

A releases manifest - a kind: url resource whose JSON is { name, latest, versions: [{ version, date, notes, assets: [{ platform, url, sha256, size }] }], channels: { arch: { repo, package, note }, ios: { testflight, note } } }, newest version first, as a release pipeline writes it - renders as one card: the newest version, the file for the visitor’s own platform first (read from the browser: ios, macos, linux-x86_64, linux-aarch64, windows, android), the other files and the channels folded under “All downloads”. Linux gets the package repo lines beside its file; iPhones and Macs get TestFlight. Platforms a manifest lacks fall through to the folded list.

A desk’s buttons reach only what it lists: where holds for a move as for a read, and a move is refused for anyone the desk is not for, so a committee given where: { field: group, equals: <its group> } on portal_memberships sees and moves its own and no one else’s.

The buckets portal keeps itself list the same way: portal_memberships (who is in a group, Memberships), portal_invites, portal_events, and portal_payments, the ledger of money asked for by a state’s payment:. A treasurer’s desk lists it with states: [requested] and the one button a desk may have on it, { from: requested, to: registered, label: Paid into the account }: the money came some other way, seen by that person. paid, failed, expired and refunded are the money service’s, and a desk naming them fails the lint. The whole ledger is never public.

states and where narrow a listing. They matter most for a register that is public by law — public about what was decided, not about what was withdrawn — while the desk working the same bucket is a different spec and still sees all of it. A record that has no such field never matches: “everything that did not say” is not something a page can ask for by accident.

Someone else’s page or feed: kind: url

source: { kind: url, url: https://… } reads an address on another site each time the list is drawn. What it reads is as::

        resource:                      # JSON, the default: jq shapes it
          source: { kind: url, url: "https://api.example/search?query=Tomter" }
          jq: '.items[] | {title: .name, url: .link, date}'
          public: true

        resource:                      # a feed, RSS or Atom
          source: { kind: url, url: https://town.example/rss, as: feed }
          jq: '.[] | select(.title | test("Tomter"))'
          public: true

        resource:                      # a web page, by CSS selector
          source:
            kind: url
            url: https://town.example/plans/hearings/
            as: html
            rows: a.teaser-title       # one row for each element this selects
            fields:
              title: "."               # the row's own words
              url: "@href"             # one of its attributes
              deadline: "time @datetime"   # or of an element inside it
            keep: 1 hour
          public: true
          empty: Nothing is out for hearing.
  • A feed gives each item’s title, url, description (its words), date, and for an event its start and end, times as RFC 3339.
  • A page gives a row for each element rows: selects, in the page’s order, at most 200. A field is a CSS selector inside the row (the first match), . for the row itself, and @name at the end for an attribute rather than the words. An href or src comes whole (https://town.example/…), whatever the page wrote.
  • A row named title (or name) with a url is a heading that links there; description is its text; any other field is listed under it. jq: reshapes or narrows the rows as it does any resource’s.
  • Only words are taken. No markup of theirs reaches the page, and a link that is not http(s) is dropped.
  • keep: is how long an answer is kept before the address is asked again (15 minutes, 1 hour, 1 day; no months): a quarter of an hour for a page or a feed, and not at all for JSON, where nothing is said. While their server does not answer, the last answer stands.
  • What is sent. A JSON endpoint gets the list’s filters as its query, as before; a page or a feed is asked for as written. Only https:// on a public address is fetched.

A page read this way is theirs to change: when its markup does, the list goes empty (empty: says so) until the selectors are updated. Say where the rows come from in the feature’s description, and ask the site’s owner before leaning on it.

A list as a file: download

download: on a group’s list puts a link under it to the same list as a spreadsheet file (CSV), for a board that prints who is coming or sorts who has paid.

        resource:
          source: { kind: kv, bucket: signups }
          requires_group: board
          title: name
          show: [guests, email]
          download: Download as a spreadsheet    # the words on the link
  • What is in it. One row per record the list has, as the visitor has narrowed it: search for a name and the file holds those. A desk’s finished records are in it too, each with its state.
  • Columns. The title: field, then the show: fields (every field without show:), under the form’s labels; then the state in the site’s words, and when the record came in, by the site’s clock.
  • Who gets it. Whoever the list lets in, checked again when the file is asked for. The lint refuses download: on a public: true list, on a list with no requires_group:, and beside jq: or key:.
  • Opens in a spreadsheet as it is. Semicolons between the fields on a site in a language that writes numbers with a comma, commas in English. A cell that would be read as a formula is kept as words.

How a list is drawn: shows

The same records can be drawn several ways. shows: on a list picks one; the checks, the filters and a desk’s moves stay as they are.

        resource:
          source: { bucket: hires }
          requires_group: counter
          shows: calendar
showswhat it drawsneeds
rowsa row per record, its fields under each other; cards where every record has a picture. The default
cardsa card per record, a picture or not
tablea column per field, in the order show: names them (every field, without it), then where each stands
boarda column per state, in the order of states:, each record a card with the desk’s moves on itstates in aggregates.yaml
calendara month, each record on its days; the month before and after a press awaya holds: on the bucket, or a type: date on its form
mapone map, a marker per record at its place. Rows on an instance without mapsa type: location on the form
counthow many records the list has, as one numberno limit:

A calendar puts a record on the days its bucket’s holds: holds it, else on the day of the first date its form asks for. A count counts what the list would show: after states:, where: and the visitor’s filters.

Narrowing a list: the resource’s own requirements

A feature with a resource: and requirements: has requirements on the resource: they show above the list, and the visitor narrows it with them. On an alternative that records nothing they are no form, and nothing of them is sent or kept; on one that records, they are sent with the answer too (see Booking from a list).

      - name: Past events
        resource:
          source: { bucket: events }
          public: true
          states: [held]
          limit: 10                # the newest ten; a search finds the rest
        requirements:
          - name: title            # a field of the records
            label: Search the titles
          - name: kind
            label: Kind
            type: select
            multiple: true
            options: [party, work day, meeting]

Each lives in the page’s address under its name, so /events?kind=party,meeting&title=summer opens the list already narrowed, and a link, Back and a reload keep it. The list asks the resource the same names: a kv list keeps the records whose field of that name holds what was asked (in the form’s answers, or on the record itself, such as state), and a url or Gitea source is asked them as query parameters. Words (type: text) are found anywhere in the field, whatever their case; a select keeps a record holding one of the chosen options as written, any of them for multiple. Nothing chosen is the whole list. limit: counts what is left after them, so a list of ten can be searched through everything.

A filter is its own list’s. Where two lists on a page narrow by a field of the same name (three lists of an archive, each with a group), each keeps its own in the address under its list’s name and the field’s, /archive?documents.group=Traffic, so narrowing one leaves the others as they were. The list’s name is its feature’s name as an id (“Plans and accounts” is plans-and-accounts), with its alternative’s before it where two lists on the page are named alike. A field only one list on the page narrows by stays under its own name. On an alternative that records (below), what is asked beside a list is the form’s too and always lives under its name.

They only ever narrow: where: and states: still decide what the list may show at all, and the page’s address never reaches them. The lint takes type: text, a select with its own options:, the two type: date days a holds: holds the list’s records by, and on an alternative that records, a type: record of: the list’s bucket; and it refuses the names the page’s address already uses (chain, email, edit, back).

Booking from a list: days and a picked row

Where a bucket holds the records of another over days (holds:, see State machines), a page books one by narrowing a list of them to the visitor’s days and picking a row:

name: When do you need a machine?
alternatives:
  - name: Book a machine
    description: Say your days and pick a machine that is free all of them.
    record_as: hires
    action: /hire/thanks
    features:
      - name: Free on your days
        description: Every machine nobody has from your first day to your last.
        resource:
          source: { bucket: machines }
          public: true
          states: [for_hire]        # a machine in the workshop is never offered
        requirements:
          - { name: from, label: First day, type: date }
          - { name: until, label: Last day, type: date }
          - { name: machine, label: The machine, type: record, of: machines }
      - name: Who you are
        requirements:
          - { name: name, label: Your name }
          - { name: email, label: Email, type: email }
  • Days narrow the list. A pair of requirements beside the list, named as a holds: on its records names its days, keeps the records nobody holds on any of them: from and until, two type: date fields, or from and for, a date and a type: duration (“first day” and “how long”). They live in the address, so /hire?from=2026-12-01&until=2026-12-05 opens the list already narrowed. With either left out, the list is the whole list.
  • An alternative that records sends them. On an alternative with record_as, the requirements beside a list are part of its form: they narrow the list and are sent with the answer, so the hire’s days are the days its list was narrowed by. They are asked for unless they say optional.
  • A record beside its list is picked from it. A type: record requirement of: the list’s own bucket is answered by the Pick button on each row, or several rows with multiple: true. The pick lives in the address too, so Back and a reload keep it. Only a row the list would show can be sent: a record in one of its states:, and free on the days.

Whether the machine is still free is decided as the hire is written, with the hire: someone who took it meanwhile leaves this booking refused, with nothing kept, and the visitor told to pick another or other days. Lists are live, so a machine someone else books leaves an open page’s list as it happens.

Gathering from a list, sending from a form

A catalogue on one page, the order on another: collect: on a list puts a button on every row, and what a visitor adds waits in a list their browser keeps until a form sends it.

# /machines: the catalogue
      - name: The machines
        resource:
          source: { bucket: machines }
          public: true
          states: [for_hire]
          title: name
          collect: { into: cart, label: Add to my list }

# /hire: the form that sends the list
  - name: Book your list
    record_as: hires
    action: /hire/thanks
    features:
      - name: Your list
        requirements:
          - { name: machines, label: The machines, type: collection, of: machines, from: cart }
          - { name: from, label: First day, type: date }
          - { name: until, label: Last day, type: date }
  • collect: { into, label } names the list (letters, digits, - and _). The button reads label, or Add to the list, and In the list once pressed; pressed again, it takes the row out.
  • type: collection is the list as a field: its rows by name, each with Take out. of: is the bucket and from: the list’s name, and the lint wants both ends to agree. The form sends the records’ ids as one answer, so one booking names every machine; with optional: true an empty list may be sent.
  • count: true gives each line a count, one unless changed, and the answer is [{ id, count }]. max: 5 is the most of one thing. For what there are many of (fence panels, fuel cans); a thing a holds: holds is one thing, so the lint refuses count there.
  • The list is the visitor’s own. It lives in this browser (local storage), follows them from page to page and through a reload, and is emptied when its form has sent it. Another browser or phone has its own. The site knows nothing of it until then.

On the server each line is checked again: the record is there and in a state a list that gathers into the same name shows, so nothing taken off offer is ordered from an old list. A holds: over the field holds every record in it, and a booking with one thing taken on its days is refused whole, with the list kept. A desk’s list shows the lines by name (Mini digger, 3 × Site fence panel), and so does a mail: {machines} in a subject or body.

Changing a record from a desk

    features:
      - name: Announcements
        resource:
          source: { bucket: announcements }
          requires_group: editors
          edit: {}                     # this list's group, the one form
          transitions:
            - { from: draft, to: out, label: Put it out }

A list with edit: lets a group change a record’s fields, in any state. “Change” opens the same form, filled in with the record, and the rest of the page steps aside; a file stays unless a new one is chosen. It goes through what a submission goes through (rich text cleaned, references checked), and is written as an event in the record’s log: who, and for each field the value before and after. “History” on the row reads it. The state does not move, no mail goes, no clock starts again, and a public list shows the new value at once. Two people changing one record: the one saving second is told to look again, and nothing of theirs is kept. A desk whose page is older than a save looks again too.

group says who may, the list’s requires_group by default; page and alternative say which form, needed when more than one files into the bucket; label replaces the words on the link. A public list can carry it with a group. The bucket must be in aggregates.yaml, since a change needs a log to go in. The form must be on a page of its own (not [key], not requires_chain) that the group may open, and be one that only keeps a record: no invite, one_per_person or self_transition. On a bucket of places (places:, see State machines), a save changes the board’s ledger first, as a sign-up takes its place there first. The place keeps its seat, or its turn on the waiting list. It counts for more only where there is room for that (otherwise the save is refused, with words saying why, and nothing changes), and what it gives back goes to the next in line, who gets the seated state’s mail. It stays on the thing it was taken on: the form opens without the slot field to choose, and a save naming another thing is refused.

# questions/desk/signup.yaml: a form of its own, for the desk
name: Sign someone up
qualifies: hosts
alternatives:
  - name: Sign someone up
    action: /desk
    record_as: signups
    features:
      - name: Who is coming
        requirements:
          - { name: event, type: record, of: events }
          - { name: name, label: Name }
          - { name: email, label: Email, type: email }
          - { name: party, label: How many, type: number, min: 1, max: 2 }

# on the desk's list of an event's sign-ups
        resource:
          source: { bucket: signups }
          requires_group: hosts
          where: { field: event, equals: '{key}' }
          edit: { page: /desk/signup, alternative: Sign someone up }

The same form, sent on its own, signs someone up as the public form does: the ledger seats them or puts them in line, and the mail goes to the address given.

A record with its own date (portal import, see Operations) shows that date on its row and sorts by it.

A board, a plan and a calendar

A list over a bucket with board: (see State machines) is read in the order of the things’ own starts, and every record says how full it is: a bar, 2 of 3 places taken, how many wait, and what is still needed (Still needs: Someone with a key). Where a place counts for more than one seat (count: and at_most: on places:, see State machines) the fill counts seats: two parties of three waiting read 6 on the waiting list. A board whose places are something else says so: words: { places: quotes, full: Enough quotes } on the board: makes the row 2 of 3 quotes and, when it is full, Enough quotes, and iris map says 3 quotes. A board of one says the noun as one too (place: machine): 0 of 1 machine. That is the coordinator’s desk and, with public: true and states: [open, full], the public plan. A resource with key: "{key}" on a thing’s own context shows the one record the same way, fill included, instead of its raw data. On a dynamic context, where: { field: shift, equals: "{key}" } is filled from the segment, so the shift’s desk lists the places on that shift.

The whole board is a calendar at /ics/<board>.ics for whoever its plan names, and a person’s own places are one at /ics/<places>/<id>.ics?email=<address>, the link {ics_link} gives in a mail. A list of the board links the first with calendar: (calendar: Add the rota to your calendar), which shows the link only while the list has a thing in it; a link written into a description is there whether the calendar has anything or not.

A notice bucket’s archive is a list with public: true and states: [<sent>], which the lint allows only with archive: true.

A narrowing requirement may carry a value:, what the list is read with until the address says otherwise: a year’s accounts open on this year with the earlier ones to pick (value: "2026", options: ["2026", "2025"]), a desk’s list of hours opens on the signed-in person. The requirement’s name is a placeholder for a kind: ledger read on the same feature (account: "dues:{year}"), so the year picked is the year read.

needs.yaml

What the site is for, as a checkable spec: who wants what, which bucket the answer must land in, which group carries it to a finished state. The runtime never reads it. iris check proves the site meets it, and iris replay runs cases through the real engine.

State machines

aggregates.yaml declares what a bucket’s records may be and how they move. It is the one file that decides what is possible; the pages only decide who presses what.

aggregates:
  - bucket: applications
    initial: open
    states:
      open:        { event: received }
      incomplete:  { event: incomplete }
      complete:    { event: complete }
      on_hearing:  { event: on_hearing }
      recommended: { event: recommended }
      approved:    { event: approved }
      refused:     { event: refused }
      withdrawn:   { event: withdrawn }
    transitions:
      open:        [incomplete, complete, withdrawn]
      incomplete:  [complete, withdrawn]
      complete:    [incomplete, on_hearing, refused, withdrawn]
      on_hearing:  [incomplete, recommended, refused, withdrawn]
      recommended: [approved, refused, withdrawn]

transitions is an arbitrary directed graph. Cycles are allowed and are often the honest shape: a case sent back for the drawing it was missing returns to a stage it was already past. A good ending may sit partway along — an authority that changes its own decision finishes the case without walking to the end of the line.

On a desk, each record shows its state and a button for every move the graph allows from there. Here, the counter of the machine-hire example, with one hire out with its customer and one waiting to be handed over:

Each state’s event string is the name written into the log, and must be unique within the bucket. A record’s state is replayed from its own events, so renaming an event orphans the records that carry the old name: when rebuilding a live site, keep the names it already has.

What a state may carry

Beside its event, a state may say what happens when a record arrives in it: a mail, a group granted or taken back, a move after a while, a payment asked for, something handed on to a program, a line in the books, and the words a list shows.

mail

      approved:
        event: approved
        mail:
          to: submitter            # or one fixed address
          subject: "Your application"
          body: |
            Hello,

            {property_address} is approved. The decision is at
            {site}/status/{chain}.

{field} is any field of the record, plus {site}, {chain}, {email}, {bucket}, {state} and {link} - the page where the reader acts on the record, their own or the desk’s (every variable is in Mail). The body is markdown; it is sent as text with an HTML alternative. to: submitter means the record’s email field, and the lint then requires every form filling that bucket to collect a required email.

A record that belongs to another (a type: record field, say notice) can write to that record’s people: to: "{notice.email}" goes to whoever posted the notice, and {notice.what} in the body is what they posted. The lint requires every form filling the bucket to carry that field. This is how an answer to a notice on a board reaches the neighbour who put it there, without anyone in between.

Portal renders it in the same write as the move, and gdo delivers it; a reply comes back as a note beside the record. A note never moves a case.

A mail about a time carries the time, for the reader’s calendar:

        mail:
          to: submitter
          subject: "Your visit"
          body: "See you on {day}."
          event:
            start: day                # a `type: date` or `type: datetime-local` field
            end: until                # optional; an hour after a time, the day of a date
            title: "Visit, {name}"    # optional; the subject when left out
            location: "{where}"       # optional

start and end name fields of the record, read as the form sent them, in the site’s timezone; title and location take the mail’s variables. The lint wants every form filling the bucket to collect start required, and end where it is named, as a date or a date and time. Portal puts the event on the mail and gdo decides how it reaches a calendar: as an invite the reader’s mail client offers to add, and onto a calendar of the site’s own when gdo has one (see Mail). The same record entering the same state again updates the entry rather than adding a second.

grants

      approved:
        event: approved
        grants: approved_firms

The person the record is about becomes a member of that group when the record arrives here. An approval that means membership should not also need somebody to remember to invite them afterwards.

The lint requires every form filling that bucket to collect a required name (or navn) and a required email (or epost) of type email, because by the time a desk presses approve there is nobody left to ask. (An invite: on a form asks less: a required name, and a required email or, with a group, phone. See Content reference.)

A grant goes the way an invite does, through the same call. With Kanidm as the people backend it makes the account and adds to the Kanidm group. With memberships it writes a record in portal_memberships, and a Kanidm configured beside memberships makes the account too, with the one-time link in the mail (see Memberships). There a phone number on an older record does as well as an address; through Kanidm it does not. An instance with neither configured grants nothing and says so in the log; the transition itself always stands.

A state may grant several groups (grants: [committees, committees_{key}_member]), and a group may have a gap a record fills (groups): committees_{key}_member is that group of the record this one belongs to, or of this record itself when its bucket has groups:; committees_{committee}_member fills the gap from the field committee. Such a group is granted only while the record it is of is open. The person is the record’s own, or the one in the fields a grant names:

      active:
        event: active
        grants:
        - { group: "committees_{key}_lead", email: lead_email, name: lead }
        - { group: "committees_{key}_member", email: lead_email, name: lead }

revokes takes a gap the same way.

revokes

      left:
        event: left
        revokes: members

The mirror of grants: the person the record is about is taken out of that group when the record arrives here. A household that leaves, or a year’s dues nobody paid, is a decision that means the membership is over, and it should not also need somebody to remember to remove them. A state grants a group or revokes it, not both.

The lint requires every form filling that bucket to collect a required phone or email, since a membership is known by one of those. With memberships the record moves to removed and stays, so a desk sees who was in and may put them back; through Kanidm the person is taken out of the group by address, and a record with a phone number alone is said in the log and left. Best-effort, like the grant: the transition stands either way.

after

      on_hearing:
        event: on_hearing
        after: { days: 42, to: recommended }

The move a clock makes rather than a person. A hearing that gets no answer in six weeks has to go on without one, and nobody in the building is in a position to press that button.

A deadline may only do what a person could have done: after.to is held to the same declared edge as a desk button, and content that says otherwise is refused when it loads, not when the hour comes round. The wait is measured from the record’s last move. The move goes through the same transition path, fires the same mail, and is announced like any decision, stamped deadline.

The unit is days and the sweep is hourly. This is a deadline, not a job queue.

payment

      awaiting_payment:
        event: awaiting_payment
        payment:
          amount: 250                   # whole kroner; or { field: amount }
          text: Annual dues
          then: paid                    # where the record goes once it is paid
          expires: 30 days         # optional; the request lapses after
          by_hand: true                 # the treasurer marks it paid; no money service
      paid:
        event: paid
        grants: members

Entering the state asks for money. Once it is paid, portal moves the record to then itself, stamped payment:<reference>, with whatever then carries (a mail, a grant), as if a desk had pressed the button. It asks however the record arrived (a form, a desk, a clock), so a record that comes round owes again each round. A request nobody answers in expires days lapses, and nothing else happens.

Each payment is a record in the built-in portal_payments bucket: reference (what the bank sees), owner (bucket:id), amount and currency (minor units, NOK unless said), text, phone, email, provider, psp (the provider’s id) and by (bucket:state). It goes requested, then paid or registered (paid some other way), or failed, expired or refunded. The amount is fixed when asked; a later change to the field changes nothing. A record with no amount, or neither a phone number nor an address, is asked nothing, and the log says why.

By hand (by_hand: true, required without a money service), a desk that lists portal_payments marks a payment registered, in the treasurer’s name. The other states are the money service’s to say.

With a money service, the site names PAY_URL (Operations) and leaves by_hand out. The request waits in the payments outbox for kron, which takes it over dhd/1 and pushes it to the person’s app by phone number (Vipps), or gives a card link (Stripe), then says back what became of it. Portal picks the provider as it asks: Vipps for a Norwegian mobile number, else Stripe, else whichever service there is. A word about an unknown payment, or with another amount or currency, is refused and logged; a word said twice is one event.

{payment_url} in the paying state’s mail: is the link to pay: the service’s link, or the person’s own page where the request went to their app or is paid by hand. With a service, that mail goes once the request is out.

The person’s own page (one with a self_transition on the bucket) is where they land after paying, and shows the latest payment: waiting, paid, refunded, refused or run out. After expired or failed a button there asks again, under the next reference. Nobody is asked twice for one payment any other way.

The lint wants then to be a declared move from the paying state, every form filling the bucket to collect a required phone or email, and { field } to be a required type: money field. The move into then is portal’s: a desk button, an own link or a clock into it is refused, and so is a desk naming a state that is not registered, or {payment_url} on a state with no payment:.

post

A record entering a state can be handed on: read through a template and given to a program beside the site, which answers, and the answer moves the record. A case sorted by a model, a filing sent to an authority, a letter typeset: each is the same three lines.

cases:
  states:
    received:
      event: received
      post:
        sort:                               # a step, by a name of yours
          template: triage.txt              # templates/triage.txt in the repo
          to: { service: scribe }           # a program beside the site
      then: { ok: sorted, refused: needs_a_person }
{# templates/triage.txt #}
Say which desk this is for, from {{ me.fields.name }}: {{ me.fields.text }}
  • post: is a map of named steps. Each renders its template over a reading and hands the rendering on, once per record and state.

  • read: says what the template sees, by names of yours; left out, it is the record as me (id, bucket, state, fields, at). An entry is one of:

    • { record: true }, the record itself;
    • { source: { bucket: <bucket> } }, other records, with states:, where: { field, equals }, since: and limit:;
    • { events: <bucket> }, what happened there (each event’s record, event, at and payload), with where:, since: 3 months and limit:. A sum over a month is read from here, since it is over what happened and not what is.

    {field}, {id} and {bucket} in a where are the record’s own, never a visitor’s. A reading gives the newest first, 500 unless limit: says (5000 at most), and is kept on the request, so how a number came to be can be shown. What a step reads is sent to the program it names: read what it needs.

  • template is a file under templates/ in the content repo, ending in .txt, .json, .xml, .html or .csv, with {{ }} over the reading. It reaches nothing outside the reading, and a name the reading lacks fails the step rather than leave a hole.

  • to is { service: <name> }, a program beside the site, or { credential: <name> }, a credential a courier holds. Content names it; where it leads, with which model or key, is the deploy’s (Operations). An address or a key in content fails the lint.

  • after: [<step>] makes a step wait: it is handed on once each step it names has answered ok, with their answers in its reading as steps.<name> (state, words, reference, object). A step whose wait was refused is never handed on. Steps with nothing between them go at once.

  • takes: [<field>] lets the answer write on the record: only the fields named, only with ok, only text, a number or true/false, written with the move the answers make and logged as the program’s. A supplier’s price, a model’s category. It is never a field a form asks a person for, so an answer cannot write over what someone typed, and a list may show: it like any field.

  • then, beside post:, moves the record once every step has answered ok, or once one was refused. Each must be a declared move from the state. Left out, the record stays and the answers are kept.

Every step is a case of its own in portal_posts (requested, then ok, refused or failed), which a desk may list like any bucket: that is where a filing nobody has taken shows. The program’s words are kept as a note on the record, where a mail’s reply lands, and its name, version and the rules it applied are on the step, so “why did this go to a person” has an answer. A failed step waits for the program to try again; no answer never counts as yes.

The lint holds a post: to what it can check without the program: the template is there and reads as a template, to says one destination by name, and then names real moves.

Not yet built of the design (#119): a gate that asks before the move, jq on a reading, .typ templates and to: { mail }.

ledger

      paid:
        event: paid
        grants: members
        ledger:
          from: "member:{id}"            # the account value leaves
          to: "dues:{year}"              # the account it lands in
          amount: { field: amount }      # kroner, from the record; or a number
          text: "Dues {year}"            # the statement line

A ledger beside the log. Entering a state with ledger: posts: value moves from one account to another, in an amount the record says, and the posting is written on the move’s own event, so the log says what was posted then and a later change to the content changes nothing already posted. Portal keeps the postings as balances and statement lines a page reads with source: { kind: ledger } (Content reference). Portal never refuses a move because of a balance: a balance is shown where the content asks for it, and the people at the desk decide.

Accounts are names the content makes up: lowercase letters, digits, :, /, ., -, _. {id} is the record’s id, {year} the year of the move in the site’s zone, {bucket} and {state} are what they say, and {<field>} is a field of the record, lowercased. A name with no placeholder is one account for the whole site; dues:2026 is what every household paid that year, member:<id> is one household over every year. The chart of accounts is whatever names the content uses; the lint holds them to the shape, and holds every form filing into the bucket to collecting the fields a posting reads.

Amounts are a number of whole units, { field: amount } a required type: money or type: number field of the record, { field: count, times: price } the product of two, or payment, what the bucket’s payment: state asks for. On the wire and in the balances they are hundredths of the unit, øre for kroner. A field that is missing or not a number leaves that posting out, said in the log; the move itself always goes.

Units. NOK unless said. A unit is letters, one to eight: a currency by its three capitals (NOK, EUR), or a count (pcs, hours, seats). Two accounts in different units never meet in one posting, and a balance is read in its unit. One state may post kroner and another pieces on the same bucket; that is how stock is counted and costed by the same movement.

In bookkeeping’s words, from is the account credited and to the account debited. An account’s balance is what landed in it less what left, debits - credits: positive for stock on the shelf and for dues that have arrived, negative for a member’s own account once they have paid. The wire (dhd::ledger) spells the two sides credit and debit.

Several postings on one state are a list, and all of them post or none do. A bucket’s own ledger posts on every move without naming states:

  - bucket: invoices
    ledger: { amount: { field: amount } }

Each move posts the record’s amount from the account of the state it left to the account of the state it entered, invoices:sent to invoices:paid; a first arrival posts from invoices:_new. Each state is then an account and its balance is how much sits there: what is invoiced and not paid is the balance of invoices:sent. A state may carry its own postings beside the bucket’s for money that crosses buckets or years.

No deletes, no edits. A mistake is a reversing posting with a reason, as in bookkeeping: a form into a bucket of its own whose state posts from and to the fields the form asks for, so a correction has a form, a reason and a person. The ledger can always be built again from the log (portal ledger rebuild), and nothing else.

Accounting of all sorts, in content

The same key says each of these; the accounts and units differ.

Dues, once a year. Who paid this year, and what one household has paid over the years:

      paid:
        event: paid
        ledger: { from: "member:{id}", to: "dues:{year}", amount: 250, text: "Dues {year}" }

The treasurer reads dues:2026 for the year’s total, and a household’s page reads the statement of member:{key}.

Invoices and what is outstanding. A bucket’s own ledger over the order’s states:

  - bucket: orders
    ledger: { amount: { field: price } }

orders:invoiced is what is invoiced and unpaid, and orders:paid is the year’s takings; a cancelled order sits in orders:cancelled and never in revenue.

Stock, counted and costed. One movement record, two states, two units:

  - bucket: movements
    states:
      booked:
        event: booked
        ledger: { from: "stock:{sku}", to: "used:{order}", amount: { field: count }, unit: pcs }
      costed:
        event: costed
        ledger: { from: inventory, to: "order:{order}", amount: { field: count, times: price }, unit: NOK }

stock:<sku> in pcs is what is on the shelf; order:<id> in kroner is what the job cost in parts. A count is a movement whose from is counted and whose amount is the difference, so the shelf and the books meet. Receiving goods posts from supplier:{supplier} to stock:{sku}.

Payroll, for the a-melding. A payslip’s payout posts gross and tax in one go:

      paid_out:
        event: paid_out
        ledger:
          - { from: "wages:{period}", to: "employee:{id}", amount: { field: gross }, text: "Gross {period}" }
          - { from: "employee:{id}", to: "withholding:{period}", amount: { field: tax }, text: "Withholding {period}" }

wages:2026-11 is the period’s gross wage bill, withholding:2026-11 what is owed the tax office, and employee:<id> the net each person was paid. Those three numbers are the a-melding’s.

Hours. Approved time in a unit of its own:

      approved:
        event: approved
        ledger: { from: "hours:{id}", to: "hours:approved:{period}", amount: { field: hours }, unit: hours }

Seats. A board’s places are a count too. ledger: { amount: 1, unit: seats } on the places bucket makes places:taken how many seats the season gave, and the waiting list a balance of places:waiting.

A deposit held and returned. Two states, the second reversing the first:

      deposit_received: { event: deposit_received, ledger: { from: "customer:{id}", to: deposits, amount: { field: deposit } } }
      deposit_returned: { event: deposit_returned, ledger: { from: deposits, to: "customer:{id}", amount: { field: deposit } } }

deposits is what the firm holds for customers at any moment.

Closing a year. There is no year-end in the ledger; a closing is a posting like any other, from dues:2026 to equity, made by a desk’s form into a corrections bucket whose one state posts from and to the fields the form asks for, with a reason. The statement then shows who closed the year and why.

leaves_after

      taken_down:
        event: taken_down
        leaves_after: { minutes: 10 }

How long a record stays in its bucket’s lists once it has entered the state, when that is not for ever. A card taken off the front page leaves the desk’s list ten minutes later instead of standing there greyed out, and the ten minutes are the time to see what was just done. Days, hours and minutes add up, and a sweep takes records out once a minute. Nothing is decided and no mail goes. The record leaves the lists, and the event log keeps it.

text

      certificate_in:
        event: certificate_in
        text: Certificate received

The state in the site’s own words. A desk’s row and a list show it where they would otherwise show the id (certificate_in, open), and the row’s fields are headed by the labels of the form that files into the bucket rather than by their stored names. Optional: without it a row shows the id made readable, and the first state is “Open”, or “Mottatt” on a Norwegian site. bratac build writes it from the plan’s stages_text.

What portal does with a bucket

Five keys beside states hand a bucket to portal for work nobody presses a button for: a schedule that opens records, one record that comes round, a notice mailed to everyone it concerns, room for a number of people, and the places taken. Each is optional and changes nothing for a bucket without it.

recurs

  - bucket: inspections
    initial: due
    states:
      due: { event: due, after: { days: 21, to: overdue } }
      overdue: { event: overdue }
      done: { event: done }
    transitions:
      due: [done, overdue]
      overdue: [done]
    recurs:
      - id: fire-doors
        every: 6 months               # or 8 weeks, 2 years
        starting: 2026-11-01          # the first due date
        lead: 14 days                 # open it two weeks ahead
        handled_by: caretakers        # whose desk works these
        fields: { what: Fire door inspection }

A length of time is written as people say it, wherever one is taken: every: 6 months, lead: 14 days, shows: 3 weeks, expires: 30 days, an event’s duration: 3h 30m, a reading’s since: 3 months. ISO 8601 works too (P14D). Days and weeks count in days, months and years in months, so a series every month lands on the same day of each month and the 31st becomes the last day of a shorter one. lead, shows and expires count in whole days.

A series may say which dates it falls on instead of counting from starting. every can then be left out: a date in the year comes yearly, a weekday of the month monthly (every: 2 years with a starting skips every other).

      - { id: workday, on: first saturday of june, handled_by: caretakers }
      - { id: winter, on: last sunday of january, handled_by: caretakers }
      - { id: meeting, on: first monday of every month, at: "18:00", handled_by: caretakers }
      - { id: advent, on: fourth sunday before 25 december, handled_by: caretakers }   # the first in Advent
      - { id: summer, on: 21 june, handled_by: caretakers }

nth is 1 to 4, or last: not every month has a fifth Sunday, and the lint refuses one, as it does 30 February and 29 February, which three years in four do not have. before counts back from a day, not including it. These dates are on the site’s own calendar, in its timezone:. at: "18:00" gives the fields {due_at}, 2027-01-04T18:00. The map and the manual say it in words. every: 1 year also works with starting, as months do. With neither starting nor anything else to go on, a series with on starts from the day it first runs, and opens nothing for a date already gone. next: after_done does not go with on.

Once a minute portal opens the record that has fallen due: an ordinary record in the bucket’s first state, with the series’ fields (each a template), due (the day it is due) and the series as where it came from. The first state’s mail goes, and its answer is stamped schedule. Overdue is the clock that already exists, after: on the first state, counted from when the record was opened.

next: after_done waits for the one before to reach a done state (the bucket’s final states unless done: names them) and makes the next due every after that. for_each: { group: volunteers } keeps one series per member, first due every after they joined (and not before starting, if given); for_each: { bucket: b, states: [...] } one per record there, with link_as naming the field that points back at it. where: narrows those records as it narrows a list’s, so each kind of thing can have its own series:

      - id: service
        every: 6 months
        for_each:
          bucket: machines
          states: [running, in_the_workshop]
          where: { field: type, none_of: [Trailer, Scaffold] }
        link_as: machine
        handled_by: workshop
        fields: { what: Service, check: "Engine, oil and filters, hoses and tracks" }
      - id: trailer
        every: 1 year
        for_each:
          bucket: machines
          states: [running, in_the_workshop]
          where: { field: type, equals: Trailer }
        link_as: machine
        handled_by: workshop
        fields: { what: Trailer check, check: "Brakes, lights, tyres and coupling" }

The lint holds where to a field the bucket’s forms have, and to its choices where they offer choices, so a misspelt value is refused rather than matching nothing. A record that stops passing gets no new one, and the one it has stays open, as when it leaves states. Templates may use {due}, and a member’s {name}, {email} and {phone}, or every field of a record and its {id}.

A record is opened once. Its id is made from the series and its due day (or the record before it), and the event log refuses to make an id twice, so a second pass, a second instance or a restart opens nothing new; where each series has got to is kept in portal_recurring. After a long stop a series opens the latest one due, not every one it missed. The lint refuses a series no desk works: a list of the bucket with transitions under requires_group: <handled_by> must exist.

comes_round

  - bucket: events
    initial: resting
    states:
      resting: { event: resting, text: Until next time }
      out: { event: out, text: Coming up }
    transitions:
      resting: [out]
      out: [resting]
    comes_round:
      date: day             # the field holding this time's date
      on: fourth sunday before 25 december
      at: "17:00"           # the site's timezone
      shows: 21 days   # goes out this long before
      out: out
      back: resting         # returns here when the date has passed

recurs: opens a new record each time, so last year’s text and picture are done again. comes_round: keeps one. Once a minute, a record resting in back moves to out shows days before its date, with the date written into the field (a type: date field holds the day; another the day and at), and back when the date has passed: at at, or with none, when the day is over, on the site’s clock. The moves are ordinary moves, stamped comes_round: the state’s mail goes, and both must be declared. on takes what recurs takes.

Change it at any time, in either state, with edit:, and the change carries over. A date someone sets by hand, still to come, goes before the rule, the year it is moved a week. A person may take it in early with a button of their own; it does not go out again for that date. Portal keeps which date has been out and which year has been asked for in portal_comes_round, so a second pass, a second instance or a restart does nothing new.

Not every date repeats, and then there is no on:

    comes_round:
      date: day
      shows: 14 days
      out: out
      back: resting
      asks: { month: 3, day: 1 }   # the day each year to ask
      handled_by: editors          # who is asked, and may set it

On asks the group’s members are mailed, once a year, with the way to the form; the desk’s row says “Needs a date” and comes first; the log says it asked. It goes out only when someone sets a date. If nobody answers, nothing goes out, so nothing wrong does. A record first seen after this year’s asks is not asked about a season under way. The lint wants a form with the date field in it, and for handled_by a list of the bucket with edit: for that group.

belongs_to and owner

  - bucket: documents
    belongs_to: { bucket: committees, field: committee }   # or belongs_to: committees
    owner: board                                           # a record with no parent

A record of this bucket is another bucket’s record’s, or a named group’s. It says whose in one field (field; the bucket’s own name when belongs_to is only a name): its parent’s key, or the owner’s name, which portal fills in when a form leaves the field empty. A submission and a save are held to it: the parent must be there, or it is the owner. So a [key] page lists a committee’s own with where: { field: committee, equals: "{key}" }, and a page of the board’s the board’s with equals: board, and nothing else is needed. A form files one with a type: record field of: committees, or type: hidden with value: "{key}", and without an owner the lint wants one of those.

The relation only reads. Closing a parent is a state it stays in, and hides nothing: its children are in their own bucket, and their lists do not ask after the parent. So the lint refuses leaves_after on a state of a bucket others belong to, which would take the parent out of its lists. The map and the manual say it in words.

groups

  - bucket: committees
    groups:
      key: short_name            # the field a new record's short name, its key, comes from
      label: name              # what a person reads as its name
      while: [active]           # the groups exist in these states (default: the initial)
      member: { label: "{label}" }
      lead: { manages: [member, lead], label: "{label}, leads" }

Each record of a bucket with groups: has groups of its own, named <bucket>_<key>_<name>: committees_traffic_lead. That one name is the group in Kanidm or Rauthy (both take it), the name in the sign-in token’s groups claim, and the group’s room in the chat. Bucket names, keys and group names are slugs with no _, so a name reads back. A key is 2 to 40, so every name fits the providers’ 64; the lint works the longest out. A record kept under a longer key, such as a hash, has no groups.

Content names such a group with a gap. On a [key] page, in qualifies, requires_group and invite.group, committees_{key}_member is that group of the record the address names (quote it inside { }). A desk for it moves the records its group is of, so its bucket has groups: or belongs_to one that has; such a list offers no edit yet. In grants and revokes the gap is filled from the record (grants). A name with a gap stands nowhere else, and is never a group anyone holds. See access.

A new record filed by a form is kept under its short name: the key field made a slug, refused when it cannot be a key or is taken.

Open and closed. A record entering a while state has its groups made where the groups are kept (Rauthy, Kanidm, or nothing to make with memberships), and in Rauthy, for a group that manages others, the admin roles that go with it: rauthy_admin:<bucket>_<key>_<name> per managed group, or rauthy_admin:<bucket>_<key>_* when it manages them all. Anyone put in that group, by a grant or an invite, gets them, and loses them when taken out; they let a person bring people in and take them out in Rauthy’s admin, for that record’s groups only. Entering any other state empties every group and takes the admin roles back; the groups stay, empty. At start and on each reload every open record’s groups and roles are made, so records from before groups: (or brought in by portal import) have them too. Best-effort, as grants is.

owned_by and shared_with

  - bucket: courses
    owned_by: sender                              # the signed-in person who files it
    shared_with: { group: guides, while: [open] } # who else, and for how long
    states:
      open:  { event: received, after: { days: 84, to: ended } }
      ended: { event: ended }
    transitions:
      open: [ended]
  - bucket: notes
    belongs_to: { bucket: courses, field: course }  # the owner's too

A record of a bucket that says owned_by: sender is the person’s who filed it. The site writes their subject on the record, in the field owner, from the session: a form cannot name it, and where the form carries an email the session’s address is written there as well. Nobody signed in files one from a browser. Only the owner sees the record, whatever page lists it and whoever that page is for.

shared_with shares it: the group sees the record, moves it from its desk and talks with its owner while the record is in one of the states while names (the initial state unless said). A share is as long as the states say. It ends when a move takes the record out of them, whoever makes it: the owner by their own link (self_transition), the group’s desk, or a clock (after:), which is what makes it a share for a while. The record’s log is the log of the share, and moving it back is sharing it again. A desk moves an owned record only from a state the share holds in.

A bucket that belongs_to an owned one is its owner’s too, one step down: a record of it is seen, and filed, by whoever sees the record it belongs to as that record stands now. The lint refuses a second step, owned_by beside belongs_to or groups, a form field named owner, and an invite: filing into an owned bucket.

A list over an owned bucket needs neither public nor requires_group: anyone may ask for it and is shown what is theirs or shared with them, record by record. A list that names a group is still only that group’s, and still shows each member only what is shared. The record’s conversation in the chat goes by the same answer (rooms), so a person in no group at all talks with the group their record is shared with, and with nobody else.

This is the plain way to give one person’s records to the people who help them. groups: (below) is for records that are a body of people in their own right, a committee with members and leads.

notice

  - bucket: notices
    initial: draft
    states:
      draft: { event: draft }
      sending: { event: sending }
      sent: { event: sent }
    transitions:
      draft: [sending]
      sending: [sent]
    notice:
      sends_in: sending          # the initial state when left out
      sent: sent
      mandatory: true            # no way to stop it
      archive: true              # a public list of the bucket is allowed
      per_minute: 60
      to:
        - { id: everyone, label: every resident, bucket: residents, states: [living_here] }
        - { id: block, label: the block, bucket: residents, states: [living_here], where: { field: block, equals: "{block}" } }
        - { id: board, label: the board, group: board }

A notice that reaches sends_in (by a desk’s button, or by arriving, when that is the first state) is mailed to everyone in its audience: a group’s members (invited or active) or everyone with a record in those states, narrowed by where, whose equals may name the notice’s own fields. A field with several choices holds each of them, on the notice’s side as on the record’s, and any_of: [a, b] in place of equals takes any of several. One message per person, to that person alone. With more than one audience the form chooses one in a required select audience. The notice needs a required subject and text (and may have starts and ends, which the mail gives in words), unless mail: { subject, body } says what to send.

When everyone has it, portal moves the notice to sent with recipients, the count. Without mandatory, each message ends with the person’s own link to stop that bucket’s notices; with it, the message says it goes to everyone it concerns. The lint holds every form that writes a notice to qualifies, refuses an own link into sends_in and any button into sent, and allows a public list of the bucket only with archive: true.

holds

A record can keep something busy over days a person chooses: a hire its machine from its first day to its last, a booking its cabin, a service its machine and the mechanic who does it. holds: on the bucket says what, from which day until which, and in which states:

  - bucket: hires
    initial: confirmed
    states:
      confirmed: { event: confirmed, text: Confirmed }
      out: { event: out, text: Out with the customer }
      returned: { event: returned, text: Returned }
      cancelled: { event: cancelled, text: Cancelled }
    transitions:
      confirmed: [out, cancelled]
      out: [returned]
    holds: { what: machine, from: from, until: until, while: [confirmed, out] }
  • what is a field naming what is held: a required type: record field of: the bucket of the things (here of: machines), on every form that records into the bucket. With multiple: true the record holds each thing it names, and a type: collection field holds every record gathered in it.
  • from is a required type: date field, the first day held, and until the last, which counts. Or say for instead of until: a required type: duration field in days or weeks (units: [days, weeks]), so a form asks “first day” and “how long” and the last day follows.
  • while is the states in which the record holds it. Outside them it holds nothing.

A record holds what it names from the moment it enters a while state, in the same write as the move, and lets go the moment it leaves: a hire returned early frees the rest of its days at once, and a hire moved to other days moves its hold. One thing has one holder on any day, whichever bucket holds it: a bucket of services that holds the same machines refuses a service planned over a hire’s days, and the hire over a service’s. A submission or a move that would hold a thing someone else holds on any of its days is refused with nothing written, and the person is told so in words; so is a last day before the first.

A record can hold several kinds of thing; holds: then takes a list:

  - bucket: services
    initial: planned
    states:
      planned: { event: planned }
      done: { event: done }
    transitions:
      planned: [done]
    holds:
      - { what: machine, from: from, until: until, while: [planned] }
      - { what: mechanic, from: from, until: until, while: [planned] }

No bucket’s holds go before another’s: an urgent repair over a booking is a desk cancelling the hire, or moving it to another machine, and then planning the service. A list of the things can be narrowed to the ones free on a visitor’s days, and a booking made by picking one (see the content reference).

holds: is for a thing held over days a person chooses; board: and places: below are for a number of seats at a fixed time.

board and places

  - bucket: shifts
    initial: open
    states: { open: { event: posted }, full: { event: full }, cancelled: { event: cancelled } }
    transitions: { open: [full, cancelled], full: [open, cancelled] }
    board:
      capacity: places           # a field of the record, or a number
      full: full                 # portal moves open <-> full
      starts: start
      ends: end                  # or duration: 4h
      summary: what
      location: where
      needs: [{ field: has_key, label: Someone with a key, at_least: 1 }]
      plan: public               # who may subscribe to /ics/shifts.ics
  - bucket: shift_places
    initial: waiting
    states: { waiting: { event: waiting }, taken: { event: taken }, withdrawn: { event: withdrawn } }
    transitions: { waiting: [taken, withdrawn], taken: [withdrawn] }
    places: { on: shifts, slot: shift, taken: taken, waitlist: true }

A form recording into the places bucket takes a place on the thing its slot field (type: record, of: the board) names. Before anything is written, portal puts the place in the board’s ledger, which is written only over the revision it was read at: a thing never holds more than its capacity, and one person (by address, phone or account) never holds two places on it, however many arrive at once. Places are seated in the order they came; the last free places are kept for someone who meets a need still missing. A seated place moves from the first state to taken (stamped board, with that state’s mail); without room it waits there, or with waitlist: false it is refused, with words saying why. When a place leaves taken or the line (an own link, a desk), the next that fits moves up; the thing moves to full and back as it fills and frees.

A place that is decided on and still counts says so in keeps: a tender that takes three quotes (places: { on: tenders, slot: tender, taken: received, keeps: [chosen, not_chosen] }) keeps all three seats when the board chooses one and turns the others down, so the decision does not open the tender to a fourth. A quote withdrawn (not kept) still gives its seat up. Each state in keeps must be declared, and neither the first state nor taken. words: { places: quotes, full: Enough quotes } on the board: says what its places are called, and place: what one is, for a board of one (Content reference).

A place may count for more than one seat: places: { ..., count: people, at_most: 4 } names a type: number field on the form (empty counts 1; below 1 or above at_most is refused at submit, and the lint requires at_most), the ledger sums counts against capacity, a place moves up only whole (a smaller one later in line may pass one that does not fit; nothing else changes in the order), and count is refused on a board with needs, since a counted place meeting a need is not defined yet.

A desk may change a place (edit: on a list over the places bucket, see Content reference): the ledger first takes what the record will say, who it is for, what it meets and how many it counts for, keeping when the place came. A waiting place keeps its turn and moves up if it fits now. A seated place keeps its seat; it may count for more only where a place of that size would be seated (room for it, and what is kept for a need still missing left alone), and is refused otherwise. What a place gives back goes to the next in line. A place never moves to another thing this way. A record that holds no place (given up) changes in its log only.

Portal makes those moves and nobody else: the lint refuses a desk button, an own link or a clock into taken or into full, and a board no form can take a place on.

Moves portal makes

after gives a move to a clock; these give moves to portal: a place seated (initial -> taken), a board’s thing full and open again, a notice sent, a paid record moved to its then. Like a clock’s, they go through the same event log and fire the same mail, and the needs check and the map count them.

attended_by

  - bucket: newsletter
    initial: open
    states: { open: { event: received } }
    attended_by: n8n newsletter compose

Names who reads a bucket when no page does. The lint refuses a bucket that a form fills and nothing attends, so no answer is ever sent where nobody looks.

fields

  - bucket: portal_asks
    fields: [name, asker, asker_id, via, ask, to, question, seal_to, alternative, answer, answered_by, words]

The fields portal itself writes on a bucket’s records, when no form fills it. A list’s title: and show: are held to a form’s fields; where there is no form, they are held to these. The built-in portal_payments and portal_asks declare theirs; a content repo’s own bucket has no reason to, since a form says what its records carry.

Who moves what

Nothing in this file says who. A move becomes possible for somebody when a page offers it:

  • a desk resource’s transitions gives it to that resource’s requires_group;
  • an alternative’s self_transition gives it to the person who sent the record, by their link and their email, from the states its from names;
  • a state’s after gives it to the clock;
  • board, places, notice and payment give their own moves to portal.

All of them compile into the same access policy, and the engine refuses anything the graph above does not declare, whoever asks.

Testing one

iris replay runs cases through the same code the running site uses, in a store in memory, and reports what was accepted and what refused.

iris replay --path questions --cases cases.jsonl

Each line of cases.jsonl is one case: a need, a record, and the states it walks. --store <file> runs them in a file instead, and --report-only --store <file> reads a site’s own store back (with the site stopped: the store opens in one process).

Access

Nobody writes access rules by hand. Who may open, read and move what follows from the pages themselves: a page for the board is the board’s, a desk’s buttons are its group’s. Portal compiles the content into one Cedar policy on every load, and every request asks that policy. The sign-in provider says who someone is; portal only decides what they may do.

Where the groups come from

The policy names groups; it does not hold them. A User entity’s parents are the person’s groups, and those come from the sign-in: the groups claim the provider sent, joined with the person’s active memberships when portal keeps them itself. Cedar sees one list either way.

What content compiles to

contentrule
a page with no qualifiesanyone may open and submit
qualifies: case_officersthat group may open and submit
requires_chain: /startthe visitor’s verified answer lineage must reach it
a resource with public: trueanyone may read it
a resource with requires_group: gthat group may read it
a desk resource’s transitionsthat group may make those moves
a list’s edit:that group, the list’s own by default, may change the bucket’s records through the form it names: edit on the bucket (edit:<bucket>:<group>). Reading the history is the same rule
an alternative’s self_transitionthe submitter may make it, from each state in from, with their link and their matching email
an alternative’s invite: {group}the page’s own group may invite into that group
an alternative’s invite: with no groupthe page’s own group may invite without a group: invite on accounts, a rule of its own (invite-account:<group>) that opens no group, and that no invite into a group grants
a form recording into a places buckettake on the board’s bucket, for whoever may submit it
a desk that moves a notice into sends_in (or the form, when it sends on arrival)notify on each audience: the group, or the bucket
a notice that is not mandatoryunsubscribe, for a Recipient whose token is the one kept for them
board.plan: public or : <group>feed on the board’s calendar
a places bucketfeed on it, for a Submitter holding one of its places and its address
qualifies / requires_group: committees_{key}_member on a [key] pagethat group of the record the page’s key names: its Record’s tag member (see A record’s groups)
an invite.group with a gap, or a record’s group’s managesinvite into that group, of the inviter’s record (any record, for a page’s fixed group)
each group of a bucket’s groups:read and post on its room, for that group of that record
any group the content names (see Rooms)read and post on that group’s own Room

Mutations always need a group, whatever public says. A schedule opening a record, and portal’s own moves on boards and notices, are made by portal, as a clock’s are, and grant no person anything. A resource with neither public nor requires_group is unreachable rather than open: the policy fails closed.

Reading the policy

iris check --path questions --access

prints every rule the content compiled to, as a table of who may do what from where to where. It is the fastest way to find a rule a content repo did not mean to write — a refusal available on the day a case arrives, a board that can decide a case it never received.

Asking it

Every decision carries the rule ids that granted it. Refusals and every mutation are written to the site’s log (target portal::access).

A program beside the site asks the same question over dhd/1 (May), with the same principal, action, resource and context the server uses internally — so an automation acting as a group gets exactly the answer a person in that group would.

A principal may also name a person by sub, phone or email and list no groups; portal then looks their memberships up before deciding. That is what makes the policy usable for someone who has never opened the site.

A record’s groups

A bucket with groups: (state machines) gives each record groups of its own, named <bucket>_<key>_<name>. The policy has a Record entity per such record, bucket its attribute and one tag per group, that group’s Group. Pages, lists, buckets, groups and rooms may be about one (record?), and a rule on committees_{key}_member asks resource has record && resource.record.bucket == "committees" && principal in resource.record.getTag("member"). What a resource is about is read when the decision is asked:

  • a page or a list: the key of its address (/committee/traffic);
  • a record (Resource::Record, for a move): its own key in a bucket with groups, else its belongs_to field;
  • a group or a room: its name, when it is one of a record’s (committees_traffic_member, with name: member).

A resource about no record meets no such rule, and a person’s groups with a gap in them are dropped before anything is asked.

A record that is its sender’s own

A bucket with owned_by: sender (state machines) has two rules, and so has every bucket that belongs to it:

@id("own:courses")
permit(principal is User, action in [Action::"see", Action::"talk"], resource == Bucket::"courses") when { principal.sub == context.owner };

@id("shared:courses:guides")
permit(principal in Group::"guides", action in [Action::"see", Action::"talk"], resource == Bucket::"courses") when { ["open"].contains(context.state) };

see is reading a record and talk its conversation. The context is read off the record when the question is asked: owner, the subject the site wrote on it, and state, where it stands; for a record that belongs to an owned one, both are that one’s. They are asked for every record of a list, for a desk’s move, for a change, for a file on the record and for a new record that would belong to it, beside the checks those had before, never instead of them. Nobody signed in, and a record with no owner, meet neither rule. iris check --access lists them (the owner | see, talk | bucket courses).

Rooms

Every group the content names has a room in the site’s chat (Rooms), and the policy says who is in it: a group may read and post its own room, the Room whose name is the group’s, and nothing else grants a room. One rule per group, with the id room:<group>:

@id("room:counter")
permit(principal in Group::"counter", action in [Action::"read", Action::"post"], resource == Room::"counter");

A group is named wherever the content names one: a page’s qualifies, a resource’s requires_group, an invite:’s group, a state’s grants:, a schedule’s handled_by and for_each.group, a notice’s senders and group audiences, a board’s plan: group, a responsible:’s group. iris check --access lists the rules with the rest (group counter | read, post | room counter); the map and the manual leave them out, since every group has one.

The chat asks with May over dhd/1, on every connection to a room and every post:

{ "principal": { "kind": "user", "sub": "<oidc sub>", "email": "a@b", "groups": ["counter"] },
  "action": "post",
  "resource": { "kind": "room", "name": "counter" } }

and gets the same answer as any other question: allow, and the rule that granted it (room:counter), or a refusal with none. A thread on a case is a question of its own, { "kind": "thread", "room": "counter", "bucket": "hires", "id": "7f3a…" }: of a record that is its sender’s own it is who may talk about that record, the owner and the group it is shared with while it is; of any other record it is answered as its room. A post is noted in the site’s log either way, a read only when refused, as for everything else.

The submitter

A person who sent a form has no account. Their credential is the link: an unguessable chain hash, plus the email they gave, which the policy compares against the one stored on the record.

What they may do, and from where, is self_transition.from. Its default is the initial state alone. A refusal reads “not found” while the record is somewhere the move could have been made from — so the endpoint cannot be used to discover which records or addresses exist — and “already processed” once the case has moved past it.

Memberships

A site’s groups are named in its content (qualifies on a page, requires_group on a list, invite: { group } on a desk, grants on a state). Who is in each group is kept in one of three places, chosen by PEOPLE_BACKEND; the content and the policy are the same whichever it is.

PEOPLE_BACKENDwho is in a group is keptaccounts are made bychoose it when
membershipsin portal, as records in portal_membershipsthe sign-in provider (Vipps Login, any OpenID provider), or a Kanidm or Rauthy beside itpeople already have a way to sign in
kanidmin Kanidm’s groupsKanidm, on portal’s invitethe site has a Kanidm of its own (Bringing your people in)
rauthyin Rauthy’s groupsRauthy, on portal’s inviteyou want sign-in pages in Norwegian and an admin to see the groups (below)

This page is mostly about the first: groups kept by portal itself. A person’s memberships count exactly as a groups claim from the provider would.

A membership is a case

One record per group and person:

statemeanshow it gets there
inviteda place is held for thema desk invite, a state that grants, the first person, someone the content names as responsible
activethey are inthey signed in, and the provider’s subject, phone number or address matched the record
removeda desk took them outa button on the desk that lists the bucket; inviting them again reopens the record

The record carries name, group, by (who or what put them there: a username, seed, responsible, or the case as bucket:id), and what is known of the person: phone, email, sub. At sign-in everything the provider verified is written onto every record that matched, so a record made from an address learns the phone number, and the next sign-in matches on the subject before anything else.

Because it is a case, a desk lists it like any other bucket:

        resource:
          source: { bucket: portal_memberships }
          requires_group: board
          transitions:
            - { from: invited, to: removed, label: Withdraw }
            - { from: active, to: removed, label: Take out }
            - { from: removed, to: invited, label: Invite again }

A person is their phone number first

A provider that verifies phone numbers (Vipps) makes the number the surest thing a record can hold. So a person is known by, in order: their phone number, their email address, the provider’s subject. A form that collects phone, telefon, tel or mobil gives the first; email or epost the second. Numbers are kept as +4791234567 whatever way they were typed; a bare national number gets the site’s country (PHONE_COUNTRY, +47 unless set). Addresses are lowercased.

At sign-in a record matches a person on any one of the three, so a desk that invited by address and a decision that granted by number are talking about one person, and there is one record.

An address counts only if the provider stands behind it: one it says it has not verified (email_verified: false) is left out of the session, so it matches no record and makes nobody responsible for a page.

A number is only sure when the sign-in proves it (a provider giving phone_number). What someone types on a form proves nothing, and two people may share a phone. So a grant that gives a number another record in the group holds, with an address of its own, is another person: they get a record of their own by that address. The number stays with the record that had it, and theirs keeps it as phone_given, or a sign-in with the number would be taken for them. Given with no address, or matching a record with none, the number finds that record, and an address given then is written on it.

Switching a site to memberships

PEOPLE_BACKEND=memberships

Unset, a KANIDM_API_TOKEN means Kanidm and no token means memberships. With memberships:

  • A desk invite writes an invited record and mails “log in at the site, and your place is there”. The provider makes people, portal makes members: with Vipps Login everyone can already sign in. A Kanidm still configured beside memberships (KANIDM_API_TOKEN) makes the account too (or Rauthy, see below), with no group and the one-time link in the mail, so a site can switch to memberships before its provider does. Someone whose account has nothing to sign in with yet missed their link, and gets a new one, in the mail and nowhere else; someone who can sign in only hears of the place. Invite again on a removed record sends the same.
  • An invite with no group (invite: {}) writes nothing here: a membership is a place in a group. The account is all it asks for, so only a Kanidm beside memberships can meet it, with the account and the one-time link, tracked in portal_invites. With no Kanidm there is nothing it could mean: the provider makes people, and anyone who can sign in already can. iris check refuses it, when it can tell: PEOPLE_BACKEND=memberships where it runs with no Kanidm configured there, or, with the variable unset, a desk listing portal_memberships. (A site with a Kanidm beside its memberships lints with PEOPLE_BACKEND=kanidm.) The content does not otherwise say where people are kept, so should one get through, the site says so in its log at start, and the desk refuses the form.
  • grants writes a record for the person the case is about, from the form’s name and phone number or address, and goes the way a desk invite does: a Kanidm beside memberships makes the account too, with the one-time link in the mail. On a site with sign-in off (neither OIDC_ISSUER nor KANIDM_URL) and no Kanidm to make an account, there is nothing for the person to do with an invite, so none goes to them: the site’s inbox (mail.reply_to, else mail.from) gets a line saying who now has a place in which group, to tell them if they should know. A mail the content wrote for the invite (invite.mail, or site.yaml’s mail.invite) that needs no link, naming none of {link}, {username} and {expires}, still goes to the person.
  • SEED_ADMIN_PHONE or SEED_ADMIN_EMAIL writes the first person’s.
  • The people the content names as responsible get theirs in RESPONSIBLE_GROUP, and lose it when the content stops naming them.
  • The groups claim, if the provider sends one, still counts: a person’s groups are the union.

Rauthy

Rauthy writes its sign-in pages, its admin and its mail in Norwegian (nb) among a dozen languages, which Kanidm does not. A site signs in through it and keeps its groups in portal:

OIDC_ISSUER=https://id.example.no/auth/v1/
OAUTH2_CLIENT_ID=<the client made in Rauthy>
OAUTH2_CLIENT_SECRET=<its secret>
PEOPLE_BACKEND=memberships
RAUTHY_URL=https://id.example.no
RAUTHY_API_KEY=<name>$<secret>
RAUTHY_LANGUAGE=nb

The client wants the authorization_code flow, S256, the scopes openid profile email (and groups with OIDC_EXTRA_SCOPES=groups, if Rauthy should assert groups of its own), and <PUBLIC_URL>/auth/callback as its redirect. The API key is one made in Rauthy’s admin with read and create on users, nothing more.

With the key, Rauthy stands where a Kanidm beside memberships stands: an invite, grants, the first person and the people the content names as responsible get an account if they have none, by their address, in no group. Rauthy, not portal, then mails them how to set a password, in RAUTHY_LANGUAGE; portal’s own invite mail has no link in it and says where to sign in. Portal cannot ask Rauthy for a new link (its reset wants a proof of work from a browser), so Invite again mails the place and the way to the sign-in page, where “Forgot password” sends one. An invite counts as taken when Rauthy shows the account has something to sign in with, or when the person signs in.

Groups in Rauthy

PEOPLE_BACKEND=rauthy moves the groups there too, as kanidm does for Kanidm: Rauthy is where they are, with its admin to see and change them, and portal still decides what each may do. The content does not change: an invite, grants, revokes, the first person and the people named as responsible put a person in a group in Rauthy (made if it is not there), a removal from a desk takes them out, and the invite is a case of its own in portal_invites, waiting for them to come.

  • Sign-in asks for the groups scope, so the token carries them.
  • The chat’s question and a desk’s member list read Rauthy at the time they are asked, so a removal there counts at once for the chat; on the site, at the next sign-in, as with every backend.
  • The key wants read, create and update on users and read and create on groups, and, where records have groups of their own, read, create and update on roles (a group that manages others comes with rauthy_admin:<bucket>_<key>_..., see state machines). A group’s name in Rauthy is lowercase letters, digits and -_/,:*, 2 to 64: a name it would refuse is refused before any call.
  • Rauthy takes a person’s groups as one list, so two desks changing one person’s groups at the same moment could lose one change.

Without the key, Rauthy is a provider like any other: people register there themselves if it lets them, and an invite is the place in the group, waiting for them.

With OIDC_EXTRA_SCOPES=phoneNumber the sign-in asks the provider for the number and reads phone_number from userinfo. Set it for Vipps; not for Kanidm, which denies a sign-in that asks for a scope the person does not hold. Without it, matching falls back to the address.

Asking who belongs

Other applications ask portal the same access question they always could, over dhd/1 (May). A principal that names a person and lists no groups is looked up. groups must be there, if empty, or the question is refused:

{ "principal": { "kind": "user", "sub": "vipps:abc", "groups": [], "phone": "912 34 567" },
  "action": "transition",
  "resource": { "kind": "bucket", "name": "hazards" },
  "context": { "from": "open", "to": "fixed" } }

The answer is Cedar’s, with the rule ids that granted it, for a person who may never have opened the site. That is the whole authorization engine: the provider says who, memberships say what they belong to, the policy compiled from content says what they may do.

What Kanidm still does

For a site on Kanidm nothing changes: invites make accounts and add to Kanidm groups (an invite with no group makes the account and adds to none), and portal_invites tracks the one-time links. The two backends can be swapped by the one variable; the content and the policy are the same either way, except that an invite with no group only means something where a Kanidm can make the account.

Mail

A mail is a subject and a body in markdown, with {placeholders} filled from the case. Portal writes it in the same write as the move that sends it, so a mail exists exactly when its move does; gdo delivers it, and a reply comes back as a note on the case.

What sends mail:

  • a state, as a case arrives there (State machines);
  • an invite, in portal’s words or the content’s (invite: { group, mail }, mail.invite in site.yaml);
  • a page naming someone responsible, telling them so;
  • a suggested change, as it moves.

Variables

A placeholder is { letters, digits, _, - or . }. One that names nothing renders as nothing; a brace that opens no name stays a brace. The variables come in layers, so a template written for one kind of mail reads the same in another.

On every mail

{site}the instance’s public URL, no trailing slash
{site_name}site.yaml’s title

On a mail about a record (every state mail)

{field}any field of the record, as the form sent it
{chain}the record’s id
{email}the record’s email field, trimmed
{bucket}, {state}where it is and the state it just entered
{machine.name}a field of the record a type: record field points at: a booking’s machine, a reply’s notice
{self_link}the record’s own page for the person it belongs to: a page offering a self-service move (self_transition) on the bucket from the state the record is in, with the ?chain=&email= that lets them act without signing in. Empty when there is no such page or no address
{link}where this reader acts: {self_link} in a mail to: submitter; in one to anyone else, the page whose list over the bucket has transitions (else one that reads it); and {site} when there is neither
{payment_url}on a state with payment: only: where the person pays, the link the money service gave, else {self_link}. With a service, a mail that says it waits until the service says the request is out (State machines)

{link} is the one to reach for. “See the report and book a visit: {link}” sent to the caretaker opens the desk the report is on; “The fault you reported is fixed. {link}” sent to the tenant opens their own case where they can still act on it, or the site when there is nothing left for them to do.

On a mail about a place on a board (a places bucket)

{ics_link}the person’s own calendar of their places on the board
{slot.field}through the type: record field naming the thing, as above: {shift.what}, {shift.start}

On a notice (notice: on a bucket; see State machines), beside every field of the notice: {name} (the recipient’s), {audience} (the audience’s label) and {unsubscribe_link} (empty on a mandatory notice). Portal adds the window and the way out (or the word that it cannot be stopped) under the body itself, so neither can be left out.

On an invite and the note to someone responsible, beside every field of the invite’s form: {name}, {username}, {email}, {group} (invite, the group as a person reads it: Medlemmer, or the content’s own label, not the name in aggregates.yaml), {questions} (responsible), {expires}, {link}, which here is the one-time sign-in link, and {handbook} (invite): the link to the group’s handbook, /handbook/<group>.

Portal’s own words for an invite into a group end by pointing to that handbook, which the group reads once signed in (A manual for the people who run the site). Words the content writes carry it where they name {handbook}.

An invite with no group has no {group} to fill. Its own mail is refused if it names one or leaves out {link}; site.yaml’s mail.invite is used if it fits and otherwise left for portal’s own words, which speak of the account alone. Someone who already has an account gets a line telling them to sign in, as there is no link to give.

A field a form asks for with type: prosekit holds HTML. Named in a mail’s body, it goes in the HTML part as written, cleaned against the same allow-list a list uses, and in the plain part as readable text: blocks apart, a list as a list, a link with where it goes. In a subject, as text. The same goes for one on a record it points at, {notice.text}.

A calendar entry

A mail about a time carries it, so it lands in the reader’s calendar:

confirmed:
  event: confirmed
  mail:
    to: submitter
    subject: "Your {machine.name}, {from} to {until}"
    body: "The {machine.name} is yours from {from} to {until}."
    event: { start: from, end: until, title: "{machine.name}", location: "{machine.where}" }

start and end name fields of the record: a type: date is a whole day, a type: datetime-local a time in the site’s timezone. Portal puts the event on the message as the person meant it, one per record and state; gdo turns it into an invite the reader’s mail client offers to add (a text/calendar part), and, where it has a calendar of the site’s own, writes it there too. The mail says which, so nobody wonders whether a calendar got it. A gdo from before events sends the mail as before, without the entry.

What the lint holds a mail to

A state mail that sends from a state no record reaches warns; one that names a field no form recording into the bucket collects fails, since it would go out with a blank where the field should be. The lint knows every variable above, so {link} and the rest are never flagged. to: submitter requires a required email on every form filling the bucket, and to: "{notice.email}" requires the notice field. An event: requires its start on every such form, required, as type: date or type: datetime-local, and its end likewise where one is named; the two may not be the same field.

Rooms

Every group on a site is a room in its chat, and portal says in that room what the group needs to act on: a new case on its desk, a deadline about to run out, a round that opened. People talk where they already are, and the desk stays where the work is.

The chat, kino, is a program beside the site, signing people in through the same provider, that dials the site over dhd/1 with a key of its own, like gdo and kron. It watches the site’s groups, takes what the site says in each room, asks who may read or post, and tells the site when a case has a thread. The design is issue #102; this page is what was built.

What a site gets

With nothing set but what a site already has, portal:

  • keeps every group the content names as a room, for the chat to Watch, and drops a group the content no longer names at the next load;
  • answers the chat’s question whether a person may read or post in a room (May, see Access);
  • says in a group’s room what lands on its desk, what a clock is about to do and did, what someone else moved, and what a schedule opened;
  • keeps what the chat says about a case’s thread, and shows it on the case on the desk, “Conversation in Counter (3)”, linking to the thread.

With CHAT_URL set, a case with no thread yet shows “Start a conversation”, linking to ${CHAT_URL}/room/<group>/case/<bucket>/<id>, where the chat opens the room with the thread beside it. Without CHAT_URL, and with no thread, the case shows nothing. With CHAT_URL, anyone signed in also gets “Open the chat” after the “Asked by” line. (Each in bokmål on a Norwegian site: “Samtale i …”, “Start en samtale”, “Åpne chatten”.)

A site with no chat beside it loses nothing: what it would say waits in its outbox for no one, and costs next to nothing.

The chat beside the site

The site names the chat’s key <key>=rooms,watch,may in DHD_KEYS. Every room and message carries the site’s name (SITE_NAME), so two sites’ board are two rooms.

whathowwho sayswho hears
the groupsWatch of groups: one document per room, then every changeportalthe chat
what the site saysrows of the rooms outbox, down the chat’s Serveportalthe chat, which keeps each in its room
who may read or postMaythe chat asksportal answers
a thread existsNote with subject: threadthe chatportal, which keeps the newest per case (portal_threads)

The thread’s messages never leave the chat. Portal keeps how many there are and where the thread is, nothing else.

The groups

A group is named wherever the content names one: a page’s qualifies, a resource’s requires_group, an invite:’s group, a state’s grants:, a schedule’s handled_by and for_each.group, a notice’s senders and group audiences, a board’s plan: group, a responsible:’s group. The key is the group’s name as the content writes it (without any KANIDM_GROUP_PREFIX). A name that cannot be a room’s name (anything but letters, digits, -, _ and =, or the name thread, which the chat keeps for itself) is left out, and the log says so.

The counter of the machine-hire example is one room:

{
  "group": "counter",
  "label": "Counter",
  "site": "northfield",
  "site_label": "Northfield Hire",
  "site_url": "https://hire.example",
  "lang": "en",
  "room": "northfield.chat.room.counter",
  "duties": [
    "Has 1 question only they see.",
    "Their desk: “What is happening at the counter?”.",
    "Sees hires.",
    "Moves cases in hires."
  ],
  "desks": [{ "label": "What is happening at the counter?", "url": "https://hire.example/counter" }],
  "updated": "2026-10-30T12:00:00Z"
}
  • label: the content’s own word for the group, where it has one: the name of a responsible: that names the group, else the label of a notice audience of it; otherwise the name made readable.
  • site: the namespace (portal without SITE_NAME); site_label the site’s title; site_url its PUBLIC_URL.
  • lang: the language’s code where portal speaks it (nb for no, nn, sv, da, de, en), else its lang as given.
  • duties: the sentences iris manual writes for the role under “Who does what” (“Hvem gjør hva”), as plain text, in the site’s language. The site has no needs.yaml, so a state is said by its text:, else its id made readable. May be empty.
  • desks: the pages that hold a desk of the group’s (a list of a bucket with buttons and the group’s requires_group), with absolute URLs; a dynamic page has no one address and is left out.

A key whose value is unchanged but for updated is not written again, so a reload that changes nothing about a group does not wake the chat.

What the site says

Each message is a row of the rooms outbox, handed to the chat down its Serve. A hire booked on the machine-hire site tells the counter:

{
  "id": "northfield:hires:7f3a…:landed:1",
  "group": "counter",
  "kind": "landed",
  "text": "New case: “Book a machine” (Wednesday 2 December 2026, Friday 4 December 2026).",
  "case": { "bucket": "hires", "id": "7f3a…", "url": "https://hire.example/counter#7f3a…" },
  "at": "2026-11-20T09:12:00Z"
}

id is <site>:<bucket>:<record>:<kind>:<n>, where n is how far into its event log the record is after the move (the time of the move for a record with no log, or just sent in). The same occurrence always has the same id, so the chat relays it once however often it hears it. case.url is the desk that shows the case, with the record’s id as the fragment; the row on the desk carries that id.

A group’s desks over a bucket decide what it hears. A desk holds a state when it lists records there and has a button from it: something for the group to do.

kindwhentosays (bokmål / English)
landeda record is sent in, or moved by anyone but the group itself (a member of another group, the sender, portal), into a state the group’s desk holdseach such group“Ny sak: …” / “New case: …”; “Ola flyttet en sak til «…», og nå venter den på dere: …” / “Ola moved a case to “…”, and it is waiting for you: …”; “En sak kom til «…» og venter på dere: …” / “A case came to “…” and is waiting for you: …”
moveda member of another group, or the sender, moved a case the group’s desk listed somewhere it has nothing to dothat group“Den som sendte den inn flyttet … til «Trukket».” / “The person who sent it moved … to “Trukket”.”
clock_soona state’s after: clock runs out within a dayeach group whose desk holds the state“Fristen for … går ut innen et døgn, og da flyttes saken til «…».” / “The deadline for … runs out within a day, and it then moves to “…”.”
clock_rana clock ran out and moved the caseeach group whose desk holds the state it left or came to“Fristen gikk ut for …, og saken er flyttet til «…».” / “The deadline ran out for …, and it has moved to “…”.”
openeda schedule (recurs:) opened recordsits handled_by“En fast runde har åpnet seg for dere: …” / “A regular round has opened for you: …”; several in one pass: “3 faste runder har åpnet seg for dere: …” with no case

The case is said as the choice it was sent by, quoted, and the first two short answers the form asked for (text, a choice, a date, a number; never an address, a phone number, a long text or a file), a date as the site says dates: “Book a machine” (Wednesday 2 December 2026, Friday 4 December 2026). A state is its text:. A state with a clock adds the day it runs out, in the site’s time zone; a schedule’s record its due. The sentences around them are portal’s, in the site’s lang (Languages).

Where it is said from: the submission, a desk’s move, the sender’s own link, the clock sweeper, portal’s own moves (a place given a seat, a notice sent) and the schedule sweeper, each where the move is made, after its mail. clock_soon is said by the clock sweeper (every hour) for each clock that came within its last day since the sweeper last looked; the first look after a start says every one within its last day, which the chat keeps once by its id.

Each message is a row of the site’s rooms outbox, written in the same batch as the move it tells of, and handed down the chat’s Serve; it goes once the chat acknowledges it. A chat that is away for a while finds what was said meanwhile when it dials back, each message once by its id. The desk has every case regardless.

Threads

The chat tells the site of a thread on its first message and every tenth after it, as a Note with subject: thread whose text is the thread:

{ "group": "counter", "bucket": "hires", "id": "7f3a…", "count": 3,
  "url": "https://chat.example/room/counter/case/hires/7f3a…" }

Portal keeps the newest per case in portal_threads, key <bucket>.<id> (one with a lower count than the one kept is not kept), only on a bucket of this site’s and only from the key that serves rooms, and the case’s row on the desk links to url: “Conversation in Counter (3)”. The group is said by its label.

A thread has an access question of its own (May with a thread resource: its room, bucket and id; see Access). For most records the answer is the room’s. For a record that is its sender’s own (state machines) it is the record’s: the owner, who may be in no group, and the group the record is shared with while it is. The thread is kept in that group’s room, and a list of the owner’s own records links to it as a desk’s does, so the owner and the group meet in one place and nobody else in the room’s group reads it once the share has ended.

Rooms of a record’s groups

Each group of each open record (state machines) has a room of the same name, committees_traffic_member: the name in the sign-in provider, in the token’s groups claim and in the rooms the chat watches is one, so a chat may match a person’s claim against a room without asking the site; asking the site works as for any room. The label is the group’s label with {label} for the record’s name ("{label}, leads"), else <name> (<group>). A desk for such a group speaks in that group’s room of the record a case is about, and its case links go to the [key] page at that record’s address. A closed record’s rooms leave the groups the chat watches at the next load.

Storylines

The same site, told two ways, and counted: which words bring people in, and how their cases go, learned from counts alone, with no one tracked.

Anywhere content says something to a person, it may say it in several ways by giving a list instead of one string:

name: Want to help out in the neighbourhood?
description:
  - The work day, the spring fair and the committees need more hands. Say what you can do.
  - The neighbours do most things themselves. Sign up here for whatever you fancy.
alternatives:
  - name: [Join in, Sign me up]
    consequence: [[Send], [Count me in]]

Each index is a storyline. A visitor is given one at their first request, kept in a cookie (portal_storyline) for a year, and reads that storyline on every page, in every button and in every mail the site sends them about their case. A single string is every storyline.

The rules

  • Same length everywhere. Every list of texts in the content has the site’s arity, so a storyline never has a hole in it. The lint refuses a list of another length and names it.
  • What varies is what a person reads: name, description, label, placeholder, title, a mail’s subject and body, a list’s empty line, consequence and encouragements (those two as lists of lists).
  • What the machine reads never varies: a field’s name (the stored key), a select’s options (the stored values), states, groups, paths, buckets.
  • One storyline per site, not per page. That is what makes it a storyline rather than a scatter of variants: a warm front door leads to a warm form and a warm mail.
  • A signed-in person keeps the storyline they had as a visitor.
  • A site that tells one storyline sets no cookie.

What is counted

Every record and every answer event carries the storyline it came from (storyline on Answer and on every row of the answers outbox). The mail a case gets tells the same storyline, so a person who read the warm front door is not thanked in the plain voice.

GET /report gives the counts, per bucket, per storyline, per state:

{ "storylines": 2,
  "buckets": { "requests": { "0": { "open": 3, "solved": 9 },
                             "1": { "open": 5, "solved": 14 } } } }

Storylines are assigned evenly, so those numbers are the comparison: which words brought more people to send, and how their cases went. No record, field, address or time leaves the site. The trainer reads this (bratac report) next to what its personas scored offline, and the plan’s tones are where the storylines are written.

Framings, and how they are rolled out

A wording of one option is a framing, and it has an id: f and the first twelve hex digits of the sha256 of the card as the visitor reads it, heading, description, button, sections and all (card::framing_id, the same text the trainer’s visitors and learn are shown). The id follows the text, not the slot: the same card has the same id on any page, at any storyline index and in any commit, and a one-character edit is a new framing. So a count, an offline score and a live outcome join by wording even when the lists are reordered, padded or rolled back. The trainer, learn and the search box’s counts (the card it ranked first) name wordings by it; records and /report still count by storyline index.

New framings reach a live site append-only:

  • Storyline 0 is never rewritten. It is the live text, and what the machine reads beside the words (the needs’ via, the access policy, icons) is built from it. A new framing takes an index at or above the site’s current arity.
  • Arity stays equal by padding with the live text. A need with fewer new framings than the others repeats its live card in the spare indices; the repeats have the live card’s framing id, so their counts merge with it rather than look like a new wording.
  • A visitor keeps their storyline. A cookie naming an index the site still tells is kept; only one at or above the new arity is drawn again, evenly, as at a first visit.
  • Rolling back is a rebuild at arity 1, with the live words alone: every visitor reads storyline 0 again, and the records already made keep the index and the framing they came from, so nothing counted is lost. Retiring one losing framing among several is replacing its texts with the winner’s at the same index: same arity, nobody re-drawn, the two ids’ counts merge from then on.
  • Never reorder the lists and never edit a live index in place; either silently changes what an index meant for everyone already holding it.

Which framings are worth adding is decided offline, by how well each routes the people it is for and leaves the others alone, never by which a judge prefers (Learning). Nothing about the visitor picks their storyline.

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.

A manual for the people who run the site

iris manual --path questions [--for <group>] [--out manual.pdf] [--typst-only manual.typ] [--slides slides.md] [--map map.svg]
            [--edition owner|showcase] [--author <name>] [--preview-url <url>] [--repo-url <url>] [--chat-url <url>]
            [--date YYYY-MM-DD]

The site’s content already says who comes, what they ask for, who answers and what happens next. iris manual (or portal manual, the same code) writes that down as a handbook for the board, the manager and the crew: a PDF to hand over at the first meeting, and to print again when the content changes.

It reads a checkout as iris check does (site.yaml, aggregates.yaml and needs.yaml one level above the pages), refuses what the site would refuse, and writes a Typst document and its PDF.

Nothing in it is invented. Every name, field, button, state, mail and contact is quoted from the content. The sentences around them are portal’s own, written by hand in the site’s language (site.yaml lang; see Languages). No model writes any of it, and the same content always gives the same document.

What is in it

  1. The cover: the site’s title and wordmark (an SVG the repo holds; a white mark for a dark header is left out), the front door’s description, the date, the content’s commit and the portal version.
  2. How it works: the choices on the front door, how to read the map, and the map itself (iris map’s drawing) on the smallest paper (A4, A3 or A2) that keeps its words legible.
  3. What people come with: one part per need in needs.yaml. Who comes and what they want, the door they take, the fields they fill in, the button they press, the list the case lands in and the desk that takes it, every state in the business’s own words, the mails each state sends, and what moves a case on until it ends.
  4. Who does what: every role the access policy names, in sentences: what they see, what they move, what they can do with a link of their own, whom they invite and who invites them.
  5. Bringing in your crew: who the first person is (the most privileged group), an invitation step by step (the desk, the fields, the mail as the content words it, how long the link lasts, the passkey, where they land), a table of who invites whom, and the states that make or end a membership (grants:, revokes:).
  6. What runs by itself, when there is any: schedules (recurs:) and their clocks, notices (notice:) and who gets them, places (board:, places:) with room, waiting lists and calendars.
  7. Changing something: “Suggest a change”, that every change is checked and can be undone, and who answers for which questions.
  8. From here: the front door’s contact, where the site’s mail comes from and where replies go.

When something is missing

The manual says what the content leaves out, rather than leave a gap:

missingthe manual
needs.yamlsays the needs are not written down yet; the map shows roles and onboarding only, and the later chapters move up
any invite:says nobody needs to sign in on an open site, or, with groups, that access is given where sign-in is managed
a group on an invitehas a “No group” row: the person gets an account and joins nothing
mail: in site.yamlsays the invite link is on the list of sent invitations, to pass on by hand
a titleuses the name the site’s mail goes out under, then the profile’s organisation
a stylesheet colourprints in slate; otherwise in the darkest --accent, --primary or --brand, deepened to read on paper
Typststops and says so; --typst-only still writes the source

Files

--out manual.pdf (the default) writes only the PDF. --typst-only manual.typ writes the source with manual.map.svg (and manual.wordmark.svg) beside it, for typst compile manual.typ; with --out as well, it does both. --map map.svg writes the map too, so one command keeps a repo’s map.svg and manual.pdf in step.

The fonts are free: Noto Serif and Noto Sans, then Adwaita Sans, then Typst’s own Libertinus Serif, whichever the machine has. Typst 0.12 or later.

The showcase edition

--edition showcase is for a sketch built under an invented name, to attach where the work is shown. Before the contents it adds a short spread: a working sketch under an invented name, used by nobody; where it runs (--preview-url); what it covers and whether all of it passes the lint; who made it (--author); and where the content is (--repo-url, for a public repo). It names no real organisation and claims nothing the content does not show.

After the roles it adds “The conversations”: with the site’s chat, each role is a room of its own (Rooms), which a person joins and leaves with the role, and where new cases and deadlines come in. --chat-url <url> says where the chat can be tried. A site with no groups has no such section, and neither does the owner’s edition.

To stay short enough to attach (twelve pages or so), chapters run on without a fresh sheet, and past three needs the first two are in full and the rest in a table.

For one group

--for verkstedet writes the handbook a group is handed when it starts: the cover and opening name the group, and the book holds the needs it handles or moves, its own role, how its members join, and the series, deadlines, notices and boards on its desks. The front door and the map stay whole, as the place it works in. Run it once per group to hand each crew its own; any other name gets the site’s groups listed back. --slides makes the same as a deck.

On the site

A site makes the same handbook for each of its groups at /handbook/<group>. It is made the first time someone asks and kept until the content changes. The group reads its own, and so do the groups that invite people into it, since they hand it out. An invite into a group links it (Mail), and so does the line of the group’s pages on every page its members open. The host needs Typst, as --out does; without it the invite goes out without the link. /handbook/ is the site’s own, so the lint keeps content pages out of it.

Slides

--slides slides.md writes the same handbook as a deck to talk through at a meeting: the opening, the showcase spread in that edition, the front door, the map, the needs in brief and a slide for each, the roles, how people join, what runs by itself, and what comes next. The sentences are the handbook’s, and the same content gives the same deck.

It is markdown with slides split by --- and a header with the author and date, which the terminal presenter slides and Marp show as they are. The map’s SVG is written beside it as slides.map.svg. With --out too, the PDF is written in the same run.

In the repo

A content repo’s README can carry the handbook beside the map:

![The map of the work](map.svg)

**[The handbook](manual.pdf)**: how the site works, every need from the
door to the end, the roles, and how to bring in the crew.

By hand:

iris manual --path questions --out manual.pdf --map map.svg

Keeping it current in CI

An optional job beside lint-and-reload.yml that makes both again on every push to main and commits them when they change. It needs Typst on the runner and a secret with write access to the repo (MANUAL_PUSH_TOKEN here); without Typst it says so and stops.

name: Manual

on:
  push:
    branches: [main]
    paths: ["questions/**", "aggregates.yaml", "needs.yaml", "site.yaml", "custom.css"]

env:
  PORTAL_RELEASE: v1.0.0   # as in lint-and-reload.yml

jobs:
  manual:
    runs-on: bare
    steps:
      - uses: actions/checkout@v4
        with:
          token: ${{ secrets.MANUAL_PUSH_TOKEN }}

      - name: Make map.svg and manual.pdf
        run: |
          set -eu
          if ! command -v typst >/dev/null; then
            echo "::warning::no typst on this runner - manual not made"
            exit 0
          fi
          # The same iris lint-and-reload.yml fetches, kept where the
          # runner may run it.
          bin="/var/local/cargo-target/iris-$PORTAL_RELEASE"
          [ -x "$bin" ] || { curl -sfL "${{ github.server_url }}/uhhm/portal/releases/download/$PORTAL_RELEASE/portal-x86_64-linux-iris" -o "$bin" && chmod +x "$bin"; }
          "$bin" manual --path questions --out manual.pdf --map map.svg

      - name: Commit them if they changed
        run: |
          set -eu
          if git diff --quiet -- map.svg manual.pdf; then
            echo "map and manual unchanged"
            exit 0
          fi
          git config user.name "portal manual"
          git config user.email "manual@invalid"
          git add map.svg manual.pdf
          git commit -m "Map and manual for $(git rev-parse --short HEAD)"
          git push

The cover names the commit, so the PDF changes with every content push and the job commits each time; the paths: filter keeps its own commit from starting another run.

Languages

Portal speaks six languages:

lang:Language
enEnglish
nb (or no)Norwegian Bokmål
nnNorwegian Nynorsk
svSwedish
daDanish
deGerman

site.yaml’s lang: picks one by its first part, so nb-NO is Bokmål and de-AT German. Any other code gets English.

The language covers every word portal says itself:

  • the page’s buttons, notices and refusals;
  • dates, times and how long until something starts;
  • the mails portal writes (invites, suggestions, events);
  • the handbook and the map;
  • the setup kit’s interview, the mails it sends and the sites it writes.

Your content stays in the words you wrote.

A phrase a language lacks comes from its fallback: Nynorsk from Bokmål, every other language from English.

Where the words are

Each part of portal keeps its words in Fluent files, locales/<code>/<area>.ftl:

CrateAreas
contentpage, dates (the browser loads these)
coreschedules, map, handbook, mail
bratacbuild, interview, mail

A new site’s README is crates/bratac/templates/questions/README.<code>.md.

A phrase names what goes into it ({ $group }) and can follow a number ({ $n -> [one] 1 day *[other] { $n } days }). { CAPITALIZE($name) } starts a sentence with a name.

Changing a word, adding a language

To change a word, edit it in the file for every language.

To add a language:

  1. Add it to Lang in crates/content/src/i18n.rs, with its code and its fallback.
  2. Write its files beside the others.
  3. List it in each part’s files!.

Each part has a test, every_language_says_what_english_says. It names every phrase a language is missing, and every one that names other variables than English.

The Nynorsk, Swedish, Danish and German words are a first draft. Have someone who writes the language read them before a site goes live in it.

Operations

Portal does not deploy itself. It publishes versions; each site decides when to take one.

Cut a release

cargo release patch        # or minor / major

That bumps Cargo.toml, tags v<version> and pushes. CI (.gitea/workflows/publish.yml) reacts to the tag, builds once for each kind of machine (x86_64 on ergo’s runner, aarch64 on macbropro’s; when macbropro is away its files arrive when it is back), and attaches portal-v<version>.tar.gz (portal, bratac, iris, learn, hash.txt, site/, examples/, and models/ when the repo ships a model) and each binary bare (portal-x86_64-linux, -iris, -bratac, -learn) to the Gitea release. Three binaries, one version: portal is the site, bratac the trainer and the kit worker, iris the lint on its own, which a content repo’s CI downloads (portal lint is the same code, so a workflow that pins the portal binary goes on working); the workflow checks each says the tag’s version. The aarch64 files are named beside them: portal-v<version>-aarch64.tar.gz and portal-aarch64-linux, -iris, -bratac, -learn. A deploy asks for its file by name, never for the first of the release: Gitea lists assets by name, and with two machines’ files the first is not x86_64’s. Plain pushes to main only run the tests: nothing reaches production from this repo.

Before cutting, move the Unreleased lines in CHANGELOG.md under a heading for the new version. That section becomes the release notes, and the table at the end of the file records which version each site runs. learn/ is a workspace of its own, so its lock follows by hand: cargo update -p dhd --manifest-path learn/Cargo.toml in the same commit.

Pkg files are content-hashed (hash-files = true, instances run with LEPTOS_HASH_FILES=true), so a freshly served page can never pair a stale cached bundle with new wasm.

Roll it out

In the content repo, one line of .gitea/workflows/deploy.yml:

env:
  PORTAL_RELEASE: v1.0.0

Its CI downloads the pinned artifact, ships /srv/app/<instance>/releases/<tag>, flips current, rewrites the instance env from that repo’s own Actions variables and secrets, restarts app@<instance> and refreshes the Caddy route. Every rollout is a commit, so reverting a bad version is git revert and a push. Sites upgrade independently and may pin different versions.

New content reaches a running site when the content repo’s CI asks for it, after its lint passes (New content, and reading the store), and at every start.

Moving a site to 1.0

1.0 keeps everything a site has in one file of its own, and the programs beside it dial it. Nothing moves over from NATS: what a 0.x site needs comes across with portal import.

  1. A place for the store. The unit needs a StateDirectory= drop-in (The site’s store).
  2. The programs. gdo, kron, learn and the kit’s worker each get PORTAL_DHD=<site key>@<address> and say their own key as they start; the site names them in DHD_KEYS (Programs that dial the site): <gdo>=mail,note,ask:owners;<kron>=payments,ask:owners;<learn>=rank;<kit>=kit. The site’s key is in its log as it starts, so a program comes up on the second deploy. Sites sharing a host each get a DHD_BIND port of their own.
  3. The automations. n8n takes the answers as a signed webhook (DHD_HOOKS=answers=https://…, DHD_HOOK_SECRET) and calls the site over HTTPS with a token (DHD_TOKENS).
  4. The content’s CI posts Load with a token named load, and prints what the site answers: {"loaded": …}, or 422 with why the content did not pass (the last good content serves on).
  5. Backups to garage, varde or both (Backups).
  6. The content passes 1.0’s lint, which refuses a key no page reads (0.x let it pass): an old route: or bind:, or a label a comma cut short in a flow mapping (label: "Inhabil, går ut" needs its quotes). iris check --path questions at the new release says where.

The search box is off until site.yaml asks for one (search:, Content reference). Before a site adds it, its host needs Ollama serving bge-m3 at OLLAMA_HOST (http://127.0.0.1:11434 unless set), and the release’s learn beside portal, which the tarball brings; a learn serve --dhd beside the site saves starting a process per search (The ranker).

Add a site

  1. A content repo with a copy of an existing deploy.yml: change INSTANCE, the port and the domains.
  2. Its Actions variables: PUBLIC_URL, SITE_NAME, and sign-in (OIDC_ISSUER or KANIDM_URL, with OAUTH2_CLIENT_ID).
  3. Its secrets: OAUTH2_CLIENT_SECRET, PORTAL_GITEA_API_TOKEN (Gitea reserves the GITEA_ prefix for secret names) and LOAD_TOKEN, with which its CI hands the site new content.
  4. A sign-in client at the provider (Bringing your people in).
  5. A place for the store: the unit’s StateDirectory= drop-in (The site’s store).
  6. DNS for its domains.

site.yaml handles all branding; no portal change is needed.

Environment

Runtime configuration is environment variables; src/main.rs is the authority and each content repo’s deploy.yml holds the production values.

LEPTOS_SITE_ADDRthe address the site listens on; 127.0.0.1:3010 unless set, and a unit sets each instance its own port
PORTAL_STOREthe site’s own redb file (see The site’s store). Unset, site.redb in the unit’s STATE_DIRECTORY; with neither the site does not start
PORTAL_COMMANDwhat portal does when started with no arguments, in place of serving: import --path … <file>, for a unit that runs an import into its own store (Starting a site filled in). Unset: the site
DHD_KEYS, DHD_BINDthe programs that dial the site, and where (see Programs that dial the site)
CONTENT_REPO, CONTENT_BRANCHthe repo that is the site
CONTENT_DIRthe site from a directory on this host instead (questions/, aggregates.yaml, site.yaml, and the files /site/ serves), read at start and on every Load: for trying a site out or writing one offline (Try it)
KANIDM_URL, OAUTH2_CLIENT_ID, OAUTH2_CLIENT_SECRETsign-in
OIDC_ISSUERsign in through another OpenID provider than Kanidm: its issuer, exactly as its discovery document gives it (Rauthy: https://id.example.no/auth/v1/). Wins over KANIDM_URL for sign-in; KANIDM_URL may stay for making accounts
PEOPLE_BACKENDkanidm, rauthy or memberships (see Memberships); unset, Kanidm when KANIDM_API_TOKEN is set, memberships otherwise
KANIDM_API_TOKENinvites and grants: through Kanidm
RAUTHY_URL, RAUTHY_API_KEY, RAUTHY_LANGUAGEwith memberships and no Kanidm: accounts made in Rauthy (see Memberships). The key is <name>$<secret> with read and create on users; the language is the one Rauthy writes the account’s pages and mail in, nb for Norwegian, English unless set
KANIDM_GROUP_PREFIXfor a Kanidm shared with other sites: the content’s kunder is the group <prefix>kunder there, and the OAuth2 client’s claim map gives it back to portal as kunder
PHONE_COUNTRYthe calling code a bare phone number gets, +47 unless set
OIDC_EXTRA_SCOPESscopes to ask the provider for besides openid profile email: phoneNumber for Vipps. Not for Kanidm, which denies a sign-in that asks for a scope the person does not hold
SEED_ADMIN_EMAIL or SEED_ADMIN_PHONE, SEED_ADMIN_NAME, SEED_GROUPthe first person in, invited once at start into the most privileged group (or SEED_GROUP)
RESPONSIBLE_GROUPthe group every person a page names as responsible joins, at start and whenever the content changes, and leaves when no page names them any more; they get an account either way
PUBLIC_URL, SITE_NAMEwhat the site calls itself in links, mail and the words its rooms hear. Unset, SITE_NAME is the host in PUBLIC_URL
GITEA_API_TOKENauthenticated resource pulls, and a private content repo: with it set, every content fetch (the tree, each page, site.yaml, aggregates.yaml, the /site/ and /.well-known/ assets) carries the token, to the content repo’s own host only. Read-only access to that repo is enough. An Actions secret cannot be named GITEA_…, so deploy workflows keep it as e.g. PORTAL_GITEA_API_TOKEN and write it into the env file as GITEA_API_TOKEN.
AUTOMATION_READ_TOKENthe automation KV read endpoint
MAPBOX_TOKENmap tiles, proxied; unset, maps are off
MAPBOX_STYLEthe Mapbox style every map is drawn in, as <owner>/<style-id>: one of Mapbox’s or your own from Mapbox Studio. Default mapbox/streets-v12
ADDRESS_LOOKUPoff keeps every site on this host from asking an address register (site.yaml addresses:, Kartverket for a Norwegian site); a type: address field is then a plain line of text. Unset, each site’s own choice stands
GARAGE_* (4)attachments; see below. Unset, upload fields fail closed
PORTAL_BACKUP_TO, GARAGE_BACKUPS_BUCKET, VARDE_SOCKET, VARDE_PUSH_TOsealed backups of the store to garage, varde or both; PORTAL_BACKUP_EVERY, PORTAL_BACKUPS_KEPT and PORTAL_VARDE_DIR tune them (see Backups)
PORTAL_RATE_BURST, PORTAL_RATE_PER_SECOND, PORTAL_TRUST_FORWARDEDthe rate limit, and whose word on the caller’s address counts; see below
PORTAL_SESSION_DAYShow long a session lasts from its last use, default 90
PUBLIC_URLwhere the site is reached; the base of /sitemap.xml’s URLs and the links in mail. Unset, the sitemap takes the host the request came to
PORTAL_EXTRA_CAa PEM file of certificate authorities trusted beside the public ones, for a Kanidm or Gitea behind a private CA (a preview, a test)
EDIT_GITEA_TOKENa token that may push branches and open and merge PRs on the content repo: “Suggest a change to this page” becomes a conversation whose change is applied on the responsible person’s yes. Unset, it is the plain form. EDIT_TALK_MODEL, EDIT_MODEL, EDIT_LLM, EDIT_ENGINE, EDIT_NUM_CTX, EDIT_TIMEOUT, EDIT_MAX_ANSWERS, EDIT_MAX_CHARS, EDIT_DRAFT_ROUNDS, EDIT_CHECK_MINUTES, EDIT_MAINTAINER_GROUP, EDIT_COMMITTER_NAME/_EMAIL, EDIT_LINT_BIN and EDIT_WORK_DIR tune it (see Training)
PORTAL_NOTICES_PER_MINUTEhow many notice mails the instance sends a minute over every bucket, 600 unless set; each bucket’s own per_minute (60) is within it
PAY_URLthe money service (kron) is there: a state’s payment: may then leave by_hand: true out, and each request waits in the payments outbox for kron as its record is made. Portal never calls the address; kron dials the site (see Programs that dial the site). Unset, the lint requires by_hand: true on every payment:, and a content repo’s own lint needs it set the same way its deploy does
CHAT_URLwhere the site’s chat answers (e.g. https://chat.lindtun.no), without a trailing /. Set, a case on a desk with no conversation yet links to ${CHAT_URL}/room/<group>/case/<bucket>/<id> to start one; unset, a case shows only a conversation the chat has told of. Optional; see Rooms
LEARN_BIN, LEARN_MODEL, LEARN_CACHE, OLLAMA_HOSTthe ranker behind the search box; all optional, and none is read by a site whose site.yaml has no search: block (see The ranker)

Mail is delivered by gdo, a separate unit on the same host that dials the site and takes what waits in its mail outbox.

Credentials never appear in the log. A URL that may carry a user and password or a token (CONTENT_REPO, KANIDM_URL, OLLAMA_HOST) is written as scheme://user:***@host wherever a log line or an error names it, and the map proxy’s warning leaves the Mapbox token out.

Groups that need a strong sign-in

site.yaml may name groups that count only when the person signed in with more than a password:

mfa_groups: [board, treasurer, editors]

Portal reads the token’s amr (RFC 8176) at sign-in. With mfa, hwk or swk in it the session has every group as before; without, the groups listed are held back for that session: their pages answer “You have a place here, but this page needs a sign-in with a passkey …”, with a link to add a passkey (account_url, or Rauthy’s own account page under OIDC_ISSUER) and one to sign in again (/auth/login?fresh=1, which asks the provider to sign them in anew rather than reuse its session). Membership is not touched: notices to the group still reach them, and desks still list them.

A site with mfa_groups asks the same of whoever changes it: “Apply this change” on a suggested change (Training) is refused after a weak sign-in, whatever groups the person holds, and the change waits for them to sign in again.

Rauthy sends mfa for anyone with a passkey. A provider that sends no amr makes every sign-in weak, so the groups are held back from everyone; set mfa_groups only where the provider says how someone signed in.

The chat asks portal with strong in its question (dhd::access::Principal::User), and portal holds the groups back from an asker that does not say strong: true. A chat that predates it says nothing, so release the chat that sends it before setting mfa_groups, or the groups’ rooms close for everyone.

A name in mfa_groups that no page uses is refused at load, since it would protect nothing.

The site’s store

A site keeps what is its own in one redb file: every record and its event log, the work waiting in its outboxes, its sessions, and what it keeps for a while (a change talked through, a web interview, a draft written together). Only its process opens it; a second process on the same file is refused at start.

The file is PORTAL_STORE, or site.redb in the directory systemd gives the unit for its StateDirectory=. With DynamicUser=yes, as app@.service has, that is the only place the site may write that outlives its release, so a 1.0 site’s unit needs one, as a drop-in beside the others:

# dropins/app@uhhm.service.d/state.conf
[Service]
StateDirectory=uhhm

The working directory is the release’s, so the site does not start with neither: a file there would go with the next deploy.

A sign-in returns before the disk has it. The site takes such writes down to the disk every minute, and as it stops: on SIGTERM it takes no new connection, gives the requests under way 10 seconds, and writes the file before it exits. A deploy signs nobody out. A crash loses the sign-ins of the last minute at most, and those people sign in again; a sign-out always waits for the disk. Sessions past their date are deleted once an hour.

Backups

The site’s store is one file, so a backup is one file too. Every six hours the site copies the whole store as it stands at one moment, while writes go on, seals the copy, and hands it to garage, to varde, or to both. It keeps the newest fourteen.

age-keygen -o backup-key.txt     # on your own machine, never the server
# the instance's env file:
PORTAL_BACKUP_TO=age1…           # the public key age-keygen printed
GARAGE_BACKUPS_BUCKET=uhhm-backups
VARDE_SOCKET=/run/varde/varde.sock
VARDE_PUSH_TO=<the peer's node id>
  • Sealed on the site. PORTAL_BACKUP_TO is an age public key. Every copy is encrypted to it before it leaves, so the bucket, the peer’s disk and anyone who reaches either see only noise. The private key stays off the server. To varde a backup goes sealed or not at all: the site will not start with VARDE_SOCKET and no key. Without a key, garage gets copies in the clear, and the site warns at every start.
  • garage: GARAGE_BACKUPS_BUCKET names a bucket the site’s GARAGE_* key may read and write. Each copy is <site>/<time>.redb.age, and the site removes copies older than the newest PORTAL_BACKUPS_KEPT.
  • varde: the site puts each copy into this host’s varde, pins it closed (served to varde’s trusted peers alone), and pushes it to every node VARDE_PUSH_TO names. varde answers once the peer has it whole. The two vardes must trust each other (varde-ctl peer trust <node id> on each). The site lets go of its own older pins. A peer keeps what it was given until its operator lets it go, so a site that is broken into cannot delete the copies away from it. A copy no peer took counts as a failed backup. A store bigger than 16 MiB sealed goes through PORTAL_VARDE_DIR, a directory both can reach.
  • Do not export a ticket for a backup’s hash on a peer. In varde a ticket is a publication: whoever holds it may fetch the content without being trusted. Without one, a node that knows the hash and the peer’s address gets nothing. The copy is sealed either way.
  • PORTAL_BACKUP_EVERY is hours, 6 unless set. PORTAL_BACKUPS_KEPT is a count, 14 unless set. Backups are off unless a bucket or a varde socket is named.

To restore, stop the site, open the copy with the key and put it in place of the store:

age -d -i backup-key.txt 20261119T101500Z.redb.age > site.redb

From varde, have it write the copy out first, to a path varde may write: varde-ctl materialize <hash> /var/lib/varde-out/backup.redb.age.

Programs that dial the site (dhd/1)

The programs beside a site (gdo for mail, kron for money, learn for search, kino for the chat, the kit’s worker for briefs) dial the site over dhd/1, by its key. The site dials no one, and opens nothing until the instance names a program:

variablewhat it does
DHD_KEYSeach program’s key, then what it may do (below): <key>=mail,note;<key>=payments. A key is what the program prints as its own. Unset or empty: no program, and no port
DHD_BINDwhere programs dial: 127.0.0.1:4300 unless it says otherwise, so only this host
DHD_TOKENSwhat a caller over HTTPS may do, by the SHA-256 of its token: <sha256>=submit;<sha256>=note,payments;<sha256>=scanner. The site keeps no token, only its hash (printf %s "$TOKEN" | sha256sum). Unset or empty: no HTTPS calls
DHD_HOOKS, DHD_HOOK_SECREToutboxes posted as signed webhooks instead of waiting for a program to serve them: answers=https://n8n.example/webhook/x;mail=…, each row signed with the secret (see below)

What a key may be named for:

  • an outbox it takes: mail, payments (and then it may move payments), answers, rooms, kit (and then it may queue a brief, say how its job ended, and settle a job it filed once an owner approves it, see Training);
  • a destination of a state’s post:, posts.<name> (<key>=posts.scribe): it takes the steps handed to that name and answers each with a Move on the step in portal_posts, its payload the answer (State machines); DHD_HOOKS may name the same outbox for a webhook;
  • submit, to send an answer as a visitor would, anywhere a visitor could; or submit:<bucket>, only through forms that record into that bucket, which is what to give a party outside the organisation;
  • a call it may make: note for replies, may for the access question, watch for the groups, load for the deploy, read for portal db;
  • ask:<group> or ask:person: it may ask that group, or one person, a question (Questions a program asks); the answer comes down its call alone, secrets sealed to it, and only its key may say what came of it;
  • a name from site.yaml’s programs: (<key>=scanner): it may make the moves listed there, as a desk button does (content reference, “Programs that move records”).

The site’s own key is site.key beside its store, made the first time and readable by the site alone; the log says it, with where it listens, as the site starts. A program needs both: the key and the address.

A program serving an outbox holds its call open and is handed every row of it, oldest first; each row it acknowledges goes from the outbox. A row it has not acknowledged when it goes is handed to it again when it dials back, or to a webhook the instance names for that outbox. Nothing goes out twice at once, and nothing a move said is lost to a program that was away.

What is not Rust (n8n, a script) makes the same calls over HTTPS, with a token as Authorization: Bearer <token>:

postbodyanswer
/dhd/1/submit{question_id, alternative, responses}{chain_hash}: the answer, as a visitor would send it
/dhd/1/move{bucket, record, to, by, seen, payload}{sequence}: a move a programs: name may make, or a payment as the money service moves one
/dhd/1/note{id, bucket, record, by, subject, text, at_ms}{ok}: a reply read elsewhere, kept on its record
/dhd/1/load{at}{loaded}: the content at commit at (the branch’s head where empty) fetched, checked and swapped in; the last good content serves until then, and stays if the new one fails
/dhd/1/read{bucket, key, log}the record as JSON, its event log with log, or every record of the bucket without key

A refusal’s status says why: 401, a token the site does not know; 403, not what the token may do; 422, a call that will never succeed (no such record, the wrong sender); 503, not now, so try again; 501, not taken yet.

And the other way: an outbox named in DHD_HOOKS is posted to its address, a row at a time, oldest first, as the JSON it is, instead of waiting for a program to serve it. n8n gets every answer (answers=…) this way. Each post carries Dhd-Outbox and Dhd-Row (the same every time it is sent, so the receiver keeps it once) and Dhd-Signature, sha256=<hex>, the HMAC-SHA256 of <outbox>.<row>.<body> under DHD_HOOK_SECRET. A 2xx lets the row go; anything else, and it is tried again after 5 seconds and then longer, up to 5 minutes, with the rows behind it waiting so they arrive in order.

gdo does this where it is told the site (PORTAL_DHD=<site key>@<address>): it prints its own key as it starts, and the site names it <gdo's key>=mail,note (with ask:owners where gdo asks for the site’s own mailbox), note for the replies it reads, which the site keeps on the record they answer. kron does the same for money (<kron's key>=payments): it takes the requests and tells the site what the provider says as a move on the payment. With ask:owners too, it asks the owners for its Vipps keys when it has none, and keeps its ledger in a file of its own (KRON_STATE).

New content, and reading the store

A content repo’s CI tells the site to load what it just linted, with a token the site names load:

curl -fsS -X POST https://<site>/dhd/1/load \
  -H "Authorization: Bearer $LOAD_TOKEN" -H "Content-Type: application/json" \
  -d "{\"at\": \"$GITHUB_SHA\"}"

The site fetches that commit, checks it whole and swaps it in; until then, and if anything fails, the last good content goes on serving. The answer says how many pages are in place, or why nothing changed.

The operator reads what a running site keeps with portal db, since the site alone opens its store:

portal db --site <site key>@<address> hires          # every hire, by key
portal db --site <site key>@<address> hires h-17     # one, as it is kept
portal db --site <site key>@<address> hires h-17 --log

portal db says its own key as it starts (kept in ~/.config/portal/db.key, or PORTAL_DB_KEY); the site names it <key>=read. PORTAL_DHD may stand for --site.

On a site being tried out, with no sign-in provider, portal session --as <name> --groups <group>[,<group>] [--email <address>] [--hours 24] writes a signed-in session into the store (PORTAL_STORE, with the site stopped) and prints the cookie for a browser, so a desk can be looked at (Try it). It refuses where OIDC_ISSUER or KANIDM_URL is set.

Presence

Who is beside a site is whoever holds a Serve open to it over dhd/1. Each program says, as it opens the call, its name (gdo, kron, learn, the chat), its version and what it can do: providers on a money service (vipps,stripe), calendar on the mail gate (caldav). The site logs each as it comes and goes. A payment request names the provider a kron here has; a mail’s event goes out knowing whether a calendar will take it. Nothing is refused for want of a program: with nobody there, the site does what it does alone, and the outbox holds the work until the program comes.

Questions a program asks

A program beside the site can ask its people something: gdo how the site’s mail should go out, a courier when to come. It sends a question in the shape a page has, with the Ask call (or POST /dhd/1/ask with a token):

{
  "id": "mail-login",
  "to": "group:owners",
  "seal_to": "age1…",
  "question": {
    "name": "How should the site's mail go out?",
    "alternatives": [
      { "name": "Through your mail server (SMTP)",
        "features": [ { "name": "The server", "requirements": [
          { "name": "host", "label": "Server" },
          { "name": "password", "label": "Password", "secret": true } ] } ] },
      { "name": "Not now" }
    ]
  }
}
  • Who it is for: group:<name>, everyone in that group, or person:<address>, one person. The site says who a program may ask: ask:<group> or ask:person beside its key in DHD_KEYS (or a token’s in DHD_TOKENS). People read who asks by the name the program opened its Serve with, or over HTTPS by from ("from": "n8n").
  • Where it shows: in the header of whoever it is for, and on a page the site draws from the question itself, /asks/<id>. Nothing in the content has to place it.
  • What it may hold: words, alternatives, and fields of the kinds text, textarea, email, tel, url, number, date and select. A field marked secret: true is sealed to seal_to before the site writes anything, and only someone signed in with more than a password may answer it. Nothing that reads the site’s records or takes a file.
  • The answer goes to the program alone: down its own Serve when it says it does asks, or, for a caller over HTTPS, to the asks webhook (DHD_HOOKS). It names the alternative picked and carries its fields, secrets sealed (dhd::ask::Answered).
  • What came of it: the program moves the record to done or refused with its words, or to withdrawn while nobody has answered (dhd::ask::Word), and the page says so.

Each ask is a record in portal_asks, opened once per program and id, so a program that asks again after a restart asks nothing new. A desk can list it like any bucket.

What waits is not left for someone to find. A signed-in person’s name in the header is marked with how many things wait for them, and opens onto the list: each question asked of them or a group of theirs, and any change they suggested that waits for their yes, each with a link to where it is answered. A visitor, and someone with nothing waiting, see the header as it always was.

A program built before 1.0.0-rc.10 that asked for a login in its Serve (waiting, ask, public_key) is not heard by a 1.0 site: gdo and kron ask with a question; a 0.x site keeps the gdo and kron it has.

Schedules, notices and boards

Three sweeps run beside the deadline and announcement sweeps, and each looks at the content first: a site without recurs, notice or board gets no work from them and no new buckets.

sweepeverydoes
schedules (recurring.rs)minute, and at startopens the record a recurs series has fallen due
what comes round (comes_round.rs)minute, and at startmoves a comes_round record out before its date and back after, and asks for a date that follows no rule
notices (notices.rs)10 smails notices in their sending state, as many as the rate allows, and moves each to its sent state once everyone has it
boards (boards.rs)minuteholds every board’s ledger and its place records to each other

What they keep, in the site’s store beside its other buckets:

bucketholdskey
portal_recurringwhere each series has got to: the last record it opened and its due day<bucket>.<series>.<hash of the subject>
portal_comes_roundwhich date a record has been out for, and the last year a date was asked for<bucket>.<hash of the record>
portal_notice_logwho a notice has gone to, and when; written after the mail<bucket>.<notice>.<hash of the address>
portal_notice_optoutseach address’s token for a bucket’s notices, and whether they stopped them<bucket>.<hash of the address>
portal_placeseach thing’s ledger: seats and the line, by a hash of who<board>.<record>

No key holds an address. Each person’s mail and the line saying it went are written in one batch, so a stop halfway sends nobody the notice twice. The log says how far a notice has got (a notice went out to more people, with counts) and never who.

Routes: GET /ics/<board>.ics, GET /ics/<places>/<id>.ics?email= (404 for anyone the policy does not let subscribe), and /notices/unsubscribe?b=&r=&t=, which asks first on a GET and changes something only on the POST its button sends, so a mail program that opens links to look at them stops nobody’s notices.

Starting a site filled in

portal import brings in what a site already has: years of events, a committee’s documents, a board’s minutes. Run it where the site’s variables are set:

PORTAL_STORE=... portal import --path questions seed/committees.yaml --dry-run
PORTAL_STORE=... portal import --path questions seed/committees.yaml
# seed/committees.yaml
committees:                     # a bucket
  - id: path                    # letters, digits, - and _; what makes it once
    state: active               # the bucket's first when left out
    fields: { name: The footpath, purpose: "Keeps the path clear." }
    announcements:              # a bucket that belongs_to: committees
      - id: workday-2024
        state: archived
        at: 2024-05-04T10:00:00+02:00   # or a day, 2024-05-04
        source: https://old.example/news/24-05-04-workday
        fields: { title: Workday on the path, text: "<p>Bring a rake.</p>" }
    documents:
      - { id: path-plan-2023, at: 2023-11-01, file: files/path-plan-2023.pdf, fields: { title: Path plan } }
board:                          # a bucket's `owner:`, holding what is its
  documents:
    - { id: agm-2019, at: 2019-03-14, fields: { title: AGM 2019 } }

A record nested under another carries its key, in the field its bucket’s belongs_to names. One at the top of a bucket with an owner: is the owner’s. file is relative to the file, and goes in the form’s one file field; it needs the site’s GARAGE_*.

Checked first. The file is read whole, against the content, and held to what a form is: fields the form has, the ones it asks for, its choices, rich text cleaned, parents and references that resolve (in the file or on the site), files that exist, ids once. Everything wrong is said at once, and one thing wrong writes nothing. A dry run says what it would do and writes nothing; with no PORTAL_STORE it checks against the content alone. Once writing has started, a store that fails stops the run with what came before it kept, and running again finishes it.

Dates. at is a field of the record’s own, which a list sorts by and shows, so a 2019 record says 2019 and sorts there. The log’s time and order are the import’s: a past date rewrites nothing.

Quiet. Each record’s one event says it was imported, from which file and from where (source), and “History” on its row reads it. No mail, no grants, nothing announced, no chain. No after: clock and no leaves_after runs on it, and it is not taken in by comes_round, until a person has moved it: it lands where it says and stays. One resting in a comes_round bucket comes round in its time, as a date still to come is live.

Once. Run again, nothing changes. A field that differs from the file is reported and left, since a desk may have changed it.

On a deployed site. The store opens in one process, and under app@.service only the unit may open its StateDirectory. So the unit runs the import itself: portal started with no arguments does what PORTAL_COMMAND says. A deploy puts the files where the unit can read them, adds one line to the instance’s env, restarts the unit, waits for it to end, takes the line out and starts the site:

echo "PORTAL_COMMAND=import --path /srv/app/<instance>/seed/questions /srv/app/<instance>/seed/import/machines.yaml" >> /etc/app/<instance>.env
systemctl restart app@<instance>      # the import, in place of the site
# wait until it is no longer running; `systemctl show -p Result` says success

Since a second run changes nothing, a deploy can do this every time.

Where the deploy runs as a service that may not set the setgid bit (RestrictSUIDSGID=, as the bare runner has), copy the files in with tar, as the release is unpacked: cp -r and chmod -R fail on directories that hand their group down.

What it refuses. People: portal’s own buckets, portal_memberships above all. A place in a group is an invitation someone accepts (and a submit: press below is how one is made). Places on a board, which are the ledger’s, and a notice in the state it is sent from, which would go out. It warns of a field holding an address or a phone number: such a file stays out of the repo.

Where. Into the site’s own store: PORTAL_STORE, or the unit’s STATE_DIRECTORY, as the site has them. The store opens in one process, so run the import while the site is stopped; while it runs, the import says so and writes nothing. Each record and the event that makes it are written together, so a run stopped halfway leaves every record it wrote whole, and the next run takes up the rest. The mail and answers the presses below make wait in the store’s outboxes, as the site’s own do, for gdo and the automations when the site starts.

Onboarding: the desk’s own presses. People still come in the one way they ever do, by an invite from a desk, but the presses can be replayed. A submit: list in the same file is the board’s buttons, in order, each sent through the same code as the desk sends it (submit_as), as someone in one group: --as <group>, else SEED_GROUP, else the group that may invite into the most groups (the board). So a site starts with everyone it already knows invited, from the first person on, without anyone pressing anything:

# onboarding.yaml - names and addresses: keep it out of the repo
submit:
  - page: /board
    alternative: Invite someone onto the board
    fields: { name: Kari Nordmann, email: kari@example.no }
  - page: /committee/traffic/board
    alternative: Give the committee a lead
    fields: { name: Ola Nordmann, email: ola@example.no }
PORTAL_STORE=... portal import --path questions onboarding.yaml --dry-run
PORTAL_STORE=... portal import --path questions onboarding.yaml

A press may be “Change” on a record instead of a new answer: record: names the record, and fields: only what changes, through the same code as the desk’s save (editing::edit_as), so the rest of the record stays as it is and the change is an event in its log. The group must be one a list with edit: lets change that bucket, and the record one that list shows it:

submit:
  - page: /committees/content
    alternative: Add an event
    record: 51cf1ee171ae9649fbf4ad2c6d0d1487d1477e74946de211f0e27ce715931792
    fields: { places: "100" }

Each press is held to what the desk holds it to before anything is sent, and one that would be refused refuses the file: the page and alternative are there, the group may send that page, the alternative is open, the form has what it asks for, an invite says who and the group may invite into its group. A dry run lists what each would do (would submit #2 /committee/traffic/board «Give the committee a lead»: invites Ola Nordmann <ola@example.no> into committees_traffic_lead); with the site’s store it also says which are made already. The real run is not quiet: each does what the press does, the account, the mail and all. An invite to someone already in the group, or with a place held there, is skipped, so a run again sends nothing new; one into a record’s group whose record is not open is refused. The records in the file go first, then the presses. Invites need the site’s people settings (PEOPLE_BACKEND and Rauthy’s or Kanidm’s), so run it where the site runs, with its environment.

portal comes-round --path questions makes one pass of what comes round, by hand. --at <RFC 3339> makes it a test clock on a throwaway: it makes real moves and sends real mail, so it needs PORTAL_TEST_CLOCK=1.

Rooms

A site’s groups are rooms in its chat, a program beside the site that dials it like the others, and the site says in each what the group needs to act on. The whole of it is in Rooms; for the operator it is one key in DHD_KEYS, <chat's key>=rooms,watch,may:

the chatwhat it does
Serve doing roomstakes what the site says in each group’s room (landed, clock_soon, clock_ran, moved, opened), waiting in the rooms outbox while the chat is away
Watch of groupsthe site’s groups, one document per room, then every change as content loads
Note with subject: threadtells the site a case has a thread, on its first message and every tenth; the site keeps the newest per case (portal_threads) for the desk’s row
Maythe access question, which also answers for {kind: room, name: <group>} (see Access)

CHAT_URL is the only setting, and it is optional.

The chat is kino, one per site, from the [uhhm] registry like gdo:

pacman -S kino
cp /usr/share/doc/kino/env.example /etc/kino/<site>.env   # PORTAL_DHD, sign-in, PUBLIC_URL
systemctl enable --now kino@<site>                        # says its key: name it in DHD_KEYS

The ranker

learn ships in the same tarball as portal, so every release dir holds both binaries side by side:

/srv/app/<instance>/releases/<tag>/
    portal  bratac  iris  learn  hash.txt  site/
    models/route.bpk  models/route.json

Portal spawns learn rank with one JSON request on stdin and reads one JSON reply back. Nothing has to be configured for that: each binary looks beside itself first. The service starts portal through the current/<instance> link, and the binary’s own path resolves through it to the release dir, so a rollout or a rollback moves portal, learn and the model together.

LEARN_BINthe learn binary portal runs. Unset, learn beside portal’s own binary, then learn on PATH. A wrapper script that sets an environment should exec learn; either way, a call past its deadline is stopped with everything it started (its process group)
LEARN_MODELthe model learn rank uses: a packed <name>.bpk (with its <name>.json beside it) or a model directory from learn train. Unset, models/route.bpk beside the learn binary, which is the shipped one. A request may name its own model, and that wins
LEARN_CACHEthe embedding cache, /srv/app/<instance>/learn-cache. Keep it outside releases/ so it survives a rollout, and make it writable by the instance’s service user
OLLAMA_HOSTthe encoder for texts the cache has not seen, and for every search’s words, http://127.0.0.1:11434 unless set. The shipped model’s encoder is bge-m3

If the cache dir cannot be written, learn keeps the cache in memory for that one call. Ranking still works, but every call then embeds all of its texts again. If a text is not cached and the encoder cannot be reached, learn rank exits 3 and portal reads that as “no decision” and carries on as it would without a model.

The shipped model is learn/models/route.{bpk,json} in this repo, written only by

learn/scripts/ship-model.sh <model dir>

That script refuses (exit 1, nothing written) any model whose manifest does not say site_classes == ["fictional"]: this repo and its releases are public, and a model trained on a client’s rows would carry what it learned from them into both. The release workflow checks the sidecar again before packing, and checks that learn rank loads the model from beside the binary. To try the release’s model on a host without touching the instance:

printf '%s' '{"decision":"route","context":{"text":"…"},"candidates":[{"id":"a","text":"…"},{"id":"b","text":"…"}]}' \
  | LEARN_CACHE=/srv/app/<instance>/learn-cache /srv/app/<instance>/current/learn rank

A site whose site.yaml has a search: block (Content reference) shows a box on the pages it lists, while this instance can rank. Portal checks with a probe, one learn rank --ephemeral of a fixed sentence and two fixed options: at start, every ten minutes, and within seconds of a reload that changes the block. The box shows while the last probe got a reply. A site without the block never asks learn.

When a search finds learn gone (Ollama unreachable, exit 3, or no answer in three seconds), the box goes at once and the probe runs every 30 seconds until learn replies, so an Ollama restart costs the box half a minute. A search that fails another way (no model, a reply that is not one) leaves the box where it is.

Each search:

  • is one learn rank --ephemeral in the visitor’s request, or one question to a learn serve, with three seconds in all;
  • takes one of four places, at most two per caller (by IP as the rate limit reads it, an IPv6 caller by its /64; two, because an office’s NAT puts many people behind one address), and waits up to a second for one before saying search is not available;
  • uses LEARN_BIN, LEARN_MODEL (or the block’s model:, a name under the models/ beside learn), LEARN_CACHE and OLLAMA_HOST as above;
  • keeps the visitor’s words in memory only: they go to Ollama, never to the cache or the log. Only the options’ texts, the site’s own words, are cached, so Ollama must be up for search to work at all.

Keep bge-m3 resident. learn asks Ollama to keep it loaded for 30 minutes, and the probe calls every ten, so with nothing competing it stays. A search that finds it evicted waits out the reload (5 s cold, 16 s beside a chat model) and is told search is not available. On a host whose GPU also runs chat models, give search its own Ollama on the CPU (ollama-embed.service on 127.0.0.1:11435, and OLLAMA_HOST=http://127.0.0.1:11435 in the instance’s env), and keep bulk embedding (learn embed) on the GPU’s. Measured on ergo (2026-10-22): a warm search against six cached options takes about 70 ms on the CPU, no slower than on the GPU, and the vectors agree to a cosine of 0.99991 or better on 2,000 texts; on the shared GPU, loading qwen3:8b evicted bge-m3 and the next search took 21 s.

Whether search is ready shows in three places:

  • the log, when a block is first probed, when a search takes the box away, and whenever readiness changes: search: learn answered the probe; the search box shows where site.yaml puts it, search: learn did not answer the probe, so no search box: <why>, or search: a search found learn gone (<why>), so no search box until it answers the probe;
  • the site’s own answer, curl -s -X POST https://<site>/api/get_site, whose "search_ready" is true or false;
  • the probe by hand, as the instance runs it:
printf '%s' '{"decision":"route","context":{"text":"Water is coming through the ceiling when it rains."},"candidates":[{"id":"a","text":"- A roof that leaks\n"},{"id":"b","text":"- Something else\n"}]}' \
  | LEARN_CACHE=/srv/app/<instance>/learn-cache /srv/app/<instance>/current/learn rank --ephemeral

Each search that got an answer is one JSON line in the log (target portal::search): the page, the top card’s framing id, the confidence, whether the gate acted, the storyline, and which way learn answered. Never the words.

/api/search_alternatives for a page with no box, or none at all, is answered 404; arguments it cannot read, 400. Neither shows as a 500.

learn serve

learn serve is learn rank --ephemeral kept running beside the site, so a search starts no process. The model loads once, at start, and the Ollama client stays open. It dials the site and serves rank: each search comes down the open call as a question, a free lane ranks it, and the answer goes back up, the same request and reply as on learn’s stdin.

learn serve --dhd <site key>@<address> [--max-in-flight 4]   # built with --features serve, as the release is
  • learn reads with a key of its own (LEARN_KEY, else learn.key in its STATE_DIRECTORY), says it as it starts, and the site names it <learn's key>=rank in DHD_KEYS. PORTAL_DHD may stand for --dhd.
  • --max-in-flight is how many searches it ranks at once, four by default, the same as the site’s own cap.
  • --model, LEARN_MODEL, LEARN_CACHE and OLLAMA_HOST mean what they mean for learn rank. A model that does not load stops it at start, before it answers anyone.
  • On SIGTERM, as systemd sends on a rollout, it answers what it has taken and turns the rest away with 421, “this one is going”: the site then starts learn rank for that search, keeps the search box, and does not say learn is gone.

The site asks a learn serving it first, for half of a search’s deadline at most: a search has three seconds in all, so learn gets 1.5, and the probe five of its ten. With none serving, none in time, or one going, the site starts learn rank --ephemeral with what is left, never more, so a hung learn costs a search 1.5 seconds and the search still ends within its three. An answer of 503 is no decision, and 400 or 500 a failed search, as exit 2 or 1 is. The probe’s log line says which way learn answered (over dhd/1 or as a process), and so does each search’s count (via).

What it saves is the process and the model load per search. With the shipped model and a stand-in for Ollama, a warm rank took 0.9 ms at the median and a spawned one 7.2 ms; through a real bge-m3 both took about 84 ms, nearly all of it Ollama embedding the words.

Rate limiting

Every request that makes portal do something passes a per-caller-IP limit before a session is loaded or a handler is entered: a burst of 100, refilled at ten a second. More than a hundred requests in ten seconds is a script; someone reloading a page again and again stays well inside it.

The files a page is made of, served from portal’s own disk, are not counted: the stylesheet and scripts under /pkg, the fonts, the favicons, the vendored libraries. Refusing one of those is what turns a reloaded page into an unstyled mess, and serving one costs next to nothing. Anything that makes portal ask someone else is counted: a content picture under /site/ is fetched from Gitea, a map tile from the map provider.

PORTAL_RATE_BURSThow many requests at once, default 100
PORTAL_RATE_PER_SECONDrequests refilled per second, default 10

Either set to 0 turns it off, for an instance behind something that already does this. The caller is read from X-Forwarded-For or X-Real-IP, falling back to the socket — all of these instances are behind Caddy.

The caller is the address the proxy in front of portal saw, not the one the request claims: X-Forwarded-For counts only when the connection comes from a loopback or private address (Caddy on the same host), and then its last entry is the caller, the one Caddy wrote; Caddy appends to a header that arrives, so the first entry is whatever the caller sent. From any other peer the connection’s own address is the caller. PORTAL_TRUST_FORWARDED is private (that), always (a proxy on another host, on a public address) or never (limit by connection).

This is a fence, not an accounting system. What keeps uploads honest is the policy check on the route itself.

The ledger

A bucket whose states say ledger: (state machines, “ledger”) writes each move’s postings on the move’s event, under postings, and keeps a projection of them in the store’s bucket portal_ledger: b.<unit>.<account> a balance, t.<unit>.<account>.<transfer> a statement line under each of its two accounts, r.<bucket>.<record>. <transfer> the same line under its record, and a.<bucket>.<record>. <sequence> the mark that an event’s postings were taken, so an event seen twice posts once. The log is the truth and the projection is derived: portal ledger rebuild [--from-scratch], run while the site is stopped (it opens the site’s store), reads every event of every bucket with a ledger and applies what is not applied yet, which is the repair for a projection that fell behind (a write that failed is said in the log at error with those words). Nothing is deleted or edited in it; a correction is a posting.

A program with a ledger engine of its own (tally over TigerBeetle, when a site’s volume wants invariants the projection does not enforce) reads the events and needs nothing else; the shapes are dhd::ledger.

What a jq filter may cost

A jq: on a resource runs in portal, on a thread of its own, within a budget: two seconds, twenty thousand values, sixteen megabytes of output. No honest filter meets any of them; repeat(.) or a range into the billions does. A filter that yields more values or bytes than its budget is cut there, and the page shows what it had, with a warn in the log naming the filter and what it cost. A filter that runs past its time is stopped between two values where it can be; one that labours over a single value is given up on, the page gets an error naming the budget, and the filter is set aside until the next Load, so a page whose filter never finishes costs one thread once and not one per visit. The thread it took ends when the filter does; nothing in Rust stops it sooner.

PORTAL_JQ_BUDGET_MShow long a filter may run, default 2000
PORTAL_JQ_MAX_OUTPUTShow many values it may yield, default 20000
PORTAL_JQ_MAX_BYTEShow much output, default 16777216

Lists in memory

A list reads its bucket from memory, not from the store: the first visit reads the bucket once and keeps every record parsed, and from then on each commit that writes the bucket updates what is kept. A page always shows what the store says, and a desk over a few hundred records costs no more to open than one over ten. A bucket nobody looks at costs nothing.

Nothing is configured. A listing that falls behind the store’s commits forgets what it kept and reads it again on the next visit. An open page hears which of its lists a commit changed (/live, as server-sent events) and draws just those again.

Compressed on the way

Nothing portal serves goes over the wire plain when the browser can take it compressed. Two layers:

  • Files the release ships. The publish workflow runs tools/precompress.sh target/site after the build, which writes a .br (brotli, quality 11) and a .gz (gzip, 9) beside every wasm, script, stylesheet, SVG and JSON file under the site root. Portal serves the sibling the browser accepts, with Content-Encoding and Vary, and the plain file to a browser that accepts neither. The page’s wasm is 2.6 MB plain and 0.7 MB as brotli; nothing is compressed per request. Fonts are woff2 and already compressed.
  • Everything else, on the way: the HTML of a page, a server function’s answer, the sitemap, a file from a build that has no siblings, compressed as the browser accepts (brotli, zstd or gzip) at a fast level, level 4. A response already encoded, an image, and a body too small to gain are left alone.

Caddy in front of these instances has no encode directive, and needs none: what it passes through is compressed already.

What a browser may load

Every page carries a Content-Security-Policy:

  • Scripts are the site’s own, and inline ones only with the response’s nonce; WebAssembly runs, nothing else that evaluates.
  • Styles may be inline, since components write style=.
  • Pictures may come from any https host, for a wordmark kept elsewhere. Maps and feature icons come from the site itself.
  • Connections go to the site, and to the relays a voice or gesture field names, over https and wss only.
  • Nothing is embedded as an object, and no other site frames a page.

Every response also says X-Content-Type-Options: nosniff, a Referrer-Policy that stops at the origin for other sites, a Permissions-Policy keeping camera, microphone and position to the site, and X-Frame-Options: SAMEORIGIN.

The policy as shipped (crates/portal/src/csp.rs):

default-src 'self'; script-src 'self' 'nonce-…' 'wasm-unsafe-eval';
style-src 'self' 'unsafe-inline'; img-src 'self' data: blob: https:;
font-src 'self' data:; connect-src 'self' https: wss:;
media-src 'self' blob: data:; worker-src 'self' blob:; frame-src 'self';
object-src 'none'; base-uri 'self'; form-action 'self'; frame-ancestors 'self'

PORTAL_CSP replaces it whole, {nonce} in it filled per response, for a site that embeds something from a named host or wants less. A violation shows in the browser’s console as the policy’s words; nothing is reported back to portal. Every script a page runs is served by the site: the rich-text editor and its Loro extension are vendored under /vendor/prosekit/ at pinned versions (tools/vendor-prosekit), as swiper and maplibre are.

Attachments

A type: file field stores an object key in the record. The file comes back out at:

GET /attachment/{bucket}/{record}/{field}

which reads the key out of that record rather than taking one from the caller, so a file can only be fetched through a record somebody is allowed to see, and a leaked key is a link to nothing. Reading it needs the same policy permission as reading the bucket on a desk, through a list that shows the record: its states, and its where. A list on a [key] page shows every record with something in the field it asks about.

Uploads need a bucket and a key in the Garage on the host:

garage bucket create <site>-attachments
garage key create <site>-portal-uploads
garage bucket allow --read --write <site>-attachments --key <site>-portal-uploads

then GARAGE_S3_ENDPOINT, GARAGE_ACCESS_KEY, GARAGE_SECRET_KEY and GARAGE_UPLOADS_BUCKET in that instance’s env. Unset, an upload field fails closed rather than appearing to work and storing nowhere.

The report

GET /report is public and answers with counts only: per bucket, per storyline, per state. It is what the trainer reads to compare the storylines on what people did.

The docs site

These pages are portal.uhhm.no: docs/ built with mdBook (book.toml, docs/SUMMARY.md) by .gitea/workflows/docs.yml on every push to main that touches them, and put to git-pages the way every static site on uhhm.no is (uhhm/infrastructure PAGES.md). The changelog is the book’s last page. mdbook serve previews it locally.

Who deploys what

Both hosts deploy from CI now, and a rollout is the same commit either way: bump PORTAL_RELEASE in the site’s own content repo.

runnerhow it is allowed to
ergoruns-on: barethe runner is privileged and writes /srv/app and /etc/app itself
kasseruns-on: fishthe runner is not privileged. It may run one root script, /usr/local/bin/deploy-portal-instance, which checks the instance against a fixed list and the tag against a release-tag shape before touching anything

The kasse grant is a single sudoers line (/etc/sudoers.d/30-portal-deploy). It exists so a workflow can pick which of three known instances gets which published portal tag, and nothing else.

Both paths health-check the instance afterwards without a forwarded header. A check that sends the header Caddy would send cannot tell you the site is broken for everything that is not Caddy.

A repo’s lint workflow downloads iris from its PORTAL_RELEASE and runs iris check, so the lint and the site are one version by construction.

Architecture

One Rust binary (Leptos SSR + hydrate, Axum underneath) serving any number of sites, one process each. The engine special-cases nothing: every page, form, desk and state graph a site serves is declared in its content repo, and instances differ only by environment variables.

Each site keeps everything it has in one redb file of its own. The programs beside it (mail, payments, search, chat) dial it over dhd/1, an iroh protocol, with keys of their own; anything else talks to it over HTTPS with a token. A Git repo holds the content, and any OpenID provider (Vipps Login, Kanidm, Rauthy) signs people in.

The pieces

Content (crates/core/src/content/) — YAML loaded from Gitea (or a directory, CONTENT_DIR) at boot and again whenever the content repo’s CI asks (Load), all of it checked before any of it is swapped in, so a bad push keeps the last good content serving. The questions/ tree is the router: file paths become URLs, _section.yaml applies to a whole directory, and [name].yaml serves any /dir/<value> with the segment fed into the page’s resource keys. See filesystem routes.

The lint (crates/core/src/content/validate.rs) — every rule a content repo is held to. It runs at boot, at every Load, and in a content repo’s CI through iris (crates/iris), released with the site, so it applies exactly the version the instance runs.

State machines (crates/core/src/aggregates/) — aggregates.yaml declares each bucket’s states and legal moves. A record’s state is replayed from its own event history, undeclared moves are refused, and racing decisions are settled by CAS on the log’s sequence. An empty history starts its log from the record’s own state on its first move, so a bucket given a state graph later strands nothing. See state machines.

The store (crates/core/src/store/, crates/core/src/answers.rs) — a site’s records, their event logs, its sessions and its outboxes, in one redb file only the site’s process opens. A submission or a decision is one batch: its event, the record that follows it, and whatever it tells the programs beside the site (its mail, a request for money, the answer for automations, a room’s message), written together or not at all. Every commit is told to whoever watches the store; the lists on pages are kept current from it (listing), and an open page hears which of its lists a commit changed, over one server-sent stream (GET /live, live), and reads those again. What the site keeps only for a while (a change talked through, a web interview) is a bucket that forgets past an age (store::Kept).

The network (crates/core/src/network.rs, crates/dhd/src/one.rs) — dhd/1, irpc over iroh. The site dials no one: each program dials the site’s key with a key of its own, and the site does for it only what the instance names that key for (DHD_KEYS). A program holds Serve open, takes the rows of the outboxes it does and acknowledges each, and answers questions asked down the same call (learn’s ranking); its open call is its presence. The other calls are Submit, Move, Note, May, Watch, and the deploy’s Load and the operator’s Read. The same calls go over HTTPS with a token (dhd_http.rs), and an outbox may be posted as signed webhooks instead (hooks.rs).

The wire (crates/dhd/) — the names and shapes portal shares with the programs beside it, as a crate of their own: the protocol (dhd::one, feature one) and the records and messages it carries (Answer, the event log’s Event, the mail gate’s Outgoing and Incoming, the money service’s Request and Changed, the rooms’ GroupDoc and Thread, the access Query and Decision). Portal re-exports them, so portal::payments::Request is dhd::payments::Request; gdo, kron, learn and the chat depend on it from this repo. The rule for what belongs there: a name both sides must spell the same, or a shape both sides serialize; never anything that reads content or decides. Named for the dial-home device.

Answer chains (crates/core/src/chain.rs) — each submission hashes its parents, so a visitor’s path through the questions is a verifiable lineage. ?chain= links carry it; a followup page is offered only once the chain has earned it, and a page behind an answer somebody has not given is never offered.

Access (crates/core/src/access.rs) — who may do what to what, compiled from content on every load into one Cedar policy set that every server entry point asks. See access.

People (crates/core/src/memberships.rs, people.rs, rauthy.rs) — onboarding as a form. An alternative with invite: {group} holds the person a place in the group: a record in portal’s own memberships, or a group in Kanidm or Rauthy (PEOPLE_BACKEND), with an account and a one-time link where the backend makes accounts. A state may also grant a group on its own (grants:), so an approval that means membership needs no second step. See memberships.

Mail (crates/core/src/mail.rs) — a state may declare the mail its arrival sends. Portal renders it into the mail outbox with the move; gdo takes it from there, delivers it, and hands replies back as notes beside the record. A note never moves a case. A mail about a time carries the event (event: under mail:), and gdo decides how it reaches a calendar.

Presence (crates/core/src/presence.rs) — who is beside the site: every program holding Serve open, with what it says about itself (dhd::srv: a money service’s providers, whether the mail gate reaches a calendar). A payment names the provider a kron here has; a feature that depends on a program reads the table and does what portal does alone when nobody is there.

Backups (crates/portal/src/backup.rs) — a snapshot of the store every six hours, sealed to the operator’s age key on the site, to garage, or into varde and pushed to its trusted peers.

Sweepers (crates/core/src/announce.rs, crates/core/src/deadlines.rs) — the two things that move without a person. An announced page’s window closes and its record becomes a “post what happened” task; a state with a deadline waits out its days and then makes the move itself. Both go through the same transition path as a desk button and write the same event.

Resources (crates/portal/src/resource.rs) — content can read a bucket of records, Gitea starred repos, org repos or releases, or any public JSON URL (SSRF fail-closed), reshaped by a content-declared jq filter. What a resource reads is never a client-supplied parameter: the client names a page and a feature, never a bucket or URL.

Maps and icons (crates/portal/src/maps.rs, icons.rs) — MapLibre is vendored, and every tile, style, still image and icon is fetched by portal and served from the site’s own origin, so a page makes no third-party request and needs no consent banner.

Desks — any Kv resource with transitions renders rows with per-state buttons and one shared confirm. Owners walk records through their graphs with no bespoke UI per bucket.

Sessions (crates/portal/src/sessions.rs) — in the site’s store, so a restart signs nobody out. A sweep deletes what is past its date, and each record’s own expiry_date decides on the way out.

Crates and binaries

One repo, one version, three binaries, and under them the crates they share (the root Cargo.toml is the workspace):

  • crates/content (portal-content) — what content means: the types a site’s YAML describes, their validation, the words. Compiles for the browser too; no network, no HTTP.
  • crates/core (portal-core) — the instance: content as the server keeps it, records and their state machines, mail, people, access, boards, rooms, memberships, notices, payments, the kit’s briefs (queued for its worker, briefs), learn and the search ranking, the lint. A function over content or over the running Instance lives here; a function over a request does not.
  • crates/bratac — the trainer and the kit worker, as a library with the bratac binary. The site runs two of its pieces itself (the interview engine behind the card, the chooser behind the search box), so portal depends on it; nothing in it knows the server exists.
  • crates/iris — the lint as the iris binary, over portal-core.
  • crates/portal — the site: the pages, the server functions, the routes, and the portal binary (serve, and still lint, iris, map and manual, so a content repo’s pinned lint keeps working).
  • crates/dhd — the wire, and the protocol every program beside the site speaks (dhd::one).
  • learn/ — the ranker, a nested package outside the workspace with a lock of its own; see learning.

The release tarball carries portal, bratac, iris and learn side by side, and each as a bare binary; see operations.

Training a site

A business describes itself in plain words: what it does, who comes to it, what it keeps track of and through which stages, and who handles what. The trainer, bratac plan and bratac build, turns that into a working content repo: a question series for every role, the state machines behind them, and a desk per handling role. No software is written for the business; the only thing produced is content, and every line of it is held to the lint (iris check), which is the same code as the site, at the same version.

The real sites’ plans, words and documents, and runs/, the lab notebook of every session so far, are private, in uhhm/sessions: every runs/... path on this page is there. The plans and intakes beside the trainer in this repo are invented examples.

Build: structure from the plan, words from the model

bratac build --plan plans/contractor.yaml --out out/nordvik \
    --lint "portal lint" --llm "MODEL=sonnet engines/claude.sh"

A plan.yaml is a needs spec that also says what each form collects and, per need, max_fields: how many required fields that person will tolerate, taken from what the business said about them, never from the form. build refuses a form over its budget, and hands the budget to the verifier, so the check still means something after handover. Everything structural is derived from the plan with no model involved: the state machines (read off stages: walk the line, be turned down at any point, succeed only from the end, pass over skippable stages), the front door, a followup page per need, a gated directory per group with its desk and the pages only that group may open, and every button the machine allows. The verifier accepts the result by construction; what it still checks is the budget.

The model writes words only, one page at a time, into a JSON object whose shape is fixed. Its strings are merged over built-in fallbacks key by key, so a bad reply costs wording, never a working site. --llm-for <path prefix> points the model at some pages only (aggregates.yaml for the mails alone), and --llm-note <text> adds a word to each of those pages’ prompts, for a page asked again (what was wrong with the last reply, or two headings that read alike). The prompt shows a page’s slots, not the words they hold, so a note that asks for a rewrite names the words it means. A plan with one tone gets that voice; with several, each pass is told to keep to its own. A reply in the wrong language for the plan is refused, and a mail that lost the submitter’s link gets it back.

Onboarding from the plan

invites_by: [board] on a plan, or invited_by: [...] on a group, puts an invite form on the inviting group’s desk for each group it may fill, and a list of the invites sent. Portal does the rest (an account in Kanidm, the group, a one-time credential link) through invite: on the alternative. Every group with a desk invites into itself by default.

Facts on a card

A need may carry facts, each { about, title, text }, with about one of cost, time, outcome, fit, not_for, prepare and place. They are what a visitor choosing between this card and the ones beside it can use: “Most kitchens take three to five weeks”. build puts them on the card word for word, after what you need and before what happens next, each with an icon for what it is about. No model rewords them. A fact informs and never acts: an order, a question or a button is refused. For a real business no fact is invented. --facts off builds the same site without them, to measure what they do.

Rebuilding a live site

--words-from <repo> lifts the words a repo already has back into the words map by what each card is (its bucket, the page it leads to, the group it invites into), across the whole repo, so a rebuild keeps hand-edited wording even when a card moves page (a door taken away, a need brought onto the front door) and adds only the new slots. Cards are matched by what they are (the bucket they record into, the page they lead to, a field’s name, the group they invite into), not by position, so a rebuild that reorders or reshapes a page still hands each card its own words; on uhhm.no the live front door’s three headings follow their buckets onto the new page. --words <json> overrides slots by page and may repeat, each file layered over the last (the words a build used, then a round of hand changes); words.json in the output is the words as used. See runs/tomtervel-invites-2026-09-23 and runs/uhhm-2026-09-23.

Same contractor, same local model (nemotron 30B-A3B on ergo)Free-form generatebuild
A site the verifier acceptsnever, in 6 rounds and 16 minfirst try, 130 s
Held-out personas, with descriptions-8 of 8
Held-out personas, headings only-7 of 8

The wording numbers are from the re-score of 2026-09-22, one task per call (runs/contractor-build-2026-09-21/rescore-2026-09-22/). The first score, all tasks in one prompt, said 8 of 8 on headings only; the apprentice picking the building survey over “Join our carpentry team” only showed once no other visitor was in the prompt.

For comparison, a Sonnet-class model writing everything free-form scored 8 of 10 on headings only and silently dropped a stage the owner had described. build cannot drop a stage: it never decides one. The denominators differ: the build site gives the two crew personas a one-option page, so they generate no task, and 8 of 8 is eight public personas where the generate number is ten. Held out means held out from the model: the plan’s who and wants lines and the personas were written by the same person about the same needs, and the fallback heading is the need’s wants, so the two are cousins.

The front door opens modestly

A front door with more buttons than text leaves a visitor paralysed. So the built front door opens with what the business does, in one or two features and no button at all (does: on the plan, at most two, each for: a need so it speaks to one role and is headed by what that role gets); then a look-around card, things a visitor may inspect before asking for anything (shows:, each a portal resource block passed through verbatim, plus every public view the plan opens); and only then the offers, as more alternatives on the same page. Nothing is layered: doors still exist for a plan that wants them, but a second tier is what this shape is there to avoid, and on uhhm.no a flat front door with an opener routed better than the doored one.

The house and its players: a role the opener invites in has to see its win, and the machine has to give it something to do after it sits down. build warns when a featured need gives the submitter neither a move (moves_by: {<stage>: [submitter, ...]}) nor a public view; a player with no move is a spectator.

Doors: a first question before the forms

A plan can put public needs behind doors: each door is one alternative on the front door leading to a page of its own, where the needs that name it sit.

A door is built as a page only where the plan’s offers outgrow one front door: more than seven public needs. Where they all fit, a door would only pass the visitor along, to a page holding a few of the things the front door could have held, so build reads the needs as the front door’s own and says so among its readings (“the plan’s 2 door(s) hold what fits the front door”). Measured both ways: six offers sat better on one page than behind two doors, ten better behind four. The lint counts what is left of passing along (see the lint), and score carries the count.

doors:
  - id: patients
    who: someone with pain or an injury, or a patient who already has a time here
needs:
  - id: new-patient
    door: patients
    ...

The door’s page is a nav page, public, holding the forms. The spec gives such a need max_steps: 2 and pins via to the door’s heading, so the verifier walks both pages. A door nobody is behind, a door on an internal need, or a door named like a group is refused, and a front door over five alternatives is warned about. The visitor is scored on both pages: a persona who picks the wrong door is a misroute on /, one who picks the wrong form is a misroute on the door’s page.

Cases with doors: plans/building-permits.yaml (a building authority, nine public needs) is built behind its two. The plans whose doors hold what fits one page are built with their needs on the front door: plans/physio.yaml (a physiotherapy clinic, patients and referrers), plans/fotballklubb.yaml (a football club, in Norwegian, parents and helpers), plans/hire.yaml (a machine hire yard, hiring and firms), and plans/contractor-full.yaml (six public needs). Each has an intake under intakes/ in the business’s own words and held-out personas.

What a plan can say about a form and its readers

  • multiple: true on a select: pick any number (portal renders toggles). What a volunteer can do, which events, which committees.
  • groups: at the top, a list of { id, label }: the groups with a name the public knows, such as a vel’s committees. A select with options_from: groups offers exactly those labels, so the application form and the desks cannot drift apart.
  • watched_by: [public]: an ungated read-only page of the bucket at /status/<bucket>, linked from the followup page. Everyone sees what was sent in and where it stands. email and tel fields, and any field marked private: true, are projected away before it is shown.
  • events: { open: applied, active: onboarded } on a need: the event name a stage is entered by, where the builder’s default (the stage’s own name, received for the first) is not what a live site already has. Portal replays every record by event name, so a rebuild of a site that holds records keeps the names its aggregates.yaml has, or every record vanishes from its desk. uhhm.no’s plan (in uhhm/sessions) rebuilds it this way.
  • mails: { <stage>: submitter | <address> } on a need: who hears when a case enters that stage, sent by portal the moment it moves (delivered by gdo, beside the site). submitter goes to the email the form collected, so the form must collect a required email; an address is the treasurer, the board. The plan then needs mail: { from, reply_to } at the top, the sender every mail carries into site.yaml. The words model writes each mail’s subject and body (aggregates.yaml in the words map); the fallback says what happened and, where the submitter has a move from that stage, the link to make it.
  • stages_text: { <stage>: <words> } on a need: each stage in the plan’s language, where the ASCII id will not do (ikke_lost reads as English). Used by the fallback mails, the “what happens next” line, the desk buttons’ fallback labels, and written into needs.yaml as stage_words so the desk score describes an outcome in the site’s own words. With them, the vel’s desks score 26 of 26.
  • turned_down_from: [<stage>, ...] on a need: the unfinished stages a case can still be turned down from; omitted, every one. An applicant is declined before they start and departs after, which is what uhhm.no’s live machine says and what two near-synonymous desk buttons had been standing in for.
  • reached_from: { <stage>: [<stage>, ...] } on a need: where a stage is entered from, when the line a case walks does not say it. Two shapes need it and nothing else does - a case SENT BACK to a stage it was already past (a building application returned for the drawing it was missing, after the hearing turned something up), and a GOOD ENDING PARTWAY ALONG (an authority that changes its own decision while it is looking at the appeal, rather than passing it up to the board). A stage named there is entered from exactly those stages and nowhere else, so saying where a refusal may come from also says where it may not: an applicant may withdraw from anywhere, and be refused only once the papers are in, which turned_down_from could not express because it was one list for every bad ending at once. Found by replaying a building authority’s real cases through portal’s engine, which refused three legal paths and accepted two illegal ones until the plan could say this; see runs/permits-2026-09-25/README.md.
  • attended_by: on a need: who moves cases that no desk button moves, an automation listening on the bucket’s events, written into aggregates.yaml as portal’s own annotation for the reader.

Plan: the intake, read by a model, checked by a person

bratac plan --intake intakes/contractor.yaml --out out/nordvik \
    --personas sectors/construction/needs.yaml \
    --llm "MODEL=nemotron-3.5-lightning:30b-a3b engines/ollama.sh"

This is the one step where a model decides structure: which needs the intake implies, the stages, who handles what, the form, the budget. Its YAML is parsed and validated exactly as build will, the errors go back to it, and what passes is written verbatim for a person to read before building from it. Personas are never asked of this model; they are attached from a file, and where their need: names an id the plan does not have, plan says so and leaves the mapping to the reader.

generate (below) is the older path, a model writing pages free-form against the lint. It is kept for the record of what it measured.

Interview: the intake, one question at a time

bratac interview is plan for a business that has not written an intake: a conversation that ends in a plan.

bratac interview --out runs/nordvik-interview --human --llm engines/ollama.sh
bratac interview --out runs/nordvik-interview --person intakes/contractor.yaml \
  --llm engines/ollama.sh          # unattended: a model plays the owner

Each turn the model is handed the plan format, the conversation so far, the current draft and what a checker still finds missing, and returns the whole updated draft, what it does not yet know, and one next question in plain words. The draft is held to two things the model cannot talk its way past: a semantic checklist (every kind of person named is a need; every need has its stages, what ends them, a desk whose role the owner has described, and a form within its budget), and the real plan parser, which is what build reads. When both are satisfied and the model has nothing left to ask, the plan is read back for the owner to confirm, written as plan.yaml, and built into site/ with the same model writing the words (--no-build to stop at the plan).

Lessons from a larger model. A small interviewer asks questions that close nothing: “Tell me about your processes.” Every interview already marks them, since transcript.jsonl carries what the checker found missing before each turn and what the turn closed. bratac teach hands each such turn to a larger model, with the conversation up to it and what was missing, and keeps the question that model would have asked:

bratac teach --out lessons.jsonl --llm "MODEL=glm-5.3-flash engines/llama.sh" \
    runs/*/transcript.jsonl
bratac interview --out runs/nordvik-2 --person intakes/contractor.yaml \
    --llm engines/ollama.sh --lessons lessons.jsonl

A lesson is {missing, asked, better, source} and is about a kind of gap, not a business: the need’s own id is taken out of the checker’s phrase, so what a physio’s interview taught is shown in a contractor’s when the same is missing. --lessons shows the interviewer at most three, those that share the most with what is missing now, and tells it to take the manner and not the words. A lesson quotes the two questions and never an answer; teach itself sends the whole conversation to the teacher’s command, so a real owner’s interview is for a model on this machine. The web interview does not read lessons yet.

--experts adds a second, short phase after the interview has what it needs. An expert is a file under crates/bratac/experts/ that knows one thing and is only called when that thing came up. The first is money (money.yaml): it fires when the owner used a word for paying, when a stage reads like invoiced or paid, or, failing both, after one plain question (“Does anyone pay you for any of this?”) that only a plain no turns away. It has three questions at most, and what it learns goes into the plan as the bucket’s existing ledger: (ledger: { amount: 2500 } or { amount: { field: price } } on a need). It may only write an amount the owner said in so many words, or a field the need already asks for as money or number; a guess is refused, as is a question that talks shop (fields, JSON, ledgers). What it could not settle is listed under open: in the plan, one line a need, and said back to the owner as still open. The web interview has no experts yet.

Three rules came out of the first runs, where an 8B model never wrote a need in twelve turns. Settled facts are merged forward, so a model that rewrites the draft from scratch cannot forget the owner’s name and ask for it three times. An incomplete draft is let through, so the conversation keeps moving while the plan fills in. And a key the parser refuses is dropped rather than refused, because a small model that pastes its own notes into the plan should not stall an interview. With those, qwen3:8b built a four-need contractor site in seven turns; what it got wrong (one mention of a safety officer became the whole office) is now a gap the checker names, so the next question asks who the desk’s people are.

What the interviewer puts right by itself. Sixty test interviews on qwen3:8b showed where the turns went: into the interviewer’s own draft, and into asking the owner again what they had answered. Four of the checker’s complaints are now settled as the draft is merged, and never reach the owner:

  • A field budget below what the form already asks is raised to it, up to five. The budget is the interviewer’s guess, and no owner has heard of it.
  • An ending that is no stage goes when another ending is one. When none is, the case ends at its last stage.
  • A role whose words are in the owner’s own answers is described: it joins groups under those words. A role they never spoke of is still asked about.
  • A question the owner has answered is not put to them a third time: told it repeats and repeating all the same, the interviewer keeps its draft and asks about the checker’s biggest gap.
  • That gap is put to the owner in their own words and language: the case as who comes and what they want, then what is open about it (“Housing boards: a survey of the building. Who with you takes care of that?”). The checker’s own line names a need by its id and a key by its name, which is the model’s to read. Each time it is the next gap that has not been asked about; with all of them asked, what else a normal week holds.

On twenty test businesses, three passes each, the first four of these took the interviews from 99, 98 and 105 turns to 75, 84 and 97, and “the role has not been described” from 19, 56 and 115 lines to 0, 3 and 8. The pass of 97 held an interview that ran out of turns over endings none of which was a stage, which is what the last-stage rule was added for, and one where the model never wrote the stages the owner had told it. Ending as the kit does (--brief-only), one pass went from 184 turns and 12 confirmed briefs of 20 to 147 and 14. What this does not reach: an owner who corrects the readback three times leaves with no brief, and nearly every such correction is about a desk the interviewer named in words the owner never used.

A confirmed draft is a plan. The checker above is not the builder: an owner could say yes to a draft that bratac build then refused, over things no owner is read. Of 46 drafts confirmed in four passes over the twenty test businesses, 15 were refused, on five rules. Each is now put right as the draft is merged, before the owner is read it:

  • What went well is one of the endings. A stage on the way (resolved, on a case that ends closed) leaves the good endings; which ending is the good one is never guessed.
  • The stage a case starts in is no ending.
  • Needs in one bucket are one kind of case. A need whose stages, endings or desk differ from the first in its bucket gets a bucket of its own, named after the need; so does one whose bucket is named after a stage.
  • A role is in groups once, under an id: “board’s upkeep parent” written where an id goes becomes one, keeps its spelling as the label, and a second entry for the same words is folded into the first. A need’s id, a bucket and a field’s name written as words are ids of those words.
  • A kind of field the builder has not (time) is one the person types.

All 46 build with these, and 142 of 143 confirmed drafts from every pass (the one left has no desk for a need). The kit’s job does the same to the draft it is handed (put_right), so a brief confirmed earlier builds too; what a draft lacks is never added, and a draft that is no plan still fails as before.

A run leaves transcript.md, every prompt and reply under llm/, and transcript.jsonl: one line per turn with the question, the answer, the gaps and the draft. That file is the training set for an interviewer of our own; it grows one real owner at a time.

From a conversation to a site

The kit puts the steps above in the order a business owner meets them. They talk with a medium model and are told “we’ll email you”; a large model writes the plan in the background; portal builds the site, lints it and draws its map; and the owner gets a mail with the map and a link to look at the site. Nobody waits on the large model.

bratac interview --human --brief-only --out runs/wagtail --lang en \
    --llm "MODEL=qwen3:8b engines/ollama.sh" [--enqueue <site key>@<address>]
bratac job run runs/wagtail [--plan-llm 'cmd'] [--mail-to addr]
bratac job worker --site <site key>@<address> --dir /data

The interview ends in a brief. With --brief-only the conversation is the one above, gaps, checker and all, but when the checker is satisfied the plan is read back in plain sentences and the owner is asked to confirm it (“Is that right? Answer yes, or tell me what to change”). A plain yes is read without a model; anything else is the model’s to judge, and a yes with a correction is not a yes. A correction is one more turn: the model takes it like any answer and the readback comes again. On a yes, brief.json is written: the business, the owner’s name and address, the language, the facts the checker saw settled, the readback they said yes to, the conversation, and the last draft as a starting point, under a job id like 20261027-wagtail-grooming-3f9a1c. The owner is thanked and told they will hear at their address. The opening question, the readback and the thanks are in Norwegian when --lang is no, nb or nn.

Who else comes. The checker only knows the people already named, and in the pitch sketches of 2026-10-28 the interview stopped at two and three needs where the owners had named seven and five. So before the first readback the owner is asked who else gets in touch and what they keep track of that nobody sends them, with the kinds of person heard of so far; an answer that brings a new need is followed by the questions its gaps raise and then the same question again, until an answer brings nothing new (never on the last turn, which belongs to the readback). The readback then lists every need on a line of its own with the role that handles it, by the label the owner gave it, under the model’s sentences. The interviewer calls the place what the owner calls it (a borettslag, a café, a club), never “the business” or “bedriften” unless it is one; the opening question names no kind.

A model owner is not a yes-man. A model playing the owner (--person) said “Ja, det stemmer” to a readback that put every case with the wrong people. Its prompt now has it compare a readback with its intake first, and the harness holds it to that: a yes, however it goes on, to a readback whose draft has a handling role that the intake’s who_is_involved never names, or fewer needs than the sentences of its who_comes_to_us, counts as a no, and the owner’s answer becomes the correction the intake gives. A person at the terminal or on the web is never second-guessed.

--enqueue <site key>@<address> queues the brief on that site then and there, with the terminal’s own key (KIT_KEY, else ~/.config/portal/kit.key, which the site names <key>=kit); without it, bratac job run <dir> runs it by hand. Every line of transcript.jsonl now also says how long the owner waited for the next question (interviewer_s), and a line answering a readback carries confirmed.

The job is plan, build, the lint, map and the mail, in that order, in-process, each step moving the job’s stage on (queued, planning, building, linting, mapping, mailing, done, or failed from any of them) and rewriting result.json with the stage, the seconds each step took, the lint’s counts by code, and the paths. The plan is written from the brief rendered as an intake (intake.md: the owner’s words, the readback, the settled facts, the conversation, the draft), by the large model with the rounds and checks plan already has; when it gives no plan (no round passed, or the call timed out), the fallback model is asked, and when neither writes one, the interview’s confirmed draft is built if it holds up to everything build checks (plan_llm says interview draft). The owner’s language and address go into the plan as the brief has them, whatever the model wrote. A failing lint finding fails the job: no mail goes out for a site the lint refused. The map is drawn as map.svg, and as map.png where rsvg-convert is installed; both are copied into the site, so the preview serves them at /site/map.png.

flagenvdefault
the plan model--plan-llmKIT_PLAN_LLM, or KIT_PLAN_MODEL on Ollamaqwen3.6:27b
its fallback--plan-fallback-llm (none)KIT_PLAN_FALLBACK_LLM, KIT_PLAN_FALLBACK_MODELnone
a call’s time limitKIT_PLAN_TIMEOUT (seconds)5400
plan rounds, per model--plan-roundsKIT_PLAN_ROUNDS4
the site’s words--words-llm (none for the builder’s own)KIT_WORDS_LLM, or KIT_WORDS_MODEL and KIT_WORDS_CTX on Ollamaqwen3:8b with NUM_CTX=12288 on Ollama; none on another engine
the engineKIT_ENGINEengines/ollama.sh

The plan can be another engine’s while the words stay on Ollama: KIT_PLAN_LLM is a whole command, so KIT_PLAN_LLM="MODEL=glm-5.3-flash TIMEOUT=5400 engines/llama.sh" writes the plan on a llama.cpp server at LLAMA_HOST (measured on ergo, 2026-11-26: GLM-5.3-Flash wrote a plan that parsed in two rounds of 14 and 11 minutes, at 2.3 tokens a second).

The mail is to the brief’s contact (or --mail-to), in Norwegian bokmål when the brief’s language is no, nb or nn and in English otherwise: a first draft is ready, a link to see it (KIT_PREVIEW_URL, where {id} is the job’s id for a preview per job), the map shown in the message and linked (KIT_MAP_URL, else the preview’s /site/map.png), that everything on it is checked by machine, and that a reply puts anything right. It is rendered into portal’s own mail contract (Mail) and goes to the site with the job’s end, which hands it to gdo like any site’s mail; that contract has no attachments, so there the map is shown from its link. Either way the same mail is written to the job’s mail.eml, with the PNG shown from inside the message and the SVG attached; in a kit with no gdo that file is the mail. The sender is KIT_MAIL_FROM (default uhhm <post@uhhm.no>), replies go to KIT_MAIL_REPLY_TO when set.

The queue is the site’s own. A brief is a record in the built-in bucket portal_kit, queued until its job ends, and the row written with it in the kit outbox is the worker’s: it serves kit over dhd/1 with a key the site names <key>=kit in DHD_KEYS, and says that key as it starts (<data>/kit.key, or KIT_KEY). One job runs at a time, because the large model is one slot. A row stays the worker’s until the site has taken the job’s end: a move to built or failed that carries what the record says (the preview, the map, an error), the job’s mails, and, for a job that waits for a yes, the desk it is filed on. A worker that stops mid-job is handed the row again, and a job that ended before finds its result.json and says its end again (word.json) rather than running twice. The site lets a kit key mail only the brief’s contact and the site’s own address. When a job is done the worker names it in <data>/preview.

The preview is a plain portal serve. bratac job content --root <data> answers the three Gitea calls portal loads content with (the tree, a file’s bytes, a file’s entry) from disk: repo kit/<job id> is <data>/jobs/<job id>/site, and repo kit/preview is the job named in <data>/preview. A portal started with CONTENT_REPO=http://127.0.0.1:3001/kit/preview therefore shows each new site as its job finishes, without a restart, where it is the site the worker serves (KIT_PREVIEW_LOAD=site, with load beside kit in its DHD_KEYS): the worker asks it to Load over its own call. One preview at a time.

The client’s place on Gitea, and the owner’s way in. With --gitea <url> (KIT_GITEA_URL) the interview also proposes a name for the site’s organisation, made from the business’s name (lowercase ASCII, æ as ae, ø as o, å as a, words joined by dashes, at most 40 characters, none of Gitea’s reserved names), and says it in the readback the owner confirms. Organisations and users share one namespace in Gitea, so both GET /api/v1/orgs/<name> and GET /api/v1/users/<name> must answer 404. When the name is taken the readback offers up to three free variants (-as, then numbers) and the owner picks one, or gives a short name of their own, which is checked the same way; when Gitea cannot be reached the name goes into the brief unchecked (org: {name, checked}), for the job to check. A private organisation is invisible to a token outside it, so the interview’s check is advice; creating the organisation is the last word.

The job then has a provisioning stage between the map and the mail. With KIT_PROVISION=auto it runs then and there when KIT_GITEA_URL and KIT_GITEA_TOKEN are set (the token is never logged); by default (approve) the job is filed on the site owner’s desk instead, and the same steps run once the owner approves (see The owner says yes):

  1. The organisation, private unless KIT_GITEA_VISIBILITY says otherwise, its description saying which job it was made for (kit job <id>). If Gitea refuses the name (someone else has it), or the organisation is there and was not made for this job (another caller asked for the same name, or the bot is in it for another reason), the first free variant is taken and result.json says which name was asked for (org_asked).
  2. <org>/questions with the built content: site.yaml, questions/, aggregates.yaml, needs.yaml, words.json, map.svg, a README in the owner’s language, and two workflows modelled on uhhm’s content repos: lint-and-reload.yml (the lint at the pinned release, then a Load of the commit that passed) and deploy.yml (the pinned PORTAL_RELEASE, the service env, the unit, the Caddy route). Nothing secret is committed: the deploy names the variables and secrets a person fills in (PUBLIC_URL, SITE_HOST, PORTAL_PORT, KANIDM_URL, OAUTH2_CLIENT_ID; LOAD_TOKEN, OAUTH2_CLIENT_SECRET, KANIDM_API_TOKEN, and on the host the unit’s StateDirectory= drop-in) and refuses to run until they are there, and the README says so.
  3. <org>/infra: compose.yml (portal from the release tarball, its store on a volume of its own, the portal port on 127.0.0.1), its Dockerfile, env.example, a README and a .gitignore for .env.

All of it is idempotent: a job run again finds its organisation (the token’s user is a member, and the description names the job) and its repos, and commits only the files whose content changed (compared by git blob id), in one commit, or none. result.json gets provisioned: the organisation, the repo URLs, how many files each run changed.

With KANIDM_URL and KANIDM_API_TOKEN set, the stage also gives the owner a way in, through the same Kanidm client portal’s own invites use: the person is found by their address, or made, and put in KIT_DEVELOPER_GROUP (default developers) and in <org>_owners (both made when missing); someone new gets a link to set their own password or passkey. KIT_INVITE_TTL asks for its lifetime (default 7 days); Kanidm 1.11 gives at most one day, and the mail and result.json (invite_expires, invite_seconds) say what it gave. The link goes in the mail and nowhere else. The mail says the way in, and where the source is only when KIT_MAIL_SHOW_SOURCE=true.

Gitea makes an account at a person’s first sign-in through Kanidm, so the owner cannot be put in their organisation’s Owners team before that. The job leaves a pending grant (grant.json in the job’s directory: the organisation, the team, the Gitea name to expect, until when), tries it once at once, and the worker looks again every 30 seconds for the first hour and every five minutes after, until the person is there or the link has run out; bratac job grants --dir <data> does one round by hand. Gitea names the account after the local part of Kanidm’s preferred_username (maddie@id.example becomes maddie), which is the Kanidm name the invite made. This was chosen over the two others after trying them against a throwaway Gitea 1.27.3 and Kanidm 1.11.2:

  • A groups claim with Gitea’s group-team map (<org>_owners to the organisation’s Owners team) needs the claim on Kanidm’s Gitea client and the auth source’s whole map rewritten for every new organisation, which Gitea only does from its own CLI (gitea admin auth update-oauth) on the Gitea host: a job would need a shell there.
  • Making the Gitea account first and letting ACCOUNT_LINKING = auto link it at the first sign-in needs a site-administrator token for the job, and access by a matching name or address is exactly what that setting warns about.
  • The pending grant needs only an organisation owner’s token (the bot that made the organisation is one) and the REST API, and a sign-in before the grant is no harm: the person sees nothing until they are in the team.

To have this on uhhm’s Gitea and Kanidm, the user (not the kit) creates:

# Gitea: a bot account for the kit, and its token (the scopes the job uses).
# In the official container, run the CLI as its git user with its config:
#   docker exec -u git gitea gitea --config /data/gitea/conf/app.ini admin ...
# A --random-password account is created "must change password", and Gitea
# refuses every API token of such an account until the flag is cleared.
gitea admin user create --username uhhm-kit --email kit@uhhm.no \
    --random-password --must-change-password=false
gitea admin user generate-access-token --username uhhm-kit --token-name kit \
    --scopes write:organization,write:repository,read:user --raw
# Kanidm: a service account for invites and groups. Managed by the
# idm_admins group, so an idm_admins member (not only idm_admin) can
# handle it, and its token is made BEFORE it joins the admin groups:
# once it is in them it counts as high-privilege, and only idm_admin or
# admin may issue its credentials.
kanidm service-account create kit-bot "uhhm kit" idm_admins
kanidm service-account api-token generate kit-bot kit --readwrite
kanidm group add-members idm_people_admins kit-bot     # make people, reset links
kanidm group add-members idm_group_admins kit-bot      # make developers, <org>_owners
kanidm group add-members idm_people_pii_read kit-bot   # find a person by address

and sets KIT_GITEA_URL, KIT_GITEA_TOKEN, KANIDM_URL, KANIDM_API_TOKEN (and KIT_DEVELOPER_GROUP if not developers) on the worker. Where these come from a content repo’s Actions secrets, name the secrets so they don’t start with GITEA_ (Gitea refuses such names) and don’t collide with the site’s own: uhhm’s deploy maps secrets.KIT_KANIDM_API_TOKEN onto the worker’s KANIDM_API_TOKEN. Nothing on Gitea’s or Kanidm’s own configuration has to change: the Gitea client already maps idm_all_persons to openid profile email, and auto-registration is on. A Kanidm behind a private CA is trusted through PORTAL_EXTRA_CA.

The interview on a site

The same conversation can be had in a browser, in a card of a portal site that declares it (interview: on an alternative, see Content reference). A line says that a model asks the questions, that the conversation is kept to build the visitor’s site, and that it is not used to train models unless they are asked first; then the question, a box and Send.

One step, two front ends. trainer::interview::step takes one answer and moves a State on (the draft, the turns, the readback waiting for a yes, the organisation’s name): bratac interview calls it in a loop at the terminal, and the site calls it once per answer. On the site the step runs in the background: the answer is posted (interview_send), the card says it is thinking, and the browser asks (interview_state) every three seconds until the next question is there, so nothing in front of portal holds a request open for the 20-60 seconds a turn takes on qwen3:8b. Between answers the conversation waits in the site’s store (portal_interviews, kept 14 days after its last answer) under a random id; the address bar carries ?interview=<id>, and that link brings a closed tab back to where it was. A turn lost to a restart is offered the address form after twenty minutes.

The yes. The readback and the confirmation happen in the chat, as at the terminal. On the yes the brief is written to the conversation and queued in the site’s store (a portal_kit record from the card’s page), and the visitor is told “We’ll email you when your map is ready, at <address>”. The page’s responsible contact (else site.yaml’s mail.reply_to, else mail.from) gets a note with the readback, the settled facts, the conversation and the job id: the owner hears about every caller.

Guard rails, beside portal’s per-caller rate limit:

envdefault
conversations under way at onceINTERVIEW_MAX_LIVE6
of them from one addressINTERVIEW_PER_CALLER2
answers in one conversationINTERVIEW_MAX_ANSWERS16 (and the engine’s 12 turns plus the yes)
characters in one answerINTERVIEW_MAX_CHARS2000
model turns at once (the rest wait up to four minutes)INTERVIEW_PARALLEL1

When the model does not answer (it is then thought out of reach for a minute, and new conversations go straight to the form), when no turn with it comes within four minutes, when the caps are full, or when the conversation runs out of turns or readbacks, the visitor is offered to leave their address and a line instead (interview_leave), and the contact gets that request with whatever was said. Answers are never logged; the log says how a turn went.

The model. Content names it (interview.model, else INTERVIEW_MODEL, else qwen3:8b); the instance runs it: INTERVIEW_LLM is a whole command, else INTERVIEW_ENGINE (else KIT_ENGINE, else engines/ollama.sh from the release, which now ships engines/) with MODEL, NUM_CTX=12288 (INTERVIEW_NUM_CTX) and TIMEOUT=180 (INTERVIEW_TIMEOUT), and Ollama at OLLAMA_HOST. English only for now: the language is a parameter (interview.lang, else the site’s lang), and the chat’s own words have one place to be translated (interview::words).

A worker beside the site. The queue is the site’s own, so a worker on the same host takes the jobs with the same release: bratac ships in it beside portal, and started bare it runs what PORTAL_COMMAND says, so a second app@ instance whose ExecStart is the release’s bratac, with PORTAL_COMMAND=job worker --dir /srv/app/<instance>/data and PORTAL_DHD=<site key>@127.0.0.1:4300, is the worker; the site names its key in DHD_KEYS as <key>=kit. Without provisioning (no KIT_GITEA_URL/KIT_GITEA_TOKEN) and with KIT_PREVIEW_URL=none, the mail to the visitor shows the map and says we will be in touch about setting up the site, and the worker switches no preview. With KIT_MAPS_DIR set to the worker’s data directory, the site serves each job’s map at /kit/map/<job id>.png, which KIT_MAP_URL=https://<site>/kit/map/{id}.png puts in the mail.

The owner says yes

A public interview is open to anyone, so on a site the kit does not make anything for a caller on its own: no organisation, no repos, no account. The caller gets their map by mail as before; the job is filed on the site owner’s desk, and the organisation, <org>/questions, <org>/infra, the Kanidm invite and the Owners grant after the first sign-in come only after the owner approves.

KIT_PROVISION says which:

KIT_PROVISIONat the end of a job
approvefiled on the owner’s desk; set up when they approvethe default when Gitea or Kanidm settings are there
autoset up at once, as the kit always didfor a private kit whose callers are known
offnothingthe default with neither

The owner’s desk is a bucket in the site’s own store. The worker files there and hears of each approval through the site, over dhd/1; it never opens the store.

A value it does not know is read as the default, never as auto. With approve and no KIT_GITEA_URL/KIT_GITEA_TOKEN, jobs are still filed, and an approval moves to failed with “provisioning is not configured” (Kanidm alone gives an account nobody can use).

On the desk. The site’s content declares the bucket and puts a card over it on the owner’s desk. In aggregates.yaml:

  - bucket: kit_jobs
    attended_by: the kit worker (bratac job worker), which files finished jobs here and sets up the approved ones
    initial: awaiting
    states:
      awaiting: { event: filed }
      approved: { event: approved }
      declined: { event: declined }
      provisioned: { event: provisioned }
      failed: { event: failed }
    transitions:
      awaiting: [approved, declined]
      approved: [provisioned, failed]
      failed: [approved, declined]

and on the owners’ desk (questions/review/index.yaml on uhhm.no, under qualifies: owners):

  - name: Sites to set up
    description: >
      Each one had the conversation and has their map. Nothing is made
      for them until you approve: then their organisation and repos,
      and a way in by mail.
    action: /review
    consequence: [Confirm]
    features:
      - name: ""
        description: ""
        resource:
          source: { bucket: kit_jobs }
          requires_group: owners
          transitions:
            - { from: awaiting, to: approved, label: Approve and set up }
            - { from: awaiting, to: declined, label: Decline }
            - { from: failed, to: approved, label: Try again }
            - { from: failed, to: declined, label: Decline }

The card offers no move out of approved: the access policy, compiled from the desk, gives no person and no visitor approved -> provisioned or approved -> failed, and no form fills the bucket. The worker makes those two moves itself, through the site with its kit key, which the site takes only for a job the kit filed and only out of approved; the event says by: kit. The bucket’s name is KIT_APPROVAL_BUCKET (default kit_jobs), and the site files nothing in a bucket that does not start in awaiting or lacks one of the moves above.

The record. The site files it with the job’s end, under the job’s id, in the answers outbox like a form’s answer: business, name and email of the caller, org (the organisation name they confirmed, or the one proposed from the business), map (the link the mail shows), job, and needs (one line: who comes and what they want). A job said again is not filed twice. result.json says filed: {bucket, record}. The site’s owner gets a note, “Kit: <business> is waiting on your desk”, with the same and a link to the desk (KIT_APPROVAL_DESK). The owner is KIT_OWNER_MAIL, else KIT_MAIL_REPLY_TO, else KIT_MAIL_FROM, and has to be one of the site’s own addresses (site.yaml’s mail.from or mail.reply_to): the site lets the kit mail nobody else but the caller.

The yes. The owner’s move to approved hands the job to the worker in the same batch, as a row in the kit’s outbox, so it reaches the worker at once and waits for it when it is down or busy with an hour-long plan. Beside whatever job is running, the worker reads the brief and checks the job finished, runs the provisioning steps above (the organisation name is checked again, and a free variant taken when someone has it now), and settles the record in one move: to provisioned with outcome and site on it (never the link), the caller’s mail with where their site lives (<gitea>/<org>, the two repos) and their way in, with when the link runs out, and the owner’s one line: “Wagtail Grooming is set up as https://git.example/wagtail-grooming; the invite went to maddie@wagtail.example, its link works until …”. When anything fails, the record goes to failed with the reason in outcome, the owner hears it in one line, and the desk offers “Try again”. The mail to the caller is also written beside the job as setup.eml.

An approval is set up once: approval.json beside the job says which approval it was (the row that handed it over), what came of it, and holds the caller’s mail until the site has taken it, so one handed over again is only settled, and a record approved again after a failure is another round. A settling move the site cannot take yet is said again until it can; nothing is set up twice, so no second link is minted. One worker per site.

A job the desk cannot take (the site’s content does not declare the bucket, or not as above) still mails the caller their map: the worker says the job’s end again without filing it, result.json says filed.error, and the owner gets “Kit: <business> is not on your desk” with the reason. bratac job run by hand has no desk: with approve it says so and sets nothing up. The standalone kit (kit/compose.yml) is a private one and sets KIT_PROVISION=auto.

A job that finished before its site asked for the owner’s yes (or one whose filing failed) is put on the desk with the worker’s settings, without planning or building it again:

bratac job file <job id> --dir /srv/app/uhhm-kit/data --site <site key>@<address>   # or the job's directory

It goes in as awaiting like a job that ends today, the owner gets the same note, and result.json says filed. It refuses a job that is not done, was set up already (provisioned in result.json), has been approved (approval.json), or is on the desk already. It dials the site with the terminal’s key, which the site names <key>=kit; the site keeps the job as a brief that built, from the brief beside it.

Which models, measured 2026-10-27 on ergo (8 GB GPU, 28 cores) with two fictional owners (an English dog groomer, a Norwegian bike workshop) played by granite4.1:8b on the CPU, so the interviewer kept the GPU:

interviewerownerseconds per turn (median, range)outcome
nemotron-3.5-lightning:30b-a3ben24 (11-32)never wrote a need in 14 turns
nemotron-3.5-lightning:30b-a3bnb35 (16-42)never wrote a need in 14 turns
qwen3:8b, 32k contexten76 (24-97)confirmed brief, 7 turns, 2 corrections
qwen3:8b, 32k contextnb64 (27-134)confirmed brief, 8 turns, 2 corrections
qwen3:8b, 12k contexten24 (16-33)confirmed brief, 4 turns
qwen3:8b, 12k contextnb43 (7-83)three readbacks corrected, no brief

qwen3:8b with NUM_CTX=12288 is the kit’s interviewer (kit/interview.sh); at 32k its context no longer fits the GPU and a turn takes three times as long. For the plan, mistral-medium-3.5:128b on the CPU took 28.6 and 25.5 minutes for two rounds and passed neither (a front-door card for a group, a form over its budget); qwen3.6:27b passed on its fourth round for the English brief (27 minutes, beside an image build) and on its second for the Norwegian one (15 minutes), so qwen3.6:27b is the kit’s plan model and the 128b is only used when named (KIT_PLAN_MODEL, or as the fallback with KIT_PLAN_FALLBACK_MODEL). The words for a three-need site take qwen3:8b about three minutes, with the same 12k context (NUM_CTX=12288) the interviewer has.

In containers, kit/Dockerfile builds portal (with its site bundle) and learn from the checkout and ships them with engines/, jq, curl and rsvg-convert as a non-root user, data on /data. kit/compose.yml runs one container: the kit’s site, which keeps the queue and shows the newest finished job on 127.0.0.1:8090, and the worker beside it, dialling it over dhd/1. The interview is docker compose -f kit/compose.yml exec kit /app/kit/interview.sh with a person at the terminal (KIT_LANG=nb for Norwegian). Models are read from OLLAMA_HOST, by default the host’s Ollama through host.docker.internal.

Changing a site from a conversation

The person a page names as responsible (see Content reference), signed in, finds “Suggest a change to this page” at its foot. On an instance with EDIT_GITEA_TOKEN that card is a conversation which ends with the change applied to the site’s content repo, after their yes and a thorough check; without the token it is the plain form it was (the suggestion becomes a case for whoever keeps the site, and the card says changes are not applied from there). The server checks on every call that the session is the page’s responsible person, as the plain form does.

The conversation. The site’s interview model (EDIT_TALK_MODEL, else INTERVIEW_MODEL, else qwen3:8b, run as the interview is) reads the page’s file as it is on main, aggregates.yaml and needs.yaml when there is one, and asks one question at a time until the change is clear: what to add, change or remove, where, and in whose words. It never shows the person YAML. It may take EDIT_MAX_ANSWERS (10) answers of EDIT_MAX_CHARS (2000) characters; on the last it must say the change as well as it can. When the model does not answer, nothing changes and the person is asked to send the answer again, or to send what was said as a plain suggestion instead.

The draft. When the change is clear, a larger model (EDIT_MODEL, default qwen3.6:27b, at EDIT_NUM_CTX 32768 and EDIT_TIMEOUT 1800 on the same engine; EDIT_LLM is a whole command) writes it in the background as edits to the content files: a few lines found and replaced, a new file, or a file removed. It reads the agreed change, the conversation, a short form of this reference, the page, its cards’ ids, aggregates.yaml, needs.yaml and the other pages (whole while they fit in 48 KB). Only pages under questions/, aggregates.yaml and needs.yaml may be written; never site.yaml, the workflows or anything else. The edits are resolved to whole files against main and the result is linted; a miss (text not found, a file it may not write, something the lint fails) is told to the model, EDIT_DRAFT_ROUNDS (3) tries at most. The card says “Drafting your change…” and the browser asks every four seconds; the person may leave and come back.

The read-back. Both sides are loaded as the lint loads a checkout and compared, and the card shows, in plain words: the model’s summary; what changes (questions, cards, fields with their kind, buttons on desks with the move they make, lists, states and moves in the graphs, who may open a page, who is responsible); who gains or loses access, from the access policy the site would compile before and after (access::Policy::from_content, rule by rule: “Anyone may now open /desk and send its forms”, “Members of board may no longer move cases in applicants from open to invited”), and who a state puts into a group or takes out of one (grants:, revokes:), or “Nobody gains or loses access”; links that would stop landing (a card id or a page that would be gone, an in-site link that would break); what the lint would newly warn about; and iris map before and after, side by side (one under the other on a phone), each opening full size. Then “Apply this change”, “Not quite” (back into the conversation, which asks what should be different) and “Withdraw”.

Words, or how the work goes. What happens on the yes depends on what the change is, and that is read from the change itself, never asked of a model (edit::kind):

the changeon the yes
only words a person reads, only on the asker’s own pageapplied: checked, committed, merged by portal, and theirs to undo
anything elsehanded over: the same draft as a PR for whoever maintains the site, which portal does not merge
anything, asked by a member of portal_maintainerapplied

Words are a question’s heading and text, a card’s heading, text, button and the lines under it, a feature’s heading and text, a field’s label, placeholder and the words for a pattern, a list’s empty line and a desk button’s label. Everything else is how the work goes: a field’s kind or stored key, where a card leads, what a list reads, who may open or see something, a state graph, another page, a new link out of the site, a storyline more or fewer. A rewording that would change who may do something, or where a link lands, is not only a rewording.

A change handed over says why (“It changes more than words: …”) under the read-back, and its button says “Send it to whoever maintains the site”. On the yes it is checked as any change is, the PR is opened, the site’s inbox is mailed with the read-back and the PR, the case rests in handed, and the page is free for the next change. The site looks in on the PR every ten minutes: merged, the person is mailed as for any applied change and the undo is theirs; closed, their case says so.

portal_maintainer is a group like any other: an invite or a state puts people in it, a site’s mfa_groups may hold it to a strong sign-in, and EDIT_MAINTAINER_GROUP names another group for the role. Its members still open the box only on pages they answer for.

The check, after the yes, on main as it is then:

  • a file the change touches has changed since the draft: refused;
  • size: at most 8 files, 64 KB a file, 256 KB in all;
  • the schema, the lint’s failures and the structure needs.yaml asks for (everything iris check --path questions says), counting only what the change brings, plus the repo’s CI command itself (iris check --path questions, run with this binary or EDIT_LINT_BIN) when a workflow runs it;
  • access: every rule it adds must be one the read-back showed;
  • links: a card id it removes must have been shown, and no in-site link may break;
  • live cases: for each state (or whole graph) it removes, the records in that state are counted in the site’s store; any at all refuses it, since a changed graph never rewrites a record (see State machines) and they would stand where nobody can move them.

New warnings are listed and do not refuse it. A refusal goes back into the conversation in plain words (“The check stopped it, so nothing changed: 2 cases in applicants are still invited. …”).

The commit and the merge. A branch suggest/<id> is made at the very commit that was checked, the change is committed on it in one commit with the person as author (name and address from their session) and the token’s account as committer (EDIT_COMMITTER_NAME/_EMAIL to name another), and a PR is opened with the read-back as its description. Portal merges it itself: every ten seconds the site’s sweeper reads the PR, the statuses on the commit, main’s head and main’s protection, and decides (edit::merge::decide):

  • a repo whose workflows run on pull_request is waited for until at least one check has reported and all have passed, and every context main’s protection requires is among them and green;
  • a repo with no checks on PRs merges on portal’s own check;
  • a failed check, a PR closed on Gitea, a push to the branch by anyone else, or a PR that no longer merges cleanly ends it: the PR is closed with the reason and the conversation goes on;
  • when main has moved, the check runs again on main as it is now with the change on top, and only then does it merge, so what lands is what was checked;
  • the merge names the checked commit (head_commit_id), so Gitea refuses it if the branch moved; nothing waits longer than EDIT_CHECK_MINUTES (30).

Gitea’s own “merge when checks succeed” was not used: without branch protection it merges at once when no check has reported yet (the CI run starts a moment after the PR opens), it would merge whatever main had become, and nothing would tell the person when a check failed. The content repo’s lint-and-reload then lints main and loads the content into the site, as for any push. The card says “Waiting for the site’s own check…” with a link to the PR, then “Applied”, and the person gets a mail with the summary and the PR (mail::suggestion_words, applied); the site’s inbox gets a line too.

The record. The first draft files the change as a case in portal_edit_suggestions, as the plain form files a suggestion (name, email, by, page, question, text with the agreed change, talk), and portal moves it through the bucket’s built-in graph: drafting, awaiting_yes, checking, then applied (with summary, readback, pr and commit), failed (with reason; the conversation goes on and the next draft moves it back to drafting) or withdrawn, and applied to undone. The states are only added to the graph, so every suggestion filed before fits it. “What you have suggested here” lists them with their state. The conversation itself (turns, the change as whole files before and after, the read-back, the PR) waits in the site’s store (portal_edit_talks, 180 days; never the person’s words in the log), the maps in portal_edit_maps (30 days), served only to the person at /edit/map/<id>/before.svg and after.svg.

Undo. Once a change of theirs is applied, the card offers “Undo my last change”: the same change turned round (each file back as it was), read back, and on the yes through the same check, PR and merge. When a file it touched has changed again since, it is refused, and the person is asked to say what should change instead. An applied undo moves the change it undid to undone, and “Undo my last change” then offers the change before it.

Guard rails. Only the responsible person, checked on the server on every call and for the maps; one change at a time per page (another responsible person is told someone is changing it; a change left waiting on its person for two hours lets go of the page); the turn and length caps above; one model turn and one draft at a time per site; a model that fails, a check that refuses and a Gitea that does not answer each leave the content as it was. A restart takes up a turn, a draft, a check or a waiting PR where it was.

Measured 2026-10-27 on ergo, a scratch copy of uhhm.no’s content on a throwaway Gitea, qwen3:8b and qwen3.6:27b on the local Ollama: a turn of the conversation took 13 to 17 seconds (under a minute when the model had to load first), and a clear first answer was enough for a change of one card; the drafts took 140 to 265 seconds (one file for a new field, three for removing a state with its desk buttons and a follow-up’s feature), each usable on its first round; the read-back took under a second; from the yes to “Applied” took 11 to 14 seconds with a CI that reports a few seconds after the PR opens. Removing invited from applicants while two cases were in it was refused by the check with the count, and nothing was opened.

Credentials. A token that can push a branch, open a PR and merge it on the site’s content repo, and nothing else. For uhhm.no the kit’s bot uhhm-kit can be that account; the user (not portal) would:

# 1. uhhm-kit as a collaborator with write on uhhm/questions
#    (Gitea: uhhm/questions -> Settings -> Collaborators -> uhhm-kit, Write), or:
curl -X PUT -H "authorization: token <an owner's token>" -H 'content-type: application/json' \
  https://project.uhhm.no/api/v1/repos/uhhm/questions/collaborators/uhhm-kit -d '{"permission":"write"}'
# 2. a token for it with only what this needs
gitea admin user generate-access-token --username uhhm-kit --token-name edit \
    --scopes write:repository,read:user --raw
# 3. if main is protected with a merge whitelist, add uhhm-kit to it; keep
#    "Lint and reload / lint (pull_request)" as a required status check
# 4. the token as the secret EDIT_GITEA_TOKEN in uhhm/questions
#    (Settings -> Actions -> Secrets), and in deploy.yml's service env:
#      EDIT_GITEA_TOKEN=${{ secrets.EDIT_GITEA_TOKEN }}
#    with a PORTAL_RELEASE that has this feature

CONTENT_REPO and CONTENT_BRANCH name the repo, as for loading the content. The token reads the content at a commit, makes branches and commits on the repo, opens, comments on, closes and merges PRs, and reads main’s protection; it never touches another repo.

How it works

 intake (plain words)
    │
    ▼  phase 1                       frozen after this phase: the generator
 needs.yaml ───────────────────────  may not weaken the spec to pass
    │
    ▼  phase 2   ◄── iris findings, until it exits 0
 aggregates.yaml + questions/** + desks
    │
    ▼  phase 3   ◄── misroutes from a blind visitor model
 wording
  1. Needs. The intake becomes needs.yaml: one need per kind of person and thing they want, including the roles inside the business. Each names the bucket the answer lands in, the group that handles it, the states that count as finished, and the effort the visitor will tolerate.
  2. Structure. Pages, state machines and desks are generated, then revised against the lint, iris check, until every need is met: a path within budget, a desk held by the right group, every state of every bucket reachable and none stranding a record. The page-writing model sees the needs and never the personas. Each round the lint writes its findings with stable ids (--findings, kept in <out>/findings/round-N.jsonl), and the round is logged as what it fixed, what is still open, what is new and what it reopened. A fix round is shown only the open findings, each with the change that closes it, and the files they name (the whole repo when a finding is about getting around the site). A change that reopens a closed finding is undone and the model told what it broke. A round that closes nothing, or leaves as many open as it found, ends the phase: what is left is written to run.log rather than polished at again.
  3. Wording. A separate model plays each persona, blind, first with headings only and then with descriptions. A misroute is a wording defect and goes back to the generator; a visitor who chose right but hesitated is reported and rewrites nothing by itself. A rewrite that breaks structure is reverted.

Model output is only ever written to aggregates.yaml, site.yaml and questions/**.yaml inside the output directory.

bratac generate --intake intakes/contractor.yaml --out out/nordvik \
    --lint "portal lint" --llm engines/ollama.sh
bratac answer --tasks tasks.jsonl --llm engines/ollama.sh > answers.jsonl

answer puts one task per call to the visitor model, with the options shuffled per task and the call seeded from the task id: no visitor sees another visitor’s situation, a heading’s place on the page cannot carry the answer, and a rerun on the same site is the same experiment. The earlier runs under runs/ answered all tasks in one prompt.

The verifier is iris, the lint: it reads portal’s own content types and ships in every portal release, so a generated repo’s CI keeps enforcing its needs after handover.

LLM backends

A backend is any command that takes a prompt on stdin and prints text.

BackendUse
engines/ollama.shLocal Ollama. MODEL=qwen3:8b answers a task in about two seconds on ergo’s GPU and is the default visitor. Generation wants a larger model (MODEL=qwen3.6:27b), which runs mostly on CPU there.
engines/llama.shA llama.cpp server (llama-server), or anything else that speaks OpenAI’s chat completions, at LLAMA_HOST (default http://127.0.0.1:8081). For a model Ollama does not run well: a large mixture-of-experts model whose experts stay in RAM. MODEL is the name the server serves under; the context is the server’s own (-c), so NUM_CTX is not read.
engines/claude.shClaude through Claude Code’s own login (a Max or Pro subscription), no API key. MODEL=sonnet or opus, EFFORT=low by default. It drops any ANTHROPIC_API_KEY from the environment, because a key outranks the login and a stale one fails every call. Log in once with claude auth login.
engines/anthropic.shThe Anthropic API, given a working ANTHROPIC_API_KEY from the Console. That is separate, prepaid billing; a subscription does not cover it.
engines/mailbox.shWrites each prompt to a directory and waits for a reply file: drive the generator from an agent session, or by hand.

The visitor and the generator should be different models. A model grading its own wording agrees with itself.

The onboarding site

portal-portal/ is the front end of this: a portal content repo whose front door is the intake interview. A submission lands in onboardings (open → drafted ⇄ revising → live | declined) and is worked from an owners’ desk. Today the desk step is a person running generate and sending the link; the intake record already carries every field the generator reads, so the step that remains is a program taking the answers outbox that runs it and pushes the draft to a new repo. It passes its own needs.yaml.

The whole card, not the heading

A visitor never sees a bare heading and description. Portal renders a card: a button, an encouragement, one or more sections each with an icon, a title and a line of guidance, and the fields with their labels and placeholders. Since 2026-09-23 the builder fills all of it and the scorers read all of it.

  • Slots. Beside the heading and description, each form alternative gets a button, an encouragement, an icon, a form title and guidance line, and a placeholder per field. A door gets an icon and a “for whom” line. Icons are picked from a fixed list of Iconify lucide names; anything else is dropped.
  • Context from the plan. Every form alternative also carries two sections built from what the plan already knows, before the form: what happens next (the stages, in order, as one sentence) and who reads it (the handling group and the contact). Their fallbacks are true before a model has written a word; the model rewords them.
  • Scoring. answer --repo <content dir> shows the visitor each option as its whole card (headings-only tasks stay headings only). rate --repo does the same and asks a fourth question, “where”: do you know where you are, who this is for, and what the button does. All four are controlled against the gutted twin.

Scoring a built site

bratac score --site out/nordvik --out out/scored \
    --iris /var/local/cargo-target/release/iris \
    --llm "MODEL=qwen3:8b engines/ollama.sh"

One command for the whole grading, which every run under runs/ before 2026-09-23 carried as its own score.sh: iris writes the visitor tasks and the simulation model, the blind visitor answers them with descriptions and with headings only, iris scores the answers (the misroutes are printed), and rate reads the cards. The two routing numbers land in summary.json, the rating in rated/rate.json. --routing stops after the two routing numbers: what a round of mending a wording is scored on, at a fraction of the visitor’s calls. The pieces still run alone: answer --tasks for one visitor model against tasks iris wrote, and:

iris check --path out/nordvik/questions --needs-sim model.json
bratac rate --model model.json --out out/rated --repo out/nordvik \
    --llm "MODEL=qwen3:8b engines/ollama.sh"

How sure the wording makes a visitor: --seeds N. One run of a small visitor model is noisy: about one persona in a round changes its mind on nothing but the seed. With --seeds 5 the visitor answers every task five times, each with its options in another order, and the score is how the five split:

SPLIT: anna@/: right 0.80, the rest to "Join a group" 0.20
brier: 0.110 over 5 seeds (0 is every seed right)
wording: 7/8 routed right (88%)
  • brier is the mean over tasks of the squared share of seeds that went wrong: 0 when every seed of every task routed right, 1 when none did. It moves when a wording gets steadier, which 7/8 cannot show. Compare two wordings on it.
  • wording counts a task right when most of its seeds were; half and half is wrong.
  • SPLIT names each task the seeds did not agree on and where the others went: the cards that read alike to that person.

summary.json carries seeds, and per mode brier and split beside right and of. What the model says of its own confidence is recorded in the answers and not scored. One seed (the default) scores as before.

One card that takes them all: DRAW. Each misroute names the card its visitor passed over, and five of them read like five wordings to mend. Often it is one: a card wide enough that visitors of several needs see themselves in it.

DRAW: on / the card "someone qualified to come and look at it and say
  what it takes" took 2.3 visitor(s) of 2 needs (build-enquiry,
  warranty-claim): its wording is the one to narrow

A card is a draw when it took a visitor’s worth of picks or more (the shares of the seeds, added up) from tasks of two needs or more, none of which it meets. Narrow that card’s heading (in a plan, the wants of its need) before touching the cards the visitors passed over, and score again. One need’s visitors all going to one wrong card is left as misroutes: there the need’s own card is as likely the cause. Per mode, summary.json carries the cards as draws.

A heading that leans on its description: LEANS. A visitor who went right with the descriptions and wrong on the headings alone was carried by the description. score names each and the card they should have taken, whose heading is the one to mend:

== leaning on the description: 2 visitor(s) went right with the
   descriptions and wrong on the headings alone; the heading to mend
   is the one each should have taken
LEANS: apprentice@/: "to be considered, without writing a letter"

In a plan that is a wants that leans on its who: “to be considered” (for what?), “it ordered” (what?). Behind a door the door said who the cards were for; on one front door the heading stands alone, and says it itself. summary.json carries them as leans.

The two lines above are the contractor plan’s, before they were acted on. Two rounds by hand, each scored with --routing (three seeds, the local visitor): narrowing the drawn card to “a survey of a building, and a report on what is wrong and what it takes” took the visitors routed right with descriptions from 9 of 12 to 11; having three more headings name their object (“to be considered for a job with us”) took them to 12, and on headings alone from 8 of 12 to 10. Four wants changed, nothing else in the plan.

Seeds are spent where they tell something: every task is asked under the first three (--first), and under the rest only where those three did not agree. Most tasks are answered alike three times over, so --seeds 7 costs little more than three. --first 7 asks every seed of every task.

rate takes the same two flags, and score passes them on: each persona answers the understanding questions under the first three seeds, and under more only while its answers do not agree. A yes is most of the seeds. With seeds, each page in rate.json also carries understanding_share and control_share: the share of all answers that were yes, per question, which tells a page nine in ten understand from one that six in ten do when both count as a yes.

With several seeds the answers are a file per seed, answers-<mode>-seed<n>.jsonl, which is how learn extract reads a run’s seeds as votes: a scored run under runs/ is training rows with soft labels, and choose --validate holds its formula to them, with nothing more to do. The lint scores them from one file of them all, scored-<mode>.jsonl. One seed is answers-<mode>.jsonl, as before.

Four yes-or-no questions per persona (which option is mine, where am I and what does the button do, what will I be asked, what happens after I send it), each also put to a gutted twin of the page with headings, descriptions, the form and the followup removed. A question the twin still gets a yes on is not measuring the page, and rate says which. The followup page is read from the repo (--repo); without it “what happens next” is reported as not measured rather than as zero. LIX is over the prose only (question, descriptions, followup): headings and labels are not sentences and would pull every page down to “very easy”. The rate.json in runs/contractor-build-2026-09-21/ predates this and its asked and next columns are the old, pinned ones.

rate --repo also scores the desks, the inside of the business, which reads button labels and nothing else: for every desk and bucket with two or more buttons, a worker is told what has just happened to a case (in the state’s own words, never the label’s) and picks the button among the ones a row in that state shows, in a rotated order. Scored per desk as right of total, with what each miss was mistaken for. Measured on 2026-09-24 on the live vel: 24 of 26, the misses one button each on the neighbour-help desk and the notice board. Two limits: the outcome is put from the state id, and a Norwegian id with its accents stripped (ikke_lost) reads as English even to a strong model; and a first version that offered every button of the bucket, not the row’s, scored the same desks 17 of 26 and sent a rewrite chasing an instrument fault. A desk that scores full marks has labels a stranger to the business could press right. prefer has a positive control on record (runs/tomtervel-opener-2026-09-23, “The friendliness judge”): the live vel front door against a bureaucratic twin, friendlier 9 of 10 to the live page and 0 to the twin. A pair that comes back “no preference” throughout is alike in tone, not an instrument that cannot see; and the rejected door rewrite that was judged clearer on 5 of 10 needs routed worse across three seeds, so clarity as judged and routing as measured are different things, and routing decides.

Measured so far

Generated: a building contractor (runs/contractor-2026-09-21/), from intakes/contractor.yaml, a Sonnet-class model generating.

  • Phase 1 derived six needs from the owner’s prose, including one nobody asked for: a project manager logging a phone enquiry, taken from “enquiries arrive by phone, email and text and get lost”.
  • Phase 2 was green on the first round: 14 files, four state machines (enquiries: open → quoted → won | lost, subcontractors with an awaiting_papers loop, applicants, site_issues), two desks.
  • Phase 3, its own personas: 10 of 10 in both modes. That number is flattering, because in that run the pages were written with the personas in view. Against ten held-out personas, with qwen3:8b as the visitor:
Visitor could readRouted right
Headings and descriptions10 of 10
Headings only8 of 10

A scaffolding firm asking “how do I get to do jobs for you?” chose “Ask about working with us” (the hiring door). An attic conversion chose “Get someone to look at a building”. The generator has since been changed to hide personas from the page-writing phase.

Built: the same contractor from a plan (runs/contractor-build-2026-09-21/), nemotron writing words only, and re-scored one task per call the day after (rescore-2026-09-22/ in it): 8 of 8 with descriptions, 7 of 8 on headings alone, the miss being an apprentice bricklayer reading “Join our carpentry team” as not for them. rate on the same site, with the followup shown and every question controlled, passes its controls and puts the pages at LIX 18 to 35.

Built behind doors, 2026-09-22. Five plans with a first question before the forms, each built and then scored by qwen3:8b one task per call, against held-out personas. Behind a door a persona is asked twice, on the front door and on the door’s page.

CaseWords byWith descriptionsHeadings onlyNotes
Machine hire (hire)nemotron10 of 1010 of 10doors that ask a question the visitor already knows the answer to
Physio clinic (physio)nemotron8 of 109 of 10“Book your first appointment” fails a daughter booking for her mother
Football club, Norwegian (fotballklubb)nemotron14 of 1611 of 16three parents walk past “Er det på tide å melde inn?”
Football club, NorwegianClaude Sonnet13 of 1612 of 16better sentences, same driver/sponsor blur
Whole contractor (contractor-full)nemotron18 of 2215 of 22“Apply to work with us” and “Find a job with us” cross over for all four
Tomter Vel, Norwegian (tomtervel), first planClaude Sonnet25 of 3022 of 30“utstyr” for a swing, hearing input behind the wrong door
Tomter Vel, plan revised 2026-09-23, whole cardClaude Sonnet31 of 3830 of 38committees as groups, public lists, hearing input on the front door

Each run’s README names the misroutes and what in the plan or the heading caused them. A stronger word model did not route better on the one plan built with both: routing is decided by which distinctions sit on one page, and the visitor grades that the same whoever wrote the words.

Planned: the contractor intake read by a local model (runs/contractor-plan-2026-09-22/), nemotron, one round, 41 s. The plan passed every check build makes and a reader finds three structural misses in it the checks cannot: the crew’s report made public, the “papers missing” stage dropped, and no need for the project manager logging a call. The person reading the plan is not optional.

Existing site: uhhm.no (runs/uhhm-2026-09-21/), eight tasks.

Visitor modelWith descriptionsHeadings only
small LLM, blind7 of 85 of 8
qwen3:8b (Ollama)7 of 87 of 8
granite4.1:8b (Ollama)7 of 86 of 8

All three send a paying client through “Work happens through dialogue, not tickets”, the collaborator door. Different models, same defect: that is what a wording problem looks like.

The noise floor, 2026-09-23 (runs/spread.sh, answer --seed). The same tasks answered by qwen3:8b with four seeds (0 is the run every score above used):

RunWith descriptionsHeadings only
uhhm.no round 6, 15 tasks11, 10, 10, 1012, 12, 7, 7
Tomter Vel with the opener, 38 tasks30, 29, 29, 3126, 24, 26, 23

With descriptions the visitor is steady: one task in fifteen, two in thirty-eight. On headings alone it is not: five of fifteen on uhhm.no between seeds, three of thirty-eight on the vel. A headings-only difference smaller than that is the visitor’s mood. Compare descriptions-mode scores; read headings-only as a sanity check, and run several seeds before believing it. Small numbers, one run each. Leads, not measurements.

What else is here

  • skill/SKILL.md - the same procedure for an agent or a person working by hand.
  • sectors/ - needs specs to start from. construction/ doubles as the held-out persona set above.
  • generator/reference.md - everything the generating model is told about portal content. When the lint rejects something the reference did not warn about, the fix belongs there.

Toward a trained model

The runs are now a training set. learn, a second binary in this repo, turns every run and every night of synthetic personas into rows labelled by the plan’s own truth, trains a small route model on a frozen encoder, calibrates it, and answers as a visitor (engines/learn.sh) and as a ranker (learn rank). The visitor models are its factory and its yardstick, never its judge: a model trained against a judge that is often wrong learns the judge. What it is, how it is measured on sites it has never seen, and how to retrain it are in Learning.

The generator side is not trained yet: generating many wordings per need and keeping the ones that route best is the next step, and those winners are the fine-tuning set for a small generator.

Learning

For a site: a search box lets a visitor say what they need in their own words, and rings the card that fits. The model behind it ships with portal, trained on made-up sites only. A site asks for the box with search: in site.yaml (Content reference); an instance needs learn beside portal, which every release carries, and an encoder (Ollama with bge-m3) (Operations). A visitor’s words answer that visitor and are never kept.

This page is the notebook behind that model: how it is trained and measured, the numbers so far, and how to run a night. It is for whoever retrains the model or adds the next decision; writing or running a site needs none of it.

What the trainer measures, portal can learn from. learn/ is a second binary in this repo: it turns every run under runs/ and every night of synthetic data into one training set, trains a small decision model on the plan’s own truth, says how right and how sure it is, and answers the trainer and the interview over JSON. The local models are its data factory and its yardstick, never its teacher of taste.

This page is for whoever runs a night, reads the table, retrains the model or adds the next decision. How learn is built is in learn/README.md; how it ships beside portal is in Operations, the ranker.

Where things live. Rows, embeddings, models, the LLM reply cache and the reports are private, in ~/repos/sessions/learn/ (the sessions repo, uhhm/sessions): the rows carry real clients’ personas and page texts, and this repo is public. The one thing that comes back here is the shipped model, learn/models/route.{bpk,json}, and only when it was trained on fictional sites alone. Numbers about real clients leave the sessions repo as counts.

The commands below assume learn and portal on PATH (cargo build --release --manifest-path learn/Cargo.toml and cargo build --release --features ssr --bin portal, both into $CARGO_TARGET_DIR/release/), are run from the root of this checkout, and use

L=~/repos/sessions/learn

1. What the model is

A frozen multilingual encoder turns every context and every candidate into a unit vector: bge-m3 through Ollama’s /api/embed, 1024 numbers. A small predictor (Burn 0.22.1, about a million parameters) maps the context’s vector to a predicted target vector in the same space. A candidate’s score is its cosine to that prediction; the probabilities are a softmax over the candidates of one context, at a temperature fitted after training.

ẑ   = normalise(c + Linear_zero(GELU(Linear(LayerNorm(c)))))     1024 → 512 → 1024, dropout 0.1
s_i = ⟨ẑ, z_i⟩ / τ                                               τ = 0.05
p_i = softmax_i(s_i / T)                                         over the context's own candidates, at most 12

The predictor’s last layer starts at zero, so the untrained model is exactly the encoder’s own cosine between the visitor and each option: the zero-shot floor. Every table therefore has the floor in it. Training keeps epoch 0 when no later epoch beats it on dev, so a model cannot do worse than the floor on dev, and that is all it promises. Dev rows are new visitors at the sites the model trains on; on a site it has never seen, a trained model can do worse than the floor, and so far every route-v1 recipe tried has (Results so far). The model that ships today is the floor itself, written by learn train --epochs 0.

The predictor scores each candidate on its own and sums nothing over positions, so the order the options are listed in cannot move it: the order-flip control below checks that bit for bit. An LLM visitor reading the same page in the other order changes its mind on up to a third of the rows.

A second encoder can be compiled in (--features onnx, --encoder onnx:<dir>, paraphrase-multilingual-MiniLM-L12-v2, 384 numbers, no Ollama). It gets its own cache and its own models, and a model refuses vectors from an encoder other than the one its sidecar names. It is the road to learn rank without Ollama; it is not what ships.

2. The four decisions

Every decision is one row shape: a context text, candidate texts, and which candidates the world agreed with. decision picks the predictor. One ships.

  • route (ships). Which option on a page a visitor picks. Context: the visitor’s own words and nothing else (template route/v2): the persona, its addresses scrubbed, NFC-normalised and trimmed. The page’s question and what the page says first stay on the row as page_question and page_head, not in the text. Until 2026-10-22 the context was "{question}\n{head}\n\nVisitor: {persona}" (route/v1), and the page drowned the visitor out (Results so far). A model reads only its own template: rank, predict, eval, answer and visitor refuse a route/v1 model fed route/v2 text and the other way round (rank and predict exit 2), telling the two apart by v1’s \n\nVisitor: line. train refuses train rows that mix the two, and dev or held-out rows of a template the train rows lack. Candidates: the options as the visitor saw them, the whole card where the run had the content repo (when one option’s card is missing, every option of that row falls back to heading and description, so a row has one rendering), else heading and description, else the heading. Positives: the options the plan says lead to the visitor’s need.
  • framing (derived, no labels of its own). Which wording of one option to offer. Not a per-visitor decision: a framing is good when it pulls the people it is for and leaves the others alone, which the route model can score per persona. The extractor finds the cases where the same visitor met two wordings of one option on one page and one routed right and the other did not (271 contexts under 892 wordings so far); those train as pairs through the route predictor, on the same route/v2 context.
  • gap (rows from now on, no model yet). Which open gap an interview turn points at. Context: the last three questions and answers and the draft plan; candidates: what the checker finds missing, plus “nothing is missing”; positives: the gaps the turn closed. Free and deterministic: bratac interview writes all three into transcript.jsonl every turn.
  • next (rows only, later). Which state a case moves to next, from the simulated walks and later from real cases’ events.

3. The rows

learn extract reads every run once and writes the rows to $L/rows/rows.jsonl, one JSON line each, through one struct with one validator. A row, from the fixtures (a fictional machine-hire yard):

{"schema_version":1,"row_id":"r_44fb516731516db2","decision":"route",
 "site":"fjellstad-hire","site_class":"fictional","language":"en","group":"fjellstad-hire|garden-wall","split":null,
 "source":{"origin":"runs","run":"hire-2026-09-10","file":"tasks-full.jsonl","line":1,"task_id":"garden-wall@/",
   "labeller":"plan","visitor_model":"qwen3:8b","writer":"unrecorded","persona_writer":"human",
   "seed":null,"seeds_total":1,"mode":"full","rendering":"heading+description",
   "words_version":"questions","words_sha":"sha256:975cdadd…","template":"route/v2"},
 "context":{"text":"I am building a stone wall in the garden …",
   "persona_id":"garden-wall","persona_text":"I am building a stone wall …","need":"hire-request",
   "page":"/","page_question":"What brings you to Fjellstad Hire today?","page_head":null},
 "candidates":[{"id":"f7f260b020dda","text":"- Hire a machine for a while: For anyone who needs a digger …\n","need":"hire-request"},
               {"id":"fcc26235cf1ce","text":"- Set up an account for your firm: … Write to contact@example …\n","need":null}],
 "label":{"kind":"listwise","positives":[0],"soft":[1.0,0.0],"smoothing":0.0,"pair":null,"value":null,"weight":1.0}}

The rules that make it one training set:

  • row_id is a hash of what the row is (decision, site, context, sorted candidates, where it came from, seed), so re-extracting is byte-identical and replaces rather than duplicates. For a factory row “where it came from” is the site or framing label, not the night’s dated directory (that is in source.run), so the same row keeps its id from one night to the next.
  • A candidate’s id is its framing id, "f" and the first twelve hex digits of the sha256 of its text: the same text has the same id on any site, at any position, in any commit. Candidates are sorted by id; the order a visitor saw is in bratac answer --trace from now on.
  • Every @ address is scrubbed to contact@example before anything is hashed, on fictional and real rows alike, so ids are stable. A card that carries an address therefore gets a different id in learn than portal’s card::framing_id gives it.
  • group is site|persona. Every page, every wording and both languages of one persona stay on one side of every split.
  • site_class is fictional or real, from one site table (learn/src/sites.rs) keyed by run prefix. A run the table does not know is a hard error, and two client sites are never read at all.
  • writer (who wrote the candidate’s words) and persona_writer (who wrote the visitor) are both recorded, so self-play is one comparison.
  • A factory persona’s row may also say what the persona describes (persona_describes: problem, outcome or service), whether the margin guard marked it (persona_margin_flag) and the panel’s verdict (persona_valid). The three are optional: rows from before week 2 have none of them, and still read.

Labels: the plan’s truth, picks soft, judges never

  • Plan truth is the label. positives are the options the plan says lead to the visitor’s need (expect in the tasks iris writes). Every number in the table is scored against plan truth alone.
  • A visitor model’s picks are soft. When a model answered the same task under several seeds, its votes go into soft. Training mixes them in at λ = 0.3 (--picks on, or off, or another λ), and a row labelled by a visitor model rather than the plan weighs 0.3 of a plan row. Picks help: training without them was worse on each of the four held-out sites tried.
  • Judges are never a label. bratac prefer (“which is clearer”, “which is friendlier”) has no path into a row. A door rewrite a judge found clearer on 5 of 10 needs routed worse across three seeds (Training a site); preference can be printed beside a number, never trained toward.

What is in the rows now

$L/rows/manifest.json counts every row by decision × labeller × class × language × rendering, and every answers file by joined and dropped. The extraction behind the table (rows sha256 3b9e655b…, extractor at 488439b):

fictionalreal
route rows labelled by the plan3,288688
route rows labelled by a visitor model only032
framing pairs, by a visitor model67257
framing pairs, by a person (override files)027
in all3,3551,004

4,359 rows: 1,333 from the runs and 3,026 from the first factory night. English 1,506 fictional, Norwegian 1,849; by what the visitor read, 2,121 headings, 2,012 whole cards and 226 heading and description. The 82 answers files hold 2,429 lines: 2,397 joined to their task, 32 dropped because their run kept no tasks file (counted, listed). A file the join table does not cover stops the extractor. That extraction is route/v1’s; the route/v2 rows behind the shipped model (5,891 of them) are counted in Results so far.

4. Splits, and why the held-out site is the number

learn split writes every split file from one rows file:

splitwhat is held outwhat it answers
dev15% of each site’s personas, by hash, stratified by needthe model that ships: trained on every fictional site, calibrated on dev
loso-<site>one fictional site, all of ithow the model does on a business it has never seen. The headline
grouped-5fold-{0..4}a fifth of the personas, across all siteshow it does on new people at businesses it knows
real-clientsnothing trains; real rows onlysanity, reported as counts
pool-out-<b> (with --blocks)one block of new sites, all of ithow the model does on six businesses it has never seen, the level where week 2 chooses

Given the pool-out blocks (--blocks blocks.json), the loso folds are cut only for the sites outside every block, and each pool-out-<b> lists its inner sites: at most eight training sites, by hash, one per twin family, for every choice made inside the fold. --curve --k 8,16,32,50 --draws 3 --cap 120 and --volume 32x100,16x200 write the learning curve and the volume pair instead, per block: the first k sites of a draw’s order of the remaining sites train (twins drawn together, counted as two, so the k = 16 sites are within the k = 32 sites), at most --cap train rows per site by row-id hash, plus one uncapped split at the largest k. learn train --train-filter persona_valid|margin_ok drops train rows only, records the filter in the manifest, and exits 2 when a train row lacks the field.

The headline is the mean over the leave-one-site-out folds because that is the job: the model will be asked about a site somebody is building today, not about the eight it was trained on. A persona split within known sites is easier by a wide margin (compare the 5-fold and loso rows below), and an easy number is the one that would hide a model that has memorised the sites’ words. vestmark (English, pages of up to twelve options) and liail-il (Norwegian) are printed by name beside the mean.

The rules, asserted again by learn train, which refuses a split file that breaks one and names the row:

  1. A real client’s row is eval-real in every split, never anything else. A model trained on one would carry what it learned into a public repo.
  2. Held-out first, then dev, by group. Three sites have a twin, the same business told in the other language (plans/*-nb.yaml, written for this); a fold that holds out one of the pair drops the other, because a translated persona is the held-out persona.
  3. Self-play: a training group whose persona was written by the model that wrote the words it is routed by moves to self-play, scored on its own line. A person, fallback and unrecorded are not a model. The current rows have none.
  4. A non-train row whose persona or context text also occurs in train is dropped and counted.
  5. A non-train persona whose bge-m3 cosine to any train persona is above 0.95 is dropped and counted (learn embed caches every persona text for this). A real row that rule 4 or 5 would drop stays eval-real and is flagged instead, and the sanity check leaves it out.

Rows whose persona a person wrote are the hard set (1,580 of them), reported apart from the synthetic personas so the easier synthetic distribution cannot hide a regression.

The sealed set. Week 2 adds a third site class, sealed: businesses made and locked before anything is trained, then opened once to test what was chosen. Their ids are s- and eight hex digits, so no training site can take one, and LEARN_SEALED_SITES lists them, one <id> <language> <plan> <half> per line, the half A or B. learn extract writes their rows only under LEARN_SEALED_DIR, and each row says its half in source.sealed_half. split, train, calibrate, lint, bench, eval, ltr, and embed into a cache outside that directory, refuse a rows file that holds a sealed row. They exit 2 and give the count by half, never the text. The way past is learn unseal --prereg <file>... --half A --sealed-dir <dir>. It checks that every PREREG file is committed, reads the scorer list’s sha256 from the freeze’s addendum (a line scorer-list sha256: <hex>), writes <dir>/UNSEALED-A and prints LEARN_UNSEALED=A:<sha>. With that token, and LEARN_SEALED_DIR set to the directory that holds the record, the readers take rows of half A, and only A. A second unseal of the same half is refused as spent.

5. Training, calibration and the gate

learn train fits one predictor per seed (three by default: 42, 43, 44) on the split’s train rows and keeps the first seed’s best epoch as the model:

  • Targets. Listwise rows: plan truth spread over the positives, the visitor’s votes mixed in at λ, the row’s weight. Framing pairs: Bradley-Terry on the two wordings’ scores. Plus a cosine term pulling the prediction toward the positive (weight 0.5).
  • Negatives. Each listwise row also gets options from other pages of the same site as extra wrong answers, one for every four of its own, redrawn every epoch, never more than twelve columns in all. Without them the model only ever compares options that sit together on one page.
  • Loop. Batches of 64 contexts; AdamW at 1e-3, weight decay 0.05, cosine decay over at most 60 epochs; dropout on the context side only. Early stop on dev NLL with patience 5. Epoch 0, the untrained floor, is a candidate for best, so the model is never worse than the floor on dev. --epochs 0 trains nothing and writes that floor as a model, with T and the gate fitted on dev as for any other.
  • The anchored head. --head anchor scores an option as the floor plus a shrunk residual, cos/τ + α·r, with r a rank-32 bilinear term that starts at zero, trained at α = 1 under an L2 pull toward zero (week 1’s anchored primary: 20 planned epochs, no cosine term). --alpha inner chooses α, the pull and the epoch count by leave-one-site-out over the split’s inner sites (its inner list, or every training site when it has none), from rows the split stamps train alone, and keeps the floor unless that gains more than 0.005; --alpha <a> holds α and chooses the rest. T and the gate are fitted on the pooled inner out-of-site logits, not on dev; --train-dev trains on the dev rows too. α = 0 is the floor to 1e-6, and the model directory’s config.json carries the chosen α. learn anchor runs the same choice as an experiment, every variant side by side.
  • Control. --control permute-labels relabels every row by a random permutation of its own candidates (a new one per seed), trains as usual, and must land within three binomial standard deviations of chance on dev, with the dev rows’ effective n over their clusters as n: n²/Σm² for clusters of m dev rows, since a cluster’s rows are right or wrong together (the 475 dev rows in 419 clusters, 12 of 5 and 8 of 2, count as about 309: about 5 points at three seeds, about 8 at one). If it does not, something other than the labels carries the answer. The permutation is drawn per cluster: rows are one example when their visitors have one text key (NFKC, lower case, punctuation and digits dropped, whitespace collapsed) or persona vectors within the split’s near-duplicate cosine (0.95), and their options match one to one by that key, a typo’s worth of edits (a swap of two letters is one) or option vectors within 0.95, but for at most one option of each dropped, added or replaced. An option only some rows of a cluster have takes a place of its own; a row without it walks the cluster’s shuffle past it. Every row of a cluster moves the same option to the same place. A train row that slipped into dev reworded, recased, repunctuated, with a typo fixed or one option fewer or more then carries its permuted label across, and the control goes red; on an honest split no dev row can be predicted. Context vectors are not compared: the page’s template makes two visitors on one page near-duplicates there.

Calibration is fitted on dev and nowhere else. The temperature T minimises dev NLL. The gate is the smallest top-1 probability at which the dev rows at or above it are right 90% of the time, with the share of rows it lets through (its coverage). A model whose dev rows never reach 0.9 has no threshold (null), and a null gate never acts. learn calibrate refits both on the same split and prints before and after; --require-calibrated fails a model whose ECE after T is worse than the floor’s. That floor is the cosine with its T fitted on the same dev rows, in-sample, in both commands: the gate compares two things calibrated the same way on the same rows, and neither may move without the other.

Serving reads the gate, never a bare score: at or above the threshold the model acts; below it, the interview asks and the trainer leaves things as they are. A low confidence is a question, never a guess.

A model directory, $L/models/route-<date>/, holds five files, the weights written last:

filewhat is in it
model.bpkthe weights (burnpack)
config.jsonwidth, hidden size, dropout, τ
calibration.jsonT, the gate (precision, threshold, coverage), the split it was fitted on, n
manifest.jsondecision, encoder and width, template, split, rows sha, training sites and their classes, git revision, burn version, backend, seeds, every hyperparameter, the headline metrics as mean ± sd over seeds
metrics.jsonthe floor, every seed’s dev and held-out numbers, the control’s verdict

The first bar was set before any number existed: route at least 10 points above the floor on the held-out-site mean, ECE at most 0.05 after T. That floor was the route/v1 cosine, which the page’s words had diluted, and no trained model met the bar. The bar now is against the person-only cosine, the model that ships, on the same rows. A trained model replaces it only when:

  • it beats the cosine on the held-out-site mean by more than its seed noise;
  • no held-out site is more than 5 points below the cosine;
  • it is at or above the cosine on a set of new sites that no choice was made on, and on the real clients;
  • its ECE is 0.08 or less on both;
  • the gutted twin stays within 5 points of chance and the permutation control at chance.

The gutted twin can be red without a model reading the options’ order: where a page’s answers are uneven, a fixed taste for one Option i lands on the commonest answer by luck, and best_fixed says how far that goes. So a gutted twin over chance + 5 points that is no higher than its best_fixed, with the gate abstaining on more than 95% of the gutted rows, is read as that position luck and does not block a replacement. That is the shipped cosine’s own case on the real clients and on moen-utleie (Results so far). A gutted accuracy above best_fixed, or a gate that acts on gutted rows, blocks it.

A floor that wins is a valid result, and today it is the one that ships.

6. The table

learn bench scores every scorer on every split and writes one table, $L/reports/<date>.md and the same numbers as .json, under a run id (a report another run already wrote for that day is kept, and the new one goes beside it as <date>-<run id>.md; --table is written as asked): b and twelve hex digits of a hash over the code revision, the rows’ sha256, every split file’s sha256, the scorer names and every model file it scored with. Same inputs, same id.

The scorers: uniform (chance, and the floor every Brier and ECE is read against); zero-shot (bge-m3 cosine at its own T, the untrained predictor; T is fitted on the split’s dev rows, else --calibrate-on’s, else the dev.json beside it, taking the first that has dev rows the line does not score, so a reported line is never calibrated on itself; a line that scores all of them, like the dev split’s own line, is at T = 1 and says so in fitted_on); route-v1 (bench trains one per split with learn train’s defaults and one seed, into $L/models/bench/route-v1/<split>-<rows sha8>/, with the decision in front of the split for any decision but route, and reuses a directory trained for the same decision on the same split, rows and recipe; the real-client split has no train rows and is scored with the dev model, which never saw a real client); route-v1-picks-off; model:<dir>; llm:<model>@<seeds>x<orders> (an LLM visitor from the reply cache, its vote share as p, a tie as an abstention); cached:<jsonl> (any scorer’s probabilities from a file, such as Laya below).

acc@1 credits a tie at the top with its share of positives, which is what a random tie-break gets on average. ECE is on top-1 confidence (10 bins under 2,000 rows, 15 above) with a 200-draw bootstrap interval. sel@50 and sel@80 are the accuracy on the most confident half and four fifths of the rows; cov@gate and acc@gate are how many rows the gate lets through and how many of those are right.

The headline, 2026-10-21

This is the last route/v1 bench, kept because it is the only one with the LLM visitors and Laya in it: their caches are keyed by row id, and every route row id changed with the template. The route/v2 numbers, and the model that ships now, are in Results so far.

Run be4afbcf74633 (git ec6060aa378a, rows sha256 3b9e655b…, 4,359 rows, bge-m3), pasted from reports/2026-10-21.md in the sessions repo. The real-client lines are counts only; their numbers stay in the sessions repo. Noise floor (two seeds of the qwen3:8b visitor disagree on the same task): 18.4% of 407 rows.

scorersplitnacc@1chanceNLLBrierECE [95% CI]sel@50sel@80cov@gateacc@gateguttedflipwrong personafull/skim
uniformdev4750.4130.4130.9320.5860.001 [0.000, 0.004]0.5000.4540.0%–ok 0.41/0.41ok bitwiseok 0.41/0.41n/a
uniformloso mean ± sd (8 folds)32880.411 ± 0.1230.411 ± 0.1230.940 ± 0.3410.588 ± 0.1220.001 ± 0.0040.418 ± 0.1150.413 ± 0.1200.0%–8/8 ok8/8 ok8/8 oknot run
uniformloso-vestmark7760.2660.2661.3310.7340.000 [0.000, 0.000]0.2820.2700.0%–ok 0.27/0.27ok bitwiseok 0.27/0.27n/a
uniformloso-liail-il3800.5000.5000.6930.5000.000 [0.000, 0.000]0.5000.5000.0%–ok 0.50/0.50ok bitwiseok 0.50/0.50n/a
uniformgrouped-5fold mean ± sd (5 folds)32880.413 ± 0.0060.413 ± 0.0060.932 ± 0.0170.586 ± 0.0060.001 ± 0.0010.500 ± 0.0000.455 ± 0.0070.0%–5/5 ok5/5 ok5/5 oknot run
zero-shotdev4750.6380.4130.8270.4980.081 [0.062, 0.135]0.7650.7080.8%1.000ok 0.44/0.41ok bitwiseok 0.41/0.41ok 0.66/0.63
zero-shotloso mean ± sd (8 folds)32880.587 ± 0.1980.411 ± 0.1230.865 ± 0.3620.525 ± 0.1610.134 ± 0.0500.632 ± 0.1940.600 ± 0.1930.1%1.000 ± 0.0007/8 ok8/8 ok7/8 ok6/8 ok
zero-shotloso-vestmark7760.4550.2661.1990.6630.083 [0.052, 0.118]0.5230.4850.0%–RED 0.34/0.27ok bitwiseok 0.30/0.27ok 0.48/0.43
zero-shotloso-liail-il3800.6740.5000.6260.4390.114 [0.080, 0.160]0.7160.6640.3%1.000ok 0.50/0.50ok bitwiseok 0.48/0.50ok 0.71/0.64
zero-shotgrouped-5fold mean ± sd (5 folds)32880.620 ± 0.0440.413 ± 0.0060.826 ± 0.0640.499 ± 0.0490.083 ± 0.0110.749 ± 0.0730.684 ± 0.0592.8%0.820 ± 0.1475/5 ok5/5 ok4/5 ok5/5 ok
route-v1dev4750.7960.4130.5290.2960.033 [0.025, 0.072]0.9330.86364.0%0.908ok 0.44/0.41ok bitwiseok 0.38/0.41RED 0.79/0.81
route-v1loso mean ± sd (8 folds)32880.503 ± 0.1470.411 ± 0.1230.905 ± 0.3340.563 ± 0.1290.073 ± 0.0330.551 ± 0.1820.526 ± 0.1629.9%0.820 ± 0.1618/8 ok8/8 ok4/8 ok6/8 ok
route-v1loso-vestmark7760.3430.2661.2820.7090.087 [0.058, 0.120]0.3810.3560.4%0.667ok 0.30/0.27ok bitwiseRED 0.32/0.27RED 0.33/0.37
route-v1loso-liail-il3800.5390.5000.7220.5130.118 [0.070, 0.170]0.6260.59228.2%0.617ok 0.51/0.50ok bitwiseok 0.52/0.50ok 0.55/0.52
route-v1grouped-5fold mean ± sd (5 folds)32880.755 ± 0.0390.413 ± 0.0060.591 ± 0.0630.335 ± 0.0370.047 ± 0.0220.925 ± 0.0330.833 ± 0.03569.8%0.866 ± 0.0433/5 ok5/5 ok5/5 ok0/5 ok
llm:qwen3:8b@3x2dev37 (of 475)0.8780.4201.5980.2090.063 [0.009, 0.135]0.9470.9330.0%–n/aok 15.3%n/an/a
llm:qwen3:8b@3x2loso mean ± sd (5 folds, 3 failed)2620.858 ± 0.0680.416 ± 0.1171.542 ± 1.0970.209 ± 0.1090.047 ± 0.0490.962 ± 0.0440.917 ± 0.0510.0%–not run3/5 oknot run1/1 ok, 4 not run
llm:qwen3:8b@3x2loso-vestmark50 (of 776)0.8030.2671.9520.2730.010 [0.017, 0.120]1.0000.8750.0%–n/aRED 33.3%n/an/a
llm:qwen3:8b@3x2loso-liail-il80 (of 380)0.8310.5000.8920.1940.027 [0.000, 0.062]0.9750.9140.0%–n/aRED 29.2%n/an/a
llm:qwen3:8b@3x2grouped-5fold mean ± sd (5 folds)2620.841 ± 0.0450.380 ± 0.0611.415 ± 0.7270.232 ± 0.0370.067 ± 0.0190.945 ± 0.0350.904 ± 0.0380.0%–not run2/5 oknot runnot run
llm:granite4.1:8bdev6 (of 475)0.8330.4084.6050.3330.167 [0.000, 0.500]0.6670.8000.0%–n/an/an/an/a
llm:granite4.1:8bloso mean ± sd (5 folds, 3 failed)380.957 ± 0.0640.415 ± 0.1161.184 ± 1.7650.086 ± 0.1280.043 ± 0.0640.921 ± 0.1140.950 ± 0.0750.0%–not runnot runnot runnot run
llm:granite4.1:8bloso-vestmark7 (of 776)0.8570.2863.9470.2860.143 [0.000, 0.429]0.7500.8330.0%–n/an/an/an/a
llm:granite4.1:8bloso-liail-il14 (of 380)0.9290.5001.9740.1430.071 [0.000, 0.286]0.8570.9170.0%–n/an/an/an/a
llm:granite4.1:8bgrouped-5fold mean ± sd (5 folds)380.960 ± 0.0560.384 ± 0.0481.116 ± 1.5410.081 ± 0.1120.040 ± 0.0560.960 ± 0.0890.953 ± 0.0650.0%–not runnot runnot runnot run
cached:laya.jsonldev4750.5470.4130.9090.5480.092 [0.059, 0.133]0.6640.6240.0%–n/aRED 32.8%n/aRED 0.54/0.56
cached:laya.jsonlloso mean ± sd (8 folds)32880.555 ± 0.1240.411 ± 0.1230.951 ± 0.3390.560 ± 0.1280.125 ± 0.0590.653 ± 0.1290.579 ± 0.1310.0%–not run2/8 oknot run3/8 ok
cached:laya.jsonlloso-vestmark7760.3310.2661.3210.7240.069 [0.044, 0.097]0.4510.3490.0%–n/aRED 58.6%n/aRED 0.28/0.39
cached:laya.jsonlloso-liail-il3800.5890.5000.7040.5020.127 [0.095, 0.182]0.6630.6020.0%–n/aRED 28.7%n/aok 0.61/0.58
cached:laya.jsonlgrouped-5fold mean ± sd (5 folds)32880.525 ± 0.0200.413 ± 0.0061.005 ± 0.1100.587 ± 0.0380.111 ± 0.0250.635 ± 0.0200.589 ± 0.0180.0%–not run0/5 oknot run1/5 ok

Real clients (real-clients, every row eval-real): 688 rows scored by uniform, zero-shot, route-v1 and Laya, 688 by qwen3:8b@3x2, 106 by granite4.1:8b. The real-client sanity check (accuracy there may not beat the held-out-site mean by more than the noise floor, or something real leaked into training) passes for every scorer.

How to read it:

  • On sites it has never seen, the trained model loses to its own floor: 0.503 against 0.587 over eight folds. That floor is the route/v1 cosine, which the page’s words diluted; the visitor’s words alone score 0.705 on the same folds, 20 points above route-v1. On new people at known sites route-v1 wins clearly (0.755 against 0.620 over five folds; 0.796 against 0.638 on dev): it learns who goes where on the sites it knows, not how a visitor’s words meet a door’s. Going from 8 to 24 sites shrank the loss but did not close it (Results so far).
  • Calibration holds where it was fitted. After T, ECE is 0.033 on dev and the gate lets 64% of dev rows through at 0.908 accuracy. A threshold fitted on known sites does not transfer: on held-out sites the gate lets through 9.9% at 0.820.
  • The 8B visitor is far ahead where it has been asked: 0.858 on the rows it answered in five of the eight held-out folds, against chance 0.416. Those are 262 rows sampled from the folds, not the predictor’s 3,288, so read the two as different samples. It changes its answer when the options are listed the other way round on 5% to 33% of rows, more than its own seed noise on five of the eleven fictional splits. The predictor’s flip is bitwise zero.
  • Laya (a general decision model, convaiinnovations/laya, Apache-2.0, run zero-shot by learn/scripts/laya.py on its ONNX exports, the English rows on its 421M checkpoint and the Norwegian on its 322M multilingual one, two orders, its own temperatures) does not beat cosine on bge-m3 here (0.555 against 0.587 held-out), and it is order-sensitive: listed the other way round, it changes its answer on 32% of the held-out sites’ rows (17.5% to 58.6% by site), above the noise floor on all but two. Its 192-token head keeps only the first 14-48 tokens of each card, which is why full cards do not help it. On this machine it took about 75 minutes for 7,952 sequences.
  • Controls. The gutted twin (every option replaced by Option i) falls to chance for the predictor on every held-out site; the label permutation lands 0.2 points from chance (0.415 against 0.413 on 475 dev rows). The wrong-persona control (each visitor swapped for another on the same page with different right answers) is red for route-v1 on four of eight held-out sites: there the model routes by what the page usually gets, not by who is asking. The rendering control (whole card beats heading alone, on rows asked both ways) is red for route-v1 on every 5-fold split: the card the visitors route better with is, to the model, mostly noise around the heading.

The bounds, each a red flag in the report when broken (consts in learn/src/bench/controls.rs): gutted twin accuracy at most chance + 5 points and the gate abstaining on more than 95% of rows (beside it, best_fixed: what always picking a page’s commonest answer position gets); order flip every probability within 1e-6, or for an LLM a flip rate at most its seed noise floor; wrong persona at most chance + 5 points; full above skim from 40 pairs; real-client sanity as above; label permutation within three binomial sd of chance, n the dev rows’ effective n over their clusters.

7. The data factory

The local models make data and are measured; they do not decide what is good. One Ollama slot, everything serial, each chat model loaded once a night, every call one line in the night’s calls.jsonl ({ts, job, model, site, seed, prompt_sha, reply_sha, duration_ms, ok, parse_ok, out}), and every job resumes by (job, site, seed, prompt_sha): a killed night sends only what is missing. The visitor’s answers go to bratac answer eight tasks to a call, each appended as it comes back, so a failed call or a stopped night loses at most eight. A site that fails (a tone build, iris) is reported, its calls are in the ledger, the next site still runs, and the job exits 1.

Why it speeds training up: a persona written for a need is labelled for free. Once it is in a site’s needs.yaml, portal iris --needs-tasks writes every page on that need’s path with the options the plan says are right, with no model call. Every framing of an option swapped into the page is another free context. The paid calls are the visitor’s soft votes and the baselines.

NUM_CTX is set per job: 4096 for the 8B visitors and persona writers, 8192 for the word writers. qwen3:8b at the engine’s default 32k context is almost four times slower (1.01 s against 0.27 s a short call). No chat model leaves bge-m3 room beside it on the 8 GB card, so bge-m3 runs in its own block with the chat model unloaded.

Night 1 measured every model (learn factory bench --out <night>: thirty identical short JSON prompts per model at its job’s NUM_CTX, thirty batches of a hundred texts to bge-m3), and night 1’s blocks measured the real jobs:

modeljobshort promptthe job, per call
qwen3:8b @4096persona writer (two a call); visitor (bratac answer, three seeds); LLM baseline0.27 spersonas 2.9 s; picks 1.0 s a task; baseline 0.44 s
qwen3:8b @32768(the engine’s default; not used)1.01 s
granite4.1:8b @4096second persona family; jury on dev and eval-real0.25 spersonas 3.8 s; jury 0.6 s
ornith:9b @4096third persona family0.33 spersonas 4.3 s
nemotron-3.5-lightning:30b-a3b @8192framing writer: bratac build with four tones0.52 s48 calls for 12 pages × 4 tones
qwen3-coder:30b @8192second framing writer0.53 s
qwen3.6:27b @8192strong visitor baseline, weekends4.78 sabout 9-10 s warm at 4096
mistral-medium-3.5:128b @8192out of the loop; a few spot checks a week19.6 s
bge-m3encoder; persona dedupe1.44 s per 100 texts

The jobs, learn factory <job> --out <night>:

  • personas: eight personas per need (--per-need), two per call, each on a grid of role × register × detail × what they describe, rotated from the seed, from the business and the plan’s own who, wants and about, never from the site’s words or a need’s facts. Half describe the problem (the situation and its symptoms, not what to buy), a third the outcome they want, a sixth the service by name. Night 1 accepted 964 and rejected 181 (66 named the business, 93 shared a 4-gram with the site’s words, 14 were too long, 7 did not parse, 1 duplicate). --writers a,b,c gives each need one writer: a site’s needs in the order of sha256(site|need), dealt in turn, so each writer’s share is within one (nemotron is short for nemotron-3.5-lightning:30b-a3b). The sidecar factory.json records each persona’s writer and what it describes.
  • picks: the plan-truth rows of every site and every persona (free), then the visitor with three seeds; --disagreement-only spends the seeds where earlier answers already disagree.
  • framings: four fixed tones through the writer, the words held to the site’s own by learn words check, split into one partial per tone by learn words split, and the site rebuilt once per tone without a model. Then picks on each rebuilt site with one seed: a framing’s label is the rate across personas, not across seeds.
  • words: one writer and one tone (--tone plain) for the sites of a week, from their plans (--plans <dir> --sites <id,id>). It builds the fallback rendering (the plan’s own wants and who), then bratac build --llm with the writer at NUM_CTX 8192, and holds every page’s reply to learn words check against the fallback’s words. Three findings only warn here, because the build renders neither and the job tidies the third: an icon off the list (blanked), a slot the page does not have beside a reply that keeps every slot it has (dropped), and an emptied road, who or form line (given the base’s line back). In the Monday probe these were all of qwen3-coder’s failures, on both sites. A page that fails is asked once more with the findings in its prompt (--llm-note); a second failure leaves the site without that rendering, and the summary says which page and why. The prompt shows a page’s slots, not its words, so a rule-1 note lists every option’s heading as it stands and names the two that read alike. Rule 1 is a mode: --rule1 off calls no encoder (the sealed night), record embeds the headings once and writes the pairs to words-lint.json, and reask runs in batched rounds: words for every site first, one bge-m3 block over the headings of every option set, then one re-ask per flagged set naming the two headings, two rounds at most (--rule1-rounds). What is left goes to words-lint.json. Every rendering is built twice, with the plan’s facts and with --facts off, into <words>-facts and <words>-bare, and the two may differ only in the cards’ features. Each site’s factory.json records the writer, the tone, which of the pair it is, and every rewrite.
  • jury: granite4.1:8b on the dev and real-client rows, for agreement with qwen3:8b, never as a judge.
  • baselines: the LLM visitors asked the trainer’s own question (answer_blind, the trainer’s shuffle) on held-out and real-client rows, into $L/cache/llm/<model>/, for the llm: scorers.
  • bench: night 1, above. interviews is named and not built yet.

The guards: a persona is 12 to 90 words, shares no 4-gram with the site’s headings, descriptions and questions, reads as the site’s language, is not closer to other doors than to its need’s (the margin guard, lint rule 2b below), and has bge-m3 cosine at most 0.92 to every persona the site already has; each rejection is counted by reason (margin for the margin guard). A persona the margin guard rejects is regenerated: its need gets one more call per two rejected, at most as many again as its own, with the next seeds, until no new rejection asks for more. The guard’s doors are the ones the night’s rows will carry: portal iris --needs-tasks --skim on a copy of the site under <night>/personas/<site>/doors/, with one probe persona (lint-probe-<need>) per need, the headings as a skim row has them and the cards as a full row has them. A need iris gives no doors for is counted unchecked, and its personas go on to the dedupe unscored. --margin-guard mark keeps a persona below the bar and records its margin and margin_flag; --margin-guard off never scores. --dedupe text drops a persona whose words, lowercased, equal another’s, or whose 5-grams overlap another’s on the same site above 0.6, instead of the bge-m3 cosine. With --margin-guard off --dedupe text the job never calls the encoder, which is how the sealed night runs it. learn words check holds a words file to the base before any build (no key the base lacks, no <WRITE left, icons from the list, equal storylines, no emptied description), so the contractor run’s reply that put the needs under doors and silently lost them would now be an error. The Norwegian twins (plans/contractor-nb.yaml, hire-nb.yaml, physio-nb.yaml) were written once by hand, so there is Norwegian beyond the football club.

The lints

Two rules from the 2026-10-22 comparison, both read off the person-only bge-m3 cosine. A row’s margin is cos(persona, its right door) − the largest cos(persona, another door on the page); margin < 0 is exactly the cosine floor’s error.

  • Rule 1, look-alike doors. Two doors on one page that lead to different needs, compared by their headings (never the whole card, whose cosines run about 0.17 higher and separate nothing): cosine 0.75 or more is a defect, rewrite one of the two; 0.70 to 0.75 is a warning. All four fictional heading pairs at 0.75 or above with five or more visitors a side were inseparable to the cosine (nordvik-bygg’s “Apply to work with us” against “Find a job with us”, 0.878).
  • Rule 2a, a door defect. On one page and rendering, with six or more personas reaching the door: 80% or more of their rows have margin < 0, and the mean margin is −0.06 or lower. The door’s words are the defect. It catches both nordvik-bygg survey doors that carried “Log a phone enquiry”; it does not catch a door whose own visitors still prefer it, which is what learn extract’s misworded guard is for.
  • Rule 2b, a persona defect. A persona whose mean margin over its rows is below −0.04. Against 290 hand-audited personas it flags 54, 76% of them judged the wrong need and 91% wrong or ambiguous. In learn factory personas it is the margin guard above.

learn lint --rows <rows.jsonl> --emb <emb dir> [--site <id>]... [--min-visitors <n>] runs the three over a rows file’s route rows with the plan’s truth: one JSON line per finding (rule, level, site, page, the doors or the persona, the numbers), then a summary line with what each rule checked and flagged by site class; it exits 1 when any finding is a defect. --min-visitors 5 keeps rule 1 to pairs whose separability the comparison could measure. On the comparison’s own rows it gives its counts: rule 1, 4 fictional pairs at 0.75 or above (7 when the visitors are not counted); rule 2a, 12 of 99 doors on the eight original sites and 3 of 142 on the 16 new ones; rule 2b, 54 of the 290 audited personas and 19 of the 492 on the new sites. On a real client’s site nothing is a defect: a finding is a warning for the owner (rule 2b flags 1 of the 35 human-written visitors, rule 2a no door).

Factory time only. Run rules 1 and 2a over a night’s rows (or a new site’s) before the night is trusted, and rule 2b runs inside learn factory personas. Never filter held-out, new-site or real-client rows by them: the margin is the floor itself, so dropping the rows it calls wrong inflates the floor by construction. Nothing marks rows already extracted: learn lint only prints its findings, and no row field, split, train or bench option reads them. To train without the flagged rows, take them out by hand from the rows learn split stamped train, never from the rows file before the split (that drops them from the held-out, new-site and real-client folds as well) and never from a dev, held-out or eval row; then report the scores of the model trained with them and of the one trained without.

What the factory makes next

The 2026-10-22 comparison says what data would let a learner show something, in this order:

  1. More businesses, not more personas per business. Going from 8 to 24 sites shrank route-v1’s held-out gap from −0.148 to −0.064, and the same 452 new rows spread over 16 sites instead of 4 gained 0.027. The target is about 48 sites, with 24 or more new kinds of business unlike the existing ones, about half of them Norwegian, about 100 plan rows each, and no twins: a twin costs a fold and adds no independent training.
  2. Harder pages. The 16 new sites average 3.0 doors a page, and 52% of their pages have two; the real clients’ pages average 4.0, and 20% have two. Pages with 4 to 6 doors whose needs sit next to each other (supplier against customer, a follow-up on a case against a new request) are where the cosine loses and a learner could win.
  3. A sealed test set. About 16 more sites under the same lints, never trained on and never looked at, kept as the next round’s new-sites test. The current 16 are training sites now: the shipped model’s T and gate have seen their dev rows.
  4. The lints at generation. Rules 1 and 2a over each new site before its night is trusted, rule 2b inside learn factory personas, and the extractor’s misworded guard kept for sites built before the lift_words fix.
  5. Later. qwen3:8b picks with three seeds on the new sites, so soft labels cover more than 8% of training rows if a residual is tried again. Outside the factory, more visitors written by people (owners’ interviews) would sharpen the real-client test more than any amount of synthetic data: it rests on 35 visitors.

Plans for new businesses

learn factory plans writes the plans of new fictional businesses, so the factory can grow past the sites people wrote:

learn factory plans --kinds $L/w2/training-kinds.yaml --assign $L/w2/training-assign.yaml \
  --select model --model <writer> --out <night> [--budget-seconds n] [--rule1 on|off] \
  [--plan-kind on|record|off] [--kind-catalogue <sectors.yaml>]
learn factory plans --validate-only <dir>/plan.yaml [--rule1 on|off] \
  [--plan-kind on|record|off --kind-catalogue <sectors.yaml> [--kind <id>]]

For each kind the assign file gives to --select, the model makes three kinds of call. First a name, built on a made-up place. Then the plan. Then, once per option set, the facts on its needs. The prompts are learn/prompts/plan.txt.

The plan comes back as two places, the front door and one door. Each place is two adjacent pairs, and each pair holds its two needs whole. The job puts them together in the schema of plans/*.yaml: four needs and the door on the front door, four behind the door. Each need gets its own bucket. Writers given the schema itself miscounted the needs per set, put one need of a pair on the other side of the door, and sent the same plan back when told.

What a plan must hold:

  • 6 to 8 needs;
  • at least two option sets with 4 to 6 options each;
  • on each such set, at least two adjacent pairs from a fixed list:
    • a new request against a follow-up;
    • a customer against a supplier, partner or job seeker;
    • urgent against routine;
    • private against business;
    • buying against renting;
    • a complaint against a question.

The pairs go to sitegen.json beside the plan, with the writer, the prompt’s sha and the number of tries. They never go into the plan.

The validator calls no chat model:

  • bratac build --plan makes the site with fallback words, so the builder’s own checks apply;
  • options are counted per page of the built site, as choose::is_option counts them;
  • each pair must name two needs on its set;
  • with --rule1 on, no two option headings on one set may have a bge-m3 cosine of 0.75 or more (rule 1 above). Training sites use it. The sealed night does not compute it.

Facts are asked per set. The writer sees the need, its siblings on the set and the set’s pairs, and is asked what a visitor choosing between them needs to know. Each public need gets 2 to 4 facts, in the site’s language. A fact may not give an order, ask a question or name a button (the same test as the lint’s feature-acts, copied verbatim into learn). It may not praise, and it gives a price only as a range or a starting price. No fact is on two needs.

On 2026-10-22 the probe on four training kinds chose the writer. nemotron wrote 4 valid plans of 4, at a median of 2.7 minutes a plan, about 1.4 of them for the facts. qwen3.6:27b took 8 to 11 minutes for one plan call on this box, and finished 1 plan of 4 in 40 minutes.

A failure goes back to the writer in words, at most three times for the plan and three times for its facts. A plan that never passes is recorded as invalid and dropped. Nobody fixes it by hand. Every call is in the night’s ledger, and a rerun replays the replies it has.

Is the plan about its kind? The checks above see shape, look-alike headings and the form of each fact. They do not see a plan that has left its kind. On 2026-10-23 nemotron, asked for redoal’s plan, had its first draft refused by rule 1; the retry copied the prompt’s own examples (a cold radiator, a monthly delivery, a noise complaint) and passed every check. Week 2’s lever is how many kinds of business the training sites cover, so a plan about something else is a silent loss.

--plan-kind on (the default) ranks the plan’s text against every kind in the catalogue: --kind-catalogue, else the sectors.yaml the kinds file names (90 kinds in week 2).

  • A kind’s text is its description and its setting in the plan’s language.
  • The plan is judged by what it offers. Its text is its pieces: each need’s who with its wants, and each fact’s title with its text. bge-m3 embeds each piece, and the plan’s vector is the mean of their unit vectors, so every need and every fact has one vote. The business name and about are left out, because they say only what the plan claims to be. Read as one text, the redoal plan ranked redoal first on its about alone. With the name and about as one more piece, a draft with eight generic needs (“a new customer: to ask what it costs”) and a plumber’s name ranked plumber first of 90.
  • The plan passes when its own kind is among the 3 kinds nearest that vector, by cosine. A rank needs no tuned threshold. Three, not one, because the catalogue has close siblings: the pharmacy plan ranks just behind the psychologist.
  • A draft that passes every other check is ranked before its facts are asked. If it drifted, the writer is asked once more, told its kind and that the draft drifted: one plan call over the three retries, at most once a plan. A draft that drifts again is dropped. So is a plan whose facts carry it out of the first three.
  • The re-ask names the plan’s own kind and no other. The catalogue holds the sealed pool, and no sealed kind may reach a training prompt. For the same reason the nearest kinds are not written to any file. Only --validate-only prints them, for whoever runs it.
  • kind_rank (the final plan’s, facts in), kind_rank_draft and kind_reasks go to sitegen.json and result.json. record ranks and records but fails nothing. off makes no encoder call; the sealed night runs off, because no encoder touches the sealed set.

Measured on 2026-10-23 with --validate-only (rule 1 off), needs and facts only:

plansown kind’s rank
the 16 in w2/plans (4 probe, 12 written by Claude, all on topic)1 of 90 for 15, 2 for the pharmacy (behind psychologist)
the same 16 as drafts, facts removed1 for 14, 2 for student welfare, 3 for upper secondary
R8’s nemotron redoal plan, redoal added as a 91st kind49 of 91 with its facts, 45 without (23 and 7 when the name and about counted)
R8’s qwen3:8b redoal plan (on topic, invalid by rule 1)1 of 91
20 swaps, plan X checked as kind Y18 fail (ranks 4 to 89)
38 plans named for another kind, with their own needs, generic needs, or the other kind’s aboutall fail (ranks 5 to 85)

The swaps that pass are near siblings: the campsite plan as cabin rental (2) and the haulage plan as a courier (3). Of all 1,424 swaps of the 16 plans, 32 would pass, at most two a plan, 12 of them in the same family. The check catches a plan that left its kind, not one that drifted to a sibling. The nearest miss among the named plans is eight generic needs under a plumber’s name: plumber ranks 5th, on needs such as booking a time and getting help today.

8. How portal calls learn

Four things call the ranker. Three run offline or in the interview. The fourth, the search box, is the one call in a visitor’s request, and only when the visitor asks it something.

As a visitor. engines/learn.sh is an engine like engines/ollama.sh: an answer_blind prompt on stdin, {"choice", "confidence"} on stdout, the calibrated top pick. learn visitor reads the prompt back into exactly the row the model was trained on (pinned by a golden test, learn/fixtures/expected/rank/visitor-parse.json); a prompt of another shape exits 1. So bratac answer, score, spread.sh and iris --needs-score run on the model with nothing changed on portal’s side, and learn answer is the same for a whole tasks file in one process. On the contractor plan, from nothing:

bratac build --plan plans/contractor.yaml --out out/nordvik
portal iris --path out/nordvik/questions --needs-tasks out/tasks.jsonl --needs-sim out/model.json
bratac answer --tasks out/tasks.jsonl --repo out/nordvik --llm engines/learn.sh > out/answers.jsonl
learn answer --tasks out/tasks.jsonl --repo out/nordvik --model learn/models/route.bpk > out/answers-learn.jsonl
portal iris --path out/nordvik/questions --needs-score out/answers.jsonl
learn visitor --parse < learn/fixtures/baselines/prompts/full-seed0-line1.prompt

That site is built without a word model (the fallback headings are the needs’ own wants), its eight tasks are answered in a tenth of a second with no LLM call, and with the route-v1 model shipped until 2026-10-22 iris said 7 of 8 routed right, the scaffolder sent to the job application, five of the seven right ones hesitant. The contractor is one of the sites the shipped model trained on, so this shows the plumbing, not a held-out result. learn answer and the engine path give the same picks, with confidences within 1e-6 of each other.

Choosing framings. bratac choose ranks candidate wordings of one option offline by routing gain: for each candidate, the page with that option swapped in, ranked for every persona whose simulated route crosses the page, in one learn rank batch; its score is the mean probability of the right option over the need’s own personas minus the mean over everyone else’s, and its gain is that score minus the live card’s. Candidates are checked first (slots, language, and every address, link, phone number and amount must be in the plan), and one the gate acted on for fewer than half its own personas is gated and never picked on its own. Winners become storylines appended behind the live one (Storylines):

bratac choose --plan plans/contractor.yaml --model model.json --repo <site dir> \
  --candidates framings.json --learn engines/learn.sh --out choose

It writes choices.jsonl, readback.md, winners.json (a --words partial), framings.json and tones.yaml (lines to paste under the plan’s tones:) under --out; --pick id,… overrides the automatic choice, and --validate <rows.jsonl> applies the same formula to the route rows’ wordings.

The interview’s gap read. bratac interview --rank learn (or --rank '<command>' that answers as learn rank does) asks the gap model every turn which open gap the conversation points at, in shadow: transcript.jsonl gains learn: {pick, confidence, would_skip, act} beside gaps_before, gaps and addressed, and the questions asked do not change. --gate lets a read that acts delay the readback when it still finds a gap the checker no longer does; it can never end an interview the checker has not passed, nor fail one it has: a hold that runs into the turn cap finishes the last draft it adopted when the checker still passes it (a refused draft is no verdict, nor is one refused as a repeat question; an adopted one that reopens a gap is, and the run stops). It stays off until the gap model’s held-out precision at its gate reaches 0.9. There is no gap model yet, so today every turn’s learn is {"error": …}; the rows for one accumulate with every interview.

The rows for it. bratac gaps --out gaps.jsonl <transcript.jsonl>... writes one line per turn that had a gap open: {source, business, language, context, candidates, positives, replayed}, where the context and candidates are what the gap read is asked on that turn and the positives are the gaps the turn closed. An interview writes the first half into its transcript as gap since 2026-11-26. A transcript from before is played again from what it holds, and a turn that does not come out the same (the draft before it does not give the gaps it logged) is counted and left out. The 11 transcripts there were on that day gave 26 rows over 41 turns, none left out. These are not yet learn’s rows: learn extract does not read them.

The search box. Where site.yaml asks for one (Content reference), a visitor can write what they need and be shown which option on the page is theirs. search_alternatives takes their words as a route/v2 context, as the model’s rows were made (NFC, addresses scrubbed, trimmed, at most 500 characters), and the options that page shows that visitor: the cards they can act on, as bratac choose and the model’s rows read a page (an overview card that repeats every option’s heading won the first live test on the contractor site, so it is left out), each rendered as bratac choose renders a candidate. It runs learn rank --ephemeral on the host, through Ollama, at most four at once and two at a time per caller (one address can be a whole office), waiting up to a second for a place. A search has three seconds from its start, that wait included. Where a learn serve serves the site over dhd/1, it is asked first: the same request and the same reply, with no process started, and a spawn only when none answers in half the three seconds, with what is left (Operations). The gate decides what the visitor is told: at or above it (0.856 for the shipped model, 90% precision on dev) the option is marked as theirs and the page moves to it; below it the nearest is marked as nearest, with a button that brings it into view, and the choice is left to them. Nothing is reordered or hidden.

The words are embedded in memory for that one call and never written to the embedding cache (--ephemeral, §9). Portal never logs them (the log says how a rank went, never what was asked, and never learn’s error text, which could repeat its input), never puts them in a URL (the form has no field name and the call is a POST) and never logs them: the one count, a line in the site’s log, carries the page, the top card’s framing id, the confidence, the gate, the storyline and which way learn answered (via: dhd or process), for counting which options people search their way to. A test captures every log line at every level across every way a rank can end and finds none of the words.

Whether the box shows is the instance’s, as a map is: a probe at start, every ten minutes, and within seconds of a reload that adds or changes the search block, ranks a fixed sentence with learn rank --ephemeral, and the box shows only while the last probe got a reply (search_ready in get_site). The sentence is never cached, so each probe reaches Ollama, which keeps bge-m3 resident (learn asks for 30 minutes on every call) and a visitor’s search off the 3.7 s cold path. When learn does not answer in time, cannot reach its encoder, fails, or no place comes free within a second (four searches, or two of this caller’s, already waiting), the visitor reads that search is not available right now and picks from the options as before. A search that finds learn itself gone (exit 3, or no answer in time) also takes the box away from the next page on and has the probe run at once, at most every 30 seconds, and every 30 seconds after that until learn replies; the box is back with that reply.

bratac search --repo <content dir> --page <id> [--storyline <n>] --texts <texts.jsonl> [--out <out.jsonl>] runs that path offline, before a site’s box meets a visitor: the cards a visitor with no account, link or chain is shown, the same candidates in the same order with the same ids (a test holds it to the server’s path on the contractor site), the words read as the server reads them, and one learn rank --ephemeral per text (--learn <cmd> for another, which must keep --ephemeral); each line says which way it was answered (via: process). Each line of --texts is {id, text}, with label_need or label_framing when the right option is known. Per text it prints the cards’ framing ids, the top, its p, the gate, the margin and where the label came; with labels, n, top-1, the act rate, the precision of the searches that acted and of those that only showed the closest, and the heading pairs between doors to different needs at cosine 0.70 and 0.75 (rule 1 of the lints, the headings embedded by learn embed into a cache of their own, removed after). A text is never logged, quoted in an error or written to --out, whose lines carry its id; for a real site, --out goes in the sessions repo.

Other things the trainer now keeps for learning: bratac answer --trace <file> writes {id, seed, order, prompt_sha, rendering} per task, the order the options were shown in; bratac rate --jsonl <file> writes each persona’s verdicts; bratac prefer --jsonl <file> writes every judge call, both orders, the raw reply and what it was decoded to (1, 2 or "unparsed").

Which binary, which model. Portal runs $LEARN_BIN, else learn beside its own binary, else learn on PATH, with a 10-second timeout (3 seconds for a search). learn takes the model from the request’s model (a path, or a name under models/ beside the binary), else --model, else $LEARN_MODEL, else models/<decision>.bpk beside itself. Exit 3 means the encoder could not be reached for a text the cache lacks, and portal reads it as no decision. A cold learn rank (model load, first encoder call) took 3.7 s, warm with new texts 0.2 s, fully cached 10 ms; a batch of 87 tasks in one process 88 ms against 1.3 s through the engine one prompt at a time. learn serve keeps the model loaded: without the encoder’s time, a warm request took 0.9 ms at the median against 7.2 ms for a spawned learn rank --ephemeral; through a real bge-m3 both took about 84 ms, nearly all of it the encoder’s.

What is never inferred about a visitor

A rule, not a setting:

  • Serving never calls the ranker to choose for a person. A visitor’s storyline stays uuid % arity, assigned evenly; nothing picks words for a person. The search box ranks only when a visitor asks it, only the options already in front of them, and only says which one fits; it reorders, hides and rewords nothing.
  • No visitor feature exists anywhere. A site records what was sent in and the storyline it was told in; /report leaves the site as counts, and the search log line (portal::search) counts which option came top, with nothing of what was asked.
  • What a visitor types into a form is never embedded, scored or trained on. What they type into the search box is embedded and scored once, in memory, to answer them, and is never cached, logged, stored, published or trained on. The route model reads plan personas, synthetic personas, and an owner’s own interview answers, which the owner gives by running the interview.
  • A real client’s rows are evaluation only for any model that ships, and the published numbers about them are counts.
  • Below the gate, nothing happens: the interview asks, the trainer leaves the words as they are, and the search box claims nothing for the visitor; it says which option is nearest and that the choice is theirs.

9. The JSON contract

learn rank reads one request and writes one reply:

{"decision":"route","context":{"text":"…"},"candidates":[{"id":"f1","text":"a"},{"id":"f2","text":"b"}],"model":"route"}
→ {"model":"route-2026-10-23-7f1c","encoder":"bge-m3","decision":"route","scores":[{"id":"f1","p":0.71,"cos":0.52},{"id":"f2","p":0.29,"cos":0.41}],"top":"f1","confidence":0.71,"margin":0.42,"gate":{"threshold":0.62,"act":true},"ms":{"embed":46,"score":2}}

or {"batch":[…]} for several, one reply each in order. p is calibrated, cos the cosine to the prediction, confidence the top p, margin the top minus the second; gate.act is true at or above the threshold and never when it is null. Scores come back in the request’s order. Both sides refuse a key they do not know. Exit 0 with a reply; 2 for a malformed request (not JSON, an unknown key, fewer than two candidates, a duplicate id, a decision the model was not trained for); 3 when the encoder cannot be reached; 1 for anything else. Every failure also prints {"error": "…"} on stdout.

printf '%s' '{"decision":"route","context":{"text":"I chair the board of a housing cooperative. Two ground-floor flats have damp in the walls."},"candidates":[{"id":"a","text":"- Someone qualified to come and look at it and say what it takes\n"},{"id":"b","text":"- Drawings, a permit application and a price\n"},{"id":"c","text":"- To be considered, without writing a letter\n"}]}' \
  | learn rank --model learn/models/route.bpk

The shipped model gives the survey 0.51 and the drawings 0.41, under its gate at 0.86, so it does not act, and below the gate nothing happens. The same request with v1’s "What we do\n\nVisitor: …" context exits 2, because the model was trained on route/v2 text. The texts are looked up in the embedding cache first ($LEARN_CACHE, else $L/emb; in memory for the one call if the directory cannot be written) and only the misses go to bge-m3. The cache is content-addressed: the key is the sha256 of encoder, width, normalisation and the NFC-trimmed text, so the same text in two rows or two nights is one vector, and a vector from another encoder can never be read as this one’s.

learn rank --ephemeral is for a context that must not be kept, a visitor’s own words in portal’s search box (§8). Each context is NFC-trimmed and embedded by the encoder in memory for that one call: it is never looked up in the cache and never written to it, and an error whose message would quote it (a vector refused with an excerpt of its text, a text too long to embed) is printed as “a context could not be embedded” with the reason withheld. The candidates are cached as without the flag, and the reply is the same, score for score. Because the context always goes to the encoder, an ephemeral rank needs Ollama even when every candidate is cached, and exits 3 without it.

learn serve --dhd (built with --features serve, as the release is) serves a site’s ranking over dhd/1: each question the site asks down its call is a request whose body is what learn rank --ephemeral reads on stdin, and the reply’s body what it prints on stdout. Every context is ephemeral there, always. Exit 2 is the service error 400, exit 3 is 503 and anything else 500, each with the {"error"} line as the body; a request turned away because the worker is stopping is 421 (Operations).

The other commands and their flags are in learn help; learn <command> --help prints one usage line.

10. Retraining the route model

From the runs and the factory nights to a model in this repo. The model that ships is the floor, so train runs with --epochs 0; drop the flag to train one, and ship it only if it meets the bar in §5:

export LEARN_EXTRA_SITES=$L/exp/sites/extra-sites.tsv
learn extract --runs ~/repos/sessions/runs --out $L/rows \
    --factory $L/factory/2026-10-21 --factory $L/exp/sites/night/2026-10-21
learn embed --rows $L/rows/rows.jsonl --out $L/emb
learn split --rows $L/rows/rows.jsonl --emb $L/emb --out $L/splits
learn train --rows $L/rows/rows.jsonl --split $L/splits/dev.json --emb $L/emb --epochs 0 --out $L/models/route-2026-10-22
learn calibrate --model $L/models/route-2026-10-22 --rows $L/rows/rows.jsonl --split $L/splits/dev.json --emb $L/emb
learn bench --rows $L/rows/rows.jsonl --splits $L/splits --emb $L/emb \
    --scorers uniform,zero-shot,model:$L/models/route-2026-10-22 --table $L/reports/2026-10-22.md
LEARN_BIN=$(command -v learn) learn/scripts/ship-model.sh $L/models/route-2026-10-22
cargo test --manifest-path learn/Cargo.toml --test ship_model

LEARN_EXTRA_SITES names fictional sites outside the built-in table (<id> <language> <plan path> a line); the 16 sites of 2026-10-22 are listed in that file, and extract and split must both see it. On 2026-10-22 these steps, run under $L/v2/, gave 5,891 rows (sha256 63694d0d…), 31 split files, every text already in the cache (0 encoder calls), and the model of Results so far: T 0.979, gate 0.856 at precision 0.9. With --epochs 0 the three seeds are the same untrained model and take a second. The bench’s model: line is refused on every fold, because dev.json’s model has seen every fictional row; the zero-shot line at each fold’s own dev T is that model held out.

One --factory per night directory; the extractor takes the latest night’s directory per site or framing variant. embed sends only the texts the cache lacks (Ollama must be up for those; it exits 3 if it is not), and a second run embeds nothing. split never calls an encoder. train checks that the split was cut from these exact rows before it reads anything, prints one JSON line per epoch on stderr and the metrics on stdout; three seeds on 2,880 training rows take about a minute and a half on the CPU. bench trains its own route-v1 per split (fifteen models with the permutation control, one seed each) unless a directory for the same split, rows and recipe is already there; from nothing it took 4m38s.

Each step is reproducible. On 2026-10-21, at 488439b, the route/v1 steps (no --epochs 0, one --factory, and route-v1 and the LLM visitors in the bench) gave the same rows sha256 as the report, split files identical byte for byte, a model whose weights and calibration (T 1.4959, gate 0.750 at coverage 0.64) are those of the learn/models/route.bpk shipped until 2026-10-22 (only the parameter ids in the file’s header differ), and, with the report’s scorers (uniform,zero-shot,route-v1,llm:qwen3:8b@3x2,llm:granite4.1:8b,cached:laya.jsonl), a report whose every table is identical to the one in §6; only the run id moves, because the code revision is in it.

ship-model.sh is the only thing that writes learn/models/. It copies the weights as route.bpk and the config, calibration and manifest as route.json (learn rank --pack makes the same pair), and it refuses, writing nothing, any model whose manifest does not say site_classes == ["fictional"]. A dev-split model trains on every fictional site and on nothing else, so it passes.

Before shipping, read the table. Until 2026-10-22 the shipped model beat the floor on known sites and lost to it on new ones; what ships now is the floor, written as a model file, and a trained model takes its place only when it meets the bar in §5 on sites it has not seen.

11. Running a night

learn/scripts/nightly.sh --help

learn/scripts/nightly.sh runs the blocks in order: framings (nemotron, two sites, four tones), personas, picks with three seeds, picks on the framing variants with one, the jury, then extract, embed, split, train, calibrate and bench. Each block runs under --budget-seconds, worked out from the bench night’s timings.json (calls the block is capped at × the measured median × how much longer its replies are than the bench’s, clamped to the schedule). The night’s own files go under $L/factory/<date>/, with its pid in nightly.pid. One night runs per $L whatever --night says (a flock on $L/nightly.lock: the pipeline steps write $L’s rows, embeddings, splits and models); INT or TERM to that pid stops the running step with it. Every factory step is given --sites $L/sites and --runs $RUNS, so a night under another LEARN_HOME never touches the real sites. At the end comes a README.md with every step’s status and seconds and the counts: calls, personas accepted and rejected by reason, route directories, rows by origin, the report. A step that fails is a line in that README, never the end of the night. --quick gives every block 60 seconds and two personas a need, for a smoke run; --sites and --framing-sites take site ids (nordvik-bygg is plans/contractor.yaml).

The schedule it was cut to, 22:00 to 07:00:

22:00  nemotron   framings, 2 sites × ~10 pages × 4 tones
22:50  qwen3:8b   personas for new sites and needs (≤ 250 calls)
23:25  qwen3:8b   route picks, 3 seeds, train sites (≤ 2,400 calls)
04:45  qwen3:8b   interviews (not built yet)
05:05  granite    jury on dev and eval-real (≤ 300 calls)
05:45  bge-m3     embed everything new
05:50  learn      extract → embed → split → train → calibrate → bench

Not in the script yet, for a weekend: learn factory baselines --out <night> --model qwen3.6:27b --budget-seconds <n> (held-out and real-client rows, one seed, one order, about ten hours for 4,008 rows) and learn factory baselines --out <night> --budget-seconds <n> (qwen3:8b, three seeds × two orders on the same rows, 24,048 calls, about four hours). Either with --dry-run says which rows it would ask and what the cache already holds, without a call.

12. Building it

learn is a nested package (learn/Cargo.toml, burn pinned to =0.22.1), so portal’s lock never sees Burn and the root cargo test never builds it. .gitea/workflows/learn.yml runs its tests and a release build when anything under learn/ changes, or any file outside it that its tests read (src/trainer/card.rs, src/trainer/build.rs, plans/, engines/learn.sh); the release workflow builds it beside portal and puts it in the same tarball with models/route.{bpk,json}.

Measured on the dev machine with the shared target directory: a cold release build 2m33s (2m15s with sccache warm); after a change to learn alone, 18 s for the release binary; portal’s own release build beside it 1m17s; cargo test for learn about 3 s of test time once built. The bare runner’s cold number is not measured yet: it comes from the first green learn.yml run, and goes in learn/README.md.

Results so far

Two rounds of experiments on the route decision, on 2026-10-21 and 2026-10-22. Each experiment was run by one agent and reproduced from scratch by another, with its own build, who also looked for leakage. Every number below reproduced, and none leaked. The outputs are in the sessions repo under $L/exp/.

The visitor was drowned by the page. route/v1 built the context as the page’s question, then what the page says first, then the visitor. The head is long, the same for everyone on the page, and often restates some of the options. So bge-m3’s vector of the context was mostly the page, and the cosine gave nearly everyone on a page the same answer. On haugland-bygg 97% of rows got the page’s commonest pick, and the floor there was at chance (0.264 with four options). Embedding the visitor’s own words alone, with nothing trained:

rowsroute/v1 contextthe visitor alone
the eight fictional sites, each held out in turn0.5870.705
16 new fictional sites, never used for any choice (1,610 rows, 492 visitors)0.6170.796

On the new sites the gain is 0.180, with a 95% interval of 0.154 to 0.208 when resampled by visitor. On the real clients (688 rows, 35 visitors) the visitor alone is ahead by about as much; those numbers stay in the sessions repo. The template was chosen after looking at the eight held-out sites, so their row is post hoc for it. The new sites’ row is not.

One data bug. On the factory’s nordvik-bygg, the survey door was headed “Log a phone enquiry” and the build door carried the survey’s words. The cause was lift_words in src/trainer/build.rs, which matched cards across pages by their record_as bucket, and three needs share enquiries. 78 rows were labelled with a door whose words name another need. lift_words now matches a form card by the need it files, read off its action, and the contractor rebuilt that way gives every enquiry card its own need’s heading. learn extract still drops a factory row whose right answer’s heading names another need, and lists it under misworded in the manifest, for the sites built before the fix: it dropped the same 78 rows from the rows the shipped model was fitted on.

Training adds no accuracy yet. Every way of training below was judged against the visitor-alone cosine on the same rows. It was judged first on held-out sites, then once on the 16 new sites and on the real clients, which chose nothing:

eight held-out sites16 new sitesreal clients
the cosine, nothing trained0.7050.796–
route-v1, defaults, trained on 8 sites0.5570.611below
route-v1, defaults, trained on 24 sites0.6410.686below
route-v1, recipe and epochs chosen with a training site held outepoch 0 in every foldepoch 0epoch 0
route-v1 with the LLM visitor’s votes as a second targetepoch 0 in every foldepoch 0epoch 0
a residual added to the cosine, its weight chosen the same way0.7030.805level
a ranker over 29 features that name no site (learn ltr)0.7170.802above, within noise
  • route-v1 with its defaults stops early on dev rows, which are new visitors at the sites it trains on. There it beats the cosine by 12 to 14 points; on a site it has not seen it loses 6 to 19 on average. It learns who goes where on the sites it knows, not how a visitor’s words meet a door’s. More sites shrink the loss, and the same rows spread over more sites help more than more rows on fewer. At 24 sites it is still behind on every test.
  • Chosen with a training site held out instead of dev, the best epoch is epoch 0, the cosine itself, every time. One epoch already costs about 0.14 on the site left out.
  • The residual and the ranker stay within two points of the cosine, and every 95% interval by visitor includes zero. The ranker picks what the cosine picks on 87% to 89% of rows. What it adds is calibration. A head that only reshapes the visitor’s cosine (its rank, margin and z-score in the row) gets the same calibration without changing one pick.

Calibration. The cosine at τ = 0.05 with nothing fitted is already calibrated where it is used: ECE 0.063 on the new sites, and under 0.08 on the real clients. A temperature fitted on the eight original sites’ dev rows (T = 1.16) makes it worse on both (0.094 on the new sites): those sites are harder than the ones the model is used on, so a T fitted there understates confidence elsewhere. Fitted on the dev rows of all 24 fictional sites, as the shipped model’s is, T comes out at 0.979, close to 1.

What ships. The route model with nothing trained, under the template route/v2: bge-m3’s cosine between the visitor’s words alone and each door, over τ = 0.05, written by learn train --epochs 0 with T and the gate fitted on dev like any model’s. It is dev.json’s model on the route/v2 rows of 2026-10-22: 5,891 rows (sha256 63694d0d…, after the guard dropped 78), of which 3,210 route rows on the eight original sites and 1,610 on the 16 new ones; 24 fictional sites, 4,113 listwise training rows, 707 dev rows, no real site. On dev:

accuracy0.751 (chance 0.406)
ECE after T0.049
T0.979
the gate at precision 0.90.856, letting 29.8% of dev rows through, 0.900 of them right

The comparison expected T 1.16, a gate near 0.95 and about 2% of dev rows through. Those figures came from the dev rows of the eight original sites alone. Dev now includes the 16 new sites, whose pages are easier (about half of them have two doors) and where the raw cosine was already calibrated, so T is close to 1 and the gate lets more through.

Bench b1c33a0ec9660 (reports/2026-10-22-route-v2.md in the sessions repo) cannot score the model itself on a fold, because dev.json’s model has seen every fictional row; it refuses each one. The zero-shot line at each fold’s own dev T is that same model with the site held out:

  • the eight original sites, each held out: 0.705 mean against chance 0.412, fold for fold the person-only floor of the comparison; ECE 0.040 pooled, 0.076 as the mean over folds.
  • the 16 new sites, each held out: 0.796 pooled (0.808 as the mean over sites), ECE 0.060 pooled. Only T and the gate have seen them, so accuracy is what it was, but they are no longer a sealed test.
  • the real clients, none of them ever trained on: well above both the old floor and the route-v1 model this replaces, with ECE inside 0.08 and the gate letting under a fifth of the rows through, nearly all of them right.

Three control lines are red. The gutted twin (every option replaced by Option i) is red on the real clients and on moen-utleie: with the words gone, the cosine gets no more than always picking a page’s commonest position gets, and the gate abstains on every gutted row, so nothing would act on it. The wrong-persona control is red on harbour-dental (0.488 against a bound of 0.479).

So the interview mostly asks, and bratac choose gates most candidates. That is right for a model that knows no more than its encoder. A trained model replaces it only when all of the following hold (the bar in §5):

  • it beats this cosine on the held-out-site mean by more than its seed noise;
  • no held-out site is more than 5 points below the cosine;
  • it is at or above the cosine on a set of new sites that no choice was made on, and on the real clients;
  • its ECE is 0.08 or less on both;
  • the gutted twin stays within 5 points of chance, or at most its best_fixed with the gate abstaining on more than 95% of the gutted rows, as the cosine’s is on the real clients and moen-utleie; and the permutation control is at chance.

What limits the tests. The real-client set has 35 visitors, so only differences of about 7 points or more show there. Three sites have a Norwegian twin, so the eight original held-out folds rest on five independent trainings. The 16 new sites have now been scored by every model, and the shipped model’s T and gate were fitted with their dev rows in, so the next comparison needs new sites that nothing has seen (What the factory makes next).

Known limits

  • The LLM visitors and Laya are not in the route/v2 bench. Their caches are keyed by row id, and every route row id changed with the template: 0 of 982 qwen3:8b rows and 0 of 150 granite4.1:8b rows join. Until they are asked again, §6’s table is the only one with them, and it is route/v1’s.
  • §6’s zero-shot lines need a rerun besides: they predate the change that keeps bench’s cosine from fitting T on the rows it scores.
  • The permutation control’s effective n in §5 (475 dev rows counting as about 309) was measured on the 4,359-row extraction, before a copy one option short or long joined its cluster; it has not been measured again on the real dev split. Such a copy inherits the permuted label only with probability about (k − 1)/k, so a weak leak of that kind slips through more easily than an exact copy.
  • No test checks a --require-calibrated pass. The tests pin where its floor is fitted and that a badly calibrated model fails.
  • A renamed dev-scheme split with a stale dev.json beside it. learn eval puts the cosine’s dev line of such a split at T = 1, with a note on stderr, rather than stopping. learn split always names that split dev, so this needs a hand-made or renamed file.
  • bratac interview --gate. A hold on the second-to-last turn followed by an adopted draft that reopens a gap stops at the cap with an error, where the same run ungated finishes; this is by design, since the checker’s latest verdict wins. The last transcript.jsonl line can show a refused working draft while plan.yaml holds the plan that was held.
  • The embedding cache and the factory ledger. An index entry past the end of vectors.f32 is a hard error. A blank meta.json over a non-empty index is refused, since the encoder cannot be recovered; over an empty index any encoder may claim it, and stray vector bytes are cut. A meta.json that is not UTF-8, or one in a read-only directory that is blank, falls back to memory. In the ledger, a call another process wrote whole that append() repairs shows in this handle’s calls only at the next open, and a call with a stray control character, NBSP, NUL or BOM beside it is dropped and asked again. The fsync order is tested through a seam, not checked against the real system calls in CI.

What is next

The generator side (portal propose), a per-framing /report, and a gap model. And more sites, harder pages and a sealed test set (What the factory makes next): the held-out-site number is the one that matters, and it moves with how many businesses the model has seen, not with how long it trains on the ones it has.

Filesystem routes, sections, and where chains fit

Status: implemented in v0.2.0 (2026-08-24) — all three phases, with one deviation: dynamic-page params substitute into resource keys via server-side resolve_question at lookup time (get_question, find_feature, submit_answer all resolve concrete paths), so no param threading exists client-side. The user-facing routing contract is documented in uhhm/questions’ README (“Routing: the tree is the router”); this file stays as the design rationale.

What exists today, precisely

  • A question’s id doubles as its URL. Filenames are meaningless: questions/ is loaded as a flat directory (both the Gitea loader and question_lint --path), every *.yaml becomes a Question keyed by its own declared id.
  • Hierarchy exists only as strings: action: /proposed edges, plus a manual followup: true flag that hides post-submission pages from the nav. The graph is invisible in a repo listing — you open every file to learn the flow. (uhhm’s actual graph: / fans out to three followups; /develop → /develop-proposal → /proposed is a two-step flow flattened into three top-level files.)
  • Criteria are per-file: qualifies: <kanidm-group> on a question, requires_group on a resource. Gating a whole area means repeating the flag in every file of that area.
  • Chains are query-string lineage: submitting hashes (question, parents, responses, ts) into chain_hash, the next page is action + ?chain=<hash>, and holding a chain is itself a capability (self_transition + email second factor). chain.rs reserves DAG shape (multiple parents) but nothing produces it yet.
  • Question.route is a declared-but-never-read field — a fossil of this exact idea.

The proposal, in three phases

Phase 1 — the tree is the router

Directory structure becomes the URL structure, next-js style:

questions/
  index.yaml              → /
  applied.yaml            → /applied
  develop/
    index.yaml            → /develop
    proposal.yaml         → /develop/proposal
    proposed.yaml         → /develop/proposed
  review/
    index.yaml            → /review
  • id: becomes optional and derived from the path (index.yaml names its directory). An explicit id: still wins so both content repos keep working unchanged; lint warns when it disagrees with the path, and the field can retire later along with route.
  • action: accepts relative references: action: proposed resolves against the file’s directory, action: /subscribed stays absolute. Resolution happens at load time, so validation and the runtime see absolute ids exactly as today. A flow directory becomes self-contained: rename develop/ and every internal edge moves with it.
  • followup: is inferred: index.yaml files are nav pages, non-index files are followups unless they say nav: true. This matches the real content exactly (uhhm’s four followup: true files are precisely its non-index leaf pages) and deletes a flag people must remember.
  • Loader: switch from the per-directory contents API to Gitea’s git trees API (/git/trees/{branch}?recursive=true) — one request for the whole tree instead of one per directory, which the flat loader should be using anyway.

Phase 2 — sections: criteria scoped by URL prefix

A _section.yaml in any directory applies to everything beneath it (underscore = not a page, like next’s private folders):

questions/review/_section.yaml:
  qualifies: portal_owners
  responsible: { name: Bendik, contact: … }

This is the URL/criteria interplay actually worth having: a URL prefix becomes a trust boundary. “Everything under /review is owner-only” is one line in one place, instead of a flag per file that drifts. Per-question qualifies still overrides (tighter or looser — lint should warn on looser). Sections are also the natural home for shared responsible contacts and, later, per-section branding accents.

Phase 3 — dynamic segments, and chains stay out of the path

Two criteria axes exist: who you are (Kanidm group) and what you’ve done (holding a chain). Phase 2 scopes the first by prefix; phase 3 does the same for the second, plus gives records addresses:

  • [record].yaml — a dynamic segment, one YAML file rendered per record: questions/review/[record].yaml serves /review/<key>, with the param available to the page’s ResourceSpec.key. Today a single record is only reachable through a desk row or a ?chain= link; this gives every record a real, gated URL — linkable from review desks, automations, and n8n notifications.
  • requires_chain: <question-ref> (page- or section-level): the page only renders for a visitor whose chain tip answers the referenced question. Today’s followup pages are soft-hidden (out of nav) but fully reachable; this makes “you must have come from X” an actual criterion, declared with a relative ref like actions are.

Deliberately not proposed: encoding the chain in the path. The page tree is static structure; the chain is runtime lineage and a bearer capability. Putting it in the path makes it look canonical and shareable — exactly what a capability URL shouldn’t invite — and a DAG (the reserved multi-parent shape) doesn’t linearize into a path anyway. ?chain= stays a query parameter: pages keep one canonical URL, lineage rides along only when it’s actually held.

Migration

Phase 1 is fully backward compatible (explicit id wins, flat repos are just trees of depth one). The content repos migrate by git mv: uhhm’s develop flow nests under develop/, its followups either stay top-level (/applied keeps its URL) or move with their flows if URL churn is acceptable; redoal’s three files are already the tree. Lint learns the same resolution rules in the same commit, so a bad reference stays a caught push, never a 404.

Order of value

Phase 1 is cheap and pays immediately (the repo listing becomes the sitemap). Phase 2 is small and unlocks gated areas properly. Phase 3 is the real feature work — [record] pages change what desks and automations can link to — and can wait until something concrete needs it.

A site’s own store, and a bus of Rust crates

Status: started 2026-11-17 on branch site-store. Done: the benchmarks (bench/) and portal_core::store, which began with JetStream and redb behind it and is now redb alone. Nothing uses the store yet. From step 3 on, the order below is replaced by Portal 1.0: 1.0 leaves NATS with no migration.

Why

NATS does two jobs for portal: it is the database (the EVENTS log, a KV bucket per record type, sessions, cursors, the chain) and the bus (the mail, payments, credentials and rooms streams, the access and ranking questions, the announcements n8n hears). Most of what portal has had to build around it is the database job done on a message broker:

  • a decision writes its event, then its record, and the gap between the two is why answers.rs has SETTLE and the mend;
  • sites on one account are kept apart by name prefixes and adoption (namespace.rs, adopt.rs and adopt’s tests, about 3,500 lines);
  • reads are round trips, which is why #134 keeps every bucket in memory, and why each load of an aggregate’s log makes a consumer;
  • sign-in is a password in NATS_URL, and whoever holds an account’s password reads every record on it;
  • about 4,000 lines of tests need a live JetStream.

The numbers are in bench/README.md: a decision is 7.5 ms on JetStream today, 3.3 to 3.7 ms through the store on JetStream, and 1.5 ms on redb with every commit waiting for the disk.

What goes where

Storage: redb, one file per site, in the unit’s StateDirectory, opened by the site’s process alone. A batch is one transaction.

Bus: irpc, over iroh when it leaves the process. irpc is a channel and no encoding in-process, and QUIC across processes or hosts, with the same protocol either way. iroh dials by key, so a program is known by its key, not a password.

NATS todaythen
EVENTS with expected_last_subject_sequencethe store’s log, an append naming the aggregate’s last event
KV buckets, sessions, cursors, chain, invitesthe store’s records
mail, payments, credentials, rooms streams and their consumersan outbox written in the decision’s batch; the program it is for pulls it over irpc and acknowledges each
portal.mail.received, portal.payments.changedirpc calls into the site, deduplicated by id
portal.access.<site>.may, learn.rank, $SRV.PINGirpc requests, the asker known by its key
ANSWERS and n8n’s NATS triggera webhook from the outbox, retried until n8n takes it (irpc is Rust to Rust only)
the content reload signalan irpc call from the deploy

One rule for every program beside a site: it dials the site, the site serves, and work is pulled and acknowledged. Only the collaborator needs the site’s address; the site answers only the keys its configuration names, protocol by protocol.

Content decides how far a site reaches

No new key: what a site needs is what its content already says.

  1. Pages, forms, lists, states: one process, one file, nothing listening but HTTP.
  2. A program beside it: mail: on a state (gdo), payment: (kron), search: (learn), rooms (the chat). The same irpc protocol, linked into the binary or a separate unit on the host; which is the instance’s configuration, not code. kron stays its own unit because it holds the Vipps keys, learn because it holds the model.
  3. A program on another host: an iroh endpoint dialled by key, the same protocol.

iris already knows what content uses; portal refuses to start when the content needs something the instance does not provide, as PAY_URL decides what payment: may do today. One build with all of it compiled in, since PORTAL_RELEASE pins one artifact for every site; only what the content needs is started.

The chat becomes kino

cnats is named for its bus, so it is renamed when it leaves it: kino. It keeps its rooms in its own process and its history in its own redb file, and meets portal on one protocol, dhd/rooms/1, which portal serves:

todaydhd/rooms/1
KV <ns>_portal_groups, which the chat readsGroups: every group, then each change, as a stream
portal.access.<site>.mayMay: the same Query, strong included
<ns>.portal.rooms.<group> in <ns>_ROOMS, read by <ns>-cnats-relayListen: what portal says, from its outbox, each acknowledged
<ns>.portal.rooms.thread, read by <ns>-portal-threadsThread: the chat tells portal

The chat’s rooms, threads and call signalling become a broadcast per room inside it. It depends on dhd for the first time, so its copy of portal’s names in site.rs goes. Its first release off NATS ships under the new name, importing its history once, with replaces=('cnats') in the PKGBUILD.

What it costs

  • irpc does no versioning, and postcard does not take a changed message the way JSON on NATS does. The version goes in the protocol name (dhd/mail/1), two run side by side during a change, and what content shapes travels as JSON inside the message. dhd’s types are JSON-shaped today (tagged enums, a serde_json::Value), so that is how the first protocols carry them.
  • redb opens in one process. portal import, bratac job file, the lint’s replay and the kit worker ask the site over irpc, or open the file while the site is stopped.
  • No nats account backup. A snapshot from a read transaction, which varde mirrors to a peer, the job it already does. The log only grows, so a live replica later is “events since N” over iroh.
  • nats kv get goes; a portal db subcommand takes its place.

Order

  1. Benchmarks, before anything moves (bench/).
  2. portal_core::store: one API, JetStream and redb behind it, the same checks on both.
  3. The decision path through the store: aggregates and answers read the record and its log once and write one batch. Half the decision on JetStream already; on redb the mend has nothing left to mend.
  4. A site on redb: Instance holds a Store, a site’s configuration chooses its file, and portal migrate copies a site’s buckets and log into it. Once every site has moved, the mend, SETTLE, namespace.rs and adopt.rs go.
  5. The outbox, in the same batch, relayed onto today’s subjects so gdo, kron and the chat do not change yet.
  6. irpc protocols in dhd; each collaborator moves when it is ready. The chat moves as kino.
  7. n8n’s webhook.
  8. NATS goes once no site’s content needs it.

Portal 1.0

Status: proposal, 2026-11-17. The direction for the schema (one key and three rules) is agreed; the details below await review, and nothing is built. This replaces the order in the site store from step 3 on: 1.0 has no NATS, and a site whose programs still need NATS stays on 0.x.

The schema stays as it is

Context, decisions and outcomes are already in the schema:

  • The question is the context. It is the page, and it is what asks.
  • An alternative is a decision. It is one choice.
  • A feature explains the choice. It has requirements, optional or not, that the alternative needs to qualify as a choice. It can also feature a resource.
  • The outcome is what the state machine in aggregates.yaml and the alternative’s own action say follows.

1.0 keeps all of that. It adds what a machine hire showed was missing: time, and choosing from a resource. That takes one key in aggregates.yaml and three rules for requirements.

What a record holds, and when

A hire keeps a machine busy from its first day to its last:

# aggregates.yaml
aggregates:
  - bucket: hires
    initial: confirmed
    states:
      confirmed: { event: confirmed, text: Confirmed }
      out: { event: out, text: Out with the customer }
      returned: { event: returned, text: Returned }
      cancelled: { event: cancelled, text: Cancelled }
    transitions:
      confirmed: [out, cancelled]
      out: [returned]
    holds: { what: machine, from: from, until: until, while: [confirmed, out] }

holds says four things:

  • what: the field naming what is held, here a type: record field of: machines;
  • from and until: the fields holding the first day and the last;
  • while: the states in which the record holds it.

From these, portal keeps a projection over time: for every machine, the days each hire in while holds it.

  • The projection changes in the same transaction as the submission or move that changes it, so it is never behind.
  • A machine is free across two dates when no hire it holds overlaps them.
  • A submission or a move that would put a hire into a while state is refused when its machine is not free across the hire’s days. The person is told in words.

places: and board: stay as they are, for a fixed number of seats at a fixed time, such as a shift or an evening. holds: is for a thing held over days a person chooses, such as a machine, a room or a cabin.

Three rules for requirements

The question that books a hire:

# questions/hire.yaml
name: When do you need a machine?
alternatives:
  - name: Book a machine
    description: Say your days and pick a machine that is free all of them.
    record_as: hires
    action: /hire/thanks
    features:
      - name: Free on your days
        description: Every machine nobody has from your first day to your last.
        resource:
          source: { bucket: machines }
          public: true
          states: [for_hire]        # a machine in the workshop is never offered
        requirements:
          - { name: from, label: First day, type: date }
          - { name: until, label: Last day, type: date }
          - { name: machine, label: The machine, type: record, of: machines }
      - name: Who you are
        description: So the counter can confirm, and tell you if anything changes.
        requirements:
          - { name: name, label: Your name, value: "{user.name}" }
          - { name: email, label: Email, type: email }

1. Two dates narrow a held resource. A pair of type: date requirements beside a resource, named like the from and until of a holds: on it, narrows the list to the records free across those days. They live in the address like any narrowing requirement, so /hire?from=2026-12-01&until=2026-12-05 opens the list already narrowed, and a link, Back and a reload keep it. With no dates given, the list is the whole list. Today only type: text and a select narrow.

2. A recording alternative sends every requirement. On an alternative that records an answer (record_as), every feature’s requirements belong to its form, including the ones beside a resource. They narrow the list and are sent with the answer, so the hire’s days are the days its list was narrowed by. On an alternative that records nothing, they only narrow, as today, where they are never sent.

3. A record requirement beside its resource is picked from it. A type: record requirement beside a featured resource of the same bucket is answered by picking a row of that list, or several with multiple: true.

  • Only listed rows can be picked. The list’s states: decide which records can be picked at all (here, none in the workshop), and the dates decide which are free.
  • Today a type: record field is always hidden, carried in from the address.

What is sent is the record picked. Portal files the answer only if that record is still one the list would show: still in a listed state, and still free across the days. That check happens in the same transaction as the filing. If someone took the machine meanwhile, the visitor is told so, and the list is drawn again.

What the renderer does with it

  • A featured resource with a type: record requirement beside it is drawn as the list with its rows to pick from, under the feature’s name and description. The rest of the form keeps its place.
  • The two dates sit above the list. The list is drawn again as they change, and the address follows.
  • Lists are live. The store tells the renderer about every commit, and a list on an open page is drawn again when one of its records changes. A machine someone else books leaves your list as you look at it, and a desk sees another desk’s moves as they happen.

What the trainer builds

Two plan keys mirror the two halves:

needs:
  - id: hire-a-machine
    who: Contractors and people who need a machine for a while
    wants: a machine that is free on their days, confirmed at once
    lands_in: hires
    handled_by: counter
    stages: [confirmed, out, returned, cancelled]
    done_when: [returned, cancelled]
    success: [returned]
    holds: { what: machine, from: from, until: until, while: [confirmed, out] }
    collects:
      - { name: from, type: date }
      - { name: until, type: date }
      - { name: machine, of: machines }
      - { name: name }
      - { name: email, type: email }
  • holds on a need goes into the bucket’s holds: in aggregates.yaml.
  • A collected field with of: is a type: record requirement. build puts the featured resource of that bucket beside it, in the same feature, together with the dates when the need holds it.

That is the rule the trainer needs: wherever a need picks something the site keeps (a machine, a shift, a room), the requirement goes beside the resource it is picked from.

The simulator walks it as a visitor would. A persona gives its days, has to find and pick a free machine that fits, and the score counts what it picked.

When a plan has mails, build also puts the asks list on the page of the group that runs the site, and puts that group in mfa_groups. The first person to sign in can then turn mail on (see Mail).

The network

 people ── HTTPS ──► Caddy ──► a site: one process
                                ├ one redb file: log, records, outbox, projections
                                ├ content at a commit, checked by the lint
                                └ an iroh key, dialled by every program beside it
                                          ▲
     ┌────────┬──────────┬─────────┬──────┴───┬─────────────┐
    gdo     kron       learn      kino    a depot's      another
   mail    payments    search     rooms    printer        site

 n8n ◄── signed webhooks from the outbox · n8n ──► HTTPS calls into the site
 Kanidm signs people in (OIDC); programs are known by their keys
 garage and varde keep sealed copies of the redb file; the site writes to them as to a disk

The rules:

  • The site dials no one. Every program beside it dials the site, by key, and holds the call open. Work and questions come down that call; acknowledgements and answers go back up it. Storage is not a program: garage (over S3) and varde (on its socket) keep files the site writes, attachments and sealed backups, as a disk would.
  • Effects are rows in the move’s own transaction. A mail, a payment request, a room message or a webhook is written together with the submission or move that set it off. It is delivered until acknowledged, deduplicated by row.
  • A program moves a record the way a desk button does: through the same transition path and the same access policy. When kron sees the money, the record moves on to its payment.then.

There is one protocol, dhd/1:

callmade byfor
Serveeach program, held openthe program says what it does (mail, payment, search, rooms, print) and what it is waiting for (an ask, below); the site hands it work and questions on this call, and it acknowledges and answers on it. An open Serve is presence
Submita program or another sitean answer into a bucket its key may submit to
Movea programa transition on a record, as a desk button makes one
Notea programwords beside a record: a reply to a mail, a chat thread
Maya programthe access question, strong included
Watcha programwhat its key may see, then every change: the groups for kino, the log for a replica

What the bus carries today maps onto it:

  • kino’s four calls in site-store.md: Groups becomes Watch, Listen becomes Serve, Thread becomes Note, and May stays;
  • $SRV.PING becomes an open Serve;
  • learn.rank becomes a question on learn’s Serve;
  • the content reload becomes the deploy’s Load, below.

Anything that is not Rust uses the same calls over HTTPS:

  • POST /dhd/1/submit, /move and /note, with a key the instance names;
  • Serve and Watch as signed webhooks, each retried until a 2xx acknowledges it.

The deploy and the operator have two calls of their own:

  • Load gives the site a content commit. The site fetches it, checks it, and swaps it in, with the last good one serving until then.
  • Read is portal db.

How far a site reaches:

  • One process: pages, forms, lists and states.
  • Programs beside it: whatever the content asks for, linked into the binary or run as a unit next to it, over the same protocol either way.
  • Another host: dialled by key, through a relay on the host with the public address.
  • One organisation with several depots is one site. A depot is a group and a field. Its printer or scanner is a program that dials out, so nothing is opened at the depot.
  • Two organisations are two sites. One calls the other’s Submit (a housing co-op’s application into the municipality’s register) where the receiving site’s policy names its key. Each site stays the only writer of its own log.

A program that asks for its own login

A program beside a site that needs a login it does not have asks the site for it, the way kron already asks for its Vipps keys (dhd::asks).

  • The ask lists the fields, which of them are secret, a line about where each is found, and the key to seal them to (age, x25519).
  • A page lists what is waiting with source: { kind: asks }, behind a group in mfa_groups, so a password alone never opens it.
  • On submit, portal seals every secret field to the program’s key before anything is written. What it keeps is a portal_credentials record with the public fields and a fingerprint per secret.
  • The program opens what it was given with the identity only it holds, tries it, and answers running, or refused with the server’s own words.

Portal can seal and cannot open. Today the ask travels on the $SRV ping; in 1.0 it travels on the program’s Serve call.

Mail

gdo stays a program beside the site and asks each site for a mail login of its own, so whoever sets up a site turns mail on from the site itself:

# questions/owners/index.yaml
      - name: What the site is waiting for
        description: Services that need a login before they can work for the site. What you give goes to them sealed.
        resource:
          source: { kind: asks }
          requires_group: owners

The ask has three fields:

  • Address: the one the site sends from, such as post@vel.example. It must be the address site.yaml’s mail.from names.
  • Password, secret: an app password, where the provider uses two-step sign-in.
  • Server, optional: left empty, gdo finds it from the address.

What gdo does with the answer:

  1. It opens the password and finds the server from the address’s domain: JMAP at /.well-known/jmap first, then the provider’s published submission server (an RFC 6186 SRV record, or the provider’s autoconfig).
  2. It signs in and sends one mail to the address itself, as proof.
  3. It answers running (“Sends as post@vel.example over JMAP, and reads replies from the same mailbox”) or refused with the server’s words, such as “535 authentication failed”, or “no mail server published for vel.example: fill in Server”. Once mail runs, the ask leaves the page and the outbox starts to drain.

What follows from it:

  • Each site sends from its own mailbox, signed by its own provider. A site keeps the address it already has, and nothing changes in DNS on the host’s side. Today every site on a host sends through the host’s mail.
  • JMAP gives the most. The account’s Sent mailbox shows what the site sent, replies come back as notes, and an event goes into the same account’s calendar over CalDAV. An SMTP login only sends.
  • Until a site answers, gdo sends through the host’s own mail as now, where the operator has set that up.

What goes

  • NATS, and everything built to use a broker as a database:

    • crates/core/src/namespace.rs;
    • crates/portal/src/adopt.rs (2,086 lines) and its tests (1,139): gone;
    • presence.rs;
    • the mend and SETTLE: gone;
    • dhd’s streams, subjects and consumers;
    • the JetStream half of the store.

    The tests that need a live JetStream (jetstream.rs, durable.rs) run on the in-memory store instead.

  • In content, nothing. The three rules change what type: date, narrowing requirements and type: record do. holds: is new.

Order

  1. holds: and the three rules, reviewed in this doc.

  2. gdo asks each site for its own mail login, over today’s asks. The ask moves to Serve with dhd/1. Built (gdo dd2f9c1, 79af085, f425375): it asks where SMTP_HOST is unset, keeps the login in its state directory, may be given a new one while it works, and asks in the site’s language. Not yet ticked: it has not sent a real mail through a site’s own mailbox.

  3. The store on redb alone (portal_core::store), with an outbox, holds, a feed of its commits, lazy batches and a format.

  4. One transaction per submission and per move, with its outbox rows and the holds projection. The app moves onto the store one area at a time, its reads and writes together, so every commit runs:

    • sessions: the sessions bucket, flushed every minute and as the site stops;
    • every record and the event log: a submission, a move, a desk’s save and a restate are one batch each (answers::write_logged), so the mend, SETTLE and adoption are gone; the lists in memory follow the store’s commits; the ledger takes an event’s postings in one batch;
    • the work a move sets off (mail, payments, announcements) as outbox rows in its batch, relayed onto NATS until dhd/1 (outbox): a mail, a request for money or an announcement exists exactly when its move does, and waits while NATS is away;
    • the holds projection, with step 5: kept with every write of the record (store::Batch::hold, holds).

    Until step 6, a program that wrote records from its own process (the kit’s approval desk, portal import, portal ledger rebuild, iris replay --report-only) opens the site’s store, and so runs while the site is stopped.

  5. holds: and the three rules in the lint, the renderer and the trainer, with live lists:

    • live lists (live): an open page hears which of its lists a commit changed, only those the person may read, and reads them again as it read them first;
    • holds: (holds), the dates above a list, a picked row sent with the form, and the three rules in the content checks iris runs and in the renderer;
    • the trainer’s holds: on a need and of: on a collected field: build writes the bucket’s holds: and puts a picked field, its list and the days beside each other;
    • the simulator walking a booking: a plan need lists samples:, the example records needs.yaml carries and a picked field offers the simulated visitor by name.
  6. dhd/1 over irpc and iroh, and over HTTPS. gdo, kron and learn move to it, cnats moves as kino, and varde keeps the backups:

    • the protocol (dhd::one) and the site’s end (network): its key, the programs DHD_KEYS names, Serve handing outbox rows down and their acknowledgements back, the relay leaving a served outbox alone, and May; open values travel as JSON text;
    • gdo serves mail and hands replies back as Note (gdo’s one-oh branch, PORTAL_DHD); tried end to end with this site;
    • kron serves payments and tells the site what the provider says as a Move on the payment (kron’s one-oh branch), with no NATS: its ledger in a file of its own, and its Vipps keys asked for down its Serve (credentials), its word back as a Move;
    • the site’s side of kino: room messages through the outbox (rooms, served over dhd/1), Watch of the groups, May;
    • Move for desks: a program site.yaml’s programs: names moves records as a desk button does (a Service in the policy);
    • the chat’s threads as Notes (subject: thread, kept in portal_threads; kino sends one as a thread grows);
    • learn’s ranking as a question on its Serve (Work::Ask, learn serve --dhd), asked before NATS and a spawn;
    • backups: a snapshot of the store every six hours, sealed to the operator’s age key on the site, to garage, or into varde, pinned closed and pushed to trusted peers that keep it (backup);
    • the chat as kino: a new program on dhd/1, uhhm/kino. Released (0.1.1, in the [uhhm] registry for x86_64) and run beside a local site; a run beside a site with real sign-in is to come, and its aarch64 package does not build on that runner yet;
    • the HTTPS binding: /dhd/1/submit, /move and /note with a named token, and outboxes posted as signed webhooks (hooks); presence from open Serves;
  7. Load (the deploy’s: a commit fetched, checked and swapped in, over iroh or POST /dhd/1/load) and Read (portal db: a bucket, a record or its log, from the running site).

  8. The NATS code goes, and 1.0 is released:

    • the site listens on nothing and relays nothing on NATS; its Instance has no NATS; what NATS kept for a while is in the store (store::Kept); learn, rooms, reloads, invites and search counts are off it; the integration tests run on a store in memory;
    • the sites the kit writes are 1.0 sites: no NATS of their own, the store in the unit’s StateDirectory= or on a volume, and their CI posts Load with a token the site names load; learn serves over dhd/1 alone;
    • the kit’s queue of briefs, the last thing on NATS: a brief is a record in the built-in portal_kit, its row in the kit outbox is the worker’s over dhd/1, the worker’s word on its end carries the fields, the mails and the filing on the owner’s desk, and the desk’s yes comes back down the same outbox (briefs, dhd::kit); async-nats is out of core, portal and bratac;
    • dhd’s NATS names, once gdo and kron drop their NATS modes (the 0.x sites’ programs still read them);
    • the chat on dhd/1 (kino), which the site now waits for: what it says in a room stays in the rooms outbox until a chat serves it;
    • the release. Candidates are out (v1.0.0-rc.7), and the first site runs on one: a preview moved from 0.20.1 with its deploy, its import and its Load from CI. one-oh is not merged to main.

Changelog

One line per change, grouped by the release that shipped it. Newest first. A release is a Cargo.toml bump plus a v<version> tag; the content repos pin the tag they run (see the end of this file).

Unreleased

1.2.1 (2026-11-29)

  • A draft its owner has confirmed is a plan the builder takes. The interview’s own checker is not the builder, and an owner could say yes to a draft that bratac build then refused over things no owner is read: of 46 drafts confirmed in four passes over twenty test businesses, 15 were. The interviewer now puts these right as it merges a draft: what went well is one of the endings (a stage on the way to one is dropped from them, and which ending is good is never guessed), the stage a case starts in is no ending, a need that differs from the first in its bucket (or whose bucket is called after a stage) gets a bucket of its own, a role is in the plan once under an id (words where an id goes become one and stay as the label), and a kind of field the builder has not is one the person types. All 46 build with it. The kit’s job does the same to the draft in a brief before it builds from one, so a brief confirmed earlier builds too. From a confirmed draft with no plan model, the job ran from brief to mail in 92 and 138 seconds for two test businesses, nearly all of it the words model. Training, “A confirmed draft is a plan”.
  • When the interviewer has no question of its own, it asks about the next open gap in the owner’s words and language: “Housing boards: a survey of the building. Who with you takes care of that?”. It used to put its checker’s line to the owner as written (“Tell me more: need housing-board-requests: handled_by is missing”, in English whatever the owner’s language), and to come back to that one line and to the question about a normal week: a test owner asked about handled_by answered that they knew of no such field, each time. Each gap is now asked about once before any is asked again. Six of 495 questions in three passes over twenty test businesses were such lines, and one interview was put the same line twice.
  • The interviewer (bratac interview, and the interview on a site) settles four of its own checker’s complaints as it merges a draft, where it used to put them to the owner turn after turn. A field budget below what the form asks is raised to it, up to five. An ending that is no stage is dropped when another ending is one, and when none is the case ends at its last stage. A role whose words are in the owner’s own answers joins the roles under those words; one they never spoke of is still asked about. And a question the owner has answered is not asked a third time: the interviewer keeps its draft and asks about the biggest gap. Over twenty test businesses, three passes each, the turns went from about 100 to about 85, and “the role has not been described” all but went. Training, “What the interviewer puts right by itself”.
  • An owner’s yes is a yes when they read a line of the question back after it. “Yes. We will keep your site under the name x.” was put to the model to judge, which answered no each of the three times the summary was read back, and the owner left with nothing: five of 140 test interviews ended that way. What an answer only repeats of the question is now left out before the yes is read.
  • The test owner (bratac interview --person) no longer turns down a name it used first. Its yes to a read-back is checked against its intake, and a desk the intake never names became “it is not X who handles that”; but the model owner drifts from its intake as it talks (“the physiotherapists” for “the therapists”), the interviewer keeps the owner’s word, and the owner then refused its own word three times over. Eight of fifteen names turned down at the end of unconfirmed English test interviews were the owner’s own. A person’s answers are never judged this way.
  • The lint says how much of a site only passes a visitor along: the cards that only lead to another page, how many of those lead to a page with one thing to do (the card could have been that thing), and the pages whose every card leads on. A count in its summary, never a failure.
  • The trainer builds a door as a page only where a plan’s offers outgrow one front door (more than seven public needs). Where they fit, the needs sit on the front door and build says so among its readings: a door there only passed the visitor along. The sector plans with a few needs behind two doors (physio, hire, fotballklubb, contractor-full) are built flat; the building authority, with nine, keeps its doors. iris check --leads lists the cards that only lead on, and bratac score carries the count in summary.json.
  • The score names the card to mend: where one card takes the visitors of two needs or more that it does not meet (a visitor’s worth of picks or more), iris check --needs-score says so in a DRAW line, and bratac score prints it and carries it per mode in summary.json as draws. Several misroutes to one wide card were read as several wordings to mend; it is one, and in a plan it is the wants of that card’s need.
  • bratac score names the headings that lean on their descriptions: each visitor who went right with the descriptions and wrong on the headings alone, with the card they should have taken (LEANS, and leans in summary.json). bratac score --routing stops after the two routing numbers, for a round of mending a wording: rating the cards asks many times more of the visitor.
  • The full contractor plan (plans/contractor-full.yaml) says what each card is for on its heading: four wants reworded as the two lines above pointed (“a survey of a building, and a report on what is wrong and what it takes” for “someone qualified to come and look at it and say what it takes”; a fault in work we did, approval as a subcontractor and a job with us named where “it” and “to be considered” stood). The local visitor went from 9 of 12 to 12 of 12 with descriptions and from 8 to 10 on headings alone, three seeds. plans/contractor.yaml and its Bokmål twin keep their wording: the learning programme builds its sites from those two.

1.2.0 (2026-11-28)

  • A card says who it is for: for: on an alternative, one name or a list. A sign-in group (for: artists) makes the card that group’s: everyone who opens the page sees the card and what it takes, its members get the form, the lists and the button, and everyone else reads “For artists” in the button’s place. The server holds the same line for the card’s form, files, conversation and lists, and the search box offers the card to its members alone. ! turns a group round, as in a systemd condition (for: !newcomers: everyone signed in outside that group, who reads “Opens after newcomers” while in it). Any other word (for: Listeners) is a word for people and guards nothing. The lint refuses a word that is a group’s name but for its spelling, ! on a word or on a group in mfa_groups, and a card both for a group and kept from it. See “Who a card is for” in the content reference.
  • A way round the site by who its cards are for: nav: bar in site.yaml puts on the wordmark’s line, after the mark, a tab for each name in the cards’ for:, each tab opening onto its cards wherever they are, each page’s under the question it asks: who the site is for, and what each of them does here. Any tab is anyone’s to open and the pages stay as they are for everyone; a card kept from the person looking is listed with the line it carries on its page. What is everyone’s has no tab: the foot goes on listing the pages anyone opens, and a group’s own pages move from the foot into the group’s tab. nav: foot keeps both of the foot’s lists and draws no bar. Left out, a site whose cards say who they are for has the bar and any other site the foot, as it always had. See “The way round the site” in the content reference.
  • The header’s own look: the wordmark’s line runs from edge to edge of the header’s column, the mark at the left and who is here at the right, on every page alike. It was centred, with who is here hung at the edge of the question’s own width, so it moved from page to page. The question keeps the centre, with more room over its head. A site whose stylesheet: leaves the header as portal draws it (.hero-top, .hero-copy) gets the new look with this release.
  • A card’s conversation (interview:) is held with those a form of the card would be taken from: on a page with qualifies, its group. It used to answer anyone who named the page and the card.

1.1.0 (2026-11-27)

  • A player on every page: player: { streams: [{ name, url, now }] } in site.yaml puts one bar along the bottom of the site that plays its stream and keeps playing from page to page. An audio file in a list or on a record gets a Play button beside its name; playing one pauses the stream, which comes back when the file ends or is stopped. now is where the stream says what it is playing and whether it is on the air. The addresses are paths on the site itself. Content reference, “A player”.
  • A page is never wider than its screen. A long word, an address or a mailbox in a heading, a description, a label or the list of other pages breaks rather than widening the page (a long compound word did, on a phone). A phone’s date, time and date-and-time controls are as wide as their form and no wider. The header with the site-wide search box fits a narrow phone: who is here takes the width of its words there. And the page itself no longer moves sideways, whatever a site’s own stylesheet lays over it; what is wide on purpose (a table, a calendar) scrolls in a box of its own as before.
  • The content reference showed stylesheet: /site/theme.css and favicon: /site/icon.svg; both take the file’s path in the repo (theme.css), as the lint has always said.

1.0.12 (2026-11-27)

  • bratac build and plan: a need that someone signed in files (enters_as), that mails its sender and collects no address, is no longer refused. The form is given an email field, which portal fills from the account and does not show, and the need’s max_fields is raised by the one, so the plan’s own count of what it asks still holds. The plan check says so among its readings. A public form that mails its sender must still ask for the address.

1.0.11 (2026-11-26)

  • A file field can be a roll: roll: true on a type: file field gives a strip of thumbnails that what is picked lands in, each one taken out or moved before the form is sent, up to at_most (12 unless said). camera: true adds a live view from the device’s camera, off until its button is pressed, and a button that puts a still in the strip. Pictures are scaled to 2400 points on the long side before they go, every file in the roll is kept (the field holds a list of keys), a list shows them side by side, and each is fetched at /attachment/<bucket>/<record>/<field>/<n>. Until now a file field with multiple: true let a person choose several files and kept only the first; it still does, and the reference says so (Content reference, “A roll of files”).
  • A plan’s need may carry ledger:, the bucket’s own ledger as aggregates.yaml has it ({ amount: 650 }, { amount: { field: price } }), written through by bratac build; money and number are field types a plan may use.
  • bratac interview --experts (a trial): once the interviewer has the structure, experts take one topic each where it is needed. The first is money (crates/bratac/experts/money.yaml): it fires on a word the owner used, a stage’s name, or a yes when asked, asks at most three questions, and writes a need’s ledger:. An amount the owner never said is not written, a question about fields or forms is not put to the owner, and what it could not learn goes into the plan’s open: and is said at the end.
  • bratac gaps writes the rows a gap model is trained on out of finished interviews: per turn, what the gap read is asked and the gaps the turn closed. bratac interview writes each turn’s gap request into transcript.jsonl (gap); older transcripts are played again and a turn that does not come out the same is left out (docs/learning.md).
  • A page can be locked: locked: true on a page, or in a directory’s _section.yaml for every page under it, and nobody is offered the suggest-a-change form there, the people who answer for the page included; the server refuses a suggestion aimed at one. locked: false on a page opens it in a locked section. A locked page is changed in the content repo.
  • engines/llama.sh: a model engine for a llama.cpp server, or anything else that speaks OpenAI’s chat completions (LLAMA_HOST, MODEL, EFFORT for a model whose thinking can only be turned down). The kit’s plan can run on it with KIT_PLAN_LLM (docs/training.md, “LLM backends”).
  • bratac score --seeds N has the blind visitor answer every task N times and scores how the answers split: a Brier score per mode (0 is every seed right), and each task the seeds did not agree on with where the others went. iris check --needs-score reads several answers per task (one line per seed) and prints SPLIT: and brier: lines for them. One seed scores as before (docs/training.md, “Scoring a built site”).
  • bratac score --seeds N asks every task under the first three seeds (--first) and under the rest only where those did not agree, so more seeds cost little on a site whose wording mostly works.
  • bratac rate --seeds N asks the understanding questions under several seeds in the same way, and rate.json gains understanding_share and control_share per page. score --seeds passes its seeds on to it.
  • bratac score --seeds N writes its answers a file per seed (answers-<mode>-seed<n>.jsonl), the names learn extract reads a run’s seeds from, so a scored run is training rows with the seeds as votes.
  • bratac teach has a larger model go over finished interviews and, for each question that closed nothing the checker wanted, write the one it would have asked (lessons.jsonl). bratac interview --lessons shows the interviewer the lessons about what is missing now, at most three. The web interview does not read them yet (docs/training.md).

1.0.10 (2026-11-25)

  • A list of records that are their sender’s own (owned_by) is read faster on a site of many pages: who sees a record is asked of the rules that name its bucket, not of every rule the site has. A list of 2000 on a site of 248 rules took 740 ms and takes 65 ms; what anyone is shown is the same (bench/README.md, “owned”).
  • A release is built for aarch64 Linux as well as x86_64: portal-v<version>-aarch64.tar.gz, and portal-aarch64-linux, -iris, -bratac, -learn bare. The x86_64 files keep their names. A deploy that took the first asset of a release must ask for its file by name: with two machines’ files the first is no longer the x86_64 tarball.
  • The front page’s map (hero: { kind: map }) no longer writes pins’ names over one another. Where two would overlap, one is shown, a record’s (hero.resource) before a page’s; the others show under the pointer or the keyboard’s focus, and on a touch screen at the first touch of their pin, the second opening its page. Names return as zooming makes room.

1.0.9 (2026-11-25)

  • owned_by: sender on a bucket: a record is the signed-in person’s who filed it, written on it by the site (owner), and only they see it, whatever page lists it. shared_with: { group, while } shares it with a group while the record is in those states: the group sees it, moves it from its desk and files what belongs to it, and stops when a move (the owner’s, the desk’s or a clock’s after:) takes it out of them. A bucket that belongs_to an owned one goes by its parent. A list over such a bucket needs neither public nor requires_group. The handbook and the map say it in words.
  • A case’s conversation has an access question of its own: May takes { kind: thread, room, bucket, id }. Of a record that is its sender’s own it is the owner’s and the group’s it is shared with while it is; of any other it is answered as its room, as before. A chat that asks it (kino 0.1.3) lets a person in no group talk with the group their record is shared with.
  • A browser’s submission no longer decides the email of a record in an owned bucket: the session’s address is written, where the form carries one.

1.0.8 (2026-11-25)

  • source: { kind: url } reads more than JSON: as: feed reads an RSS or Atom feed, a row an item (title, url, description, date, an event’s start and end), and as: html reads a web page by CSS selector, a row for each element rows: selects with the fields: named in it (. the row’s own words, @href an attribute). Only words and addresses are taken, never markup. An answer is kept for keep: (15 minutes for a page or a feed where nothing is said, not at all for JSON, as before), and stands while the other server does not answer. The lint refuses a selector that is none, and rows: or fields: on anything but a page.

1.0.7 (2026-11-25)

  • The front page’s map (hero: { kind: map }) pins every point of a page whose place: is several pins (points:), each under its own name; before, such a page had one pin in the middle of them. An area or a path still has one.

1.0.6 (2026-11-25)

  • download: on a group’s list: a link under it to the list as a CSV file, one row per record as the visitor has narrowed it, with the title: and show: fields under the form’s labels, the state and when it came in. The same person is let in as the list lets in; the lint refuses it on a public list. Semicolons on a site whose language writes numbers with a comma, and a cell that would run as a formula is kept as words.

1.0.5 (2026-11-25)

  • The map hero fits its pins inside the padding of its box (.hero-map { padding: ... }), so a site whose header lies over the map says in its stylesheet how much room the pins keep, per screen width if it likes; the pins are fitted again when the box changes size, until the visitor moves the map. It was a fixed 72 pixels all round, and a pin could sit under the header on a phone.

1.0.4 (2026-11-25)

  • hero: { kind: map }: the front page’s header is a map with a pin for every first-level page that has a place:, each pin a link to its page and named by it; pages: [/a, /b/c] names the pages instead. A visitor gets pins only for pages they may open, and the same places stand as links under the map, which is all there is on an instance without map tiles. resource: on it puts a bucket’s records there too, as a list reads them (public/requires_group, states:, where:, limit:), each at the place it holds and named by title:, opening the page to: says.
  • Markers on a map follow the site’s --accent: a list drawn as a map, the front page’s map and the pin of a type: location field. They were MapLibre’s blue and the ink’s grey. MAPBOX_STYLE is in the operations table.

1.0.3 (2026-11-24)

  • A list’s filter narrows its own list only. Where two lists on a page have a requirement of the same name beside their resources, each now keeps its own in the page’s address under its list’s name and the field’s (/archive?documents.group=Traffic, the list’s name being its feature’s as an id), where both used to read the one ?group= and so narrowed together, every list on the page changing when one was narrowed. A field only one list on the page narrows by lives under its own name as before, and so does what an alternative that records asks beside its lists. A link written as ?group=… to a page where several lists narrow by group narrows none of them now: name the list it means.

1.0.2 (2026-11-23)

  • type: address: a street address that suggests itself as it is typed, in the browser’s own list. The site says whom to ask (addresses: kartverket or off in site.yaml; Kartverket by default for a site in Bokmål or Nynorsk, nobody otherwise), and asks on the visitor’s behalf, so no third party sees them. One picked is kept with its postcode, town, place and the register’s id; ADDRESS_LOOKUP=off on a host turns it off for every site there.

1.0.1 (2026-11-22)

  • A list the browser keeps: collect: { into: cart } on a list puts Add to the list on every row, and a type: collection field (of:, from: cart) on a form anywhere on the site shows what was gathered and sends it as one answer, so one booking names several machines. count: true gives each line a count (max: the most of one). Kept in local storage, emptied when sent; a holds: holds every record in it; desks and mails say the lines by name.

1.0.0 (2026-11-22)

  • type: duration: a form asks for a length of time as a count and a unit (units: [days, weeks]), kept as ISO 8601 and said in the site’s language; holds: { what, from, for: <that field>, while } holds from the first day for that long, in place of until; and a first day with how long narrows a list to what is free across those days, as two dates do.
  • Each list on a page, and a select’s options read from records, is read once and sent once. leptos builds a page more than once on the server to render it, and each build read every list on it again and put another copy in the page (three of each on the machine-hire counter desk); the lists are kept for the request (ListsOnce), and the browser builds and follows its page as before (#152).
  • A date rule is said as a phrase: on: first saturday of june, last sunday of every month, fourth sunday before 25 december, 17 may. The keys spelled out ({ nth, weekday, month }) still work.
  • One way to write a length of time, wherever content takes one: every: 6 months, lead: 14 days, shows: 3 weeks, expires: 30 days, a reading’s since: 3 months, an event’s duration: 3h 30m, as people say it or as ISO 8601 (P14D). The old { days: 14 } shapes are refused with the new spelling named. Counting is calendar-aware (jiff): a month is a month, a day across a summer-time change is a day.
  • The site’s time zones come from the time-zone database built in, not a table of the EU’s rule: a wall clock, a deadline and a calendar feed read the zone’s real history, and the feed’s VTIMEZONE lists the real changes.

1.0.0-rc.11 (2026-11-21)

  • iris manual --slides slides.md writes the handbook as a deck to talk through: the opening, the showcase spread in that edition, the front door, the map, the needs in brief and a slide for each, the roles, how people join, what runs by itself and what comes next, in markdown split by ---, the map’s SVG beside it. Begun on 0.11 and never committed; ported to 1.0.
  • iris manual --for <group> writes one group’s handbook: its needs, its role, how its members join and what runs on its desks, with the group named on the cover. Once per group hands each crew its own; --slides makes the same as a deck.
  • A site serves each group’s handbook at /handbook/<group>, made the first time someone asks and kept until the content changes. The group reads its own, and so do the groups that invite into it. An invite into a group links it ({handbook} in an invite’s words, a closing line in portal’s own), and so does the line of the group’s pages, on its desk too. The host needs Typst; without it the invite goes out as before. /handbook/ joins /asks/ as a path content pages stay out of.
  • Portal speaks Nynorsk, Swedish, Danish and German besides English and Bokmål: lang: nn, sv, da or de in site.yaml. Every word portal says itself (the page, dates, its own mails, the handbook, the map, the kit’s interview and the sites it writes) is in Fluent files, locales/<code>/<area>.ftl, so a language is files a translator writes. A missing phrase comes from the fallback (Nynorsk from Bokmål, the rest from English), and each part’s test names what a language lacks. The new four are a first draft: have someone who writes the language read them before a site goes live in it. The docs’ Languages page says how to add one.
  • Plurals follow the number: “shown 1 day before”, “good for 1 day”, “om 1 time” read as they should. English and Bokmål are otherwise word for word as before.
  • On a phone, text reads at 14px and a form field never under 16px, so iOS leaves a field at its size when it takes focus; larger screens scale as before, with no ceiling, up to TVs and wall displays.

1.0.0-rc.10 (2026-11-21)

  • The old credential ask is gone from the site: a program asking for a login in its Serve (waiting, ask, public_key), the source: { kind: asks } list that showed it as a form, the built-in portal_credentials and the credentials grant in DHD_KEYS. Programs ask with a question (dhd::ask), as gdo and kron now do, and it waits in the header without a page placing it. Content with kind: asks is refused by the lint; replacing a working login from the site went with it. dhd::asks is gone too: gdo and kron releases from here on speak only to 1.0 sites, and a 0.x site keeps the gdo and kron it has.

1.0.0-rc.9 (2026-11-21)

  • rc.8 was tagged but never released: the release build of the browser code went deeper than the compiler allows on the new ask page. The page erases its view types at each card, feature and field, and rc.9 carries rc.8 with that.

1.0.0-rc.8 (2026-11-21)

  • A program beside the site asks its people a question (dhd::ask): the Ask call, or POST /dhd/1/ask with a token, carries a question in a page’s own shape, with alternatives and their fields, for a group (ask:<group> in DHD_KEYS) or one person (ask:person). It waits in their header and is answered at /asks/<id>, a page drawn from the question; fields marked secret are sealed to the asker before anything is written and need a strong sign-in. The answer goes to the asker alone (its own asks.<key> outbox, or the asks webhook over HTTPS), and the asker says done or refused with its words. Each ask is a record in the built-in portal_asks. A content page under /asks/ is refused.

1.0.0-rc.7 (2026-11-21)

  • source: { bucket: machines } is a list of the site’s own records: kind: is left out. kind: kv, the 0.x name, reads the same, and every other source still says its kind. A stray key inside source is refused by name. The docs, the examples and bratac write the short form; a reading in post: takes it too.

  • A series’ for_each takes where: as a list does, so each kind of thing can have its own series: where: { field: type, none_of: [Trailer, Scaffold] }. The lint holds the field to the bucket’s forms and the values to its choices. The handbook says it in words (“Only those whose kind is not «Trailer» or «Scaffold»”) and the map in short (type ≠ Trailer, Scaffold).

  • where: takes none_of beside equals and any_of, on lists, notices and series alike: a record holding none of the values, which one with nothing in the field is.

  • A refused send keeps its button at the card’s edge, with the reason under it; a long reason pushed the button aside.

  • The machine-hire example’s thanks page has no button of its own: portal already adds the way back.

1.0.0-rc.6 (2026-11-21)

  • A release unpacked as it ships runs with no LEPTOS_* set: a hash.txt beside the binary turns on hashed scripts and styles, and a site/pkg beside it is the site root (portal::release). Before, the quickstart’s command served a page whose styles and scripts were missing. What the environment sets still wins.
  • The lint’s first line says how many buckets are the site’s own and how many are built in, instead of one count of both.

1.0.0-rc.5 (2026-11-21)

  • A program beside the site may let its owners replace a login that works (replaceable: <kind> beside its ask): the ask stays on the owners’ page with a line saying it works, a new login can be given there, and the program keeps the old one until the new one is proven. An ask may carry lang, and the site shows the one in its own language (#151). gdo and kron say neither yet: they follow once a release carries it.
  • The list of what waits for you closes on a click anywhere else, or Escape, as a dropdown does. Seen in a browser on a scratch site with sign-in on: the name marked with a count, the list opening under it.
  • A post: step’s answer may write on the record: takes: [price, delivery_date] names the fields, and an answer’s fields are taken only by those names, only with ok, only as text, a number or true/false, written with the move then.ok makes. A field a form asks a person for cannot be taken, so an answer never writes over what someone typed; a list may show: a taken field.
  • submit:<bucket> in DHD_KEYS and DHD_TOKENS lets a caller submit only through forms that record into that bucket, where submit lets it submit anywhere a visitor could.
  • Whoever is signed in sees what waits for them: their name in the header is marked with a count and opens onto the list, each a line and a link to where it is answered. Two things count: a program beside the site asking for a login, on a page whose asks they may see, and a change they suggested that waits for their yes (app::waiting, POST /api/waiting_for_me). With nothing waiting, the header is as it was.
  • A call on dhd/1 keeps its place on the wire: a test holds each one’s, and the list only grows at the end. Load and Read had been put first (before the first candidate), which renumbered every other call, so a program built against an older dhd said Serve and was heard as something else, with no error on either side. gdo and kron were such programs; both are pinned to a release tag now.
  • A site goes by one name to every program beside it (instance::site): what a program is told it serves and the site on a request for money, a login given and a step handed on were two forms of SITE_NAME (folded to a token, and as written), which differed for a name with capitals or spaces, so a program that said back the one it was told could be taken for another site’s. A name a program says back is compared as a token.
  • A post: step may wait for others (after: [<step>]): it is handed on once each has answered ok, with their answers in its reading as steps.<name>; one whose wait was refused is never handed on. The lint refuses a step that waits for itself, for a step the state does not have, or in a ring.
  • The workflow the kit writes for a new site prints what the site answers its Load (what was loaded, or why the content did not pass), and tries for two minutes while a deploy restarts the site; curl -f hid the answer. Operations says to copy a seed in with tar where the deploy may not set setgid.

1.0.0-rc.4 (2026-11-20)

  • Load at a commit works for a private content repo: aggregates.yaml, site.yaml and the templates are fetched through the API’s raw endpoint, as the pages are. They were fetched by the download_url Gitea hands back, which for a commit is its web address and answers a private repo with the sign-in page, so every Load the content’s CI asked for was refused (422) while the load at start, by branch, passed. A Load that fails is said in the site’s log with why. Found moving the first preview to 1.0.

1.0.0-rc.3 (2026-11-20)

  • A post: step reads more than its record: read: entries name other records (source: { kind: kv, bucket }, with states, where, since, limit) and what happened in a bucket (events: <bucket>, with where, since, limit), each under a name the template uses; {field}, {id} and {bucket} in a where are the record’s own. The newest first, 500 unless said. The lint holds each entry to one source and to a bucket the site has.
  • post: on a state, the first slice of #119: a record entering the state is read through each named step’s template (a text file under templates/, {{ }} over the record) and handed to the program the step names (to: { service } or { credential }), as a row in the outbox posts.<name> written with a case for the step in the built-in bucket portal_posts. The program answers with a Move on the step (ok, refused, failed); its words are kept as a note on the record, and the state’s then: moves the record once every step is ok, or one was refused. Templates load and swap in with the state graphs, and the lint fails on one that is missing or unreadable, on an address or a key where a name belongs, and on a then that is no declared move. Not yet: steps that wait for each other, gates, readings beyond the record, .typ and to: { mail } (docs: state machines, “post”).

1.0.0-rc.2 (2026-11-20)

  • On a site with mfa_groups, a suggested change is applied only after a strong sign-in (a passkey or a second step), whatever groups its asker holds; after a weak one the yes is refused in words and the change waits (#148).
  • “Suggest a change” applies only words on its asker’s own page (headings, texts, labels, button words); a change to how the work goes (a field’s kind, where a card leads, who may see what, a state graph, another page, a new link out) is handed over instead: the same draft and read-back as a PR for whoever maintains the site, which portal does not merge, with the inbox mailed and the case resting in handed until the PR is merged or closed. Which of the two a change is, is read from the change itself (edit::kind), never asked of a model. Members of portal_maintainer (or EDIT_MAINTAINER_GROUP) apply either on their own yes. (#148).
  • At sign-in, an address the provider says it has not verified (email_verified: false) is not carried into the session: it no longer makes a person the one a page names as responsible, nor claims an invitation waiting for that address. A provider that says nothing about verification is taken at its word (#148).
  • iris lint --path … runs the lint as portal lint --path … does, so EDIT_LINT_BIN may name either binary.
  • A suggested change that alters who a state puts into a group or takes out of one (grants:, revokes:) says so in its read-back, among what people gain and lose, and is refused after the yes when the person was not shown it, as an access gain is (#148).
  • “Suggest a change” runs the repo’s own CI lint on a proposed change where the workflow says iris check --path questions, as the workflows the kit writes do; it only knew the older lint --path forms, so on such a site that check was skipped without a word.
  • Operations says how a deployed site is imported into: its unit runs the import itself (PORTAL_COMMAND), since only the unit may open its store.

1.0.0-rc.1 (2026-11-20)

Portal 1.0, in brief. A site is one process and one redb file: its records and their logs, sessions, outboxes and holds, every move written whole in one batch. The programs beside it (gdo, kron, learn, kino, the kit’s worker) dial it over dhd/1 with keys of their own; n8n and scripts make the same calls over HTTPS, or take an outbox as signed webhooks. A site can come from a folder (CONTENT_DIR), so trying portal is a folder of YAML and one command. For content: bookings that hold a thing over days, lists drawn as rows, cards, a table, a board, a calendar, a map or a count, live as records change, the browser’s own input types, programs: that move records, and a lint that refuses keys nothing reads. Nothing moves over from a 0.x site: a 1.0 site starts with an empty store (docs: operations, “Moving a site to 1.0”). The lines below are in the order the work landed; where one says NATS still kept something, a later one took it out.

  • portal session --as <name> --groups <group>: a signed-in session on a site being tried out, written into its store (with the site stopped) and printed as the cookie for a browser, so the machine-hire example’s counter desk can be opened with no sign-in provider running (docs: Try it). Refused where OIDC_ISSUER or KANIDM_URL is set.
  • A board says its noun as one where it has room for one: words: { place: maskin, places: maskiner } reads “0 av 1 maskin” and “2 av 3 maskiner”, on the row and on the map. With no words, a board of one says “1 place taken” (“plass”), not “places”.
  • iris with no command printed iris replay --path <dir> --nats <url>, a flag replay no longer takes: it says --store <file>, and lists map and manual beside check and replay. An owner giving a service its login after the service went away is told it “is not connected to the site any more”.
  • A site the kit writes lints with iris (portal-x86_64-linux-iris, 24 MB) rather than the whole portal binary (107 MB): the same code, a fifth of the download. The lint chapter and operations say iris check throughout and no longer tell 0.6’s story of iris leaving and coming back; getting-started counts its four kinds of content right, drops a 0.5.4 failure and a client’s infrastructure link, and says gdo needs its key in DHD_KEYS.
  • Feature icons come from the site (/icons/<set>/<icon>.svg, icons.rs): it fetches each from Iconify once and keeps it, as it proxies map tiles. Before, every visitor’s browser asked api.iconify.design for each icon on a page, telling it who looked at what. An icon is served as image/svg+xml under a policy that runs no script. Content reference’s hero, search box and iOS profile sections say the same in fewer words, and operations lists what a page may load.
  • The manual and a room’s duties say “Has 1 question only they see”, not “1 questions”. The chapters’ examples are in English throughout (content reference, operations’ import and onboarding, mail, rooms), and rooms shows the machine-hire example’s counter rather than a preview site’s; it says a room’s message is a row of the rooms outbox, where it still named a NATS subject.
  • A series on on: { nth: last, … } (“the last Sunday in January”) loads; the check that holds on: to its shape refused last, which the docs and the dates themselves always took. State machines’ examples are in English, and its payment section says the same in half the words.
  • A desk’s button, which confirms the moves picked on its rows, says “Confirm” (“Bekreft”) where the content names none, rather than “Send”.
  • A card that collects nothing only goes on, and its button says where in the card’s own name (“Hire a machine →”) rather than “Send”.
  • docs/examples/machine-hire, shipped in the release as examples/: a whole site to run with CONTENT_DIR (a front door, machines narrowed to a visitor’s days, a booking held over them, a confirmation mail with a calendar entry, a counter desk), and the docs’ first pictures, on the front page.
  • The chapters say how mail, payments, deadlines and announcements travel in 1.0 (the move’s own write, an outbox a program serves), where they still named NATS subjects and streams.
  • The lint fails on a key no page or site.yaml reads (serde_ignored), named as “card 1 › feature 3 › field 4: bind”; such a key used to be dropped without a word, so a site quietly did less than its content said. Five such keys were in the content repos on this host.
  • A site with a title and no wordmark is named by its title in the header, not by the house mark the release carries.
  • When a record came in, or a note or a move was made, is said in the site’s words and on its own wall clock (timezone, summer time as the EU keeps it): “Thursday 19 November at 23:37”, not “2026-11-19 22:37 UTC” (tz::wall_clock).
  • A catalogue (a bucket nothing moves, such as machines for hire) has nothing finished: its records were all dimmed as ended. And a list without moves shows every record it is sent; it used to hide the oldest finished one behind “Show finished”, a desk’s way of asking for more.
  • A file field speaks the site’s language: portal draws its button (“Velg et bilde”, “Choose a file”) and the name of what was chosen, over the browser’s own picker, which still opens from the label, takes the keyboard and says when a required file is missing. Before, a Norwegian site showed the browser’s “Choose File / no file selected”.
  • A date with a time keeps the time to its “kl.” or “at” (a no-break space), so a narrow column never leaves “kl.” at the end of one line and “07:00” on the next.
  • portal import’s submit: presses on a page with a key (/ledig/uke48-sl10 for /ledig/[key]) carry what the address gives the form’s fields (value: "{key}"), as a browser’s form does. Before, such a press was refused as missing the record it is about: a rental’s bookings could not be brought in.
  • The kit’s queue is the site’s own, and portal opens no NATS at all: async-nats is out of core, portal and bratac. A confirmed brief (a web interview’s yes, bratac job enqueue, bratac interview --enqueue) is a record in the built-in bucket portal_kit, queued, with a row in the new kit outbox in the same batch. bratac job worker --site <key>@<address> serves that outbox over dhd/1 with a key the site names <key>=kit (dhd::kit is the contract), runs one job at a time, and says each job’s end with a move to built or failed that carries the record’s fields, the job’s mails (the site lets a kit key mail only the brief’s contact and its own address) and, with KIT_PROVISION=approve, where it waits for the owner’s yes. The owner’s move to approved hands the job back down the same outbox; the worker sets it up and settles it in one move with the caller’s way in and the owner’s line, which works beside a running site (before, the desk opened the site’s store and so needed the site stopped). kit.status, KIT_JOBS, --nats, --mail-nats/KIT_MAIL_NATS, KIT_APPROVAL_EVERY and NATS_URL on the site are gone; bratac job key <file> prints a key file’s public half; the standalone kit (kit/compose.yml) is one container, its site and its worker. CI starts no NATS, and backfill.yml (a 0.x one-time migration whose binary is gone) is removed.
  • The repos the kit writes for a new site are 1.0’s: no NATS in its compose.yml or its deploy; the site’s store in the unit’s StateDirectory= (the deploy refuses to run without one) or on a store volume; and lint-and-reload.yml posts /dhd/1/load with LOAD_TOKEN, whose hash the deploy gives the site as DHD_TOKENS=…=load. Before, such a site would never have taken new content: a 1.0 site does not listen on NATS. The curl in operations.md’s New content now sends Content-Type: application/json, without which Load answers 415. Load on a site read from CONTENT_DIR says it read the folder.
  • CONTENT_DIR: a site from a directory on this host instead of a Gitea repo (questions/, aggregates.yaml, site.yaml, every storyline, and the files /site/ and /.well-known/ serve), read at start and on every Load. With it, trying portal is a folder of YAML and one command; the new Try it page walks through one.
  • The site has no NATS: nothing it serves, keeps or hands on goes through it, and it does not connect at start. The kit’s queue of briefs is the one thing left there (NATS_URL, for the kit alone). portal import and comes-round go into the site’s store (PORTAL_STORE, with the site stopped). The operations guide is rewritten for 1.0: moving a site onto it, presence, the programs beside a site, rooms and learn over dhd/1.
  • Toward 1.0 without NATS: the site no longer listens on the bus or relays to it. Mail replies, the money service’s words and a program’s word on a login come as dhd/1 calls (Note, Move); the outbox’s rows wait for the program serving them over dhd/1, or a webhook (DHD_HOOKS), and nothing relays them to NATS; presence is the programs holding a Serve open; the access question is May; content comes with Load. Access decisions worth keeping are written to the site’s log (target portal::access) instead of portal.access.decided. An invite’s, a responsible person’s and an applied change’s mail go through the outbox like every other. The integration tests run on a store in memory and read what the site says off its outbox, so the 46 that skipped without PORTAL_TEST_NATS_URL now always run.
  • Load and Read on dhd/1: the deploy loads a content commit (POST /dhd/1/load {at} with a token named load, or over iroh), fetched, checked and swapped in with the last good content serving until then; the operator reads a running site’s store with portal db [--site <key>@<address>] <bucket> [<key>] [--log], with a key of its own named read. The reload is one step now (content::Content::load), shared by both.
  • programs: in site.yaml: a program beside the site (a scanner at the counter, a script, n8n) moves records as a desk button does. Each program is named with the moves it may make ({ bucket, from, to }), the instance gives its key or token that name (DHD_KEYS=<key>=scanner), and its Move goes through the policy (a Service principal), the same states, the state’s mail and the announcement, with the log naming it. Only the moves listed, from where the record is now; a move decided on a record that has moved since is refused, and a move carries no fields. The lint, the start and every reload refuse a move aggregates.yaml does not declare.
  • A program on dhd/1 that needs a login asks for it on its Serve (credentials): what the owners give comes down that program’s call alone, sealed to it, written with the record in one batch, and only the key it was sealed to may say whether it worked (a Move on its portal_credentials record). kron uses it: with PORTAL_DHD set it needs no NATS, its ledger and its keys in a file of its own (KRON_STATE).
  • Backups of the site’s store: every six hours (PORTAL_BACKUP_EVERY) a copy of the whole store at one moment (Store::snapshot), sealed on the site to the operator’s age key (PORTAL_BACKUP_TO), goes to garage (GARAGE_BACKUPS_BUCKET), to varde (VARDE_SOCKET), or both, and the newest fourteen are kept (PORTAL_BACKUPS_KEPT). varde pins each closed, for its trusted peers alone, and pushes it to the peers VARDE_PUSH_TO names, which keep it until their own operator lets it go; varde without a key to seal to is refused at start. Restoring is age -d and the file in place of site.redb.
  • learn serve --dhd <site key>@<address> (built with --features serve, as the release is): learn serves a portal 1.0 site’s ranking over dhd/1 with a key of its own (LEARN_KEY), each question to a free lane and its answer back up the call, a failure as its code (400, 503, 500) with the visitor’s words kept out of it. Stopping, it answers what it has taken and turns the rest away with 421. Its NATS mode is gone, and with it async-nats from learn.
  • Questions down an open Serve: a program serving a kind of question (learn, rank) is asked it down its call (Work::Ask) and answers up it (Done::Answer); network::ask asks the newest one serving, and none where nobody does. A search’s ranking asks a learn serving the site over dhd/1 first, then the resident service on NATS, then spawns learn rank as before (Via::Dhd).
  • The outbox as signed webhooks (hooks): an outbox named in DHD_HOOKS (answers=https://n8n.example/…) is posted to its address a row at a time, oldest first, as the JSON it is, with Dhd-Outbox, Dhd-Row and Dhd-Signature (HMAC-SHA256 of <outbox>.<row>.<body> under DHD_HOOK_SECRET); a 2xx lets the row go, anything else is tried again from 5 seconds up to 5 minutes, in order. While hooked, the relay leaves the outbox alone. n8n can take every announcement this way, off the bus.
  • dhd/1 over HTTPS for what is not Rust (dhd_http): POST /dhd/1/submit, /move and /note as plain JSON, each with a bearer token the instance names by its SHA-256 in DHD_TOKENS (network::Tokens; the site keeps no token). The same checks as over iroh (network::Site), and a status for each refusal (401, 403, 422, 503, 501). network::from_env returns the site with its listener, so the routes work with no program on iroh.
  • Submit over dhd/1: a program named for submit sends an answer as a visitor would, through the form’s own path (portal’s submit_as, handed to the network by the binary as a Submitter), and gets its chain hash. The network’s calls are methods on a public Site taking a Caller (what a key or token may do), so the HTTPS binding takes the same path.
  • A program serving the site over dhd/1 is beside it (presence): Serve says its name, version and what it can do in the services API’s words (calendar, providers, site), and the site counts it as present for as long as the call is open, alongside whoever answers a ping on the bus (presence::joined). A mail’s calendar line and a payment’s provider read it as they read a ping. Serve::new makes one.
  • What the site says in a group’s room leaves through the outbox (outbox::ROOMS): rooms::say writes the messages as rows in one batch, and the relay puts them on their room’s subject in the rooms’ stream as before (one message per id), or a chat that serves rooms over dhd/1 takes them. A NATS that was away used to lose what was said; now it waits. Watch over dhd/1 hands a key named for watch the site’s groups (dhd::one::GROUPS): every group’s room document (rooms::group_docs, lifted out of write_groups), then each that changes or goes, looked for every 30 seconds; dhd::one::Change carries what a record now is. A clippy pass leaves the workspace without a warning.
  • Move over dhd/1 for the money service: a key that serves payments moves a payment record (portal_payments) as its word says, the word (dhd::payments::Changed) as the move’s payload, through the same path the word on NATS takes (payments::take_word, split from take); the record waiting for the money moves on from there. A move and word that disagree, another contract, another bucket or another key are refused, and said.
  • Note over dhd/1: a program named for note hands the site a reply it read (its id, the record, the sender’s address, the words), and the site keeps it as it keeps a reply from NATS (mail::note): onto a record of this site’s, from the address the record holds, once.
  • The site’s own network, dhd/1 (docs: operations, “Programs that dial the site”). The protocol is in dhd behind its one feature, as irpc over iroh: Serve, Submit, Move, Note, May and Watch, with open values carried as JSON text (postcard carries no tagged enum). The site’s end (network) listens on DHD_BIND (127.0.0.1:4300) with a key of its own beside the store (site.key), only when DHD_KEYS names a program, and turns away a key it does not name. A program that serves an outbox (mail, payments, answers) is handed its rows down the open call and acknowledges them back up; while it serves, the NATS relay leaves that outbox to it (Store::serving). May is answered as the NATS question is (access::filled, lifted out of it); the other calls say they are not taken yet. No relay server is used: nothing about a site reaches anyone else’s machine. The browser’s build carries no iroh.
  • A plan need can list samples:, example records of what it lands in (- { what: Excavator 3 }, the fields its form fills). bratac build carries them into needs.yaml, and the simulation model offers them by name wherever a field picks a record of that bucket, so a simulated visitor booking a machine picks one. Nothing on the site is made of them. A sample naming a field the form never collects is refused.
  • A list can be drawn several ways (shows:, docs: content reference, “How a list is drawn”): rows (the default), cards, a table (a column per field of show:), a board (a column per state in the order of states:, the desk’s moves on each card), a calendar (a month, each record on the days its holds: holds it or on its form’s first date, a press to the months before and after), a map (a marker per record’s place, from the vendored MapLibre and this origin’s tiles; rows without maps) or a count. The lint holds each to what it needs of its records. In every list, a type: record field shows the record it names by its name (“Excavator 3”), not its id (content::record_heading, resource::with_record_names).
  • Input types make use of what HTML has (docs: content reference, “A requirement”). min/max take a day on a date or datetime-local (2026-12-01, today, today+365) and a time on a time, as well as a number; new are step, unit (beside the field, and with its name in a list), minlength/maxlength, pattern with pattern_says (the words a person is told), inputmode, autocomplete (an email, a tel and a field named name fill themselves when it is left out) and rows. type: checkbox is one tick, stored as true or false, which must be ticked unless it is optional, and reads as yes or no in a list; time, month, week, color, url and search are checked as a browser checks them. The server holds every attribute as the browser does. The lint refuses a type portal does not draw (it passed any before) and an attribute on a type it means nothing for; every content repo passes.
  • The trainer books things over days: a need says holds: (as a bucket does) and a collected field of: <bucket> (a record another need lands in). bratac build writes the bucket’s holds:, and puts the picked field, the list of that bucket (its public fields, in its public stages, readable by whoever fills in the form) and the hold’s two days in one feature before the rest of the form. The plan is checked for a held field with of:, required type: date days, stages the need has, and a bucket some need lands in; needs sharing a bucket share their holds. The planner is told when to use them.
  • A list’s rows show what was filled in: a field left empty (nothing, blank text, an empty list) takes no line. A 0 or a false still shows. Cards already left blank text out.
  • A record can keep something busy over days (holds: on its bucket, holds): a hire its machine from its first day to its last while it is confirmed or out, a service its machine and its mechanic while it is planned. holds: names the type: record field that says what (of: the bucket of the things, on every form into the bucket; multiple: true holds each), the two type: date fields of the first and last day, and the states it holds in; one map, or a list of them. The hold is taken, moved and let go in the same batch as the move that changes it, one thing has one holder on any day whichever bucket holds it, and a submission or move that would hold a thing someone else holds on any of its days is refused with nothing written and the person told in words; so is a last day before the first. The store’s holds take several things per holder, and release lets go of all of them (store format 2).
  • Booking from a list (docs: content reference, “Booking from a list”). Two type: date requirements beside a list, named as a holds: on its records names its days, narrow it to the records free on all of them, from the page’s address. On an alternative that records, the requirements beside a list are sent with the answer as well, and a type: record requirement of: the list’s own bucket is answered by a Pick button on each row (several with multiple: true), kept in the address too. A picked row must be one the list shows (in its states:), and free on the days as the record is written. On an alternative that records nothing, a list’s requirements still only narrow. No content repo had requirements beside a list on a recording alternative, so no existing form changes. A date filter on a list now draws as a date; a lone date there is refused by the lint, which explains the pair.
  • Lists are live (live). A page with a list opens one server-sent stream (GET /live?page=<page>), and the site tells it which of the page’s lists a commit changed; the page reads those lists again as it read them first, through get_resource and every check it makes. Only the lists the person may read are watched, decided as the page’s own read is, and the stream says which lists changed and nothing more. A booking someone else makes leaves your list as you look at it, and a desk sees another desk’s moves as they happen. A lone change is told at once; one right behind the last event waits 200 ms and takes along what lands meanwhile, so a burst of moves is two redraws; a stream that falls behind says every list changed; a stream opened again after a break (the site restarted) reads every list again. Streams end as the site stops, and the browser opens them again. A list read again keeps its rows on screen until the new ones are in (it was a Suspense, which blanked it).
  • What a move tells the programs beside the site leaves through an outbox (outbox): a state’s mail, the announcement on portal.answers.submitted and a request for money are rows written in the move’s own batch, so each exists exactly when its move does, and a relay beside the site hands them on to NATS as each move is committed, letting a row go once NATS has it. Before, they were published after the move, and a stop or a NATS that was away between the two lost them; now they wait, and go in order when NATS is back. A submission’s record, mail and announcement are one batch, and a submission whose write fails is refused (try again) instead of announced with no record. A notice’s mail and the log’s word that it went are one batch; so are a come-round ask and its mails, a payment and its request, and a request’s going out and the mail that waited for its link. Store::once keeps one relay per store (docs: operations, “What NATS keeps”).
  • Every record and the event log are kept in the site’s store, not in NATS. A submission is its first event and its record in one batch; a desk’s decision, a deadline, a payment’s word, a membership or invite move, a schedule, an announced page and a save from a desk are each their event and the record that follows it, in one batch (answers::write_logged, decide, restate), so a record never says other than its log. The mend that wrote a record back to its log, SETTLE’s quarter-second wait and the warnings about either are gone: there is nothing left for them to do. A decision whose case moved since it was seen is refused with nothing written, as before; a note that lands between a decision’s read and its write makes the decision read again. The ledger takes an event’s postings, statement lines and balances in one batch.
  • Lists in memory follow the store’s commits instead of a NATS watch per bucket: each record a commit wrote in a listed bucket is read again, and a list that falls behind reads its buckets afresh (listing). Fixed on the way: the first read of a bucket could wait forever when its reader was the one that read it.
  • Gone, with no migration: adoption (portal adopt, NATS_ADOPT_LEGACY, <site>_portal_adopted, the gate kit workers waited behind) and the EVENTS stream. A 1.0 site starts with an empty store. portal import, portal ledger rebuild and iris replay --report-only --store <file> open the site’s store, and so run while the site is stopped; iris replay runs its cases in a store in memory, with no NATS. The kit’s approval desk reads and moves its records in the site’s store too, which until dhd/1 means with the site stopped (docs: training, “The owner says yes”).
  • NATS keeps what a site says to the programs beside it: announcements, mail, payments, credentials, the chat’s rooms, the kit’s queue (docs: operations, “What NATS keeps”).
  • Sessions are kept in the site’s store, not in NATS: the sessions bucket of its redb file, which is PORTAL_STORE, or site.redb in the unit’s STATE_DIRECTORY. A site with neither does not start. A sign-in returns before the disk has it, and the store is flushed every minute and as the site stops, so a deploy signs nobody out and a crash loses the last minute’s sign-ins at most. A sign-out waits for the disk. Sessions past their date are deleted once an hour, as the bucket’s max_age did. The sessions NATS kept are not taken over: everyone signs in once, and adoption no longer takes portal_sessions over (docs: operations, “The site’s store”).
  • On SIGTERM the site stops taking connections, gives the requests under way 10 seconds and writes its store before it exits. Before, it was killed where it stood.
  • portal_core::store: what a site keeps, in a redb file of its own. A Batch is one transaction, so a move’s event, the record that follows it, the work it hands a program beside the site (an outbox, read with pending and cleared with ack) and what it holds over time (hold, refused where another holds the thing on any of those days) land together or not at all. A watcher hears what each commit wrote; a lazy batch, for a session or a cursor, returns before the disk has it, and flush takes the lazy ones down. The file says its format and a file of another is refused. It is the store portal 1.0 runs on (docs: design, “Portal 1.0”), and sessions are the first thing in it. bench/ measures what the move buys: a decision takes 7.5 ms on JetStream today, and 1.5 ms on redb with every commit waiting for the disk.

0.20.1 (2026-11-17)

  • Fixed: 0.20.0 never published. The publish workflow ran tools/precompress.sh directly, and the runner’s checkout is a noexec mount; it runs through sh now. 0.20.1 is 0.20.0 published.

0.20.0 (2026-11-17)

  • A narrowing requirement (a feature’s requirements: over its resource:) may carry a value:: what the list is read with until the address says otherwise, so a year’s accounts open on this year with the earlier ones to pick. Its name is a placeholder for a kind: ledger read on the same feature.
  • Fixed: the browser build broke on FINISHED_PARAM naming a server-only constant (0.19.2’s unreleased show-finished fix); the word is spelled on both sides and a test holds them equal.
  • A ledger beside the log (#110). ledger: on a state posts as a record enters it: value from one account to another (from, to; credit and debit on the wire), an amount from the record (a number, a money or number field, a product of two, or payment), in NOK or any unit (stk, timer), with {id}, {year}, {bucket}, {state} and {field} filling account names. ledger: { amount } on a bucket posts every move between the states’ own accounts, so each state is an account. Postings are written on the move’s event and kept as balances and statement lines in portal_ledger; source: { kind: ledger } reads a balance, balances under a prefix (lonn:*), or a statement (an account’s, or a record’s, bounded by since/until). The lint holds accounts and units to shape, {year} off first arrivals, and every form filing into the bucket to the fields a posting reads. portal ledger rebuild rebuilds the projection from the log. Portal never refuses a move for a balance (docs: state machines “ledger”, with dues, invoices, stock, payroll, hours, seats, deposits and a year’s close as examples; content reference; operations).
  • Fixed: a desk’s “show finished” and “show older” showed nothing. The page sends the count as __finished, and the server threw every __ parameter away (the 0.11 fix against a caller naming __user_email) before the list read it. The count is let through, as a number and nothing else; every other __ is still the server’s.
  • The rate limit counts the caller as the proxy saw it. The extractor took the first X-Forwarded-For address, which is the one the caller sends, since Caddy appends its own reading to a header that arrives; a script naming a fresh address per request was never limited. Now the header counts only from a loopback or private peer, and its last entry is the caller; from anywhere else the connection is. PORTAL_TRUST_FORWARDED: private (default), always, never (docs: operations, “Rate limiting”).
  • submit_as, four hundred and seventy lines in one function, is app/submit.rs: Asked (the page, the alternative and the principal once the policy has said yes) with a step each for the answers, one card per person, the check, an invite, the next page, a notice’s audience, the record’s key, a place on a board, and what arriving sets off; Made for the time and the chain hash, and the announcement. The same order, since most of it is the order things must happen in; nothing a site sees changes.
  • AlternativeCard, eleven hundred lines, gives up its fields: app/fields.rs holds FormFields (every field of a form by kind, and responses(), what the form sends, with a test) and RequirementField (one requirement as the form draws it). The four browser widgets (gesture, location, voice, the editor) mount through one mount_widget instead of four copies of the same effect and cleanup. Nothing a site sees changes.
  • The rich-text editor is served by the site: prosekit 0.23.3, its Loro extension, loro-crdt 1.18.0 and loro-prosemirror 0.4.4 bundled at those versions under /vendor/prosekit/ by tools/vendor-prosekit/build.sh into one prosekit.js, with Loro’s wasm fetched only when a collaborative field asks for it and the two stylesheets beside it. Before, prosekit-editor.js imported them from esm.sh at whatever version it resolved that day, and the page’s policy had to allow that host for scripts and styles; now every script is 'self'.
  • Compressed on the way: the publish workflow writes a .br and a .gz beside every wasm, script, stylesheet, SVG and JSON file of the site (tools/precompress.sh), and portal serves the one the browser accepts; everything else (pages, server functions, files with no sibling) is compressed as it goes, brotli, zstd or gzip at level 4. The page’s wasm went over the wire as 2.6 MB with no encoding; as brotli it is 0.7 MB (docs: operations, “Compressed on the way”).
  • A jq: filter runs within a budget: two seconds, twenty thousand values, sixteen megabytes (PORTAL_JQ_BUDGET_MS, PORTAL_JQ_MAX_OUTPUTS, PORTAL_JQ_MAX_BYTES). More values or bytes than that are left out with a warn naming the filter; a filter past its time is stopped between values, or given up on over one value, the page told the budget, and the filter set aside until the next content reload so it costs one thread once. Before, a content author’s repeat(.) pinned a worker thread for every visit to its page (docs: operations, “What a jq filter may cost”).
  • Lists in memory: a list on a page reads its bucket from a listing portal keeps and keeps current by watching the bucket (listing), built on the first visit by replaying the bucket’s history in one stream, instead of one round trip per record on every visit by every visitor. Puts, deletes and purges from any instance arrive on the same watch; a watch that fails drops its bucket and the next visit rebuilds it. One record (key:) and a person’s own records still read the bucket directly (docs: operations, “Lists in memory”).
  • app.rs, which had grown past seven thousand lines, is eleven files under crates/portal/src/app/, one per concern (the frame, a question, suggestions, the widgets, the hero, search, an alternative’s card, a feature’s list, the asks, a desk’s rows, the server functions). Each reads app’s imports through use super::*, and app.rs keeps the shell, App and what the rest of the crate reaches in for. Nothing a site sees changes.
  • Every page carries a Content-Security-Policy: the site’s own scripts, the inline ones Leptos and the hero write, each with the response’s nonce (leptos/nonce), WebAssembly allowed and nothing else that evaluates, inline styles allowed, pictures over https from anywhere, relays over https and wss, no objects, no framing by another site. Every response also says X-Content-Type-Options, Referrer-Policy, Permissions-Policy and X-Frame-Options. PORTAL_CSP replaces the policy whole, {nonce} filled per response (docs: operations, “What a browser may load”).
  • dhd::post: the wire for a state’s post: (#119), ahead of portal’s side of it. A Request (portal.posts.request on the posts stream: who it is for as to: {mail|service|credential}, the template and the rendering, the reading, the deadline) and an Answer (portal.posts.answer: ok, refused or failed, the destination’s words and reference, the rules version). Service metadata gains kinds (courier, typeset, rule) and a courier’s credentials. Nothing in portal publishes or reads it yet; the courier bud does.
  • A list narrowed by its own requirements: on a feature with a resource:, the requirements: are the resource’s, shown above the list as words to search for (type: text, found anywhere in the field, whatever the case) or the chips of a select’s own options: (any of several for multiple). They live in the page’s address under their names (?kind=party,meeting&title=summer), so a link opens the list narrowed. A kv list keeps the records whose field holds what was asked; a url or Gitea source is asked them as query parameters; limit: counts what is left. They only narrow: where: and states: are untouched, and nothing is sent as an answer. The lint takes text, or select with options:, and refuses chain, email, edit and back as names (docs: content-reference, “Narrowing a list”).
  • Removed: bind: on a requirement (a field loading its value from a resource when a sibling changed). One page used it, uhhm’s develop/proposal, which is not open yet; the key is now ignored.
  • Fixed: limit: on a kv list keeps the newest records. A listing leaves the server newest first (the record’s own date, else when it was sent) instead of in the bucket’s key order, which made limit: keep any few.
  • Fixed: a url or Gitea resource no longer gets the signed-in person’s address appended to its query (__user_email, which a kv list’s where reads).
  • A text written together: collaborative: true on a type: prosekit field lets everyone who may change a record (edit: on a list) write in the same text at once, with each other’s cursors and names. The browser runs prosekit’s Loro extension, loaded only where such a field is; the server keeps one Loro document per record and field (/collaborate/{bucket}/{record}/{field}, a WebSocket open to whoever may save the record, same-origin only), applies every update before passing it on, and keeps it in portal_collaborate across restarts until nobody has had it open for ten minutes. Saving is unchanged, one edit event of the text as HTML; another save of the same shared text is no longer “changed meanwhile”. The lint refuses collaborative on any other type and on a form no edit: opens (docs: content-reference, “collaborative”; #127).

0.19.2 (2026-11-15)

  • A desk may change a place on a board: edit: on a list over a bucket with places: is no longer refused. The save changes the board’s ledger first (boards::amend): the place keeps its seat or its turn on the waiting list, counts for more only where there is room (else refused, There isn’t room for 1 more, and nothing is written), and what it gives back goes to the next in line, who gets the seated state’s mail. It stays on the thing it was taken on: the form opens with the slot field hidden, and a save naming another thing is refused. New words: board_no_room_for, board_stays_on (docs: content-reference, “Changing a record from a desk”; state machines, “board and places”).

0.19.1 (2026-11-15)

  • A page’s own words above its suggest-a-change form: responsible.suggest replaces the interface’s line (You are listed as responsible for this question…) on that page, and stands above the conversation where that is on. For a page a change to which means something else, such as bylaws only an annual meeting may change. A list is one per storyline (docs: content-reference, “A question”; #125).
  • Fixed: a list of a bucket portal fills itself (portal_payments, portal_credentials) could not say title: or show:, since the lint knew a record’s fields only from the forms filing into its bucket. A built-in bucket now declares the fields portal writes (fields: on the schema), and the lint holds a list to those where no form says otherwise (docs: state machines, “fields”; content reference, “A resource”).

0.19.0 (2026-11-12)

  • A service asks for its own credentials: source: { kind: asks } lists what the programs beside portal wait to be given (their $SRV metadata waiting, public_key, ask), renders each ask as a form, seals its secret fields to the asking service’s age key in the handler, publishes the given on the new credentials stream and keeps a portal_credentials record with fingerprints only; the service’s word (running, refused) moves the record. The lint requires the listing feature to be behind a group in mfa_groups. dhd::asks carries the shapes.

0.18.12 (2026-11-11)

  • The calendar link under an event list (calendar:) is fetched by the browser again: the client router had taken the click and shown its 404 instead of the .ics feed.

0.18.11 (2026-11-10)

  • Focusing the site search no longer moves the top bar on a skin that pins it to the hero (the copy is lifted by z-index alone, not positioned).

0.18.10 (2026-11-10)

  • A submit whose next page is the record’s own (an alternative there has a self_transition on the bucket) opens that page as the person’s at once, with ?chain= and &email= as the mail’s link has them, so a payment’s standing and link are there the moment they arrive. The page asks again for the link every two seconds while the money service has not given one, and once more after “ask again”.
  • The payment request names the person’s own page as return_url (kept on the payment record), so the money service can send them back there after paying. New words: “Pay now”, “Ready to pay”, “Getting your payment link”.

0.18.9 (2026-11-10)

  • min and max on a type: number field: the box stops at them, and the server refuses an answer outside them as it refuses one of the wrong kind. A place’s count says min: 1 and max: its at_most, so a sign-up cannot say minus one guest (docs: content-reference, “A requirement”).

  • Fixed: a read-only list dimmed every record not in a state named open, so an event (kommer) or a committee (aktiv) read as settled. The server now marks what is in a final state on every list, and only that is dimmed.

0.18.8 (2026-11-10)

  • portal import’s presses may change a record: record: on a submit: entry names it, and fields: only what changes, through the desk’s own save (editing::edit_as), as «Endre» does; the rest of the record stays, and the change is an event in its log (docs: operations, “Onboarding: the desk’s own presses”).

0.18.7 (2026-11-10)

  • Fixed: the site search’s suggestions went under the cards below the header. .hero-copy’s view-transition-name makes it a stacking context level with the page, so no z-index inside it could rise above the cards; while the box has focus or shows something, the header’s copy is lifted above them.

0.18.6 (2026-11-10)

  • Fixed: portal import’s submit: presses skipped an invite made already only by portal’s own membership records, so on a site that keeps its groups in Rauthy (PEOPLE_BACKEND=rauthy) a run again invited everyone again, mail and all. It now also asks Rauthy whether the person is in the group.

0.18.5 (2026-11-10)

  • Fixed: a form on a record’s own page whose action names the page’s key (/komiteen/{key}, /komiteen/{key}/styret) was refused with “this answer is missing what the next page needs”: the next page was filled from the answer alone, and the key is the address’s. It is now filled from the answer, then from the address (content::next_page). An invite sent there was made, and its mail sent, before the refusal; a form keeping an answer kept nothing.

0.18.4 (2026-11-10)

  • Fixed: portal import’s presses ran on a site with sign-in off, so an invite’s mail went to the site’s inbox instead of the person; the site it runs on now reads sign-in, CONTENT_REPO and CONTENT_BRANCH from the environment as serve does, and makes sure the mail stream is there. portal comes-round the same.
  • portal import and portal comes-round log to stderr (warnings and up; RUST_LOG for more), so a press that fails says why: “the account could not be made just now” no longer hides the reason.

0.18.3 (2026-11-10)

  • portal import replays a desk’s presses: a submit: list (a page, an alternative and its fields, in order) is sent through submit_as as someone in one group (--as, else SEED_GROUP, else the board), so a site onboards everyone it already knows by the invites its desks make, from the first person on. Every press is held to what the desk holds it to before anything is sent, and --dry-run says what each would do and which are made already; an invite to someone already in the group, or invited, is skipped (docs: operations, “Onboarding: the desk’s own presses”).
  • Fixed: a desk invite on a page of a record’s own (/komiteen/<key>/styret, «Gi komiteen en leder») was refused with “this page’s address names no scope to invite into” since 0.18.0: the role’s group was read against the address, not the page it fills in (content::pattern_of).

0.18.2 (2026-11-10)

  • A list’s link may wait for a field: link: { to, label, when: plasser } puts it only on records where plasser is filled in, so a list of events where some take sign-ups is one list with “Meld deg på” on those that do. The lint refuses a when that no form filing into the bucket has (docs: content-reference, “A resource”).
  • calendar: <words> on a list of a board is a link under it to /ics/<bucket>.ics, shown only while the list has rows, so nobody is offered an empty calendar. The lint refuses it on a bucket without a board or a board without a plan (docs: content-reference, “A resource”).

0.18.1 (2026-11-09)

  • One search box for the whole site: search: { scope: site } puts it in the header of every page, between the wordmark and who is here, and ranks every option on the site that the visitor may act on (no page behind a case, after a form or under [key]; a qualifies group’s pages only for its members). Enter goes to the nearest card, on this page or another, and lists the nearest three under the box with their pages’ questions; Enter again goes to the next. The header row is then three slots spread edge to edge, the session’s of a fixed width, so a sign-in or a long name never moves the wordmark. pages: is refused beside it; scope: page, the default, is the box as before (docs: content-reference, “One box for the whole site”; #35).

0.18.0 (2026-11-09)

  • A record’s groups: groups: on a bucket gives each of its records groups of its own while it is open, named <bucket>_<key>_<name> (committees_traffic_lead). That one name is the group in Kanidm or Rauthy, in the token’s groups claim and the group’s room in the chat. A new record is kept under its short name (groups.key, refused when taken), and is its groups’ key. A [key] page names one with a gap, committees_{key}_member, in qualifies, requires_group and invite.group; a desk for it moves only the records of that record (or that belong to it); a group that manages others invites into them, for its own record only. Opening makes the groups, and in Rauthy the admin roles of a group that manages others (rauthy_admin:committees_traffic_*), which go with being put in it and leave with being taken out; closing empties the groups. Every open record’s groups are made at start and on reload. The policy decides it with a Cedar Record entity whose tags are its groups; a member of one committee meets nothing of another’s, and a held name with a gap is no group (docs: state-machines, “groups”; access, “A record’s groups”; rooms).
  • grants: takes a list, a name with a gap filled from the record (committees_{key}_member: this record’s or its parent’s; committees_{committee}_member: that field), and { group, email, name } to grant to someone the record names other than its own person. A record’s group is granted only while its record is open. revokes: takes a gap too (docs: state-machines, “grants”).
  • Several fixed pages may sit under a dynamic directory ([key]/lead.yaml, [key]/board.yaml); only [name].yaml files compete for an address.
  • A Rauthy key for a site whose records have groups needs read, create and update on roles.

0.17.3 (2026-11-09)

  • A slide’s caption sits on a lighter scrim (0.38 black at the foot, gone by the middle, was 0.72), with a wider shadow under the text, so it is no longer the darkest, highest-contrast spot on the page.

0.17.2 (2026-11-09)

  • A page with a place and no pictures has its maps in the header’s strip, the full width as pictures are, instead of a strip of its own in the text column under the question, where one pin read as a lone, cropped card.

0.17.1 (2026-11-08)

  • A page’s place may be several points: type: pins (a map per point, each a slide in a strip, even one), area (one map, the points as a shaded outline) or path (one map, a line through them), with follow: walking, cycling or driving drawing a path along the ways from Mapbox’s directions, fetched once per route. The map of an area or a path comes from this origin (/map/shape/...). The single place: { lat, lon, zoom, name } reads as one pin, so no content changes (docs: content-reference, “A question”).
  • A list may choose what its rows show: show: [kort, leder] makes a row its title and those fields (the record and its own page keep the rest), and meta: false leaves the state and the time out. For a public list where a long text, “active” and an import time drown what the reader came for. The lint refuses a show field no form has (docs: content-reference, “A resource”).

0.17.0 (2026-11-08)

  • Groups that need a strong sign-in: site.yaml mfa_groups count only when the token’s amr holds mfa, hwk or swk (Rauthy: a passkey). A weaker session has them held back, and their pages say why, with a link to add a passkey (account_url, or Rauthy’s account page) and one to sign in again (/auth/login?fresh=1 asks the provider anew). The chat’s question carries strong, and portal holds the groups back from an asker that does not say so. A name no page uses is refused (docs: operations, “Groups that need a strong sign-in”).
  • The rich-text editor’s “Repo” button, and a pasted repository link turned into a card, are off unless site.yaml says editor: { repo_cards: true }, and then point at the Gitea the content comes from rather than project.uhhm.no. Elsewhere /gitea-repo answers 404. A card already in a text still shows. A site that used the button sets repo_cards: true to keep it (docs: content-reference, site.yaml).

0.16.0 (2026-11-08)

  • profile_save: true on a profile: field saves what the signed-in person gives on their account, where what makes the accounts keeps it (Rauthy), after the answer is filed; the field says so. email and name are not changed from a form, and the lint says which claims may be saved (docs: content-reference, “A requirement”).
  • profile: on a form field starts it from what the signed-in person’s provider says of them (phone_number, the address’s parts, birthdate, the names), and leaves it asked. Sign-in asks for the scopes the content’s fields need (phone, address) only where the provider’s discovery lists them, so Kanidm is never asked for one it would refuse. A misspelled claim is caught by the lint (docs: content-reference, “A requirement”).
  • PEOPLE_BACKEND=rauthy: Rauthy holds the groups, as Kanidm does with kanidm, and portal still decides what each may do. Invites, grants, revokes, the first person and the people named as responsible put a person in a group there, made if missing; a desk’s removal takes them out. Sign-in asks for the groups scope; the chat’s question and a desk’s member list read Rauthy when they are asked. The content does not change, and Kanidm and memberships are as they were (docs: memberships, “Groups in Rauthy”).

0.15.0 (2026-11-08)

  • Sign-in through any OpenID provider, and accounts made in Rauthy. OIDC_ISSUER names the provider by its issuer and wins over KANIDM_URL, which stays the default and may stay for making accounts. With PEOPLE_BACKEND=memberships, RAUTHY_URL and RAUTHY_API_KEY make Rauthy stand where a Kanidm beside memberships did: an invite, grants, the first person and the people named as responsible get an account by their address if they have none, and Rauthy mails them how to set a password in RAUTHY_LANGUAGE (nb for Norwegian). Groups stay portal’s (docs: memberships, “Rauthy”; operations).

0.14.2 (2026-11-07)

  • A page with both a place and a slideshow shows the map as the strip’s first slide, as wide as the strip, with the pictures after it. Before, the strip ran across the top and a small map stood on its own under the question (docs: content-reference, “A question”).
  • A crowd taking places on one shift at once all gets an answer: a write that lost the race tried again after a fixed wait that was the same for everyone who lost with it, so they met again in lockstep, one seated per round, and past 32 rounds the rest were told the board was busy. They now wait a random moment that grows (up to 64 ms) and keep trying for five seconds, not a count of tries. It showed as the 40-at-once test failing now and then.

0.14.1 (2026-11-05)

  • A desk hides what is finished: of the records in a final state (one the bucket’s state graph has no move out of), a desk list shows none until “Show finished” asks for the newest ten, each “Show older” ten more, and “Hide finished” folds them away again. It showed the newest three, which on a desk with a few busy lists was most of the scrolling, for records nothing more can be done with. A state with a move out (a lead that failed, one sent and waiting for won or lost) is not finished and stays, and a list without buttons is shown whole as before.

0.14.0 (2026-11-05)

  • Three binaries, one version. bratac is the trainer and the kit worker: every command portal plan, portal build, portal interview and portal job had, with the same flags, the same KIT_* environment and the same files, and PORTAL_COMMAND read the same way, so a kit worker’s unit only changes which binary it starts. iris is the lint on its own (check, replay, map, manual). portal is the site, and still answers lint, iris, map and manual, so a content repo’s pinned lint keeps working; portal plan and portal job say where they went. All three ship in the release tarball and as bare binaries (portal-x86_64-linux-bratac, -iris), and the release checks each says the tag’s version. Under them, portal-core is the instance - content as the server keeps it, records and their state machines, mail, people, access, boards, rooms, memberships, notices, payments, learn and the search ranking, the lint - and portal-content what content means, which the browser compiles too; the site depends on bratac for the interview engine behind the card and the chooser behind the search box, and nothing in bratac or iris knows the server exists. Every module keeps its path (portal::mail is portal_core::mail), so nothing built on portal changes (docs: architecture, operations, training; proposals/2026-11-three-binaries).
  • Who is beside this portal is asked of the bus, not told by the deploy: every few seconds portal broadcasts $SRV.PING and keeps what answered with the metadata each service says about itself (dhd::srv: the service names, its site, a money service’s providers, the mail gate’s calendar), said in the log as services come and go. Portal registers itself the same way, as portal with its site and the wire’s version, so the programs beside it see it too (docs: architecture).
  • A payment request names its provider: from what the money services on the bus say they have keys for, Vipps for a Norwegian mobile number it can push to, else a card through Stripe, else what is there; fixed on the payment record as provider, and None while no service has answered, for whichever comes. A kron for another provider leaves the request alone, so a site may run one kron per provider (docs: state machines).
  • A state’s mail may be about a time: event: under mail: names the record’s field holding when it starts (type: date for a day, type: datetime-local for a time in the site’s zone), optionally when it ends, a title and a location over the mail’s variables; portal puts the event on the message in ISO 8601 as the person meant it (a civil time with the site’s zone, or a day), under one uid per record and state, and gdo carries it as an invite and onto a calendar when it has one. The lint wants the fields collected by every form filling the bucket. A gdo from before events sends the mail as before (docs: state machines, mail).
  • /sitemap.xml and /robots.txt, from the content: every page a stranger may read (no qualifies, no requires_chain, not a follow-up, not dynamic), as absolute URLs under PUBLIC_URL or, unset, the host the request came to; robots allows everything but /auth/ and /api/ and names the sitemap. Both used to answer with the app shell, which told a search engine nothing (docs: operations).
  • The lint takes {payment_url} in a paying state’s mail as the built-in it is; it refused it as a field no form collects, while the validator already refuses it on a state that asks for no payment.

0.13.0 (2026-11-05)

  • The repo is a cargo workspace. Making the content, presenting it and verifying its integrity are three jobs, and only the middle one needs Leptos, axum and the AWS SDK; this is the room for the other two. crates/portal is the site, lib and bin as before; crates/content is what content means (no NATS, no HTTP, no Leptos, so it compiles for the browser too); crates/core is content as the server keeps it; crates/dhd is the wire. One version across them, one tag, one tarball, and cargo test --features ssr at the root runs every member. learn stays outside on purpose (its own manifest says why). The lint and the trainer still ship inside the portal binary; their own binaries, iris and bratac, are the next steps, not this one. Nothing changes for a deploy: the same portal binary, the same tarball, the same portal lint.
  • A session lasts 90 days from its last use, PORTAL_SESSION_DAYS to say otherwise. No expiry was set before, which left the cookie’s default - gone when the browser closes - so a phone that closed its browser signed its person out; the session bucket keeps a record 120 days now, and an existing bucket is brought to that on start (docs: operations).
  • A link dressed as a button (.alt-submit on an <a>) ends in an arrow, since it goes somewhere rather than doing something, and keeps its button look when hovered on every site: a content stylesheet’s bare a:hover used to outrank the class and wash it in the link colour with the button’s own text still on it.
  • The names and shapes portal shares with the programs beside it on NATS are their own crate, crates/dhd/ (the dial-home device): the streams, buckets, subjects and durable consumers, and the records and messages on them - Answer, the event log’s Event and the portal.answers.submitted announcement, the mail gate’s Outgoing and Incoming, the money service’s Request and Changed and how a payment record is read, the rooms’ GroupDoc, Said and Thread, the access Query and Decision, a board’s Ledger, the chain’s node and hash, hash16, and how a site’s names are prefixed on a shared account. No NATS client and no web framework in it, so gdo, kron, cnats and whatever reads the event log next depend on it from this repo (package = "dhd") and bring their own. Portal depends on it and every module re-exports what it owned, so nothing built on portal changes, with three exceptions: access::Principal::from_user is access::principal_of, a board’s fill speaks through the answers::FillWords trait, and a ledger is seated through the boards::Seating trait (docs: architecture, README).
  • revokes: on a state, the mirror of grants:: the person the record is about is taken out of the group as the record arrives. A household that leaves, or a year’s dues nobody paid, ends the membership by the same decision that says so; nobody has to remember to remove them. Through memberships the record moves to removed and stays; through Kanidm the person is taken out by address. A state grants a group or revokes it, not both, and the lint wants a form filling a revoking bucket to collect a required phone or email.
  • The lint’s rules for grants: and invite: accept the names forms actually use for a name and an address: navn beside name, epost beside email, the phone names likewise - the same lists the grant itself reads a record by. Before, a Norwegian form was told to collect a name it had collected as navn.
  • A payment’s request goes out, and what comes back moves the record. With PAY_URL in the deploy (the money service, kron, is there), payment: may leave by_hand: true out, and as the record is made its request is published on the payments stream (portal.payments.request: v, id, site, amount, currency, text, phone, email, expires_at, the reference as the message id). The service’s words come back on portal.payments.changed, read through a durable consumer per site (portal-<site>-payments-changed): requested keeps psp and url on the record, paid, failed, expired and refunded move it; a word for another site, under an unknown v, for no payment, or naming another amount or currency is left alone and logged, and one delivered twice is one event. A paying state’s mail: may say {payment_url}, the service’s link or the person’s own link, and with a service waits until the request is out. The person’s own link shows the latest payment where it stands, and after expired or failed offers a new request under the next reference. The lint refuses {payment_url} on a state without payment:, and payment: without by_hand where PAY_URL is unset (docs: state machines, operations, mail; step 2 of the payments proposal).

0.12.1 (2026-11-03)

  • A list names its title field: title: navn on a resource: shows that field first and larger on every row, with no field name over it and not again among the fields, and makes it the heading of a card instead of the first text. The lint holds it to a field some form filing into the bucket has, and not a prosekit, file or location one (docs: content reference).
  • A payment is a record. payment: { amount: 250 | { field: belop }, text, then, expires: { days }, by_hand: true } on a state makes a request in the built-in portal_payments bucket as a record enters it, by a form, a desk, a clock or a move portal makes (so comes_round asks again each round), with the amount fixed then: reference, owner, amount and currency in minor units, text, phone and email from the record, psp, by. States requested, paid, registered, failed, expired, refunded, each change an event in its log. When a payment is paid or registered, portal moves the owner to then itself, stamped payment:<reference>, with then’s mail and grants; expires withdraws an unanswered request and nothing else. A desk lists the ledger like any built-in bucket, with registered as its one button; paid, failed, expired and refunded are the money service’s, which is not built yet, so the lint requires by_hand: true and refuses a desk naming them, a then that is not a declared move from the paying state, a { field } that is not a required type: money field, a form into the bucket with no required phone or email, and a desk button, own link or clock into then from the paying state. New form type money: whole kroner, none below zero (docs: state machines, content reference; step 1 of the payments proposal).
  • 0.12.0 was tagged with an empty changelog section, so nothing was published under it; this is that release.

0.11.2 (2026-11-03)

  • A rich text field on a list takes the whole row, under the short fields, at a reading width. It used to take one column of the field grid, 320px wide and as tall as the text made it.
  • A place on a board may count for more than one seat: count: antall, at_most: 4 on places: names a type: number field on the sign-up form (empty counts 1; 0 or more than at_most is refused at submit, with words saying why). The ledger sums counts against capacity, a place is seated only whole (one that does not fit waits, or is refused without a waiting list, and a smaller one later in line may pass it), the row’s fill and waiting list count seats, and the lint requires at_most with count, a type: number field of that name on the form, and no needs on the board (docs: state machines, content reference).

0.11.1 (2026-11-02)

  • A security fix, for every site: a list’s edit: holds a save, a record’s history and the form opened to change a record to what the list shows that person, as a desk’s move is held to its desk. The policy’s edit is on a whole bucket, so a group allowed to change its own cases through a list with a where could change any record in the bucket, or read its history, by naming it in a request; edit_record, record_log and ?edit= now refuse a record the list does not show (where, states, key), on a [key] page too.
  • A security fix, for every site: a hidden field filled from the page’s address (value: "{key}") holds what the address gave, whatever the browser sent. A form on committee A’s page could file a record under committee B by sending B’s key in the belongs_to field; the server now writes the key from where the form was sent.
  • The sign-in line at the foot arrives with the page it ends. It was the only thing showing on the empty page between two.

0.11.0 (2026-11-02)

  • A form’s inputs now belong to its form: the browser holds them to required and their type before sending, and Enter sends. They sit in the feature cards and the form held only Send, so none of this worked. A file already on one’s own card is not asked for again, and moves pressed on a desk don’t wait for empty fields.
  • A form is held to what it asks on the server too. A POST with no required email used to be kept as it came: submit_answer now refuses a field that is not optional and has no value, and a value that is not what its type says (an address, a number, a date, a time, a URL, a choice from options, a place on earth, a file key), before anything is made or kept, naming the field by its label in the site’s language. A file already on one’s own card counts, a hidden field is held only to what the content gave it to carry, and a required location or select, which no browser input stopped, is refused now too (docs: content reference).
  • A missed link no longer strands a person. Inviting someone whose account, found by their address, has nothing to sign in with now makes a new one-time link and mails it, whether the invite is through Kanidm or a Kanidm beside memberships, rather than “log in, your place is there”. The invite waits on that link like any other, and the link is in the mail only, never on the record a desk reads, since the account may already hold places. “Ta ut” and then “Inviter igjen” (removed to invited) on a desk listing portal_memberships used to send nothing, and now sends what an invite sends. Someone who can sign in gets no link: Kanidm’s credential status does not list passkeys, so it is asked again of what signing in offers them, and anything but a plain “nothing” means no link. “Send again” on an expired invite holds to the same. An invite no longer sends mail to nowhere for someone known by phone alone.
  • A shared phone no longer locks out a paying member. A number typed on a form proves nothing, so a grant with a number another record in the group holds and an address of its own is another person: they get a place by their address, the number stays with the record that had it (theirs keeps it as phone_given), and they are let in at sign-in. A person is known by phone alone only where nothing says otherwise, and on a sign-in that proves it. A record found by number that had no address gets the one given. Taking someone out finds their record the same way.
  • A phone number is read right on a Norwegian site: 4748571123 is +4748571123, not +474748571123. Only ten digits starting 47: eight digits starting 47 are an ordinary number. A record stored as +474748571123 still finds its person.
  • An invite mail names the group as a person reads it, in Norwegian and English: “invitert inn i Medlemmer”, “plass i Kasserer”, not the raw name, in {group} of the mail the content writes too. The same word as the chat’s rooms and the question nav (rooms::group_label).
  • What someone signed in meets where they have no place no longer speaks of owners, which was wrong for an ordinary member whose place is on another address: “Dette er for dem som har fått plass her, og det har ikke kontoen du er logget inn med. Er du invitert, logg inn med adressen invitasjonen kom til.” / “This is for those who have a place here, and the account you are signed in with does not. If you were invited, sign in with the address the invitation came to.”
  • portal lint warns when an invite: form asks for no address (invite-no-address): no invitation can be sent, and only a sign-in that proves the number lets the person in. A warning, since a site with a provider that proves phone numbers is legitimate (docs: lint).
  • A bare address in a mail is a link in its HTML part: a notice’s stop link, an invite’s one-time link, a state mail’s {link}. The plain text is as it was.
  • Docs say what the code does: a grant goes through the same call as an invite, a Kanidm beside memberships included (state machines, memberships); a desk’s invite on memberships is a place in portal_memberships, not a case in portal_invites (getting started); a grants form must ask for email, an invite’s for email or phone (state machines); the may example has its groups (memberships).
  • A desk’s where holds for what it moves as well as what it shows, and a person must be someone the desk is for. A rule of the policy is a move on a whole bucket, so anyone in a group with a button on portal_memberships could, by naming a record or another desk in a request, take anyone out of any group: a committee member, the board’s chair. transition_answers now refuses a desk the person may not read and a record it does not list (docs: content reference).
  • A type: location field does what it promises. Without MAPBOX_TOKEN it is two number inputs, “Breddegrad” and “Lengdegrad”, where it was an empty box and null on the desk, and a stored place on a desk or list is its coordinates, with no broken image. With a token, a direct visit loads MapLibre: map.js now loads it itself, where the page’s tag only reached the browser on a client-side move. A map that will not load says so in the site’s language rather than in English, and asks for the two numbers (docs: content reference).
  • A type: prosekit field is safe to show and reads as written: what it holds is cleaned against one allow-list when it is written and again when it is shown (paragraphs, headings, lists, emphasis, and https, mailto and tel links marked nofollow ugc; ammonia, on the server only), and lists, desks, cards and record pages show it as text with its shape instead of as a plain answer. In a mail the HTML part carries the message and the plain part reads as text: it used to lose the one and show <p> in the other. A plain answer keeps today’s rules, and a picture stays a type: file field beside the text (docs: content reference, mail).
  • where finds a choice among several: equals on a multiple select holds when it is one of the choices, and any_of: [a, b] in place of equals holds when any is, on a list and on a notice’s audience. A notice’s equals: "{tema}" naming its own field with several choices asks for any of them. It never matched a multi-select before (docs: content reference, state machines).
  • A list may let its group change a record’s fields: edit: on the resource says who (the list’s group by default) and which form (page, alternative, when more than one files into the bucket). “Endre” / “Change” opens the same form filled in, a file stays unless a new one is chosen, and each save is an event in the record’s log saying who changed what, before and after, by field, read under “Historikk” / “History” on the row. It goes through what a submission goes through. The state does not move and no mail goes. The policy has an edit action on Bucket (edit:<bucket>:<group>), which portal lint --access lists, and the lint refuses a list naming no form, no group, a bucket with no log, a place on a board, or a form the group may not open (docs: content reference, access).
  • on: on a recurs: series names the dates it falls on as people say them: { nth: 1..4|last, weekday, month? } (first Saturday in June, last Sunday in January, first Monday of every month), { nth, weekday, before: "MM-DD" } (the fourth Sunday before 25 December is the first in Advent) and { month, day }, with at: "HH:MM" as {due_at}, on the site’s calendar in its timezone:, through the changes of the clock. every: { years: 1 } is new, and every may be left out with on. The lint refuses a fifth weekday, 30 February and 29 February. The map and the manual say it in words, in bokmål and English (docs: state machines).
  • comes_round: keeps one record that returns, where recurs: opens a new one: date, on, at, shows, out, back. Portal moves it out shows days before, writing the computed date into the field, and back when the date has passed, through restarts and second instances without doing anything twice. With no on, asks: { month, day } and handled_by say when and whom to ask: the group is mailed once a year, the row says “Mangler dato” / “Needs a date”, and it goes out only when someone sets one. It can be changed at any time, in either state, with edit:. The lint checks the states, that both moves are declared, and that the date field and the desk exist; the map and the manual say it in words (docs: state machines).
  • belongs_to: on a bucket says its records belong to a record of another, and owner: whose a record with no parent is: a named group, in the same field, so a board’s past documents are found as a committee’s are. A [key] page lists a parent’s own with where. Submissions and saves are held to it, closing a parent hides nothing, and the lint refuses leaves_after on a parent, a form that cannot say whose, an owner no content names, and a circle (docs: state machines).
  • portal import --path questions <file> [--dry-run] starts a site filled in. The file is nested as the content is, a committee with what is its under it, or a named group with its own, with at, source and file beside state and fields. It goes through what a form is held to, all of it before anything is written, and one thing wrong writes nothing; a dry run writes nothing either. A record’s at is a field of its own that a list sorts by and shows, so a 2019 record says 2019 and sorts there, and the log’s order is not touched; its event says it was imported and from where. No mail, no grants, nothing announced, no clock: it lands where it says, and stays until a person moves it. Ids make a second run change nothing, and a field that differs is reported, not overwritten. People are refused, as are places on a board and a notice about to be sent. It names buckets by SITE_NAME as the site does, refuses a named site that has not started and adopted, and takes its address from NATS_URL, with no default (docs: operations, content reference).
  • portal comes-round --path questions [--at <time>] makes one pass of what comes round, by hand, or on a test clock with PORTAL_TEST_CLOCK=1 (docs: operations).
  • A file opens from a list on a [key] page (where: { equals: "{key}" }), where it used to answer 404 to everyone, and no longer from a public list whose states: do not show its record (docs: operations, attachments).

0.10.4 (2026-11-02)

  • What a person reads no longer names what the site is built from: failed invites, invites not being set up, a mail that could not go out, session errors and an approval’s outcome say what happened in plain words, and the manual says “chatten”, not cnats. Logs keep the details.

0.10.3 (2026-11-01)

  • A site with sign-in ends every page, the gates and the nothing-here included, with a quiet line of its own (<footer class="session-foot">). Signed out it is a link to sign in that returns to the same place: “Log in for questions your role can answer” / “Logg inn for spørsmål rollen din kan svare på”. Signed in it is the last thing on the page: “Signed in as Kari · Log out” / “Logget inn som Kari · Logg ut”. A site without sign-in shows nothing. The header’s .session nav stays, and a site’s stylesheet that hides .session does not hide this line; hiding .session-foot does (docs: content reference).
  • The question nav is split in two. “Also worth asking” / “Også verdt å spørre” holds the pages open to anyone; a new line under it, “For your group” / “For gruppen din”, holds the ones the visitor sees because of a group they hold (qualifies), named by the group’s label when one group applies (“For Board” / “For Styret”). list_qualifying_questions now returns { "entries": [{ "id", "name", "group" }] } instead of a list of pairs. A signed-out visitor’s list is as before, and a line with nothing on it is not drawn (docs: content reference).
  • Someone signed in who meets a gate (a qualifies they do not hold, a requires_chain) no longer finds “Sign in” in the header there: the gate’s header was not told who is here. It now names them and offers the way out, as on every other page.

0.10.2 (2026-11-01)

  • An announced event’s date and how soon it starts follow the site’s lang. A Norwegian site’s banner said “Wed 18 Nov, 18:00 · in 18 days”; it now says “ons. 18. nov., 18:00 · om 18 dager”, and “i morgen”, “om 4 timer”, “om 20 min” and “nå” for the nearer ones, counted in the same calendar days as before. English sites, and any lang the portal does not speak, read as they did. The numeric timestamps on a desk’s rows (2026-10-26 08:16 UTC) stay as they are, the same in either language.
  • A PDF under /site/ is served as application/pdf, so a browser shows it rather than only downloading it. It was application/octet-stream.
  • The showcase spread no longer says a sketch was built from a public description of the work, which is untrue of one not made from a listing: “Dette er en skisse som virker, under et oppdiktet navn.” (“This is a working sketch, under an invented name”). That the name does not exist and no organisation uses the sketch still stands.
  • The showcase edition says how conversations follow responsibilities: a short section, “Samtalene” (“The conversations”), after the roles, naming each role’s room as the chat names it. The new, optional portal manual --chat-url <url> ends it with where the chat can be tried; without it, it says the sketch runs without a chat. A site with no groups leaves it out, and the owner’s edition never has it (docs: manual). A chapter’s opening words now stay on the page with what they open, in both editions (#lead): in the showcase, “Hvem gjør hva” and “Slik får dere med mannskapet” each ended a page on their heading and opening words alone.
  • group on invite: is optional. An invite with no group (invite: {}) makes the account, sends the mail with the one-time link, and joins no group; someone with an account already keeps it and is told to sign in. It is a case in portal_invites on the desk that lists it, and portal.people.invited carries group: "", as for someone responsible with no group. The compiled policy gives it to the page’s own group with a rule of its own (invite on accounts, invite-account:<group>), which opens no group; groups_named names none for it, so it makes no room. The map draws it as “a new account”, the manual has a row “No group” and a sentence on the role, and the mail words speak of the account alone: its own mail must name {link} and cannot name {group}, and site.yaml’s mail.invite stands only if it does the same. An account comes by address, so the form must ask for email. A site on memberships with no Kanidm beside it has no account to make, and portal lint refuses it there (from PEOPLE_BACKEND where the lint runs, else a desk listing portal_memberships), with an error at start and a refusal at the desk for what gets through (docs: content reference, memberships, access, mail).

0.10.1 (2026-10-31)

  • With CHAT_URL set, anyone signed in gets a link to the chat after the “Asked by” line: “Åpne chatten” (“Open the chat”). Signed out, or with no CHAT_URL, the line reads as before (docs: rooms).

0.10.0 (2026-10-30)

  • A group is a room in the site’s chat (cnats, one beside each site), and portal speaks in it (docs: rooms; proposal 2026-10, “a group is a room”). At start and on every content reload, every group the content names (qualifies, requires_group, an invite:’s group, grants:, a schedule’s handled_by and for_each.group, a notice’s senders and group audiences, a board’s plan: group, a responsible:’s group) is written to the KV bucket <site>_portal_groups, one key per group: its label in the content’s words, the site, its title, address and language, the room’s subject <site>.chat.room.<group>, its duties and its desks with absolute URLs. A group the content no longer names is deleted; a name that cannot be a key and a subject token is left out with a warning. Without SITE_NAME, the bucket is portal_groups.
  • A group’s duties are the sentences portal manual writes for its role under “Who does what”, as plain text in the site’s language: the sentences are one function (lint::manual::role_sentences) that the manual’s Typst and a room’s plain text both read, and the roles one (lint::manual::role_parts). The manual is the same as before, byte for byte.
  • The compiled policy has a Room resource and a post action: each group the content names may read and post its own room (room:<group>), and nothing else grants a room. iris check --access lists the rules (group kildetjenesten | read, post | room kildetjenesten); the map and the manual leave them out. portal.access.<site>.may answers { "kind": "room", "name": "<group>" } like any other resource, with the granting rule or a refusal, and a post is published on portal.access.decided like any other mutation (docs: access, “Rooms”).
  • The site says what a group needs to act on, on <site>.portal.rooms.<group>: landed when a record is sent in, or moved by anyone but the group itself, into a state the group’s desk holds (lists, with a button from it); moved when a member of another group or the sender moves a case the group’s desk listed somewhere it has nothing to do; clock_soon when a state’s after: clock runs out within a day; clock_ran when it did and moved the case; opened when a schedule opened records for its handled_by (several in one pass are one message). Each carries a stable id (<site>:<bucket>:<record>:<kind>:<n>, n the record’s place in its event log), the case with a link to the desk that shows it, and a sentence in bokmål or English after the site’s lang, with the content’s words in it: the choice the case was sent by, its first two short answers by the form’s labels’ order (never an address, phone number, long text or file), dates as the site says them, states by their text:, and the day a clock runs out in the site’s time zone. Said where the move is made (a submission, a desk’s button, the sender’s link, the clock sweeper, portal’s own moves, the schedule sweeper), never by reading the event stream from outside.
  • The case’s conversation on the desk: the chat says on <site>.portal.rooms.thread when a case has a thread, and portal keeps the latest per case in <site>_portal_threads (key <bucket>.<id>). The case’s row then links to it, “Samtale i Kildetjenesten (3)” / “Conversation in Kildetjenesten (3)”. With the new, optional CHAT_URL, a case with no thread yet links to ${CHAT_URL}/room/<group>/case/<bucket>/<id>, “Start en samtale” / “Start a conversation”; with neither, nothing. A desk’s row carries the record’s id as its id, so a room’s link to …#<id> lands on it (docs: operations, “Rooms”).
  • What the site says in its rooms waits while the chat is down: portal owns a stream <site>_ROOMS on <site>.portal.rooms.> (plain ROOMS without SITE_NAME; file storage, kept 7 days, duplicate window a day), made at every start, and publishes into it through JetStream with the message’s id as Nats-Msg-Id, so a message counts once the stream has acked it and a restart’s repeated clock_soon is stored once. The chat reads it with its own durable consumer (<site>-cnats-relay). The chat’s thread notices are in the same stream, and portal reads them with a durable consumer of its own (<site>-portal-threads) instead of a plain subscription, so a notice sent while portal restarts is not lost (docs: rooms, “What the site says”).

0.9.1 (2026-10-29)

  • A request dropped mid-page no longer leaves panics in the log. When a reader (or a crawler) left before a page’s data came, one worker tore the request’s reactive owners down while another, woken by the data, was still building the page into them; the builder found no NavRes, AnnounceRes or Lang context and no router, and panicked on its own task, three lines each (“expected context of type …”, “You cannot call use_navigate outside a <Router>”, “Tried to access a reactive value that has already been disposed”). Nothing reached anyone, since the response was gone, and no check in the page can close the window. Those panics are now one debug line on portal::render (“a render outlived its request”); every other panic is reported as before. It showed on uhhm.no, redoal.com and the previews as a panic “at the first request”.
  • The map draws its recurrence mark rather than writing “↻”, and its “Recurring” lines say “kept in <bucket>” (“lagres i”) rather than “→ <bucket>”: a font without those glyphs, as in the manual’s PDF, showed a box. A state a schedule opens records in reads “every 8 weeks · to arrange” (“hver 8 uker · avtales”) beside the mark.
  • The manual keeps a section’s heading and opening words on the page with its first item: “Plasser og ventelister” no longer ends a page with its places on the next. The schedules, notices and places sections’ leads stick to what follows (#intro).

0.9.0 (2026-10-29)

  • portal manual --path questions [--out manual.pdf] [--typst-only manual.typ] [--map map.svg] writes a site’s own handbook for the people who lead and run it, as Typst and PDF: a cover with the wordmark (an SVG the repo holds), the front door’s line on what the site is for, the date and the content’s commit; how it works, with the front door’s choices and portal map‘s drawing on a sheet of its own (A4, A3 or A2, whichever keeps its words legible); each need from needs.yaml from the door to how it ends (the fields by label, the list it lands in, who takes care of it on which desk, every state in the business’s words with the mails it sends and the buttons, own links and clocks that move it); the roles from the compiled access policy in sentences; bringing in the crew (the first person, how an invitation goes with the invite mail as the content words it or portal’s own, the link’s 24 hours, the passkey, who invites whom from which desk, the grants: that make members); schedules, notices and places where the content has them; suggesting a change; and the responsible contact. Every name, field, state and mail is quoted from the content; the sentences around them are written by hand in bokmål or English after site.yaml lang, with no model. The accent is taken from the stylesheet’s --accent/--primary (the light scheme’s, deepened to print), else a neutral slate; the fonts are free ones, cut to what the machine has. A site without needs.yaml gets no empty chapter, a site without invites is told how people get in, and a missing Typst is said plainly (--typst-only writes the source without it). --edition showcase [--author] [--preview-url] [--repo-url] adds a short spread for a sketch under an invented name (what it is, where it runs, what it covers and whether the lint holds it, who made it) and keeps to about twelve pages. The .typ is the same for the same content; the fixtures’ are held in tests/fixtures/manual/ (docs: “A manual for the people who run the site”, with a README link and an optional CI job that keeps map.svg and manual.pdf current).
  • portal map’s loading is one function (lint::map::load) that the manual shares, and the invite mail’s words are one function (mail::invite_text) that the site’s mail and the manual both read.
  • Sites on one NATS account keep apart. A site with SITE_NAME keeps every KV bucket, stream and subject it owns under that name: members is <site>_members, EVENTS on events.<bucket>.<id> is <site>_EVENTS on <site>.events.<bucket>.<id>, KIT_JOBS is <site>_KIT_JOBS on <site>.kit.jobs (status <site>.kit.status.<id>), sessions are <site>_portal_sessions, and portal.content.reloaded is <site>.portal.content.reloaded. The namespace is SITE_NAME lower-cased with _ and anything but letters, digits and - made -; portal, events and kit are refused. Every bucket and stream goes through one place (namespace::Js), so none is reached by a plain name by accident. What programs that are not a site read stays account-wide: the mail stream and gdo’s portal.mail.send / portal.mail.received (each site’s consumer was already portal-<site>-mail-received; a reply names a bucket by its plain name and each site looks it up in its own namespace, so gdo changes nothing), ANSWERS and portal.answers.submitted, portal.access.<site>.may, portal.content.reload, the notifications, and learn serve’s subject. Unset SITE_NAME, nothing changes. Before, uhhm.no and redoal.com shared EVENTS, portal_sessions, portal_events, portal_memberships, and the previews each other’s notice opt-outs (docs: operations, “Sites sharing a NATS account”).
  • A site with SITE_NAME takes what was its own out of the plain names once, at start, before it serves or writes (NATS_ADOPT_LEGACY): all takes its content’s buckets that have records, whole, each claimed first in the account-wide portal_legacy_claims so a bucket two sites’ content named alike is refused to the second until its operator says -<bucket> (a refused start gives its claims back); portal’s own buckets record by record (by the page and alternative a record was made on; memberships, seeds and invites by the decision that granted them or the people the site itself names, never another site’s first person; notices, opt-outs, cursors and places by the bucket in their key; a change’s talk, page lock and last-applied by its page; a record both sites can claim goes to both); sessions one at a time, when the browser that holds one presents it, moved out of the plain bucket; its events from EVENTS at the same sequence numbers, so a record’s place in its log and a desk’s “seen” stay right; and the kit’s waiting jobs to the site with an interview. sole takes everything (a site alone on its account), none nothing (a site new on one). A site that finds plain objects and has no decision refuses to start, saying which. Everything else with the site’s SITE_NAME waits until it is done: the kit worker waits, portal job enqueue|file and portal lint --replay refuse; a writer that does not wait stops the event copy rather than take a plain event’s number, and the decision then says stopped so every restart refuses with what to do; a copy taken up again first checks that the site’s log ends with the message it left there. A copy cut short is taken up only as it was begun; an own log that has counted already, even emptied, is refused; a decision whose copy is gone is not believed; bucket errors stop the start. Nothing else is deleted; the decision and what came of it are kept in <site>_portal_adopted, so a restart copies nothing again. portal adopt plan|status|wait says beforehand what a start would take, what it took, and waits for it in a deploy. The kit’s deploy template and its preview say none (docs: operations, “Upgrading to 0.9”, “Undoing an upgrade”).
  • An invite on a site with sign-in off (grants: with no KANIDM_URL and no Kanidm to make an account) no longer mails the person an empty link and portal’s internal name for them: the site’s inbox gets a line saying who now has a place in which group. A mail the content wrote for the invite that needs no link (it names no {link}, {username} or {expires}) still goes to the person; one that needs a link is named in the inbox’s line (docs: memberships).
  • A board says what its places are: board: { words: { places: tilbud, full: Har nok tilbud } } makes a row “2 av 3 tilbud” and, full, “Har nok tilbud”, and the map “3 tilbud”. Additive; without it the rows read as before.
  • A place decided on keeps its seat: places: { …, keeps: [valgt, ikke_valgt] } lists states a place moves on to from taken and still holds its seat in, so choosing one quote and turning down the others does not open a full tender to a fourth. Each must be declared, and neither the first state nor taken. Additive.
  • Dates read as the site speaks: a date or a date and time in a record shows in a list’s and a desk’s row, and in a state mail’s {field}, as “tirsdag 6. oktober kl. 15:00” or “Tuesday 6 October 2026”, in the site’s lang; one with an offset, or anything else, as written. A calendar (.ics) gives a time typed in a form in the site’s zone, DTSTART;TZID=Europe/Oslo:… with the zone’s rules, from site.yaml’s new timezone: (default Europe/Oslo; one of the Central, Western or Eastern European zones or UTC, whose rules the calendar carries, and refused at load otherwise); one with an offset stays in UTC. Additive.
  • action: /#join (a page and a card on it), styret#sak and "#sak" (this page’s card, said in full as <page>#sak at load) load and lint, as the content reference promised; before, start and portal lint refused them as no such page. The page must exist; a card that is not there stays the anchors lint’s warning.
  • A notice’s audience select shows each audience’s label (to: [{ id: alle, label: alle beboere }]) and stores its id; it showed the ids.

0.8.2 (2026-10-29)

  • A private content repo loads: with GITEA_API_TOKEN set, portal sends Authorization: token … on every content fetch (the recursive tree, each page’s raw file, the contents entry and its download_url for site.yaml and aggregates.yaml, and the /site/ and /.well-known/ asset proxy), so a private <org>/questions, which the kit makes by default, no longer fails the start at aggregates.yaml. The token goes only to the content repo’s own scheme, host and port: a download_url on another host is fetched without it, and it never stands in a URL, a log line or an error. A token with read access to the repo is enough (docs: operations, “Environment”).
  • A site whose site.yaml says lang: nb, nn or a regional form (nb-NO) gets Norwegian chrome everywhere (“Ingenting her ennå.”, “Også verdt å spørre”, “Logg inn”…); the table matched only no, so the nb a kit job writes gave English. One normaliser (i18n::is_norwegian) now decides for the chrome, the mails, the map, the interview and the builder. The served page carries one lang attribute, the site’s; the shell’s own lang="en" came second beside it.
  • portal build says its fallback words in the plan’s language: a Norwegian plan’s cards read “Hva skjer videre”, “Hvem som leser det”, “Opplysninger”, “Navn”, “E-post”, “Telefon”, the road “Den er først mottatt, så …, og ender som … eller …”, and the desks, followups, doors and public lists likewise, where the words model leaves a slot unfilled. English plans render byte for byte as before. An escalated stage reads as the stage it went up from and where it went (mottatt → styret), in no language in particular.
  • A plan’s form may call the person’s address what its language does: a form with no field named email and exactly one field of type: email (epost) has that one read as the address mails go to, so Lindtun’s plan is no longer refused four rounds running; it must still be required where a mail, a submitter’s move, grants or followed_by needs it. A mail the plan addresses to a group (mails: { lukket: driftsleder }) goes to the group’s address when the plan gives one (the contact is that group), and is left out when the group already sees the case on its desk; any other group is refused with what to do instead. portal plan and portal build say each such reading, the plan prompt says both rules, and the refusals name a required field of type email rather than email (docs: the plan reference in portal plan).
  • The words model’s reply keeps what it got right. A need’s card put under the wrong key (qwen3:8b nested a front door’s four needs under doors, and every card fell back) is taken by its need id from wherever it is, the object most like a card; the opener’s own feature for a need stays the opener’s. What is the plan’s stays the plan’s: a card’s requirement is the plan’s requires word for word, a need with no requires gets no requirement title or icon, a need that is not paused says nothing about pausing, and none of those slots is asked of the model any more. Placeholder junk (“John Doe”, lorem ipsum, example.com addresses, “Må ha tittel”) in any slot but a field’s example answer gives way to the fallback, and the prompt asks for examples from the site’s own language and country. portal plan refuses a plan for a Norwegian site (the intake’s language:, else the plan’s) that leaves a stage without Norwegian words in stages_text, and the plan prompt says so, so the desk, the map and the mails no longer show open, gjennomfort or avslatt.
  • A shows card whose source points nowhere is refused before it reaches a front door, where it printed “error running server function: resolving resource host”: portal build refuses a kv bucket no need lands in and a url that is not https:// or is on a made-up host (.example, .test, .invalid, localhost, example.com), and portal plan refuses a URL or Gitea owner the intake never gives; the plan prompt says to show only what the intake gives.
  • A desk’s rows say what they hold in the site’s words: each field under the label the form that files into the bucket gives it (“E-post”, “Telefon”) rather than its stored key uppercased, and the record’s state in the content’s words rather than OPEN or KONTAKTET. A state in aggregates.yaml may carry text: (attest_levert: { event: attest_levert, text: Attest levert }), which portal build writes from the plan’s stages_text; without it the row shows the id made readable, and the first state “Open”, or “Mottatt” on a Norwegian site. The listing sends the labels and the state’s words beside each record and stores nothing (docs: state machines, “text”).
  • Portal’s Norwegian reads as Norwegian. In the chrome: “For denne enheten”, “Akkurat nå kan det ikke sendes filer herfra … Gi beskjed til dem som står bak.”, “Velg en ny hvis du vil bytte, eller la den stå.”, “Dette henger sammen med et svar du ikke har gitt ennå.”, “Dette er for dem som eier organisasjonen. Logg inn med eierkontoen, så ser du det.”, “Foreslå en endring her”, “… så går det til dem som har ansvar for innholdet.”, “Takk! Forslaget er sendt.”, “Noen få ord er nok”, “Dette ser ut til å passe for deg: …”, “Det som ligner mest: …”, “Søket virker ikke akkurat nå. Velg heller et av valgene under.”, “Vis meg”, “Noen har flyttet saken i mellomtiden, så ingenting ble endret. Se på den på nytt.”, none of them about a “side” any more. In the builder’s fallbacks: the road “Slik går saken: …, så …, og til slutt …”, “Lurer du på noe, kan du spørre … på …”, “Det er andre som flytter disse videre” (was “En annen pult flytter disse”), “Med knappene krysser du av for det du har gjort med den”, “Forslag til endringer”, “Sendte invitasjoner”, and the invite and member lists’ notes.
  • The kit’s models by default: the plan on qwen3.6:27b (was mistral-medium-3.5:128b, which passed no round on the CPU), with no fallback unless one is named (KIT_PLAN_FALLBACK_MODEL or KIT_PLAN_FALLBACK_LLM); the words of the site on qwen3:8b with NUM_CTX=12288 when Ollama is the engine (was no words model unless KIT_WORDS_LLM named one). Each stays settable: KIT_PLAN_MODEL, KIT_WORDS_MODEL, KIT_WORDS_CTX, KIT_WORDS_LLM for the whole command, --words-llm none for the builder’s own words. kit/compose.yml follows, and the worker’s first line says the words model too (docs: training, “From a conversation to a site”).
  • The interview no longer stops at the first two or three kinds of person. Before the first readback (--brief-only, and on the web) the owner is asked who else gets in touch and what they keep track of that nobody sends them, again after every answer that brings a new need, until one brings none, within the turn cap. The readback lists every need with the role that handles it under the model’s sentences. The opening question and the interviewer no longer call every organisation “the business” or “bedriften”: the place is called what the owner calls it (a borettslag, a café, a club). With --person, a model owner’s yes to a readback its intake contradicts (a handling role its who_is_involved never names, fewer needs than its who_comes_to_us lists) counts as a no, with the intake’s correction as the answer (docs: training, “From a conversation to a site”).
  • The same for the person’s name: a form with no field named name and one text field navn (or fullt_navn, full_name) has that one read as name, which grants makes an account or a membership from; the proof run’s first plan round was refused over exactly this. The refusals now say “a required field named name”.
  • Recurring records: a bucket in aggregates.yaml may carry recurs:, series of records a schedule opens when they fall due (every: { days | weeks | months }, starting, lead, next: on_calendar | after_done, for_each: { group } or { bucket, states } with link_as, handled_by, fields as templates, done). Once a minute, and at start, portal opens the due record in the bucket’s first state with its fields and due, sends that state’s mail and announces it stamped schedule; overdue is the existing after: clock. A record is never opened twice: its id comes from the series and its due day (or the record before it) and the event log refuses an id twice, where a series has got to is kept in portal_recurring, a record whose bucket write was lost is written again, and a series that missed passes opens the latest one due, not each. The lint refuses a series no desk under handled_by works (docs: state machines, “recurs”; proposal 2026-10).
  • Notices to a group: notice: on a bucket (sends_in, sent, to with audiences that are a group’s members or a bucket’s records in some states, narrowed by where from the notice’s own fields, mandatory, archive, per_minute, mail). A notice in its sending state is mailed through gdo’s portal.mail.send, one message per person and to that person alone, with the window in words; the worker sends as many as per_minute (60, at most 600) and PORTAL_NOTICES_PER_MINUTE (600) allow every ten seconds, logs who has it by a hash of the address (portal_notice_log) so a restart sends nobody a second, and moves the notice to sent with recipients, the count. Without mandatory every message carries the person’s own link to stop that bucket’s notices (/notices/unsubscribe, asks first; a token per address in portal_notice_optouts); a mandatory one says it goes to everyone it concerns. The lint puts every form that writes a notice behind qualifies, refuses buttons and own links that would send or mark sent past portal, wants a required audience select with several audiences, and allows a public list of the bucket only with archive: true (docs: state machines, “notice”; mail; operations).
  • A board of places: board: on a bucket whose records have room (capacity as a field or a number, open, full, starts, ends or duration, summary, location, needs, plan) and places: on the bucket of places taken on it (on, slot, taken, waitlist). A take puts the place in the board’s ledger (portal_places, written only over the revision it read) before anything is written: never more than capacity, never two places for one person on one thing, whatever arrives at once; places are seated in the order they came, and the last are kept for a need still missing. Portal moves a seated place to taken, the thing to full and back, and the next in line up when a place is given up by an own link or a desk; a minute’s sweep puts right a stop between the ledger and the records. A refused take says why in the site’s language (full, already yours, kept for a need, closed). A board’s list says how full each thing is and reads in the order of starts; one record shown by key: now renders as a row rather than raw data. Calendars: /ics/<board>.ics for whoever plan names and /ics/<places>/<id>.ics?email= for one person, linked as {ics_link} in that bucket’s mail. The lint refuses a board nobody can take a place on and any button, own link or clock into taken or full (docs: state machines, “board and places”; content reference).
  • The access policy gains the actions take, notify, unsubscribe (a new Recipient principal, whose token is never published) and feed, compiled from the keys above; iris check --access prints them. portal map draws schedules, notices and boards in sections of their own, portal’s own moves in the lanes as clocks are drawn, a schedule on the state it opens in, and takes places on and notifies in the roles. The needs check counts portal’s moves as it counts a clock’s.
  • On a dynamic context, where: { equals: "{key}" } is filled from the segment, as the content reference has said; before, it was filled only when the browser passed the value along.
  • “Suggest a change to this page” is a conversation whose change is applied. On an instance with EDIT_GITEA_TOKEN (a token that may push branches and open and merge PRs on the content repo) the person a page names as responsible gets a chat in place of the textarea: the site’s interview model (EDIT_TALK_MODEL, else INTERVIEW_MODEL, qwen3:8b) reads the page as it is on main, aggregates.yaml and needs.yaml, and asks one question at a time until the change is clear (EDIT_MAX_ANSWERS 10, EDIT_MAX_CHARS 2000). A larger model (EDIT_MODEL, qwen3.6:27b; EDIT_LLM) then drafts it in the background as edits to questions/, aggregates.yaml or needs.yaml (never site.yaml or the workflows), resolved to whole files and linted, with the misses told back to it (EDIT_DRAFT_ROUNDS 3). The read-back says in plain words what changes (questions, cards, fields, desk buttons, states and moves), who gains or loses access (the compiled access policy before and after, rule by rule), which links would stop landing, what the lint would newly warn about, and shows portal map before and after; then “Apply this change”, “Not quite” or “Withdraw”. On the yes it is checked on main as it is then: unchanged since the draft, within size, nothing new the schema, portal lint or needs.yaml refuses (and the repo’s own CI command when a workflow runs it), no access gained that the read-back did not show, no card id lost that it did not show, no in-site link broken, and no state or graph removed that live cases in the site’s KV are still in. A refusal goes back into the conversation in plain words. A pass is committed on suggest/<id>, branched from the checked commit, with the person as author and the token’s account as committer, and opened as a PR with the read-back; portal merges it itself once the repo’s checks on the PR have all passed (and every check main’s protection requires), checks again first when main has moved, merges only the checked commit, and closes it with the reason on a failed check, a foreign push or a PR that no longer merges (EDIT_CHECK_MINUTES 30), rather than Gitea’s “merge when checks succeed”, which merges at once when no check has reported yet. The card says “Waiting for the site’s own check…”, then “Applied”, and the person gets a mail with the summary and the PR; the inbox gets a line. Each change is a case in portal_edit_suggestions, whose built-in graph gains drafting, awaiting_yes, checking, applied, failed, withdrawn and undone (only added to, so every suggestion filed before fits). “Undo my last change” turns the person’s last applied change round through the same read-back, check and merge. One change at a time per page; the model, a refused check or Gitea not answering leave the content as it was; a restart takes up a turn, a draft, a check or a waiting PR where it was. The conversation waits in portal_edit_talks, the maps in portal_edit_maps, served only to the person. Without the token the card is the plain form and says changes are not applied from there (docs: training, “Changing a site from a conversation”; content-reference, “A question”; operations, “Environment”).

0.8.1 (2026-10-27)

  • The kit asks the site’s owner before it sets anything up for a caller. With KIT_PROVISION=approve (the default where KIT_GITEA_* or KANIDM_* are set; auto sets up at once as before, off never) a finished job mails the caller their map as now, files itself as a record in awaiting in a bucket the site’s content declares (kit_jobs, KIT_APPROVAL_BUCKET; business, name, email, the organisation name, the map, the job, its needs in a line) through portal’s own event log, and tells the owner it waits on their desk (KIT_OWNER_MAIL, KIT_APPROVAL_DESK). The owner approves or declines on the desk; every KIT_APPROVAL_EVERY seconds the worker sets up each approved job exactly as auto would (organisation, <org>/questions, <org>/infra, Kanidm invite, Owners grant after the first sign-in), mails the caller where their site lives and their way in with its expiry, moves the record to provisioned (or failed with the reason; the desk can try again) and tells the owner in one line. Only the worker makes those moves; an approval seen twice is set up once (approval.json). A job the desk cannot take still mails the caller their map, and the owner hears it is not on the desk. kit/compose.yml, a private kit, sets KIT_PROVISION=auto. portal job file <id> --dir <data> puts a job that finished before the approval step on the desk as awaiting without planning it again. The worker reads the bucket’s graph from CONTENT_REPO (docs: training, “The owner says yes”).
  • The kit no longer takes an organisation as its own because its bot is a member: one it makes says in its description which job it was made for (kit job <id>), and only that job finds it again. Before, a second caller who asked for a name the kit had already made (or the name of an organisation the bot was in for another reason) had their content written into it and were made one of its owners; now they get the first free variant (docs: training, “From a conversation to a site”).

0.8.0 (2026-10-27)

  • The interview on a site: an alternative with interview: ({ model: qwen3:8b, lang: en }, both optional) holds the conversation in its card in place of a form. A line says that a model asks, that the conversation is kept to build the visitor’s site and is not used for training without asking; then the question, a box and Send. Each answer is one step of the same engine portal interview --brief-only runs at the terminal (the loop is now trainer::interview::step over a State both use), run in the background while the card says it is thinking and the browser asks again every three seconds, so no request is held open for the 20-60 seconds a turn takes. The conversation waits in the NATS KV bucket portal_interviews (kept 14 days) under a random id that ?interview=<id> brings back after a closed tab. The readback and the yes happen in the chat; on the yes the brief is kept in the conversation, put on KIT_JOBS over the site’s own NATS, the visitor is told “We’ll email you when your map is ready” at the address they gave, and the page’s responsible contact (else mail.reply_to, else mail.from) gets a note with the readback, the settled facts, the conversation and the job id through portal.mail.send. Guard rails beside the per-caller rate limit: at most INTERVIEW_MAX_LIVE (6) conversations at once and INTERVIEW_PER_CALLER (2) from one address, INTERVIEW_MAX_ANSWERS (16) answers and INTERVIEW_MAX_CHARS (2000) characters an answer, INTERVIEW_PARALLEL (1) model turns at once with the rest waiting up to four minutes; when the model is out of reach or busy past that, or the conversation runs out of turns, the visitor may leave their address instead and the contact gets that request with what was said. The model is a name the content check holds to letters, digits and ._:/-; how it is run is the instance’s (INTERVIEW_LLM, INTERVIEW_ENGINE, INTERVIEW_MODEL, INTERVIEW_NUM_CTX, INTERVIEW_TIMEOUT). The release now ships engines/. A kit beside a site: KIT_PREVIEW_URL=none mails the map with “we’ll be in touch about setting up the site” instead of a preview link, and the worker no longer switches a preview or asks for a content reload then; KIT_MAPS_DIR lets portal serve a job’s map at /kit/map/<job id>.png for the mail to show (KIT_MAP_URL); PORTAL_COMMAND="job worker --dir ..." makes a bare start of the binary (systemd’s app@) run the worker (docs: training, “The interview on a site”; content-reference, “An alternative”).
  • A CONTENT_REPO with a port (http://gitea.local:3000/owner/repo) is fetched on that port; portal asked the scheme’s default port instead.
  • The kit provisions the client: with --gitea (KIT_GITEA_URL) the interview proposes an organisation name from the business (Gitea’s rules, lowercase ASCII, at most 40), checks it against both organisations and users, offers free variants when it is taken, and has the owner confirm it in the readback (org in brief.json, unchecked when Gitea cannot be asked). A job with KIT_GITEA_TOKEN then makes the organisation (private by default, a free variant if the name turns out taken), <org>/questions with the built content, a README in the owner’s language and lint-and-reload and deploy workflows pinned to this release, and <org>/infra with the site’s compose stack; nothing secret is committed, and a run again commits only what changed. With KANIDM_URL and KANIDM_API_TOKEN the owner is found or made in Kanidm, put in KIT_DEVELOPER_GROUP and <org>_owners, and sent a link to set their own password or passkey (KIT_INVITE_TTL; Kanidm gives at most a day); once their first sign-in has made their Gitea account, the worker puts them in the organisation’s Owners team (grant.json, portal job grants). The mail shows the map inside the message and gives the way in, and the source only with KIT_MAIL_SHOW_SOURCE=true. PORTAL_EXTRA_CA trusts a private CA beside the public ones (docs: training, “From a conversation to a site”; operations).
  • The kit, a first version: from a conversation with a business owner to a built, linted and mapped site and a mail to the owner, with nobody waiting on the large model. portal interview --brief-only reads the plan back for the owner to confirm (a correction is one more turn) and ends in brief.json instead of a plan: the settled facts, the owner’s contact, the language, the readback, the conversation, the last draft; the owner is told they will hear by mail, in Norwegian for no/nb/nn, and --enqueue <nats url> puts the brief on the job queue. portal job run <dir> has the large model write the plan from the brief (with plan‘s rounds and checks, and a fallback model), builds, lints (a failing finding fails the job), draws map.svg and map.png, and writes the mail to the owner (map shown, preview link) into mail.eml, with result.json saying the stage, the timings and the lint’s counts at every step. portal job worker takes jobs one at a time from the JetStream work queue KIT_JOBS (kit.jobs), says each stage on kit.status.<id>, hands the mail to gdo over portal.mail.send when --mail-nats names a NATS gdo reads, and switches the preview to the newest site; portal job content serves finished jobs’ sites as portal reads a content repo, so a plain portal serve previews them. kit/Dockerfile and kit/compose.yml run it all (NATS, worker, preview on 127.0.0.1, the interview with docker compose run --rm interview). Interview lines in transcript.jsonl now say how long the owner waited (interviewer_s), and the opening question is in Norwegian for a Norwegian owner (docs: training, “From a conversation to a site”).
  • portal map --path questions [--out map.svg] [--score answers.jsonl] draws a site’s work on one landscape page for its owner: one lane per need (who, the door, the form’s fields against the budget, the bucket, its states with the handling desk’s buttons, the sender’s own link and the clocks, finished and successful states, the states that mail), the lint’s four structural checks per lane with the finding code in red where one fails, every role the access policy names and what it may do, who invites whom and which states grant a group, and a footer with the content commit and the release. Fixed words follow site.yaml’s lang; a repo with no needs.yaml gets roles and onboarding only (docs: lint, “A map of the site”).
  • Every card has an id, so https://uhhm.no/#applied opens the front door at that card, from the served page with no script and after a navigation in the page too, where the card’s heading also takes focus. The id is the alternative’s new anchor: if set, else the last segment of its action: when no other card on the page ends in the same, else its heading as lowercase words joined by dashes (æ, ø, å as ae, o, a); a later card with the same id gets -2. portal lint refuses a bad or repeated anchor: and warns on an in-site link or action: whose # names no card on its page (anchor-missing) (docs: content-reference, “An alternative”).

0.7.1 (2026-10-26)

  • Portal logged NATS_URL whole at every start (connecting to NATS nats_url=nats://user:password@host:4222), so the NATS password stood in the journal of every 0.6.x and 0.7.0 instance. The log now says nats://user:***@host:4222, and the same goes for every URL that may carry a user and password or a token when it reaches a log line or an error: CONTENT_REPO, KANIDM_URL, portal lint replay --nats, portal search’s NATS, learn’s --nats and OLLAMA_HOST; the map proxy’s warning no longer names the Mapbox token. Whoever ran 0.6.x or 0.7.0 should treat the NATS password as exposed and rotate it (docs: operations, “Environment”).

0.7.0 (2026-10-24)

  • The week-2 test set is fixed before anyone has seen it: 18 fictional businesses, generated and encrypted on the night of 2026-10-22 into two halves, A.tar.gpg with sha256 213d17735c231f329a0f5d12a2e137229defff25bd85e4fc74b330deb33a8add and B.tar.gpg with sha256 56fdf0fbc37fc5b61528685f7ee18261a8af0b766107edbef0ae16da0c30adb5, under the pre-registration with sha256 8ab75d77d349e512796defb7580a801dfa6a3e00a2b02701d80af24f6c34845b. A result on either half can be checked against these hashes; until a half is opened, nothing reads, embeds, scores or trains on it.

  • A plan’s need may carry facts, each { about, title, text } with about one of cost, time, outcome, fit, not_for, prepare and place: what a visitor choosing between options can use, such as “Most kitchens take three to five weeks”. portal build renders them word for word as features after what you need and before what happens next, with an icon by about, and --facts off builds the same site without them. A plan without facts builds byte for byte as before. A fact informs and never acts, and for a real business none is invented (docs: training, “Facts on a card”).

  • portal lint warns on a feature with no form and no list that gives an order, asks a question or names a button (feature-acts), naming the alternative as its page and its place there (/kitchen#2). portal build refuses a fact that does. A warning and not a failure, because two live sites already have such features (docs: content-reference, “A feature”; lint).

  • learn factory plans checks that a plan is about its kind (--plan-kind on|record|off, default on). bge-m3 ranks what the plan offers (every need’s who and wants, its facts; the mean of their unit vectors; not its name or about, so a plan cannot pass on its name) against every kind in the catalogue (--kind-catalogue, else the kinds file’s sectors.yaml), and the plan passes when its own kind is among the nearest 3. A draft that drifted is asked once more, told its own kind and no other, then dropped; kind_rank goes to sitegen.json and result.json. The 16 week-2 plans rank their kind first or second of 90; the redoal plan that passed every other check while writing about radiators and deliveries ranks redoal 23rd of 91. train-night.sh runs it on, with room in --print-budgets for as many re-asks, at a plan call on a loaded box (168 s), as the words leave while every site’s words fit; sealed-night.sh runs it off (docs: learning, “Plans for new businesses”).

  • learn factory plans has a local model write the plan of a new fictional business: 6 to 8 needs, two option sets of 4 to 6 options with adjacent pairs that go to sitegen.json, and 2 to 4 facts on each public need. A validator that calls no chat model builds the plan with portal build, counts the options per page and checks the pairs, rule 1 and the facts. A failure goes back to the writer at most three times for the plan and three for its facts. --validate-only checks a plan on disk (docs: learning, “Plans for new businesses”).

  • portal build --llm-note <text> adds a word to the prompt of every page the model writes in that build, for a page asked again: what was wrong with its last reply, or two headings that read alike. A plan with one tone now tells the model just that voice; only a plan with several says the site is told in more than one (docs: training).

  • portal search --repo <content dir> --page <id> --texts <texts.jsonl> runs the search box’s live path offline, before a site’s box meets a visitor: the same cards, candidates, ids and request as the server’s (a test holds it to the server’s path on the contractor site), one learn rank --ephemeral per text, and with LEARN_NATS set the resident learn serve first, as the server asks it; per text the top option, its p, the gate, the margin, where the label came (label_need or label_framing) and which way learn answered (via), and with labels top-1, the act rate, the precision and the heading pairs between doors to different needs at cosine 0.70 and 0.75. A text is never logged, quoted in an error or written to --out (docs: learning, “How portal calls learn”).

  • learn factory words writes a week’s sites in one tone with one writer: every page’s reply held to learn words check and asked once more if it fails (an icon off the list, an extra slot beside a complete reply and an emptied line only warn, since the build renders none of them and the job tidies them), rule 1 off, recorded, or asked again in batched rounds, and every rendering built with and without the plan’s facts, differing only in the cards’ features (docs: learning, “The jobs”).

  • A record in the state its log has the case in, but written further back in the log than the log reaches (a case moved and moved back whose two record writes were both lost), is brought up to its log when a decision is about to be made on it, notes kept; before, every decision made from it was refused as made from a case that moved meanwhile, however often the desk looked again. An announced page whose date was corrected while announced, summarized at a desk straight from announced and then taken out of the list, is no longer made again and its summary asked for again: the refresh puts the corrected window in the page’s log, and a desk’s move on an announced page says which window it closed (docs: operations, “What NATS keeps”).

  • Before rolling out: SITE_NAME set, and different, on every site that shares a NATS account. Replies to case mail are read through a consumer named after the site, and every announced answer carries the site’s name, so two sites with one name would share the one and look like one site in the other. Setting it moves the site’s access subject to portal.access.<SITE_NAME>.may (docs: operations, “Roll it out”).

  • A decision is made only from where the case still is. For a bucket with a state graph, a decision carries the state it was made from, and the event log refuses it before anything is written if the case has moved since, even when the move would also be allowed from where the case went: before, a desk’s forkastet made from open was taken after another desk’s vedtatt, and both mails went out. The desk now says the case moved meanwhile and to look again; deadlines, announced events, memberships, invites and self-service links make their moves the same way. A record whose history no longer fits its content’s states (the content changed the graph, and replaying the log skips an event) is no longer mended backwards: it is left as it is, and the log says once that its history no longer fits, with the bucket, the record and the skipped move, until whoever keeps the content decides. A record read just as a decision was written is read again a quarter of a second later before it is mended or warned about. A record made again under an id that has a history starts afresh in its log too, instead of being mended back to where the old history ended. One announced page whose record cannot be read no longer stops the sweep for the others (docs: operations, “What NATS keeps”).

  • A decision is weighed against the case as the page it was made on showed it. A desk’s page sends, with each decision, the state it showed and how far into its log the record then was (a record now says so, from the moment it is made), and a self-service page the same; when the case has moved since, or been decided on and come back, the decision is refused with “this case moved meanwhile; look again” before anything is appended, written or mailed. Before, the server weighed it against what it read when the click arrived, so two desk members who both saw open and clicked seconds apart both got through on Gullberg’s graph, and both mails went out. A page loaded before the update sends neither and is weighed against the record as read, said once in the log. An announced page whose record left the list after its summary was asked for, or made, is no longer made again and its summary asked for again; the page’s log knows the window (docs: operations, “What NATS keeps”). A record behind its log is mended even when the log skips an event from before the two last agreed; only a skip after that leaves the record as it is. That such a record no longer fits is said once per record, and again only when the record is written or the content’s states change: the invite and announced sweeps no longer warn about it every ten minutes and every minute.

  • A record follows its event log. For a bucket with a state graph, a decision the log has taken is always written to the record, as the log has it (the state it replays to, and when and by whom), even when another decision landed first; before, the record could stop at the earlier state while the log said the later one, and the case was stuck. A record that says other than its log is written again as the log has it, notes kept and a warning logged, when a decision is about to be made on it and in the hourly deadline sweep (docs: operations, “What NATS keeps”).

  • A reply noted on a record and a desk’s decision on it no longer write over each other. Both are written only if the record is as it was read; if someone wrote it in between, it is read again and only the note, or the state and who decided, is made again. Before, a reply that came in while a desk was deciding could be lost (docs: operations, “What NATS keeps”).

  • learn serve: learn as a resident NATS service, so a search no longer starts a process. It answers learn.rank (--group changes the first part, --subject names the whole subject, such as learn.rank.uhhm for a worker in an account of its own) in the queue group learn, so several workers share the searches, and it answers $SRV.PING, INFO and STATS. A request is what learn rank --ephemeral reads and a reply what it prints; exit 2 is a 400, exit 3 a 503 and anything else a 500, each with the {"error"} line. The model loads once, at start. On SIGTERM it stops taking requests, answers every one it has taken, then exits; a request NATS had already handed it that was still waiting for a lane gets one if a lane comes free within half a second, and is turned away with a 421 at once if not; that is up to 1.5 seconds after the SIGTERM, since the worker first stops taking searches and flushes that out. Portal reads 421 as that worker going, not learn: it spawns with what is left of the search’s deadline, keeps the search box and does not log learn as gone, where before the 503 it got made a rollout under load hide the box. Every context is embedded in memory only, never cached, logged or published, as under --ephemeral. Portal asks it when LEARN_NATS names the subject, for searches and the probe alike, and spawns learn as before when no worker answers in time. A search has one deadline, three seconds from its start: the service gets half of it at most and the spawn what is left, so a worker that hangs never makes a search take longer (the probe the same, out of ten). The fallback it logs as a warning once every ten minutes and otherwise at info, so a LEARN_NATS that no worker answers gets noticed; the probe’s log line and each portal.search.ranked count say which way learn answered (via), never the words. learn builds it behind the serve feature; the release builds learn with it, and learn’s CI tests both ways. Warm, a request took 0.9 ms against 7.2 ms for a spawn with Ollama’s time left out; through a real bge-m3 both took about 84 ms, so what it saves is the process and the model load, not the wait (docs: operations, “learn serve”; learning).

  • Answers are kept. Every submission and decision is still announced on portal.answers.submitted, and now also says which portal sent it (site, origin). It is still a plain publish on the same subject with no reply subject, as before; new are the chain hash as a Nats-Msg-Id header and the site and origin keys. A new stream, ANSWERS, keeps it for 30 days, a retry once. Plain subscribers, n8n’s workflows among them, receive it on the same subject as before, with nothing to answer. n8n does not read the stream: its NATS trigger is a plain subscription, so an answer given while n8n is down still reaches no workflow, and can be read again in ANSWERS for 30 days. No announcement is confirmed one by one: a JetStream publish would carry a reply subject, and n8n’s trigger answers every message that has one with {"success":true}, which on a shared account could be taken for the stream’s confirmation (a rehearsal saw it). Portal instead logs at start which stream keeps answers, or warns that none does. Nothing waits on the stream, and an announcement is sent once. The comments that called the announcement the durable record are corrected: the bucket and its event log are the record.

  • Replies to case mail survive portal being down. Each site reads portal.mail.received through a durable consumer of its own on the mail stream, portal-<site>-mail-received, and acknowledges a reply once it is noted. A reply for another site’s bucket is acknowledged and left alone; one that fails for a reason that may pass is tried again. Replies are read from whichever stream owns the subject, so an older stream left over from a rename still works. With no stream at all, replies are heard plainly while portal runs, as before, and portal moves to a stream once there is one. Sites on one NATS account each need their own SITE_NAME for this. Without it a site goes by the host in PUBLIC_URL, for its consumer and for site on its answers; with neither, it keeps no consumer and hears replies plainly while it runs. Portal warns at start whenever SITE_NAME is unset. The access subject stays portal.access.<SITE_NAME>.may, portal when unset. A reply for a bucket in none of the site’s storylines is logged at info, with the bucket and the record and never the mail (docs: operations, “What NATS keeps”).

  • Portal’s NATS client is async-nats 0.50, up from 0.38. It is built with only what portal uses: JetStream, key-value buckets, and ring for TLS. The object store, services, websockets and nkeys are left out. Nothing a visitor or a desk sees changes. Two new JetStream tests hold the parts that matter most: a move made on a stale sequence is still a conflict, never a storage error, and a key-value create on a taken key still fails, which is what keeps a new session from writing over someone else’s (docs: operations).

  • A search box, where site.yaml asks for one (search: { pages: [/] }): a visitor says what they need in their own words and is shown which option is theirs, ranked by the shipped route model through learn rank --ephemeral, which embeds the words in memory and never caches them; portal never logs, stores or publishes them, and counts only which option came top (portal.search.ranked). Sure, the option is ringed and brought into view; unsure, the nearest is ringed faintly and “Show it” brings it into view; nothing is reordered or hidden. The box shows only while the instance’s learn answers a probe every ten minutes, and goes from the next page on when a search finds learn gone, back within 30 seconds of learn answering again (docs: content-reference, “A search box”; operations, “The search box”).

  • The route model reads the visitor’s words alone (template route/v2). route/v1 put the page’s question and its opening text in front of the visitor, the page drowned the visitor out, and the cosine gave nearly everyone on a page the same answer; with the persona alone the untrained cosine went from 0.617 to 0.796 on 16 fictional sites that informed no choice. No trained recipe beat that cosine on sites it had not seen, so the shipped learn/models/route.{bpk,json} is the cosine itself, written by learn train --epochs 0, with T 0.979 and a gate at 0.856 fitted on dev (it lets 29.8% of dev rows through, 0.900 of them right). A model refuses contexts of the other template, and portal choose sends the persona alone (docs: learning, “Results so far”).

  • learn lint checks a factory site’s rows for door headings that look alike (cosine 0.75 or more between doors to different needs), a door most of its own visitors pass by, and a persona closer to other doors than its own; learn factory personas regenerates the personas the last rule rejects. For factory time only: the margin it reads is the cosine floor’s own error, so filtering evaluation rows by it would inflate the floor (docs: learning, “The lints”).

  • portal build --words-from carries a form card’s words over by the need it files, not by the bucket it records into. Three needs that record into one bucket swapped words on the contractor site (the survey door was headed “Log a phone enquiry”), which put 78 factory rows on a door naming another need; learn extract still drops such rows from sites built before.

  • portal interview: only the checker ends an interview (an empty question with gaps open is asked as the biggest gap instead of ending it), transcript.jsonl pairs each answer with the question that was asked, and with --gate a readback held into the turn cap finishes the last draft adopted when the checker still passes it, instead of stopping “did not finish”.

  • portal choose ranks framings of a need’s card offline by routing gain: each candidate is checked against the live card (only its own varied slots, a section empty exactly where the live one is, the plan’s language, no address, phone number, link or amount the plan does not state), swapped into the live page as the build renders it, and read by the learned route model for every persona on that page; the score is what the card draws from its own need’s visitors less what it draws from everyone else’s. It writes every judgement, a readback of each candidate as its card, and winners.json, a --words partial that appends the winners as storylines behind the live text and is refused if it would change any storyline already served. A words reply with the needs under the wrong key is a shape error, named, not a silent fallback. --validate holds the formula to the wordings visitors saw.

  • The trainer keeps what learn needs to learn from. A card has an identity, card::framing_id (f and twelve hex of the sha256 of the card as read), the same for the server’s parsed page and the trainer’s YAML and the same as learn’s candidate ids. portal answer --trace notes per task the order the options were numbered in, the prompt’s sha256 and the rendering; rate --jsonl every persona’s answers on every page and its twin; prefer --jsonl every call with its raw reply, an unparsed one recorded as unparsed. The tables on stdout do not change. portal interview writes gaps_before and addressed every turn, free labels for the gap decision, and with --rank asks learn rank (src/learn.rs: $LEARN_BIN, else learn beside portal, ten seconds, exit 3 is no decision) for its read in shadow, logged and never asked; --gate lets a confident read hold the readback a turn, never skip the checker, and is off by default.

  • The release tarball carries learn beside portal, with the route model it ships at models/route.bpk, so nothing has to be located or configured; ranking still needs Ollama serving bge-m3 (OLLAMA_HOST) for any text not already in LEARN_CACHE, and without it every call is no decision; the bare learn is a release asset of its own (portal-x86_64-linux-learn, named to sort after the tarball that every deploy takes first, which the release now checks). Only a model trained on fictional sites alone can become the shipped one: learn/scripts/ship-model.sh refuses any other, and the release checks again (docs: operations, “The ranker”).

  • learn/, a second binary beside portal: it turns the trainer’s runs and the data factory’s nights into one row set labelled by the plan’s own truth, splits it so a business the model has never seen is the headline, fits and calibrates a small route model over bge-m3, benches every scorer with its controls, and answers rank, visitor and answer over JSON. A real client’s rows are evaluation only, and rows, caches, models and reports stay in the private sessions repo; only the shipped model comes back here (docs: learning).

  • The contractor, the hire yard and the physiotherapy clinic have Bokmål twins (plans/contractor-nb.yaml, hire-nb.yaml, physio-nb.yaml): every id, stage, bucket, group and field name byte for byte as in the English plan, every word a person reads written as a Norwegian would say it, with stages_text for the desks. They build and lint like every other plan, and learn knows them as fictional NB sites (haugland-bygg, moen-utleie, lunde-fysio), so the trainer’s Norwegian data is no longer one football club.

  • portal interview: the intake as a conversation. One question a turn, in plain words, until a plan is complete; completeness is a checklist here plus the plan parser, not the model’s opinion. The owner is a person at the terminal (--human) or a model playing one from an intake (--person); the plan is read back, written and built. Settled facts are merged forward, an incomplete draft is let through, and keys the parser refuses are dropped, which is what made an 8B model finish in seven turns where it had never produced a need. Every turn lands in transcript.jsonl (docs: training, “Interview”).

0.6.27 (2026-10-23)

  • A module hero (hero: {kind: module}) across pages: the module is started once per visit to the landing page and stopped once on leaving it, also when its import lands after the page is gone (a draw loop ran on in a detached canvas), and no longer for the render the router swaps in and out on its way elsewhere; a landing page reached by a link within the site, or a repeat visit with the bundle cached, gets its piece (the helper is a classic script, so it exists before hydration asks for it; before, the box stayed empty); the picture of the new page waits for the piece to be drawn (data-hero), so the field arrives with the page instead of popping in after the slide; the header’s copy and the piece move as layers of their own (hero-copy, hero-piece), the copy travelling from where it stood to where it stands while the page slides, and --hero-piece-height is a site’s to set. A transition the browser skips (hidden document) no longer logs an unhandled rejection on every click (docs: content-reference, “A hero module”).

0.6.26 (2026-10-23)

  • An announced event counts days on the calendar where it happens, not in 24-hour spans: on a Thursday evening a Saturday opening reads “in 2 days”, not “tomorrow”, and on Friday afternoon “tomorrow”, not “in 23 h”.

0.6.25 (2026-10-21)

  • Feature icons are back: the icon API now answers lucide:ruler.svg with 403 and only lucide/ruler.svg with 200, so the URL is built with the slash. Content keeps writing icon: lucide:ruler, as before.
  • The real sites’ plans, words, assets and documents, and the one real intake, leave this public repo for uhhm/sessions (private), beside the trainer’s runs; that repo is uhhm/portal-trainer under its new name, and the dead copy of the trainer is gone from it. The invented sector examples stay here, and the trainer reads a plan from any path, so nothing in the binary changes. The operations guide stops describing an iris release that has not existed since 0.6 (docs: training, operations).

0.6.24 (2026-10-20)

  • A slideshow with few enough pictures to fit now centres them instead of bunching them against the left edge with the whole gap on one side (Swiper’s centerInsufficientSlides, which measures the slides there actually are, so it holds at every width and for a strip of one as much as a strip of three).
  • A hero with a slideshow keeps one gutter on a phone instead of two. The strip runs the full width and the copy inside it carries the gutter, so the hero has no side padding of its own; the rule that narrows a hero under 40rem was written as a plain .hero, sat later in the stylesheet at the same specificity, and quietly put that padding back, so the two stacked and the words began 2.75rem in on the narrowest screen there is.

0.6.23 (2026-10-07)

  • A configuration profile’s per-payload PayloadVersion is an integer, as the plist key is typed; it was a string, which iOS may refuse.

0.6.22 (2026-10-07)

  • /profile.mobileconfig renders an Apple configuration profile from the mail server’s own PACC document (profile.pacc in site.yaml), so iOS can be set up in one install instead of probing for ports it cannot reach. Mail, CalDAV and CardDAV in one profile; every host, port and path from PACC, never written down twice; no address, username or password in the document, so one profile serves everyone and iOS asks at install; identifiers derived from the site, so reinstalling replaces the accounts rather than duplicating them (docs: content-reference, “A configuration profile”).

0.6.21 (2026-10-07)

  • A content repo’s .well-known/ is served at the site root (/.well-known/security.txt, /.well-known/assetlinks.json, /.well-known/matrix/server), and a miss there is a 404 instead of the app shell answering 200 with an HTML page. RFC 8615 reserves the prefix and a question’s id cannot begin with a dot, so nothing a repo ships can shadow a page. An extensionless file under it is typed as JSON, by the convention those files follow; .txt, .xml, .webmanifest and .mobileconfig are typed too, the last so an Apple configuration profile offers to install rather than download.

0.6.20 (2026-10-05)

  • A releases card lets a platform’s file carry an architecture: a Mac visitor is offered the macos-arm64 file, not sent to TestFlight past it.

0.6.19 (2026-10-05)

  • A kind: url resource whose JSON is a releases manifest (latest, versions with per-platform assets, channels such as a package repo or TestFlight) renders as a download card: the file for the visitor’s own platform first, decided in the browser, the rest and the channels folded. Written for redoal’s public releases at dl.redoal.com (docs: content-reference, “A releases manifest”).

0.6.18 (2026-10-03)

  • iris check --findings <out.jsonl> writes every finding as JSON: a stable id (scope, need, code and subject, nothing of the wording), level, code, scope, need, subject, message and fix. Every message that knows its fix now says it after “fix:”. The codes are listed in docs/lint.md.
  • portal generate follows its findings through: each structure round is logged as fixed, still open, new and reopened; a fix round is shown the open findings with their fixes and only the files they name; a change that reopens a closed finding is undone; and the phase stops when a round closes nothing, writing what is left to run.log. A hesitant visitor no longer triggers a wording rewrite by itself, only a misroute does. A lint without --findings is still driven the old way.

0.6.17 (2026-10-02)

  • A desk shows every record still moving and only the three most recently finished (a final state: no move out of it), with “Show older” for three more at a time. A desk that has run for a year is still about the work in hand.
  • Mail variables are one set for every kind of mail (docs: Mail). Every mail has {site} and {site_name}; a state mail also has {link}, {self_link} and {desk_link}: the reader’s own page for the record (a self-service page with ?chain=&email=, when the record’s state allows a move there), the desk that moves it, and {link} choosing between them by who the mail is to. {link} in a state mail used to render as nothing.
  • The lint follows every state of every bucket a need lands in: a state no desk, link or clock reaches fails; a state a record can reach and never leave fails, after “done” too; a declared move nobody offers warns; a desk gated to one group on the page and another on its list warns; working stages must follow each other in the business’s order; a mail from an unreachable state warns, and one naming a field no form collects fails. Clocks (after:) count as moves, and a visitor’s own link only from the states it names. Each finding ends in the fix: the { from, to, label } and the desk page it goes on, or the group that already has the button. A schema error no longer hides the needs findings.

0.6.16 (2026-10-01)

  • The lint refuses an alternative that has a form to send (fields to fill in, an invite, or a bucket to record into) and no action. The button is only drawn for an alternative with an action, so such a form could be filled in and never sent, which is what happened to uhhm.no’s first invite form. An alternative that moves its own record (self_transition) draws its own button and is left alone.
  • portal iris is the lint’s name, after the iris that keeps bad content out of the portal. portal lint is the same command and keeps working.

0.6.15 (2026-10-01)

  • An invite may carry its own mail: invite: { group, mail: { subject, body } }. Every field of the form is a placeholder besides {name}, {link}, {expires} and the rest, and a date and time (type: datetime-local) is written out in words (“tirsdag 6. oktober kl. 15:00”). The words and the form are kept with the invite, so sending it again sends the same mail. This is for a desk that invites someone to a conversation at an hour, not into a group for good.

0.6.14 (2026-10-01)

  • Less room above the wordmark: 1.75rem, 1.25rem on a narrow screen (it was 4rem). The space was kept for who is here, which now sits on the wordmark’s own line, and on a tall, narrow screen it read as dead space.

0.6.13 (2026-10-01)

  • Who is here (the name and “sign out”, or “sign in”) sits on the wordmark’s own line instead of being pinned to the corner of the page, where it read as a row of its own. With a picture strip it is in the wordmark’s bar; without, it is level with the mark at the right edge. On a narrow screen it drops under the mark.
  • Trainer: every form, public ones included, carries a signed-in person’s name and address from the login instead of asking for them; a visitor still sees the fields. Only the inside forms did before, so someone signed in filled in their own name and address again on a public form.

0.6.12 (2026-10-01)

  • Trainer: the words model is told who opens each mail: the person who sent the case, the person who posted the record an answer is about, or someone at the business. Mails to the business about another person’s case used to be written as if to that person (“you will hear from us”); on Gullberg, three of nine were.

0.6.11 (2026-10-01)

  • wordmark_ink: true in site.yaml: an SVG wordmark is drawn in the page’s own ink, as a mask over the text colour, so it follows the page’s light and dark in every browser. A wordmark shown as an <img> only knows the system’s setting, and some browsers don’t pass even that on. Opacity in the file still shows, so a lighter line stays lighter. Opt-in, for one-colour marks; a mark with a colour of its own keeps its colours.

0.6.10 (2026-09-30)

  • Trainer: who a business is gets a page of its own (“who are we?”, /hvem in Norwegian), with nothing to do on it. It has one card per need that presents (the people, the work, each shown as picture cards) and one for the plan’s values. The front door leads there instead of carrying it all.
  • Trainer: the words model is told that a form page from the inside asks a real question and says where the answer ends up (“How do you present yourself?”, not “Your card on the front page”), and that a one_per_person form is the colleague’s own.
  • Trainer: portal build names every need no persona tries. Klingenberg Bygg’s plan had personas only for customers, so nobody ever played the office filling in its own forms.
  • Klingenberg Bygg: “Hvem består Klingenberg Bygg av?” with Menneskene, Erfaringer (projects with pictures, added from the office) and Verdier (a first draft for Fredrik to replace).

0.6.9 (2026-09-30)

  • What a person wrote on a card (a bio) is shown as markdown: paragraphs, line breaks as typed, lists, emphasis, and links to https, mailto or tel marked rel="nofollow ugc". No images and no raw HTML, which is stricter than the site’s own descriptions. The desk still shows the text as written.

0.6.8 (2026-09-30)

  • An upload that did not arrive says why: larger than 20 MB (checked in the browser before anything is sent), a site that takes no files (no Garage configured), not allowed from here, or anything else. It used to say “try again, or with a smaller file” whatever the reason, which sent people looking for a smaller file when the site had no storage at all.

0.6.7 (2026-09-30)

  • leaves_after: { minutes: 10 } on a state: a record that has been there that long leaves its bucket’s lists (days, hours and minutes add up; swept every minute; the event log keeps it). Trainer: leaves_after per stage on a need. A Klingenberg Bygg card taken off the front page leaves the office’s list ten minutes later instead of standing there greyed out.

0.6.6 (2026-09-30)

  • one_per_person: true on an alternative: each signed-in person keeps one record there, their own. The form opens filled in with it, a file left unchosen keeps the one already there (shown beside the picker), and sending again replaces the card instead of adding one. Two sends at once settle on the newest. Trainer: one_per_person on a need entered from inside; Klingenberg Bygg’s people each edit their own card on the front page.
  • Send is disabled from the moment it is pressed. Files upload before the form is sent, and a second press in that time used to send it twice.
  • A failed upload stops the send and says so. The form used to go without the file, which made a record that looked complete and was not.
  • A refused send says why, under its button. It used to say nothing.

0.6.5 (2026-09-30)

  • Trainer: paused: true on a need. Its card stays on the front door with what the business does and a sentence saying it is not taking new ones right now, with no form and a button that does not press; nothing is recorded. The lint reports a paused need as a warning (“paused, not open now”) and counts it on its own in the summary, as planned already did for needs not open yet. Klingenberg Bygg’s building applications are paused for capacity.

0.6.4 (2026-09-30)

  • The rate limit is a hundred at once, refilled at ten a second (it was 30, one every two seconds, which a page with a picture strip used up in one load: a few reloads and the stylesheet was refused). The files a page is made of, from portal’s own disk, are not counted at all. PORTAL_RATE_PER_SECOND replaces PORTAL_RATE_SECONDS; no site set it.

0.6.3 (2026-09-30)

  • Pages move the way their addresses do. Deeper in the address comes in from the right, back up comes in from the left, and a page at the same depth comes from below or above, with the index on top. The cards on screen leave as layers of their own, one after another, and the next page’s cards arrive the same way. The old page stays on screen until the new one has loaded, where it used to go blank in between. Only transforms and opacity are animated, through the browser’s View Transitions (public/page-motion.js, before the router). Browsers without them, and anyone who asks for reduced motion, navigate as before.
  • A record that carries a picture, in a list with no buttons, is shown as a card: the picture, the first field as the heading, the rest under it, with no field names, state or time. Cards are shown in the order they were put up. On a desk, the same picture is a thumbnail.
  • Trainer: values in a plan and presents: true on a need make a “who we are” card on the front door. The business’s own statements are carried word for word, beside every record the need presents: the people who work there, entered from inside, each with a picture field (a file that only takes JPEG, PNG or WebP) that shows as their portrait. A public list keeps the form’s field order, so the first field heads each row.

0.6.2 (2026-09-30)

  • The header knows who is here: on a site with sign-in, a link top right to sign in, or the person’s name and the way out. A page with a slideshow gets the wordmark as a bar of its own, the strip full width under it, and the question after.
  • “My cases”: where: { field: email, equals: "{user.email}" } lists the records that carry the signed-in person’s own address, filled from the session and never from the caller; nobody signed in matches nothing. An attachment is fetched only through a list that shows its record, so a list of my cases opens my files and nobody else’s.
  • A stored file on a listed record shows as the name it was sent with and opens from the row, for whoever the list shows the record to. It used to show as its storage key, a string nobody could open.
  • Form controls scale with the text around them (em, not rem): fields, pills, buttons and labels follow a site’s body size. The date picker’s calendar icon is the size of the text beside it, and the file picker’s button takes the field’s colours instead of the browser’s.
  • KANIDM_GROUP_PREFIX: a site on a Kanidm it shares with others keeps plain group names in its content; the prefix is put on when portal adds or removes a member, and the client’s claim map takes it off.
  • Fixed: maps never reached the browser (serde(skip)), so a page with a map drew it on the server and dropped it on hydration.

0.6.1 (2026-09-30)

  • Trainer: documents in a plan. A text the site carries word for word (bylaws, terms) becomes a page of its own where every section is one alternative: its heading the card’s, its paragraphs the card’s words, from a markdown file beside the plan. No model touches it.

  • slideshow on a page: a strip of pictures the full width of the screen under the question, max_height in svh, each picture with its caption laid over it. Swiper when the bundle has loaded, a sideways-scrolling row before. /site/ serves jpeg, and lets a browser keep photographs for an hour.

  • The release’s bare binary is named portal-x86_64-linux (it was portal in 0.6.0 only). Gitea lists assets by name, and deploy scripts that take the first asset got the binary instead of the tarball.

0.6.0 (2026-09-30)

  • One binary. The lint (uhhm/iris) and the trainer (uhhm/portal-trainer) are commands of portal: portal serve (the default), portal lint, and portal plan, build, answer, rate, prefer, score, simulate, compare, report, generate. Same source, same version, so the site, the lint and the trainer never disagree about what content means; both histories are merged in. The release attaches the bare portal binary beside the tarball, so a content repo’s CI downloads it and runs portal lint. No more iris releases; the pins that exist keep working. The trainer’s plans/, intakes/, engines/, sectors/ and its reference prompt live here now; its runs/ stay in uhhm/portal-trainer. Docs gained “Training a site” and “The lint”.

0.5.11 (2026-09-30, tagged, never published)

The publish job failed at its lint step: iris, built against this tag, did not compile against the storylines change (the same two fixes that went into src/lint/ when the lint moved in). Nothing was attached to the tag; 0.6.0 is the first release that ships storylines.

  • Storylines (src/content/variants.rs, docs/storylines.md): any text a person reads may be a list, one entry per storyline, every list the same length; a visitor is given one storyline for the whole site (the portal_storyline cookie, a year) and reads it on every page and in every mail about their case. What the machine reads - a field’s name, options, states, groups, paths - never varies. The lint refuses a list of another length. Records and answer events carry storyline, and GET /report gives counts per bucket, per storyline, per state, and nothing else.

0.5.10 (2026-09-30)

  • The lint lets an invite form collect a required phone in place of a required email: memberships know a person by number first.

0.5.9 (2026-09-30)

  • With memberships as the people backend and a Kanidm token still set, an invite makes the Kanidm account as well (no group, the one-time link in the mail): Kanidm makes people, portal makes members, and a site can switch to memberships before its sign-in provider is one everyone already has.

0.5.8 (2026-09-30)

  • Fixed: 0.5.7 asked every provider for the phoneNumber scope, and Kanidm denies a sign-in that asks for a scope the person does not hold, so nobody could sign in. The scope is asked for only with OIDC_EXTRA_SCOPES=phoneNumber (Vipps). 0.5.7 must not be deployed on a Kanidm site.

0.5.7 (2026-09-30)

  • Memberships: groups kept by portal itself (src/memberships.rs, docs/memberships.md). A membership is a case in the built-in portal_memberships bucket - invited by a desk, a grants, the seed or the responsible pass; active from the person’s first sign-in, when the provider’s subject, phone number or address matches; removed by a desk. A person is their phone number first (+4791234567, PHONE_COUNTRY for bare numbers), their address second, the provider’s subject third, and one record per group and person however it was keyed. At sign-in the active memberships join the groups claim, so Cedar sees the same parents as before. PEOPLE_BACKEND=memberships switches a site; unset, a KANIDM_API_TOKEN means Kanidm and no token means memberships. SEED_ADMIN_PHONE seeds by number. The sign-in asks for the phoneNumber scope and reads phone_number from userinfo.
  • The NATS access service answers for a person named by sub, phone or email with no groups listed: their memberships are looked up first.
  • who_for (the person a grants is about) takes navn as well as name, and a phone number in place of an address.
  • The invite mail for someone who needs no link says where to sign in.

0.5.6 (2026-09-30)

  • A group may hold a page’s responsibility: responsible: { name, contact, group: styret }. No account or mail for the inbox, and any signed-in member of the group gets the suggest-a-change card. Before this, a board’s shared address was onboarded as a person.

0.5.5 (2026-09-30)

  • One record answers another, from a list. link on a resource puts a link on every listed record to a page about it ({id}, {field}), a state mail’s to may be a field of the record this one belongs to ({notice.email}, and {notice.field} in the text), and value: "{user.email}" fills a field from the session and hides it, so a signed-in person is not asked who they are. Together they make a board: a notice is listed with “answer this”, the answer page’s form carries the notice’s id, and the mail goes to whoever posted it. The lint requires the record field the mail reaches through.
  • The way down the tree is the line at the foot of the page and nothing else. The arrow fixed at the left edge, which 0.5.3 added beside it, is gone: it followed the reader down every page to offer something the foot already does.

0.5.4 (2026-09-29)

  • Accounts the content mandates, made at start (src/seed.rs). Every person a page names as responsible gets a Kanidm account if they have none, and a mail in the site’s language saying they are listed as responsible for asking that question, with the link to sign in; RESPONSIBLE_GROUP puts them all in one group (people who already had an account are added without a mail). SEED_ADMIN_EMAIL (and SEED_ADMIN_NAME, SEED_GROUP) invites the first person into the site’s most privileged group - the group whose desk may invite into the most groups - so a site with its own Kanidm has someone to invite everyone else. Both happen once per address and group (portal_seed), side by side, and each tries again a minute apart, twenty times, while Kanidm comes up. The responsible are gone over again whenever the content changes (portal.content.reloaded, published once new content is in place), so a new page’s person is set up without a restart - and someone the content has stopped naming leaves RESPONSIBLE_GROUP in the same pass, if portal is who put them there.
  • An invite is a case that keeps itself current (portal_invites: open, expired, done). Signing in closes a person’s invites; a sweep every ten minutes moves one whose link ran out unused to expired, and takes the link off the record. From expired a desk may send it again: the move back to open makes a fresh link and mails it. Content offers that with { from: expired, to: open } on the list of invites. The invites portal makes itself at start are on file with the rest.
  • Fixed: an invite mail said the link worked “until” and then nothing. Kanidm 1.11 gives a link’s end as seconds since the epoch, and portal read only the older RFC 3339 string.
  • Fixed: a search by mail that Kanidm failed to answer (a 5xx) was read as “not permitted”, and the invite went on to match by username - which could give someone with an account under another name a second one. Only a refusal is read that way now.
  • A page’s responsible person, signed in, may suggest a change to it: a card at the foot of their own pages, checked on the server against the page’s responsible.contact, published on portal.edits.suggested, and mailed to the site’s inbox with them as reply-to. It is a case in the built-in portal_edit_suggestions bucket - open, discussed, done or declined - so a desk that lists the bucket takes it up and settles it, the person who made it is mailed at each move, and the card shows them what became of what they sent before. The session now carries the signed-in person’s email.
  • The mail to someone named responsible names the first three questions and counts the rest; on a site where one address answers for every page it used to list them all.
  • Fixed: an invite of someone new failed on a Kanidm set up with the onboarding account alone. Portal created the person, then set their address in a second call, and idm_people_on_boarding may create but not modify: 403. The address now goes in with the person.

0.5.3 (2026-09-29)

  • A way down the tree from every page: an arrow fixed at the left edge, half-way up, and the same link in words at the foot (“Tilbake til starten”, “Back to “What came in?””). It goes to the nearest page below the current one that the visitor may open, taking the path apart a segment at a time, and to the front door when none is; the front door has none. Content no longer needs a “back” alternative, and a visitor who went up a branch that turned out not to apply is never stranded.

0.5.2 (2026-09-28)

  • The rate limiter answered 500 to any request that arrived without X-Forwarded-For. It reads the caller from that header or X-Real-IP and falls back to the socket, and 0.5.0 served the app without connect info, so there was no socket to fall back to and no key to rate-limit by. Through Caddy every request carries the header and the site was fine; a health check on localhost got a 500, which is how the first deploy of 0.5.1 failed.

0.5.1 (2026-09-28)

  • A self_transition that names no from means the bucket’s own initial state, not the word open. 0.5.0 read the literal, which is only right for a bucket whose records start there: redoal’s watchers arrive at pending and confirm themselves into open, so the rule compiled as open -> open and the confirm link in the mail could never match. Wrong the same way before 0.5.0, and now visible because the lint checks the edge exists.

0.5.0 (2026-09-28)

  • Sessions live in NATS KV (src/sessions.rs), not in memory. Every restart used to sign out every desk on the site being deployed; they now survive it, in the JetStream that is already under everything else - no new service and no new store to run. The bucket’s max_age collects what nobody returns for, and a record’s own expiry is what answers a load.
  • Fixed: the JetStream integration test asserted a record’s projected state was one a desk move had never written to it, so it failed whenever it actually ran. test.yml has been red since 0.3.47 while publish.yml stayed green, which is how 0.4.0 shipped past it.
  • A file can come back out. GET /attachment/{bucket}/{record}/{field} streams what a type: file field stored, reading the object key out of the record rather than taking one from the caller - so a file is only reachable through a record somebody may see, and a key that leaks off a desk is a link to nothing. Before this, uploads were one-way: a desk showed the key as a string and there was no way to open it.
  • Rate limiting, per caller IP, outside everything else: a burst of 30 refilled one every two seconds (PORTAL_RATE_BURST, PORTAL_RATE_SECONDS; either 0 turns it off). A form-filling visitor never reaches it; a script does. There was none at all before.
  • /upload asks the policy, like every other way in. It asked nothing: any caller who could reach the host could put 20 MB in the bucket, as often as they liked, and a site whose forms are public is a site whose upload route is public. It now takes the question and alternative the file is being attached to, refuses a page that declares no type: file field or an alternative that is closed, and asks Submit on that page - the same question the submission itself will ask - before a byte is written. Latent until an instance had storage configured; the first one now does.
  • A submitter stays in dialogue with their case for as long as it runs. self_transition takes from: [state, ...], and the access policy compiles one rule per state named; it defaulted to the initial state alone and was written that way in the compiler, so an applicant written to for a missing drawing could not send it, and nobody could withdraw once anything had happened. Omitted, it still means the initial state alone.
  • A record can belong to another record. type: record with of: <bucket> stores the parent’s id, which arrives on the link rather than being typed; a submission naming a record that is not there is refused. The other half is where: { field, equals } on a Kv resource, so an application’s page can list the objections that name it.
  • A public view need not publish the whole bucket. states: [...] on a Kv resource shows only those, for one record as well as a listing - a register that is public by law is public about what was decided, not about what was withdrawn. The desk over the same bucket is a different spec and still sees all of it.
  • A state can grant a group: grants: <group> beside its event, so an approval that means membership does not also need somebody to remember to invite them afterwards. The lint requires the forms that fill such a bucket to collect a required name and email, because by the time a desk presses approve there is nobody left to ask.
  • A state can be moved by a clock: after: { days, to }, swept hourly, measured from the record’s last move (src/deadlines.rs). A deadline may only do what a person could have done - after.to is held to the same declared edge as a desk button - and the move fires the same mail and publishes the same event, stamped deadline.
  • Documentation moved out of the README into docs/: architecture, content reference, state machines, access, operations.
  • A page says nothing until it has something to say. The Suspense fallback on a question was the whole served page - no header, no wordmark - so the first and only thing a visitor or a crawler read was the word “loading…”, which is true and is not about them. It now holds the space and stays quiet, with aria-busy for a reader that would otherwise find an empty document.
  • Gone: the gitea_org_repos resource kind, which no site ever named. gitea_starred and gitea_releases stay.

0.4.0 (2026-09-24)

  • A field can be a place: type: location puts a pin on a map and stores {lat, lon, zoom}; a record holding one renders as a still map on its desk and in any resource card.
  • A question can be about a place: place: { lat, lon, zoom, name } is the counterpart to event: - event makes a page an occasion with a time, place makes it somewhere, draws the map under the question, and opens any location field on that page there instead of on the globe.
  • Maps are served from this origin. Portal fetches every tile and every still itself (src/maps.rs, MapLibre vendored), so a page with a map on it makes no third-party request, needs no consent banner, and the MAPBOX_TOKEN never leaves the server. Unset, the feature is simply off.
  • A reply to a case mail becomes a note on its record: whatever reads the mailbox publishes on portal.mail.received and portal appends the note, after checking the record exists and the sender is the address the record itself holds. A note never moves a case.

0.3.47 (2026-09-24)

  • iris: needs.yaml takes stage_words, each state in the site’s own words, carried into the simulation model for the trainer’s desk score. No change to portal itself.

0.3.46 (2026-09-23)

  • An invite first looks the email up in Kanidm (/v1/raw/search on mail, when the service account may read people: idm_people_pii_read) and only adds an existing account, under whatever username, to the group; no second account, no reset link.

0.3.45 (2026-09-23)

  • A mail stream that cannot be created at boot (subjects owned by an older stream) is a warning, not a failed start; 0.3.44 took the kasse sites down for two minutes on the rename.

0.3.44 (2026-09-23)

  • The mail stream is named mail (was WORMHOLE); gdo 0.1.2 matches. Delete the old stream on each NATS after upgrading both.

0.3.43 (2026-09-23)

  • Mail is content: mail: { to, subject, body } on a state in aggregates.yaml sends when a record enters that state (to: submitter or one address; {field}, {site}, {chain}, {email} in the templates), and an invite mails its one-time link built in; site.yaml gains mail: { from, reply_to, invite }. Portal renders and publishes on portal.mail.send in the WORMHOLE stream; uhhm/gdo delivers. The lint requires a required email field on every form recording into a bucket that mails the submitter.

0.3.42 (2026-09-23)

  • people: the Kanidm person lookup reads the body, since Kanidm 1.11 answers a missing person with 200 and null rather than 404; before this every invite skipped account creation and failed on the group step

0.3.41 (2026-09-23)

  • publish: the iris release step retries on a fresh clone when its push loses a race against a push to iris main (the v0.3.40 tag never published)
  • iris: check --access prints the access matrix, and every check validates the compiled policy against the schema

0.3.40 (2026-09-23)

  • One access policy, compiled from content into Cedar on every load (src/access.rs): pages, resource reads, desk transitions, self transitions and the automation endpoint all decide through it; decisions carry rule ids, refusals and mutations publish on portal.access.decided, and portal.access.<site>.may answers the same question for other apps over NATS
  • invite: {group} on an alternative onboards a person into Kanidm from a desk (src/people.rs, KANIDM_API_TOKEN), recording the one-time credential link in portal_invites and on portal.people.invited

0.3.39 (2026-09-23)

  • publish: releases the matching uhhm/iris by proxy - re-pins, builds, tests and tags it as this version (needs the IRIS_PUSH_USER variable and IRIS_PUSH_TOKEN secret); iris carries portal’s version number from here on

0.3.38 (2026-09-22)

  • publish: the iris build step gets a writable cargo home; the v0.3.37 tag never published

0.3.37 (2026-09-22)

  • The lint moves to its own repo, uhhm/iris: question_lint becomes iris check, needs_replay becomes iris replay; the tarball ships iris (pinned in publish.yml) instead of question_lint; the needs module and local loaders leave portal

0.3.36 (2026-09-22)

  • Question nav: a followup is offered only once earned - the verified chain answered the alternative leading there, or a link that records nothing leads on from an earned page. Standing on a page no longer unlocks the pages behind its forms; the chain index now records which alternative was answered
  • One bounded HTTP client for every server-side fetch: 20 s budget, size caps per kind of fetch (src/http.rs)
  • Uploads are refused past 20 MB while streaming, and the route body limit that had capped them at axum’s 2 MB default is raised to match
  • tests/jetstream.rs: the store, the event log and the projection tested against a real JetStream (CI starts a throwaway one)
  • content split into gitea, validate, markdown, handlers; every path still content::x
  • This changelog, and the table of what each site runs
  • Business needs as a checkable spec: needs.yaml + question_lint pass
  • needs: success states and a resolved simulation model
  • needs: stages - every stage the business named must be a state
  • needs_replay: make simulated cases real aggregates, report buckets by state
  • needs: also_moved_by - a need carried by more than one group’s desk

0.3.35 (2026-09-12)

  • Item cards: no paragraph margin under the description

0.3.34 (2026-09-11)

  • Question nav: offer followups by reach, not by carrying any chain

0.3.33 (2026-09-02)

  • Head preloads: latin font, wordmark, content-host preconnect

0.3.32 (2026-09-01)

  • Per-site favicon via site.yaml

0.3.31 (2026-09-01)

  • Markdown links allow tel:

0.3.30 (2026-09-01)

  • Single alt-image shows natural height

0.3.29 (2026-09-01)

  • Markdown image layout hints + AVIF assets

0.3.28 (2026-09-01)

  • Hero description renders inline markdown

0.3.27 (2026-09-01)

  • wordmark_invert: explicit, not inferred from .svg

0.3.26 (2026-09-01)

  • Select fields: inline static options

0.3.25 (2026-09-01)

  • Content-shipped stylesheet override (site.yaml stylesheet)

0.3.24 (2026-09-01)

  • Gateway submit-as-link loses the underline

0.3.23 (2026-09-01)

  • Chrome speaks the site’s language: site.yaml lang + i18n table

0.3.22 (2026-09-01)

  • site.yaml wordmark_height; raster logos keep their colors

0.3.21 (2026-09-01)

  • Hero paragraph centers its measure box

0.3.20 (2026-09-01)

  • Sign-in becomes optional: KANIDM_URL unset disables auth cleanly

0.3.19 (2026-09-01)

  • Markdown images in descriptions, gated and framed

0.3.18 (2026-09-01)

  • Item cards render inline markdown descriptions
  • Convergence: ink converges onto the decoded key (WebGL glow)
  • Gesture results overlay the canvas - the page never jumps

0.3.16 (2026-08-30)

  • Announce sweeper: refresh open records from content

0.3.15 (2026-08-30)

  • Hidden fields: carrier value without a label row

0.3.14 (2026-08-30)

  • Feature cards: icon column, one text edge

0.3.13 (2026-08-30)

  • Voice field: nothing leaves the browser until Keep it here

0.3.12 (2026-08-30)

  • Voice preview stays hidden until there is something to play

0.3.11 (2026-08-30)

  • README: gesture and voice fields
  • Validate templated actions against the page pattern

0.3.10 (2026-08-30)

  • type: voice, Requirement.value, playable resource cards

0.3.9 (2026-08-30)

  • Templated actions; places are pickable in the gesture input

0.3.8 (2026-08-30)

  • Descriptions are inline markdown; Feature.link withdrawn

0.3.7 (2026-08-30)

  • Feature.link: a card’s name may point elsewhere

0.3.6 (2026-08-30)

  • Announced pages: event windows, header announcements, summary tasks

0.3.5 (2026-08-30)

  • Gesture widget: stop drawing the decoded ghost path
  • Gesture widget: ghost path back, for v2 keys only

0.3.4 (2026-08-25)

  • Alternative.disabled: announced but not yet takeable

0.3.3 (2026-08-25)

  • Empty list says so before it can parse as zero answers

0.3.2 (2026-08-25)

  • README: hashed pkg assets in the release flow
  • Resource empty text: content-declared, and null counts as empty

0.3.1 (2026-08-25)

  • Content-hashed pkg assets (hash-files) so stale bundles can’t pair with new wasm

0.3.0 (2026-08-25)

  • Hero becomes a content-owned module; site asset proxy; gesture growth fix

0.2.4 (2026-08-25)

  • Gates keep the question nav

0.2.3 (2026-08-25)

  • Attended-bucket lint rule; app-lifetime resources fix first-nav corruption

0.2.2 (2026-08-24)

  • One app-level Title fed by a shared site resource

0.2.1 (2026-08-24)

  • Docs: routing bullet + design doc marked implemented
  • Revalidating cache on app assets; site title survives SPA navigation

0.2.0 (2026-08-24)

  • Initial commit: content-driven onboarding portal
  • Load content from Gitea directly, drop the local clone; add deploy workflow
  • Share sccache between manual dev builds and CI
  • Give CI its own SCCACHE_SERVER_PORT
  • Erase view types at every list/component boundary, not just leaves
  • Redirect cargo-leptos’s tool cache out of act-runner-bare’s StateDirectory
  • Fix Ship release: site-root is project-relative, not CARGO_TARGET_DIR
  • Drop sudo from the deploy workflow - NoNewPrivileges blocks it outright
  • Caddy snippet: use multi-line log block
  • Fix static asset 404s and build-time SITE_NAME
  • Hot-reload content on a NATS trigger instead of requiring a restart
  • Add prosekit rich-text field, Gitea repo embeds, automation KV read endpoint; fix apex/www session-cookie mismatch on /auth/callback
  • Fix prosekit-editor.js: remove bare CSS imports that aborted the whole module
  • Redirect back to the originating page after sign-in, not always /
  • Fix hero-canvas navigation race; style the prosekit editor and add a toolbar
  • yes.js: guard against the canvas not being in the DOM yet
  • Fix get_resource/transition_answer: scope feature lookup to its own alternative
  • Add self-service transitions, authorized by item possession not group membership
  • Event-sourced applicant/subscriber/project aggregates, generalized resources
  • deploy.yml: write GITEA_API_TOKEN for the new GiteaStarred/OrgRepos resource sources
  • Cargo.toml: disambiguate bin-target for cargo-leptos
  • Add manually-triggered backfill workflow, no terminal/sudo needed
  • Trigger redeploy to pick up PORTAL_GITEA_API_TOKEN secret
  • Render generic resource lists as cards, not raw JSON dump
  • Fix recursion-limit build failure in the new item-card renderer
  • Resource-backed multi/single-select requirement
  • Add Organization aggregate (client-as-status), wired but inert
  • Fix favicon (real icon, not an unrelated orange circle) + stack encouragements with the submit button
  • Fix bucket-404 on empty resources, redesign review actions as select-then-confirm, CSS polish
  • Inline encouragements with the submit button, vertically centered
  • Use the real institutional logo for the header wordmark, not plain text
  • Use the actual UHHM-letters wordmark, not the institutional mark
  • Responsive base font size via svmin, not fixed 17px
  • Add plain-unit fallbacks for svmin/svh in case of unsupported engines
  • Size the YES canvas from its container, not window.innerHeight
  • Debounce the YES canvas resize handler and skip no-op resizes
  • Revert canvas sizing to window.innerWidth/innerHeight, gate resize on width change
  • Stop blocking native scroll on the YES canvas’s touch handlers
  • Quicksand: font-display optional, not swap, to stop the text-jump on scroll
  • Use lvh/lvmin, not svh/svmin - svh was the wrong end of the viewport
  • Update style/main.css
  • Update style/main.css
  • YES canvas: size off its own container rect, not window.innerHeight
  • yes.js: freeze .hero-yes’s height via inline style, don’t trust svh alone
  • add responsive container width
  • deploy.yml: build and publish question_lint alongside the app binary
  • Make aggregate state graphs content-driven, not compiled Rust
  • One shared, content-labeled Confirm button per alternative instead of one per row
  • get_resource/get_requirement_options: #[server(default)] on params
  • Add optional Alternative.image and Feature.color/icon for richer layouts
  • Drop the feature list’s left-padding
  • Drop question-report entirely, obfuscate the mailto link instead
  • Transition.from: state graphs deeper than one decision
  • Alternative.images: array of urls, rendered as a Swiper card deck
  • Reseed lost event history from the KV projection on transition
  • Lighten the comment load
  • Validate action targets; format timestamps client-side; clippy cleanup
  • Question nav + gateway alternatives
  • Responsible note under the title; followup pages out of the nav until a chain exists
  • README: what the engine provides
  • Feature icons: masked span painted by currentColor, not
  • Responsible note: one line, same hue and size as the hero description
  • Responsible note as <small>: meta information, dimmer than the description
  • Responsible note back to the footer, above the question nav
  • Bound inputs: a field that loads its value from a sibling-parameterized resource
  • add some more width to our alternatives
  • Accent to a dusty press-cyan, a muted echo of the canvas’s cyan ink
  • Editor type in rem: prosekit’s px typography ignored the responsive root
  • Ban px from stylesheets: every length rem/em off the responsive root
  • No translucent input chrome: solid ink-dim placeholders and embed meta
  • Editor type scales for real: drop prosekit typography.css, fix selectors
  • Stable server fn endpoints: open tabs survive deploys
  • Drop stray local tool temp file, ignore .claude/
  • Noise-driven YES, sticky hero with frosted cards, full light theme
  • increase translucency of laternative cards
  • Showcase jq test tracks Gitea repo shape and website-first links
  • Gesture input type, redoal-relay client, gitea_releases, content-driven branding
  • Echo thumbnails fade in via timeout, not rAF
  • Trigger deploy: redoal OAuth2 credentials now configured
  • Deploy becomes publish: portal ships as a versioned release artifact
  • Semver releases cut with cargo-release; publish on v* tags only
  • Docs: release/rollout flow after the instance-ownership refactor
  • README: frame portal as a generic multi-site question engine
  • Design doc: filesystem routes, sections, dynamic segments
  • Filesystem routes, sections, dynamic segments; instant YES hero

What each site runs

Read from the hosts on 2026-09-28; a rollout is a pin bump in the site’s content repo (PORTAL_RELEASE in its deploy.yml) - on both hosts now, since kasse’s runner deploys its own instances.

SiteHostInstanceVersion
uhhm.noergoapp@uhhm-portalv0.5.2
redoal.comergoapp@redoal-portalv0.5.2
westra.klingenbergbygg.nokasseapp@westra-portalv0.5.2
portal.klingenbergbygg.nokasseapp@klingenberg-portalv0.5.2
vel.klingenbergbygg.nokassetomtervel-portal-1 (podman, tomtervel/infrastructure)v0.6.0, memberships

Changelog

One line per change, grouped by the release that shipped it. Newest first. Each release names the portal tag it is built against.

Unreleased

  • owned_by and shared_with on a bucket are read and checked: shared_with needs owned_by: sender, a group without a gap, and while states the bucket has; owned_by beside belongs_to or groups, a bucket two steps below an owned one, a form field named owner and an invite: filing into an owned bucket are refused. A list over an owned bucket with neither public nor requires_group is no longer unreachable.

  • A key no page reads (a typo, or a key in the wrong place such as link: on a card, which goes on with action:) fails the check of a checkout (--path), named where its author would look: “questions/index.yaml, card 1 › feature 3 › field 4: bind”. site.yaml likewise. Before, such a key was dropped without a word.

  • event: under a state’s mail:: start must be collected, required, as type: date or type: datetime-local by every form filling the bucket, end likewise where named, and the two may not be the same field; any other key under event is refused.

  • needs.yaml may name the site’s tones, one storyline each; the checks read the first storyline, which is what build_questions gives.

0.5.10 (2026-09-30) - portal v0.5.10

  • Matches portal v0.5.10 (released by portal’s publish job).

0.5.9 (2026-09-30) - portal v0.5.9

  • Matches portal v0.5.9 (released by portal’s publish job).

0.5.8 (2026-09-30) - portal v0.5.8

  • Matches portal v0.5.8 (released by portal’s publish job).

0.5.7 (2026-09-30) - portal v0.5.7

  • Matches portal v0.5.7 (released by portal’s publish job).

Unreleased

  • The effort budget counts what a person fills in: a type: record field (the case an answer is about, carried on the link) and a hidden preset are not asked and no longer count. An objection page whose form carried the application’s id used to be one field over.

0.5.6 (2026-09-30) - portal v0.5.6

  • Matches portal v0.5.6 (released by portal’s publish job).

0.5.5 (2026-09-30) - portal v0.5.5

  • Matches portal v0.5.5 (released by portal’s publish job).

0.5.4 (2026-09-29) - portal v0.5.4

  • Matches portal v0.5.4 (released by portal’s publish job).

0.5.3 (2026-09-29) - portal v0.5.3

  • Matches portal v0.5.3 (released by portal’s publish job).

0.5.2 (2026-09-28) - portal v0.5.2

  • Matches portal v0.5.2 (released by portal’s publish job).

0.5.1 (2026-09-28) - portal v0.5.1

  • Matches portal v0.5.1 (released by portal’s publish job).

0.5.0 (2026-09-28) - portal v0.5.0

  • Matches portal v0.5.0 (released by portal’s publish job).

0.4.0 (2026-09-24) - portal v0.4.0

  • Matches portal v0.4.0 (released by portal’s publish job).

0.3.47 (2026-09-24) - portal v0.3.47

  • Matches portal v0.3.47 (released by portal’s publish job).

0.3.46 (2026-09-23) - portal v0.3.46

  • Matches portal v0.3.46 (released by portal’s publish job).

0.3.45 (2026-09-23) - portal v0.3.45

  • Matches portal v0.3.45 (released by portal’s publish job).

0.3.44 (2026-09-23) - portal v0.3.44

  • Matches portal v0.3.44 (released by portal’s publish job).

0.3.43 (2026-09-23) - portal v0.3.43

  • Matches portal v0.3.43 (released by portal’s publish job).

0.3.42 (2026-09-23) - portal v0.3.42

  • Matches portal v0.3.42 (released by portal’s publish job).

0.3.41 (2026-09-23) - portal v0.3.41

  • Matches portal v0.3.41 (released by portal’s publish job).

0.3.39 (2026-09-23) - portal v0.3.39

  • Matches portal v0.3.39 (released by portal’s publish job).

0.1.1 (2026-09-22) - portal v0.3.36

  • check --repo fetches needs.yaml itself; the v0.1.0 tag never published (a cache permission on the runner, since fixed).

0.1.0 (2026-09-22) - portal v0.3.36

  • First release: the lint moved out of portal (question_lint becomes iris check, needs_replay becomes iris replay), with the business-needs pass, the wording task export and scoring, and the simulation model export. Portal is a library dependency pinned to the release iris matches.