---
id: DEC-000002
title: Build toolchain
summary: One Python script with three pinned dependencies validates and compiles the repository to static HTML and JSON; no site framework.
schema: 1
revision: 1
status: draft
visibility: public
created: 2026-12-03
taxonomy: [TAX-000014, TAX-000043]
relations:
  - {type: implements, target: STD-000001}
  - {type: depends_on, target: DEC-000001}
contributors:
  - {name: xmzr, role: author}
  - {name: Claude Opus 5.5, role: drafting, agent: true}
changes: Initial draft.
---

## Context

STD-000001 R9 requires a deterministic build that validates the repository and generates every index. The project brief proposed Astro. The decision principles rank long-term maintainability, inspectability and minimal dependencies above feature breadth.

## Options

Table 1. Build options.

| Option | Dependencies | Validation | Fit |
|---|---|---|---|
| Astro | Node.js toolchain, hundreds of packages | Content collections with Zod | Strong UI features; high release churn over a multi-decade horizon |
| Hugo | One binary | Weak: no schema validation | Fast; Go templates are hard to extend with custom checks |
| Quarto website | Quarto, Pandoc | None built in | Suited to computational documents, not to a typed object graph |
| MkDocs | Python, plugins | None built in | Documentation layout; weak object model |
| Single script | Python 3.11+, python-markdown, PyYAML, jsonschema | Full: schema, sections, references, revisions | The whole pipeline fits in one inspectable file |

## Decision

1. `record.py` implements `check`, `build` and `new`. Its dependencies are pinned in inline script metadata (PEP 723) and run with `uv run record.py`.
2. Output is static HTML with one style sheet and no client-side script, plus JSON records, a catalogue and a SKOS export.
3. URLs are flat: `/<ID>`, `/<ID>@<N>`, `/<ID>.json`, `/<ID>.md`, `/catalog.json`. They do not encode taxonomy or titles.
4. Search is deferred. Pagefind or an SQLite index is added when the repository exceeds about 100 objects.

## Consequences

- The build is replaceable: `catalog.json` exposes all metadata, so a different frontend can be built without touching objects.
- Interactive features (search, graph views) need separate work when they are added.
- Build time grows with commit count because revision history is read from git per object. A single-pass history reader replaces it when builds exceed about 10 s.
