# Triage docs & enforcement site

The documentation, audit and enforcement UI for the Triage Design System. It
serves the **system package itself** (`../tokens`, `../core`, `../examples`,
`../fonts`), the spec catalogue (`../spec`) and the provenance archive
(`../provenance`) — every component example on every page is the real system,
not a redrawn copy.

## Run

```bash
python3 site/serve.py                  # http://127.0.0.1:8102
python3 site/serve.py --host 0.0.0.0   # expose on all interfaces (tailnet)
```

Stdlib only. `/healthz` is the liveness endpoint.

## Routes

| Route | What it is |
|---|---|
| `/` | overview, principles, how to use the system, package map |
| `/foundations/color` | token palette, **live contrast audit**, ink literals, tint pairings |
| `/foundations/brand` | theming: token tiers, alias usage, white-label checklist |
| `/foundations/typography` · `/spacing` · `/icons` · `/motion` · `/accessibility` · `/voice` | the foundations |
| `/components/*` | buttons · forms · navigation · data · feedback · chat · overlays — live + markup |
| `/patterns/*` | dashboard · detail · settings · flows · dry-run · stepper · index & eval |
| `/spec` | **the enforceable rule catalogue** (TDS001–TDS010) and triage-lint usage |
| `/system` | package layout, consumption, token pipeline, versioning, decoupling status |
| `/screens` | all seven examples, live in iframes at desktop and phone widths |
| `/audit` | findings register against the original pack + what 0.1.0 resolves |
| `/docs` | doc index (provenance markdown under `/provenance/`) |
| `/tokens.json` | the DTCG token document (`application/design-tokens+json`) |
| `/api/tokens` | same document as `application/json` |

Static passthrough: everything under the repo root — `/tokens/*`, `/core/*`,
`/fonts/*`, `/examples/*`, `/patches/*`, `/spec/*`, `/provenance/*`, `/site/*`,
plus `/README.md`, `/AGENTS.md`, `/CHANGELOG.md`, `/PROVENANCE.md`,
`/RENAME-MAP.md`, `/VERSION`, `/rename-map.json`.

## Files

```
site/
├── serve.py              stdlib server + routes + static passthrough
├── site_data.py          palette, contrast math, inventories, icon registry
├── layout.py             docs shell (dogfoods the system's sidebar/topbar/tabbar)
├── pages_foundations.py  colour · brand · typography · spacing · icons · motion · a11y · voice
├── pages_components.py   buttons · forms · navigation · data · feedback · chat · overlays
├── pages_patterns.py     dashboard · detail · settings · flows · dry-run · stepper · misc
├── pages_meta.py         home · screens · audit · docs · spec · system · tokens · mcards demo
├── portfolio.css / .js   showcase chrome only (namespaced .p-*) — never system code
├── docs-from-app/        the app's interaction standard, verbatim
├── README.md             this file
└── AUDIT.md              the durable audit record
```

## Relationship to the system

- `../` is the artifact products consume; `site/` documents and audits it. The
  site loads the package over HTTP, so a broken build is visible immediately.
- Contrast numbers are computed at render time from `core/base.css`, so they
  cannot go stale.
- The pack (`../provenance`) is kept untouched as history, including the
  original design records and screenshots.

## Serving over Tailscale

```bash
sudo tailscale serve --bg --https=8102 http://127.0.0.1:8102
# → https://<host>.<tailnet>.ts.net:8102/
```

or bind directly with `--host 0.0.0.0`.
