Docs with everything
Omniglass ships its documentation as part of the product. The docs are not an
afterthought in a separate wiki; they are Astro Starlight content under docs/, compiled
to a static site and published at docs.omniglass.hyperscaleav.com (and, in time, embedded
into the Go binary to serve at /docs). The architecture is
published ahead of the code, so the design is visible (and reviewable) before, or
alongside, the feature that implements it.
The rule
Section titled “The rule”A feature is not done until the docs that teach it ship in the same PR.
Concretely, a user-facing PR must do one of:
- change
docs/to add or update the page(s) that explain the new behavior, or - state a one-line justification in the PR body (pure refactor, internal-only change, etc.).
The docs-touched gate is enforced by the PR template checklist and the /ship-slice
pre-ship pass, not by a label-driven CI check (the
label taxonomy is closed, and no workflow reads a docs label). The
justification path exists so the gate never blocks a genuine internal change, not as a
routine escape hatch.
A mechanical layer backs the human gate: the docs lint suite (internal/docslint, run
by go test and so by make test and CI) checks the hand-written docs against the code.
The suite covers vocabulary (retired identifiers must not appear in current-tense
prose, in the docs, the operator strings, and the generated OpenAPI descriptions),
the decision log’s format, routes and permissions (both checked against the generated
spec, permissions in both directions), make targets, env vars, file paths, and
table.column references (against the generated schema facts), plus the badge-fence
coverage check and the docs-command-and-flag guard in internal/cli. The semantic
drift no lint can see gets the periodic /docs-audit pass (#429).
A worked example of the rule: the collection page’s per-transport probe table (each transport’s
rung, its endpoint.params and the samples its probe lands) is rendered from the transport registry
and the probe keys through cmd/seedgen, seed.json and SeededSet, and a test in internal/outpost
drives each built transport’s probe and fails when what it lands differs from what its entry
declares. A new transport’s row, such as snmp’s, appears with its registry entry and no doc edit.
What “the docs” means here
Section titled “What “the docs” means here”The site is laid out by audience, one directory per section, and each section’s sidebar except
Reference’s is generated from its directory, so a new page needs no config edit (it orders itself
with sidebar.order). Reference is listed in the config: its pages come from generators, so a new
one is a generator change that adds its entry in the same PR:
- Start here (
/start/): what Omniglass is, the model in one pass, the first ten minutes. - Operator (
/operator/): running the fleet from the console and the CLI. - Admin (
/admin/): accounts, access, audit, secrets and variables, the catalog, automation. - Developer (
/developer/): the API, the CLI, agents and MCP, the lab and PR previews, and contributing. - Deployment (
/deployment/): installing Omniglass and running it in production. - Architecture (
/architecture/): how it is built, one page per subsystem, badged; the architecture of record, where each official term is defined once and not redefined, with the implementation status grid, the roadmap, the decision log and the build log. - Reference (
/reference/): generated, never hand-written: the glossary, the CLI, the MCP tools and the API.
A slice that ships or changes a user-facing surface updates the page for whoever does the task in
the same PR, not just the architecture page: the architecture page says how the surface is built,
the audience page says how to use it. Until a section is rebuilt, its old pages (under Being
rebuilt in the sidebar: /guides/, /contributing/ and the unbadged /architecture/ pages, which
set sidebar.hidden so the Architecture section lists only rebuilt pages) are where that update
goes; the section’s PR deletes them and their sidebar entries.
A word an operator or an admin reads (an entity, a nav label, a health value) is a row in
internal/vocab/terms.yaml: its word and plural, a one-sentence definition, its API collection,
schema and permission noun, its nav entry, and any word it retired. make gen renders the
glossary and the entity descriptions in the OpenAPI spec from it, and the
guards fail a new collection, nav entry or health value that names no row, or a retired word back in
console strings or docs prose. A term only the code’s internals use is defined on the Architecture
page that owns it, in bold where the page first uses it.
When a feature introduces a concept an operator must understand, the teaching surface ships with it (the learning-tool restriction).
So a feature that adds an operator surface usually touches two homes: the Architecture page (the model) and the audience section’s page (the how-to). A purely internal change touches neither and states its one-line justification in the PR body.
Status moves with the code
Section titled “Status moves with the code”The rebuilt pages are written in the present tense as the target design, so build status is carried alongside the prose, not woven into it, and keeping it current is part of docs-with-everything. A slice that advances a rebuilt page updates three surfaces in the same PR:
- the page’s status badge moves to its new floor (
DesigntoPartialtoBuilt), which the live grid on implementation status reads directly, so the grid never lies; - the build log gains the slice’s entry, a new file of its own (one file per entry); and
- if the shipped code diverges from a page’s design, the page carries an inline note and a decision-log entry (an ADR) lands in the same PR.
Forward-looking intent that is not yet a slice lives in a GitHub epic and is indexed on the
roadmap; it is not written into a page as if built. This is the contract that
keeps the published design describing what exists: a built capability never sits behind a Design badge,
and a divergence is never silent.
The logs are one file per entry
Section titled “The logs are one file per entry”Nearly every PR adds a build-log entry and many add an ADR, so while each log was one page that every
PR appended to, any two open PRs conflicted at the same line. The build log
and the decision log are instead fragment directories: each entry is its
own file, the page holds none, and the docs build splices the entries into the page where a directive sits
(::build-log, ::decision-index, ::decision-log), rendered by docs/src/plugins/fragments.mjs. Two PRs
adding entries add two files.
-
A build-log entry is
docs/src/content/build-log/<YYYY-MM-DD>-<slug>.md, named for the day it lands (entries of one day order by slug). Its frontmatter is the heading and the references, and its body is the entry’s prose:---title: "The thing that landed, said as an outcome (#1234)"date: 2026-10-24refs: [1234]---What shipped, how it is proven, and what was deferred where. -
A decision is
docs/src/content/decisions/adr-NNNN-<slug>.md, its frontmatter the index row (title, date, status, summary, andrefs) and its body the entry; the index table is generated from the files. The/record-decisionskill is the procedure. An ADR’s number is the number of the issue it was decided under (refsnames it): a decision made on issue #NNNN is ADR-NNNN, and a second one on the same issue ADR-NNNN.2. Issue numbers never collide, so two PRs recording decisions at once never compete for a number. ADR-0001 to ADR-0163 are the closed legacy range, numbered in sequence before the rule. The one clash left is two PRs both adding an issue’s next suffix: the decisions lint names both files, and the one landing second runsmake adr-renumber FROM=NNNN.2 TO=NNNN.3(addingFILE=once both are in the tree), which renames its file and rewrites every reference across the docs, code comments, and skills.
Cite an ADR by the slug of its current title. An ADR’s heading id on the decision log is
github-slugger’s slug of its title:, so a link is /architecture/decisions/#adr-NNNN-<title-slug> (or
#adr-NNNN-... from inside the log). Reword a title and every link that spelled the old one silently lands
at the top of the page, so the docs build checks it: docs/scripts/check-decision-anchors.mjs runs after
astro build and fails on any link into the log whose fragment is not a heading id on the built page.
When you retitle an ADR, the build names the links to fix.
The frontmatter is a small line grammar (a double-quoted or single-quoted string, a list of integers like
[1234], or a bare word), read identically by the docs build and by internal/docslint, which checks every
entry’s shape and fails an entry written into a log page instead of its own file. An entry body carries
no headings of its own and no directive lines (::screenshot, :::design) outside a code fence: a
directive resolves against the page’s frontmatter, and an entry has none. The adversarial-review
anti-pattern catalog follows the same pattern, one file per entry under the skill’s references/anti-patterns/.
The design fence
Section titled “The design fence”A badge is page-granular, and a page is not one thing: most architecture pages mix built behavior with target design. The design fence marks the unbuilt part structurally, at the section where it lives, instead of a hand-written “still design” sentence at the top that rots when a slice ships:
:::design[Target design, tracked in #434]The prose in here describes something that does not exist yet.:::The fence renders as a visually distinct aside (dashed, purple, labeled), and its label
must name the issue or ADR that tracks the gap; a fence with neither fails the docs
build, so unbuilt prose always has an owner. To nest a normal aside inside a fence, give
the fence more colons (::::design around a :::note), which is remark-directive’s
nesting rule.
The fence is also the boundary the docs lint suite keys on
(internal/docslint, the Regions split): the vocabulary lint runs everywhere,
fenced or not, because future design must still be written in current nouns, while the
existence lints (routes, permissions, tables, make targets, env vars, paths) run
only outside a fence, where prose claims to describe something that exists. Building a fenced section
means deleting the fence in the same PR, exactly like moving the badge.
Screenshots are generated, not pasted
Section titled “Screenshots are generated, not pasted”Screenshots embedded on a docs page are a generated resource, treated like the OpenAPI
spec or the CLI reference, never a static image dropped in by hand. A page declares what it
needs in screenshots frontmatter (the shot’s id, the console path, its alt, and any
interaction steps), and embeds it in the prose with a directive:
---title: Secretsscreenshots: - id: secrets path: /web/secrets alt: "The Secrets directory: type badges, owner scope, and masked field previews."---
::screenshot{#secrets}That frontmatter is the single source: make docs-shots reads it from every page, drives
the real console (the same binary an operator runs, never a mock, served by a throwaway lab with
no outpost collecting, so the pages hold still; the capture hides the lab’s banner), and writes
public/screenshots/<id>.png; the directive renders the figure from the same entry. So the
capture list and the embed cannot drift, a #id with no frontmatter entry (or no captured
image) fails the build, and adding a screenshot is a frontmatter edit, not a code change.
Because the images track the live UI, they are refreshed like any generated artifact: a change
to an operator surface is followed by main re-running make docs-shots after the merge (below); a PR itself commits only a new shot for a new id. Each capture
writes two renders of the same settled page: the clean shot under
docs/public/screenshots/, every region live, which is what the docs embed (a masked history
strip teaches nothing); and its masked twin under docs/screenshots/baseline/, where the
regions a capture cannot render deterministically (a v7-uuid id subtext, a seed-time
timestamp, a history strip whose weights divide by the capture’s own clock) are painted as
constant boxes. make docs-shots-check recaptures and diffs the baselines only, at zero
tolerance, the visual sibling of the make gen drift check: the pinned browser’s masked
rasters are byte-stable, so any diff is a real, un-recaptured UI change. The comparison is
exact: byte-equal files pass, and otherwise every pixel is compared in every channel, so a
change confined to near-identical dark tones fails too (#774). The old percentage ceiling
passed exactly the changes the gate exists to catch, a renamed label or a collapsed rail
repainting fewer pixels than seed jitter (#398, #623), and a perceptual threshold would have
passed a surface token swap. One caveat: a real UI change that falls entirely inside a masked
region is invisible to the gate, which is the price of masking and the reason a mask names the
smallest box that holds still around what moves.
Main refreshes the shots, a PR does not (#2561). A PR never re-renders an existing docs shot: git
cannot merge binaries, and every merge used to make the other open PRs conflict on the same PNGs. After a
merge, the recapture job in docs-shots.yml recaptures both sets on main’s tree; when a masked baseline
changed it pushes those shots and their clean twins (a clean shot alone differs on every capture, so it is
not committed) to claude/docs-shots-recapture and opens (or updates) one PR titled “docs: recapture the
docs screenshots”, as the agents’ App. When that PR is in the merge queue GitHub locks its branch, so the job
pushes to claude/docs-shots-recapture-<short sha> and opens a new PR instead of failing main (the choice
lives in scripts/docs-shots-plan.sh), which the architect approves like any other PR. Branch protection is
untouched and nothing bypasses it. A concurrency group coalesces merges that land close together, and a run
whose commit is no longer main’s head stands down, so the latest main wins. What a PR commits: a new shot
for a new id (a new file cannot conflict, and the docs build needs it), and its visual evidence under
.github/screenshots/<n>/. A guard in the verify job (scripts/docs-shots-guard.sh) fails a PR whose
diff modifies, deletes or renames an existing file under docs/public/screenshots/ or
docs/screenshots/baseline/; the recapture branch alone is exempt. docs-shots-verify still checks every
PR’s shots are declared and present. The workflow runs on a PR or a push to main or a release branch that
touches an input to a capture: docs/**, web/**, the dev seed (internal/devseed/**), the boot seed
(internal/seed/**), db/migrations/**, the Makefile, the Dockerfile and docs-shots.yml itself (#860).
A seed-only PR runs the structural verify job; the recapture runs on main after it merges, so a seed change that
moves a shot is recaptured instead of waiting for a later docs/** or web/** push. The freshness comparison (make docs-shots-check) does not run on
pull requests, so a stale shot never reads red on a PR; make docs-shots-check stays the local proof that a
recapture is stable.
Capture on a committed tree. The console shows the build id it was built from, and a dirty
tree stamps a long -dirty-<time> id where CI’s clean checkout stamps a bare commit, which
wraps and changes the height of the platform cards, so every shot of that page shifts. Commit
the code, run make docs-shots, then commit the PNGs (the recapture branch does this on main), and
make docs-shots-check passes on the clean tree that follows.
The capture pins the raster path (#1860). The pinned browser picks its rasterizer’s SIMD path from the host
CPU (Skia dispatches at runtime between SSE2, AVX2 and AVX-512), and the paths can round a gradient pixel one
level apart: a host without AVX2 (a generic virtual CPU) once differed from CI by five pixels of the users page’s
avatar gradient (#774). So the capture browser runs with --disable-skia-runtime-opts (web/e2e/docs-shots.mjs),
which turns the runtime dispatch off: every host takes the same baseline path. The comparison stays exact.
Measured on an AVX2 host and a host with no AVX at all, the same tree captured with and without the flag
(the comparison on #1860):
the users page’s shot (users) is byte-identical across the two CPUs either way, one other baseline (notification-target-new, 8 pixels)
differs across the CPUs without the flag and is byte-identical with it, and 36 of the 37 baselines match across the
two CPUs with it. The one that did not, fleet-history, drifted for a reason the rasterizer has no part in, and the
flag could not pin it: the shot follows the lab’s timing (#2707, #2802), pinned below.
Each capture logs the host’s CPU model and whether AVX2 and AVX-512 are present (capture: cpu ... from
docs/screenshots/capture.sh), so a baseline’s hosts are in the run log. The baselines committed before the pin came
from the unpinned path, so the first recapture after it lands (the claude/docs-shots-recapture PR) rewrites a few
gradient pixels; adopt it. If a local make docs-shots-check still differs on a host only by such a residue, adopt
the CI recapture rather than loosening the comparison or masking the element.
A shot that follows the lab’s timing is pinned in its capture
Section titled “A shot that follows the lab’s timing is pinned in its capture”fleet-history (the auditorium’s Activity tab) read the lab’s timing in two places, which no mask on a value could
hold, and two captures of the same tree differed by 14.98% of their pixels:
- The row count of the health history. The lab opens with the room commissioning for about a second before it
reads healthy (the first two recorded edges), and
stretchesOfkeeps a stretch only if it lasted half a second. A fast host drops it and lists one row (the ongoing stretch); a slow host keeps it and lists two, and the events and logs below move down by a row. A mask paints over a box and cannot stop what follows it from moving. - The alarm marker’s x. The marker sits at the raise’s share of a window that runs from the lab’s first record to now, so it moves with the lab’s age at capture: the same alarm sits further left the older the lab is.
The capture setup pins both, in the shot’s frontmatter and not in the console. A hide step takes every row but the
ongoing stretch out of both renders ([data-testid=stretch-list] > li:not([data-testid=stretch-0])), so the list
holds one row at any lab age; an expect-count step after it fails the capture by name if the list shows other than
one, so a page whose row count still varies is refused instead of written. The marker row
([aria-label='Alarm raises on this timeline']) is masked whole: it is full width and a fixed height, and only the
markers inside it move. Both steps are web/e2e/shotsteps.mjs’s, shared by the capture and by
web/e2e/shotsteps.spec.ts, which runs the page’s declared steps and masks against markup shaped like the tab, with
and without the commissioning row and with the marker at different x, and requires the same baseline bytes (and that
the baseline moves without the step or the mask, so the test would fail if either were dropped). A shot whose
region renders a variable number of rows takes the same two steps.
A mask covers a box that holds still, and says that it is there
Section titled “A mask covers a box that holds still, and says that it is there”A mask is painted over the element the selector resolves to, so what a mask entry
resolves to is the whole contract. A text=/…/ selector resolves to the innermost element
carrying the text, the value’s own <span>, and so does a data-testid hook placed on that
span, so the painted box is the size of the value. The console does not render a
capture-relative value at one width (a relative age in the audit trail reads 9m or 11h,
fmtTime prints a short absolute (“Nov 23, 01:56 PM”), the Time component adds a relative age (“4m ago”), an age reads 9s or
17s), which means the same unchanged page paints a box seven pixels narrower at 9 o’clock than
at 11, and every recapture rewrites the baseline on a PR that changed no UI. So a mask over
text whose width can change paints a box the text cannot move, one of two ways:
-
Name a container the layout pins. The table cell, by appending
>> xpath=ancestor::td[1], whose width its column descriptor pins (#773); or a whole row, when the values that follow the text on its line move with it (a system header’s standard and size after its since-line). Check the container’s height as well as its width: a wrapping row whose wrap depends on the value’s width does not hold still. -
Declare the box, when the only container that holds still also holds what the shot exists to show (a since-line beside the health value it qualifies, #1081):
mask:- selector: "[data-testid=since-line]"width: 184The box is painted at the value’s top-left, as tall as the value and
widthCSS pixels wide, whatever the value reads; it suits a value whose left edge stays put (not right-aligned or centered, which moves the left edge with the text) and which ends its line. Size it from the widest value a capture can render, measured in the console’s own face, with some headroom, and say the measurement in the frontmatter comment. A value wider than its box fails the capture by name rather than leaving its tail live. -
Anchor the box at the right edge for a right-aligned value,
align: right: its right edge holds still and its left edge moves with its text, so the box is paintedwidthCSS pixels wide ending where the value ends.
A mask over text of fixed width (a uuid in a monospace face) stays on the text, which is also the only correct answer when the enclosing cell holds something the shot exists to show.
Standing masks cover console chrome that shows a count of the seed’s rows, and need no
frontmatter entry: the capture applies them to every shot wherever the element renders
(STANDING_MASKS in web/e2e/shotmasklib.mjs). Today that is the Catalog subrail’s per-catalog
counts (data-testid="catalog-entry-count"). A count is the seed’s, not the page’s, so a release
that adds a driver or a type moves a digit on every page under the Catalog shell; without the
standing mask each such PR failed the gate on a UI it never touched (#1482). Add a new count of
catalog rows to chrome the same way, a data-testid and an entry in that list, rather than a mask
on each shot.
The top bar’s inbox bell is masked the same way (data-testid="inbox-indicator"), because its
unread badge belongs to the run: the lab raises a notification partway through a capture, so a
shot taken near that moment shows the badge on one run and not the next (#2196). The badge sits
past the bell’s own corner, so its mask is a padded box, { selector, pad: N }: the element’s
bounding box grown by N pixels on every side, painted whether the badge renders or not.
The fill is deliberately visible in the baseline: the console’s own neutral surface, one step lighter than the card behind it, so a human reading a diff artifact sees a block placed over a value rather than a column that failed to render. The published docs never show the fill; they embed the clean render.
Prove a mask holds by recapturing with the clock moved, never by capturing twice a few minutes apart: two captures in the same hour of the same day are structurally blind to exactly the jitter a mask exists to absorb. The gate’s comparison is exact (#774), so a mask edge moving one pixel fails it and the proof is the gate itself with the clock moved:
make docs-shots-check # the gateDOCS_SHOTS_TZ=Asia/Kolkata make docs-shots-check # the proof: the clock moved, every pixel equalThe contract (the page’s declared mask paints a box the value cannot move, leaves what the shot
shows live, and the raster survives the value changing) is pinned at the browser tier by
web/e2e/shotmask.spec.ts. It reads each mask from the page’s own frontmatter and drives the
capture’s own mask code (web/e2e/shotmasklib.mjs) against synthetic markup, changing the value
on demand, so it also covers the single-digit day a timezone shift cannot reach. A new mask over
a varying value adds its case there. Every capture logs what each mask resolved to
(mask 59x td 190x37 <- text=/…/, mask 1x box 184x16 over span 157 <- [data-testid=since-line]),
so a mask that lands on the wrong element shows up in the capture output rather than in a raster
nobody diffs by hand: a selector mask whose box is as wide as its text is the tell.
Both renders’ page.screenshot calls (the clean shot in docs-shots.mjs and the baseline in
shootBaseline) go through withCaptureRetry, because Chromium can drop a capture under runner
load (Protocol error (Page.captureScreenshot): Unable to capture screenshot, #1177). That error
comes from the browser, not the page: Chromium has already forced the page to redraw and retried
its copy of the compositor surface five times before reporting it, so waiting on the page (a load
state, a requestAnimationFrame) cannot prevent it. The capture is retried once, and only on that
exact error, logging the failing call and the page’s state (URL, readyState, viewport) so a
recurrence shows in the capture output. Any other error and a second drop fail the capture.
Playwright’s own retries stays off, since it would also hide a real assertion flake.
Every PR demos its feature
Section titled “Every PR demos its feature”The docs teach a feature; a demo shows it working, on the PR itself, as a recording the
reviewer watches rather than a transcript they read. Every PR carries one: a terminal demo (a
VHS tape typed into a real terminal) for CLI and API behavior, a walkthrough (a Playwright
recording of the console) for an operator flow, both when it has both, and “n/a” only with a
reason in one clause (a test-only or docs-only change). The PR body’s Demo section links the
comment the run:demo label posts, and /ship-slice holds a PR that needs a demo to it, as it
holds a UI PR to its screenshots. Writing, recording and reviewing either kind is
demos.
Walkthroughs embed the same way
Section titled “Walkthroughs embed the same way”A page that teaches an operator flow can embed its walkthrough (the recorded, captioned flow a
PR carries as evidence) exactly as it embeds a screenshot: the id in walkthroughs frontmatter and
::walkthrough{#id} where it belongs. The page declares only the id; the title, captions, video
and stills come from the recording, copied into docs/public/walkthroughs/<id>/ by
make docs-walkthroughs, so a re-recorded flow updates the docs by a copy, never by an edit, and
the embed plays the video with controls. Writing,
recording, reviewing and embedding one is demos.
Where committed images live
Section titled “Where committed images live”A committed image (.png, .jpg, .jpeg, .gif, .webp) belongs in one of a short list of
homes, and a guard test in internal/build fails any other:
docs/public/screenshots/: the clean docs renders frommake docs-shots.docs/screenshots/baseline/: their masked twins, the diff baseline formake docs-shots-check.docs/public/walkthroughs/<id>/: walkthrough stills copied bymake docs-walkthroughs.docs/public/d2/: D2 diagram renders (SVG, an image home all the same)..github/screenshots/<n>/: PR evidence for PRn, including itswalkthroughs/subtrees.internal/avatar/testdata/: a test fixture the avatar renderer reads.
A new home is a line in the guard’s list with the reason it exists, plus a line here.
- No em dashes. Use commas, colons, periods, or parentheses.
- Write for someone learning the system, not someone who already built it. The same page serves the operator using the product and the contributor extending it.
Publishing
Section titled “Publishing”The docs site builds in CI on every PR that touches docs/** (the docs-build workflow,
.github/workflows/docs-build.yml, path-filtered), so a broken .mdx page, a dead import,
or invalid frontmatter fails the PR that introduces it. The published site is
docs.omniglass.hyperscaleav.com; in time, the same content is embedded into the Go binary
to serve at /docs.