docs+tooling: theme-alignment strategy + read-only drift check #61

Merged
peterswimm merged 1 commit from fix/theme-alignment-guard into main 2026-07-25 17:47:33 +00:00
Owner

What

Answers "how do we keep themes aligned across all destinations?" with a strategy doc and a read-only drift check.

Strategy doc — docs/reviews/theme-alignment-strategy.md

Maps the pipeline (single DTCG source → generators → per-platform artifacts → consumers), a gated-vs-ungated table, and the drift surface, with ranked recommendations:

  1. Native app drift (highest leverage) — Swift/Flutter own divergent values under the canonical token names; reintroduce Swift+Dart emitters from the DTCG (udg.dart-key / a udg.swift-key), generated + gated like forgejo.py, source-injected to the sibling repos.
  2. Consolidate the two disagreeing sync-manifest.ymls and make consumers: drive a real just sync.
  3. Retokenize / keep on the radar the hand-authored WP artifacts (atahualpa-tctd, toilville-fse non-color ladders).
  4. Fix doc-drift traps (the unread udg/baseline/tokens/*.yml referenced by CLAUDE.md/extract.py; the stale macOS path).

Drift check — udg/generators/align_check.py + just align-check

Read-only, stdlib. Two audits:

  • Hand-authored raw hex — flags raw hex literals (not var() fallbacks) in files that should track tokens (atahualpa-tctd/style.css → 34 candidates).
  • Native drift — compares the sibling repo's Dart/Swift token values against dist/rituals/tokens.dtcg.json matched by udg.dart-key. Already catches 4 real divergences: Dart brandPrimary #CC5C37 ≠ dtcg #C05734, accentWarning, textDim, textMeta. Skips the native audit cleanly when the sibling Toilville_Rituals repo isn't checked out — so CI stays green.

just align-check-strict (check mode) exits non-zero on native drift for opt-in enforcement.

Testing

  • just align-check reports the drift; just align-check-strict exits 1 (found divergence).
  • Not wired into just check (avoids depending on the sibling repo) — just check green, pytest 132 passed, yamllint clean.

Scope

The native emitters and manifest consolidation (items 1–2) touch the sibling repos and the manifest schema — documented as recommendations, not built here.

## What Answers "how do we keep themes aligned across all destinations?" with a **strategy doc** and a **read-only drift check**. ### Strategy doc — `docs/reviews/theme-alignment-strategy.md` Maps the pipeline (single DTCG source → generators → per-platform artifacts → consumers), a gated-vs-ungated table, and the drift surface, with **ranked recommendations**: 1. **Native app drift (highest leverage)** — Swift/Flutter own divergent values under the canonical token names; reintroduce Swift+Dart emitters from the DTCG (`udg.dart-key` / a `udg.swift-key`), generated + gated like `forgejo.py`, source-injected to the sibling repos. 2. Consolidate the two disagreeing `sync-manifest.yml`s and make `consumers:` drive a real `just sync`. 3. Retokenize / keep on the radar the hand-authored WP artifacts (`atahualpa-tctd`, `toilville-fse` non-color ladders). 4. Fix doc-drift traps (the unread `udg/baseline/tokens/*.yml` referenced by CLAUDE.md/extract.py; the stale macOS path). ### Drift check — `udg/generators/align_check.py` + `just align-check` Read-only, stdlib. Two audits: - **Hand-authored raw hex** — flags raw hex literals (not `var()` fallbacks) in files that should track tokens (`atahualpa-tctd/style.css` → 34 candidates). - **Native drift** — compares the sibling repo's Dart/Swift token values against `dist/rituals/tokens.dtcg.json` matched by `udg.dart-key`. **Already catches 4 real divergences**: Dart `brandPrimary #CC5C37 ≠ dtcg #C05734`, `accentWarning`, `textDim`, `textMeta`. **Skips the native audit cleanly** when the sibling `Toilville_Rituals` repo isn't checked out — so CI stays green. `just align-check-strict` (`check` mode) exits non-zero on native drift for opt-in enforcement. ## Testing - `just align-check` reports the drift; `just align-check-strict` exits 1 (found divergence). - **Not wired into `just check`** (avoids depending on the sibling repo) — `just check` green, `pytest` 132 passed, `yamllint` clean. ## Scope The native emitters and manifest consolidation (items 1–2) touch the sibling repos and the manifest schema — documented as recommendations, not built here.
docs+tooling: theme-alignment strategy + read-only drift check
All checks were successful
Test Generator / lint-workflows (pull_request) Successful in 28s
Security Scans / Gitleaks secret scan (pull_request) Successful in 42s
Security Scans / Trivy filesystem scan (pull_request) Successful in 47s
UDG dist drift gate / dist/ matches dtcg + udg sources (pull_request) Successful in 17s
Test Generator / lint-prose (pull_request) Successful in 28s
Test Generator / test (pull_request) Successful in 3m33s
3b944a0e7b
Map how the single DTCG source fans out to every destination, which are gated,
and where drift creeps in — and add a scanner that flags it.

- docs/reviews/theme-alignment-strategy.md — the source→destinations map, the
  gated-vs-ungated table, the drift surface (native Swift/Flutter apps, the two
  disagreeing sync-manifests, ungated hand-authored WP artifacts, doc-drift
  traps), and ranked recommendations (native emitters via udg.dart-key/a
  swift-key; manifest consolidation + actionable consumers:; retokenizing the WP
  artifacts; doc fixes).
- udg/generators/align_check.py + `just align-check` (read-only, stdlib):
    · hand-authored raw-hex scan (atahualpa-tctd) → tokenization candidates
    · native drift: Dart/Swift values vs dist/rituals/tokens.dtcg.json matched by
      udg.dart-key. Already catches 4 real divergences (Dart brandPrimary
      #CC5C37 ≠ dtcg #C05734, plus accentWarning/textDim/textMeta). Skips the
      native audit cleanly when the sibling Toilville_Rituals repo isn't checked
      out, so CI stays green.
  `just align-check-strict` exits non-zero on native drift for opt-in enforcement.

Not wired into `just check` (avoids the sibling-repo dependency). Native emitters
and manifest consolidation are documented as recommendations, not built here.
peterswimm deleted branch fix/theme-alignment-guard 2026-07-25 17:47:33 +00:00
Sign in to join this conversation.
No description provided.