Hypertekt › Docs › Concepts

MOTH

How MOTH, Hypertekt's website architect, works on a site: its changes are ordinary commits, it checks its work, and it keeps notes on each person.

MOTH is Hypertekt’s website architect. Owners and developers ask MOTH for changes in their own words, from the dashboard. MOTH changes a site’s files the way a person does, so everything MOTH does is in the site’s git history, and anyone on the site can see it, change it or undo it.

Each request is a commit

Each request to MOTH is one commit on the draft. The commit’s author is “MOTH, for” whoever asked. Its message says what changed, the way a developer would write it (“Saturday hours are 8am to 7pm”), and then who asked and what they asked for. Pull it like any other commit.

A request from an owner whose changes reach every page (a layout, the styles, a part or a snippet on every page, so that all or nearly all of the pages built before change) isn’t committed right away. It’s held in the site’s object, with a preview at a link of its own, until the owner keeps it, and dropped if nobody does within 7 days. A developer’s is committed at once, and its card says it reaches every page.

MOTH reads the history too, and can put files back as they were at any commit, pictures included. Before it puts the whole site back, which undoes every commit since, it asks the person and names whose changes go.

To undo a request, press Undo under MOTH’s answer. That undoes only the files the request’s commit changed, as a new commit, and is refused when a later commit changed one of those files since, naming that commit. Or revert the commit like any other: from History, from Recent changes on the Overview (which puts back every change since too), or with git revert. See The draft and publishing.

MOTH works on its own copy of the files while it runs, so you can keep editing and pushing. When MOTH is done, its commit goes on top of whatever was saved or pushed in the meantime. If someone changed a file that MOTH changed too, MOTH is shown their change before it finishes, and keeps it.

MOTH never publishes. Only a person publishes, from Publish or with tekt publish.

Watching a request

While MOTH works, the Code tab marks the files MOTH is changing. On a long request, like a new page, the Preview shows MOTH’s work in progress at a link of its own: the draft as it is, with MOTH’s changes on top. Only the person who asked is given the link, and the link stops working when the request is done.

What MOTH knows, and how it checks its work

MOTH is briefed with the same spec as The template language, and is told about the site at the start of each conversation: its collections and their fields, the pages it makes, and its files. MOTH checks its changes with the same checker as the Code tab and tekt build, and the search and accessibility checks come with it. Then MOTH looks at the pages it changed, on a phone and on a desktop.

Hypertekt checks MOTH’s work too, and sends a request back to MOTH before it’s done when something is wrong:

  • Forms: every form a request touched is filled in and sent the way a visitor would, on each page it’s on. Nothing is kept or emailed. A form that can’t be sent goes back to MOTH with what was sent and what came back.
  • Phones: every page a request changed is loaded at a phone’s width. A page that’s wider than the screen, so it scrolls sideways, goes back to MOTH with what sticks out. A page that already did before the request isn’t sent back.
  • Pages taken away: a page the site had that no page or redirect answers anymore goes back to MOTH, to add a redirect or to say why there shouldn’t be one.

MOTH’s notes on each person

Each person has their own conversation with MOTH on each site. MOTH keeps short notes on each person: what they call things, how they like their answers, and what’s left to do. MOTH reads its notes at the start of each session, so a conversation picks up where it left off. To read and correct your notes, open the site’s Settings, then MOTH. Nobody else on the site sees them.

What MOTH won’t do

  • Publish.
  • Put a secret in a file or in the conversation. MOTH asks for a secret with a card that sets it as one of the site’s secrets, and only learns that it’s set. See Analytics, other scripts and secrets.
  • Follow instructions in the site’s content, in what visitors send through its forms, or on other sites’ pages.
  • Make up facts about the business, like its hours or prices. MOTH asks instead.
  • Delete what nobody asked it to.

What MOTH stands for

It depends when you ask. Some of the answers so far:

  • Mildly Overcaffeinated Technical Helper
  • Merciless Optimizer of Terrible Homepages
  • Midnight Operator, Taking Hotfixes
  • Mends Overgrown Template HTML

None of them is the real one. MOTH won’t say what is.