The Gantry app
The Gantry app is a local-first web app (a PWA) for reading and editing a
project’s design ledger: its rulings, defects, design passes and evidence.
It runs the same core as the CLI, compiled to WebAssembly, so it lints and
writes a project exactly as gantry does. Nothing leaves your machine: there
is no account, no server and no telemetry, and after the first visit it works
offline.
Opening a project
Section titled “Opening a project”The Open screen offers three ways in:
- Open folder… (Chromium browsers: Chrome, Edge, Brave, Arc) asks for
the project folder, the one that holds
gantry.yaml, and opens it to edit in place. The folder is remembered under Recent. After a reload the browser asks for permission again, so a remembered folder shows Reconnect folder. Click it and allow access. - Open folder (view only) (Safari and Firefox, which cannot write to a folder) reads a snapshot of the folder. You can also drop the folder on the page. See Editing, and view-only browsers.
- Try the example opens
examples/reference-slice, which is bundled with the app, in memory. Changes to it are kept only until you leave.
The app picks between these by feature detection, never by browser name.
The app reads what gantry would read: gantry.yaml, the content directory
(docs/design by default) and the files your platforms’ test globs match. It
never reads .git or node_modules, so a test glob that reaches into
node_modules finds nothing in the app, though the CLI would find those
tests. If you need such tests counted, run gantry lint.
The five views
Section titled “The five views”The header has tabs for each view, and a lint summary such as
0 errors · 0 warnings that leads to the lint panel.
- Ledger: every ruling, and a ruling × platform matrix whose cells show each answer’s state: ruled, n/a, missing assertion, or open defect. Filter it by status or app, and show superseded rulings if you want them. Below the matrix, Passes lists the design passes, and New pass starts one.
- Ruling: one ruling. It shows the current answer and the cell for
each platform, then the amendments, newest first. The evidence strip
is an appearance × platform grid of frames for the latest pass, with a
slider back through earlier passes. Amend this ruling opens a form:
it previews the change as a diff before it writes, and it refuses what
gantry amendwould refuse. - Defects: a board grouped by status, filtered by platform, class and severity. New defect files one. Close asks for the defect’s owed items (an assertion, a primer line, a gate check or a ruling amendment), and the defect will not close until they resolve.
- Pass: a pass’s frame grid by platform, appearance and app. Select a frame and choose Disagrees with…, then pick a ruling. A draft defect opens, filled in with the frame, platform and app: capture, read and file in one gesture.
- Compare: any two frames, or one label across two passes, shown Side by side or as an Onion skin, where a slider fades one frame over the other.
The Lint panel lists every finding as gantry lint reports it. The
history rules (ruling-edited-without-amendment, defect-id-collision and
their kin) compare against a git base, and the app has no git. They show as
skipped, by name, under Skipped (needs git), as the CLI shows them without
--base. Run gantry lint --base <ref> in CI for them.
Editing, and view-only browsers
Section titled “Editing, and view-only browsers”Every change goes through the core’s edit and format, so each file the app
writes is the file the matching CLI command writes. Before each write the app
checks the file on disk. If the file changed since it was read (by an editor,
by an agent, or by git pull), the app reloads the project instead of
overwriting the file.
In Chromium, the folder opens read-write and a change is saved to disk straight away.
In Safari and Firefox, the folder opens view only: the browser handed over a copy it cannot write back. Changes still work, and the app shows them, but it queues them as a download. The header shows Not saved to disk (N), and its panel lists the files changed and the files to delete. Download N changed files gives the changes:
- one changed file comes alone, named by its base name, and the panel tells you the project path to save it at;
- several, or any deletion, come as
<project>-changes.zip, a zip of project-relative paths. Unzip it into the project folder. If it holds.gantry-deleted.txt, delete the files that list names, then the list itself.
Until your next edit the header offers Downloaded — download again, in case the browser blocked or lost the download.
Evidence: states and pulling
Section titled “Evidence: states and pulling”Frames are screenshots stored in Git LFS (see Evidence in the
README). In the app each frame is in one of three
states, as gantry evidence ls reports them:
- pulled: the image is in the folder, and the app shows it;
- pointer: the folder holds the LFS pointer, not the image. The app
shows a placeholder and the command that fetches it, such as
gantry evidence pull --pass 037; - missing: no file at all, which is
evidence-blob-missingin lint.
To see pointer frames, run the pull command in your checkout and reopen the folder (or reconnect it).
What the app does not do
Section titled “What the app does not do”- It cannot add evidence. Capturing a frame means hashing the image,
storing the blob through LFS and recording its metadata. A pass shows the
command to run instead, such as
gantry evidence add --pass 037, with a Copy button. - It does not run the history rules, which need git. They show as skipped (see the lint panel above).
- It does not run gates.
gantry sweepruns the project’s own checks. - It does not commit or push. The app writes files; what you commit is up to you and git.
Offline
Section titled “Offline”After the first visit the service worker holds the app, the WebAssembly core and the example. With the network gone the app still loads. The example opens, and on Chromium a project under Recent reconnects as usual: the folder is on your disk, so it needs no network.
Deploying the app
Section titled “Deploying the app”pnpm -C web build (or make web-test) writes the app to web/app/dist/.
It is built with the base /app/, so serve the directory’s contents at
/app/ on any static host. It needs no server code. Two things to get right:
- serve
.wasmasapplication/wasm; - send the Content-Security-Policy that
web/app/vite.config.tsnames as a header. The built page carries it as a meta tag too, but a meta tag does not reach the core’s worker.