ADR-015: A Generated Static Documentation Site on Vercel

Status: Accepted (proposed, then accepted as written by the maintainer) Date: 2026-10-17

Context

The repository became public and contains a large, well-structured body of Markdown — the README, the PRD, 14 ADRs, the threat model and risk register, the implementation plan, and the community files. GitHub renders all of it, but a project's front door should answer "what is this, does it work, how do I start" without asking a reader to navigate a repository.

There is still no web application. apps/docs-site was a placeholder, like the other apps/* directories, and the only real artifacts are the two Go binaries. A documentation site is therefore the correct first deployment: it publishes work that already exists, it exercises the release path, and it commits the project to nothing it has not built.

Three constraints shaped the decision:

  • No new dependencies. The project has one Go module with no external dependencies. Adding a JavaScript documentation framework (Docusaurus, VitePress, MkDocs) would introduce a second toolchain, a lockfile, a supply chain, and a second language for contributors to learn.
  • No drift. A hand-written marketing site diverges from the documentation it claims to summarize. The site must be generated from the same Markdown that reviewers approve in a pull request.
  • Vercel's build image has no Go toolchain. Confirmed by a real deployment: make site failed with make: go: No such file or directory. Downloading a compiler during a deploy, or caching one in .vercel/cache, trades a minute of build time and an external dependency for a slightly smaller commit.

Decision

The documentation site is generated by a standard-library Go program in this repository, committed as static HTML, and served by Vercel with no build step.

The generator

tools/docsite renders the repository's Markdown with no external dependencies. It supports the subset the docs actually use — ATX headings, fenced code, GFM tables, nested lists with task boxes, blockquotes, thematic breaks, and inline code, emphasis, strikethrough, links, images, and autolinks — and escapes everything else, so a document can never inject markup. Raw HTML is never passed through.

Links are rewritten at build time: a link to a published page becomes its site URL, a fragment becomes an in-page anchor, and anything else (ADRs are published; LICENSE, progress.md, and fixtures are not) becomes a blob/main link on GitHub. A link that cannot be resolved fails the build rather than shipping a dead end.

Published pages: the top-level README.md, PRD.md, CHANGELOG.md, CONTRIBUTING.md, SECURITY.md, CODE_OF_CONDUCT.md, every file under docs/ except progress.md, and every docs/decisions/*.md except the template. The ADR index becomes /docs/decisions.html; ADRs are discovered from the directory, so a new one needs no registration.

The artifact

The generated site is committed to apps/docs-site/public and served as-is. It contains no JavaScript, no web fonts, and no third-party stylesheets; the only external request is img.shields.io for the README badges, allowed explicitly by the CSP.

The output is a pure function of the Markdown — no timestamps, no build host, no commit hash — so the committed copy can be verified. TestCommittedSiteIsUpToDate rebuilds the site into a temporary directory and fails go test ./... when public/ no longer matches the docs. A stale site cannot be merged without a red test, and a page that is no longer generated is removed from the output directory rather than lingering.

The deployment

Vercel project scopra serves apps/docs-site/public with framework detection disabled, a no-op build command, and a no-op install command. vercel.json adds the headers the rest of the project expects: a CSP with script-src 'none', frame-ancestors 'none', and base-uri 'none'; HSTS; nosniff; frame denial; a restrictive referrer policy; COOP; and a Permissions-Policy that disables every feature the site does not use.

Canonical URLs, sitemap.xml, and robots.txt derive from one base URL. A push creates a preview deployment; the production alias https://scopra-six.vercel.app follows the project's production branch (main), and is promoted explicitly until this work lands there. The full procedure, including rollback, is in docs/operations/deployment.md.

Consequences

  • The site is always exactly the documentation in the repository, and reviewing a docs change includes reviewing the generated HTML that will be served.
  • Documentation changes touch generated files. make site is part of any commit that edits published Markdown, and the tests enforce it.
  • The deploy is a file copy: fast, deterministic, and impossible to break with a toolchain change or an upstream package.
  • The generator is a real program with tests rather than an ad-hoc script, so it is held to the same standard as the rest of the repository (gofmt, go vet, table-driven tests, fail-closed link resolution).
  • A future move to a hosted docs platform, a custom domain, or server-side search changes the hosting, not the source of truth. Markdown remains the only authored artifact.

Alternatives considered

  • Commit a Node static-site generator and build on Vercel. Rejected: a second toolchain, a dependency tree, and a build that can break for reasons unrelated to the documentation.
  • Download or cache a Go toolchain in the Vercel build. Rejected: an external download on every cold build, an unverifiable runtime, and a slower deploy for no artifact-level benefit.
  • Hand-write the marketing pages. Rejected: they would drift from the README, and the README is the document reviewers actually maintain.
  • Publish progress.md. Rejected: it is a 300 KB engineering log with per-increment verification notes. It stays in the repository, linked from the overview page.