create-ailk 0.46.6 → 0.48.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (144) hide show
  1. package/README.md +180 -43
  2. package/component-catalog.json +223 -285
  3. package/component-catalog.md +1 -1
  4. package/dist/apply-design.d.ts +26 -68
  5. package/dist/apply-design.js +150 -322
  6. package/dist/cli.js +152 -17
  7. package/dist/compare-chrome.d.ts +108 -0
  8. package/dist/compare-chrome.js +481 -0
  9. package/dist/compare-look.d.ts +94 -0
  10. package/dist/compare-look.js +378 -0
  11. package/dist/copy.js +1 -1
  12. package/dist/design-compile.d.ts +17 -21
  13. package/dist/design-compile.js +32 -56
  14. package/dist/design-files.d.ts +93 -0
  15. package/dist/design-files.js +312 -0
  16. package/dist/design-home.d.ts +4 -2
  17. package/dist/design-home.js +88 -6
  18. package/dist/design-names.d.ts +13 -0
  19. package/dist/design-names.js +76 -0
  20. package/dist/design-package.d.ts +46 -56
  21. package/dist/design-package.js +285 -288
  22. package/dist/design-presets.d.ts +41 -0
  23. package/dist/design-presets.js +83 -4
  24. package/dist/design-scaffold.d.ts +12 -2
  25. package/dist/design-scaffold.js +72 -34
  26. package/dist/generated/design-settings.d.ts +56 -0
  27. package/dist/generated/design-settings.js +237 -0
  28. package/dist/index.d.ts +1 -1
  29. package/dist/index.js +2 -2
  30. package/dist/inventory.d.ts +3 -2
  31. package/dist/inventory.js +10 -4
  32. package/dist/lib/design-checks.d.ts +46 -0
  33. package/dist/lib/design-checks.js +79 -1
  34. package/dist/lib/env-catalog.js +5 -1
  35. package/dist/lib/module-license-gate.d.ts +1 -1
  36. package/dist/lib/module-license-gate.js +1 -1
  37. package/dist/lib/render-verdict.d.ts +13 -1
  38. package/dist/lib/render-verdict.js +41 -1
  39. package/dist/look-hub.d.ts +44 -0
  40. package/dist/look-hub.js +130 -0
  41. package/dist/look-record.d.ts +35 -0
  42. package/dist/look-record.js +85 -0
  43. package/dist/look-samples.d.ts +66 -0
  44. package/dist/look-samples.js +456 -0
  45. package/dist/look-settings.d.ts +53 -0
  46. package/dist/look-settings.js +363 -0
  47. package/dist/module-architecture.js +12 -0
  48. package/dist/parse-args.d.ts +10 -6
  49. package/dist/parse-args.js +26 -13
  50. package/dist/programmatic.d.ts +1 -19
  51. package/dist/programmatic.js +65 -103
  52. package/dist/retired-design-bodies.d.ts +29 -0
  53. package/dist/retired-design-bodies.js +51 -0
  54. package/dist/seed-flows.d.ts +1 -1
  55. package/dist/seed-flows.js +12 -14
  56. package/dist/seed-workspace.d.ts +4 -1
  57. package/dist/seed-workspace.js +139 -17
  58. package/dist/site-chrome.d.ts +41 -41
  59. package/dist/site-chrome.js +50 -70
  60. package/dist/site-fonts.d.ts +10 -14
  61. package/dist/site-fonts.js +5 -1
  62. package/dist/starter-grid.d.ts +2 -2
  63. package/dist/strip-look-copies.d.ts +67 -0
  64. package/dist/strip-look-copies.js +591 -0
  65. package/dist/template-manifest.d.ts +6 -14
  66. package/dist/template-manifest.js +0 -9
  67. package/dist/template-record.d.ts +3 -1
  68. package/dist/template-record.js +3 -1
  69. package/dist/topology.d.ts +15 -0
  70. package/dist/topology.js +60 -0
  71. package/dist/update.d.ts +57 -1
  72. package/dist/update.js +742 -13
  73. package/package.json +3 -4
  74. package/site-templates/aliases/hub.TEMPLATE-MANIFEST.json +2 -31
  75. package/site-templates/designs/minimalism/DESIGN.md +163 -297
  76. package/site-templates/designs/minimalism/LOOK.md +42 -0
  77. package/site-templates/designs/minimalism/design.yaml +167 -0
  78. package/site-templates/designs/standard/DESIGN.md +145 -149
  79. package/site-templates/designs/standard/LOOK.md +42 -0
  80. package/site-templates/designs/standard/design.yaml +72 -0
  81. package/site-templates/marketing-site/TEMPLATE-MANIFEST.json +2 -31
  82. package/site-templates/marketing-site/TEMPLATE-MANIFEST.md +1 -25
  83. package/site-templates/marketing-site-free/TEMPLATE-MANIFEST.json +2 -31
  84. package/site-templates/marketing-site-free/TEMPLATE-MANIFEST.md +1 -25
  85. package/site-templates/shapes/local-business-service/TEMPLATE-MANIFEST.json +2 -31
  86. package/site-templates/shapes/local-business-service/TEMPLATE-MANIFEST.md +1 -25
  87. package/site-templates/shapes/organization-service/TEMPLATE-MANIFEST.json +2 -31
  88. package/site-templates/shapes/organization-service/TEMPLATE-MANIFEST.md +1 -25
  89. package/site-templates/shapes/person-service/TEMPLATE-MANIFEST.json +2 -31
  90. package/site-templates/shapes/person-service/TEMPLATE-MANIFEST.md +1 -25
  91. package/site-templates/shapes/person-service/content/_site.mdx +0 -26
  92. package/templates/.claude/rules/extending.md +3 -2
  93. package/templates/.env.example +11 -4
  94. package/templates/CLAUDE.md +1 -1
  95. package/templates/DESIGN.md +145 -149
  96. package/templates/README.md +15 -16
  97. package/templates/apps/api/.env.example +29 -4
  98. package/templates/apps/api/CLAUDE.md +7 -4
  99. package/templates/apps/api/src/__tests__/vercel-handler.test.ts +176 -2
  100. package/templates/apps/api/src/lib/__mocks__/prisma.ts +30 -4
  101. package/templates/apps/api/src/vercel-handler.ts +32 -2
  102. package/templates/apps/mcp/.env.example +8 -0
  103. package/templates/apps/mcp/CLAUDE.md +5 -3
  104. package/templates/apps/web/.env.example +10 -3
  105. package/templates/apps/web/CLAUDE.md +31 -4
  106. package/templates/apps/web/app/[locale]/layout.tsx +141 -77
  107. package/templates/apps/web/app/llms.txt/__tests__/site-listing.test.ts +13 -3
  108. package/templates/apps/web/app/not-found.tsx +11 -11
  109. package/templates/apps/web/auth.ts +48 -35
  110. package/templates/apps/web/jest.config.cjs +5 -0
  111. package/templates/apps/web/lib/__tests__/hub-site-config.test.ts +542 -10
  112. package/templates/apps/web/lib/__tests__/library-fonts.test.ts +35 -0
  113. package/templates/apps/web/lib/__tests__/page-chrome-navigation.test.ts +233 -0
  114. package/templates/apps/web/lib/__tests__/page-chrome.test.ts +123 -26
  115. package/templates/apps/web/lib/__tests__/section-look.test.ts +150 -0
  116. package/templates/apps/web/lib/__tests__/site-identity-feature-list.test.ts +19 -1
  117. package/templates/apps/web/lib/__tests__/site-navigation.test.ts +288 -0
  118. package/templates/apps/web/lib/__tests__/site-theme.test.ts +81 -289
  119. package/templates/apps/web/lib/deck-page.ts +3 -10
  120. package/templates/apps/web/lib/deploy-fonts.ts +12 -0
  121. package/templates/apps/web/lib/hub-site-config.ts +237 -29
  122. package/templates/apps/web/lib/library-fonts.ts +41 -0
  123. package/templates/apps/web/lib/mcp-oauth.ts +11 -4
  124. package/templates/apps/web/lib/page-chrome.ts +105 -20
  125. package/templates/apps/web/lib/section-look.ts +28 -0
  126. package/templates/apps/web/lib/site-design.ts +205 -0
  127. package/templates/apps/web/lib/site-navigation.ts +208 -0
  128. package/templates/apps/web/lib/site-theme-head.ts +98 -13
  129. package/templates/apps/web/lib/site-theme.ts +40 -62
  130. package/templates/apps/web/messages/en.json +0 -6
  131. package/templates/apps/web/next.config.mjs +213 -11
  132. package/templates/apps/web/package.json +2 -0
  133. package/templates/apps/web/site-pages.config.tsx +4 -2
  134. package/templates/content/_site.mdx +0 -26
  135. package/templates/design.yaml +75 -0
  136. package/templates/project.yaml +14 -0
  137. package/versions.json +52 -51
  138. package/site-templates/marketing-site/DESIGN.md +0 -259
  139. package/site-templates/marketing-site-free/DESIGN.md +0 -259
  140. package/site-templates/saas-product/DESIGN.md +0 -259
  141. package/templates/apps/web/lib/__tests__/deck-page.test.ts +0 -288
  142. package/templates/apps/web/lib/__tests__/site-theme-head.test.ts +0 -70
  143. package/templates/apps/web/lib/site-chrome.ts +0 -46
  144. package/templates/apps/web/lib/site-fonts.ts +0 -15
@@ -43,7 +43,7 @@ Raw HTML is allowed only when no `@working-theory/ui` component fits. Flag it in
43
43
  - Animations: only `transform` and `opacity`. Never `transition-all`.
44
44
  - Every interactive element needs hover, focus-visible, and active states.
45
45
 
46
- The four widths above are the responsive contract. Brand reference files (logos, photos, colour and type notes) live in `brand_assets/` at the repo root; the site's own brand colours and fonts are set in `content/_site.mdx` under `brand.colors` and `brand.fonts`. The signed-out header button is set there too, as `header.cta` (`label`, `href`), with `header.signIn: link | hidden` choosing whether Sign in stays beside it as a text link — never by editing `app/[locale]/layout.tsx`. Each page's chrome is set there too (#10049, resolved by `lib/page-chrome.ts`): `header.style` (`full | bare | none`), `footer.style` (`columns | centered | closing | none`), `layout` (`deck | default`, the home's) and one `{ header, footer }` key per route family (`blog`, `docs`, `services`, …), with a page's own `header:` / `footer:` / `layout:` frontmatter winning over all of them. The closing footer alone also reads three site-level keys (#10550): `footer.locality` (the line above the email, winning over the identity's address), `footer.actions` (one or two `{ label, href }` site paths — the primary, then the secondary — in place of the auth links) and `footer.legalBar` (off by default: `true` moves the legal line into a full-width bottom bar, on the deck's closing slide its bottom edge). The cookie notice's look is set there too (#10555, #10721): `consent.appearance` is `compact` (the floating card, bottom-left) or `hairline` (the full-width band on the page ground); absent, it follows the design's `chromeStyle` — the band under `minimal`, else the card. Only the band waits for the minimal deck home's first slide to leave view (#7782); the card shows on load on every page.
46
+ The four widths above are the responsive contract. Brand reference files (logos, photos, colour and type notes) live in `brand_assets/` at the repo root; the site's own brand colours and fonts are set in `content/_site.mdx` under `brand.colors` and `brand.fonts`. The signed-out header button is set there too, as `header.cta` (`label`, `href`), with `header.signIn: link | hidden` choosing whether Sign in stays beside it as a text link — never by editing `app/[locale]/layout.tsx`. Each page's chrome is set there too (#10049, resolved by `lib/page-chrome.ts`): `header.style` (`full | mark-only | bare | none`), `footer.style` (`columns | centered | closing | none`) — one set of values each, `HEADER_STYLES` and `FOOTER_STYLES` in `@working-theory/validation`, shared with a look's `layout.nav` / `layout.footer` and the hub's design record (#12470 D7), `layout` (`deck | default`, the home's) and one `{ header, footer }` key per route family (`blog`, `docs`, `services`, …), with a page's own `header:` / `footer:` / `layout:` frontmatter winning over all of them. The closing footer alone also reads three site-level keys (#10550): `footer.locality` (the line above the email, winning over the identity's address), `footer.actions` (one or two `{ label, href }` site paths — the primary, then the secondary — in place of the auth links) and `footer.legalBar` (off by default: `true` moves the legal line into a full-width bottom bar, on the deck's closing slide its bottom edge). The cookie notice's look is set there too (#10555, #10721): `consent.appearance` is `compact` (the floating card, bottom-left) or `hairline` (the full-width band on the page ground); absent, it follows the design's `chromeStyle` — the band under `minimal`, else the card. Only the band waits for the minimal deck home's first slide to leave view (#7782); the card shows on load on every page.
47
47
 
48
48
  ## Local dev
49
49
 
@@ -1113,13 +1113,34 @@ A list page whose frontmatter sets `navOnly: true` (valid on a registry list typ
1113
1113
 
1114
1114
  ## A hub-connected site's identity
1115
1115
 
1116
- **A site connected to its hub reads its name, description, legal name, contact and sameAs from the hub (#11456).** Hub-connected means a spoke key on the wire (`sendsSpokeKey()`), whatever the content adapter — a site serving file content with a key reads the hub too (#11515); `lib/hub-site-config.ts`'s `readHubSite()` then reads `GET /v1/content/site-config` through `siteConfig.get()` — the key's own workspace's identity and seo rows, 401 to any other caller — cached by `unstable_cache` under `siteConfigTag()` for at most 300 s. A site with no spoke key makes no call and renders from `_site.mdx` exactly as before.
1116
+ **A site connected to its hub reads its name, description, legal name, contact and sameAs from the hub (#11456).** Hub-connected means a spoke key on the wire (`sendsSpokeKey()`), or — a single-tenant site, its own hub (#12390) — no key but an API address the site names (`apiBaseConfigured()`: `AILK_API_URL`, `NEXT_PUBLIC_AILK_API_URL` or `NEXT_PUBLIC_API_URL`; `getApiBase()`'s `localhost:3001` default does not count) over `https:` or loopback (`isSafeTransport`), whatever the content adapter (#11515). `lib/hub-site-config.ts`'s `readHubSite()` then reads `GET /v1/content/site-config` through `siteConfig.get()` — a key's own workspace's identity and seo rows, or for a keyless call the deployment's one workspace's on a deployment that has exactly one and is not a hub; 401 to any other caller — cached by `unstable_cache` under `siteConfigTag()` for at most 300 s, keyed by the spoke key's digest or, keyless, `keyless:` plus the API address's digest. A site with neither a key nor an API address makes no call and renders from `_site.mdx` exactly as before.
1117
+
1118
+ - **A refused keyless read is "no rows".** A 401 to a keyless read resolves `{ identity: null, seo: null }` inside the cached callback, so the refusal is held for the cache's lifetime with one `console.warn`, and the site renders from `_site.mdx` — the hub's own web app and a site on a multi-workspace deployment land here. A keyed 401 still throws, so a spoke whose key was revoked keeps its last good value. Any other failed keyless read makes the instance wait 15 s (`HUB_SITE_RETRY_SECONDS`) before asking again.
1117
1119
 
1118
1120
  - **Who reads it.** `resolveSiteBrand()` (`lib/site-brand.tsx`) gives the locale layout's title, description, og/twitter copy, Nav/Footer `siteName` and copyright holder, and both llms.txt headings; `lib/site-identity.ts` registers a JSON-LD reader (`setSiteIdentityReader`) whose registration keeps the file's `baseUrl`, so no hub value moves an `@id`; the contact email and the closing footer's contact lines read the value the last read resolved (`heldHubSite()`), because their seam is synchronous. `SITE_NAME`'s other readers (og image, icons, auth, mcp.json) keep the file value. The seo row's `robots.index` (the retired Allow search indexing) is read by nothing (#11978 D7).
1119
1121
  - **A hub row is the whole identity.** A field the operator cleared is absent, never refilled from the file; only a missing row, an unreadable one or a failed read falls back to `_site.mdx`. The file's top-level `contactEmail` stays the contact email's fallback. Hub values are collapsed to one line.
1120
- - **A save shows without a redeploy.** A 200 PUT of `identity` or `seo` sends the signed `site-config` revalidate event (`notifySiteConfigRevalidate`) to the site and its spokes; `app/api/revalidate/route.ts` answers it by purging `siteConfigTag()`. The 300 s expiry is the net for a spoke with no `revalidateUrl`.
1122
+ - **A save shows without a redeploy.** A 200 PUT of `identity` or `seo` sends the signed `site-config` revalidate event (`notifySiteConfigRevalidate`) to the env site target (`CONTENT_REVALIDATE_URL`) and the hub's spokes; `app/api/revalidate/route.ts` answers it by purging `siteConfigTag()`. The 300 s expiry is the net for a site with no revalidate target.
1121
1123
  - **A hub outage never breaks a page**: a failed read writes no cache entry and serves the instance's last good value, else the file.
1122
1124
 
1125
+ ## A site's navigation from its hub
1126
+
1127
+ **A hub-connected site renders its header and footer from its workspace's navigation record when its hub read carries one (#12401).** The record (#12400, `siteNavigationSchema` in `@working-theory/validation`) rides the identity read: `readHubSite()` (`lib/hub-site-config.ts`) answers `navigation: { version, record } | null` beside `identity` and `seo`, in the same request, the same `unstable_cache` entry under `siteConfigTag()` and the same 300 s expiry, so the `site-config` purge a save sends refreshes it on the next request. The cache key carries a shape part (`nav1`), so an entry written by older site code is never served as this shape.
1128
+
1129
+ - **What is read as no record.** An absent `navigation` key (a hub older than #12400), `null`, a version that is not a positive integer, or a record this site's schema refuses — the last two with one warning per distinct refused field path (`[hub-site-config] navigation unreadable at <path>`), never a value. The schema check is the only barrier between a hub value and a link (`localeHref` passes any scheme through), so only its parsed output is kept; `identity` and `seo` are parsed as before in every case.
1130
+ - **One translator.** `lib/site-navigation.ts`'s `navigationChrome(record, locale)` turns the record into the existing `Nav` and `Footer` props — no `@working-theory/ui` prop changes. A `page` target goes to the page's public path (`pagePath` at `SERVICES_PATH`, then `toPublicDocsHref`); a `path` or `url` target is used as stored, and the layout's three rewrite passes never run on a record. A label is the visitor's locale's text (a case-insensitive `byLocale` match), else its default text. Keys are positional and every one contains a dot (`rec.h0`, `rec.h1.g0.l2`, `rec.f0`), so a record label never replaces a `nav` message. Order is the record's; the hub has already removed every item whose page is not live. Every emitted address must be a site path or an `http:`/`https:` URL, else it throws; `safeNavigationChrome` catches that, logs one `[site-navigation] record not rendered (<error name>)` and answers `null`.
1131
+ - **The layout.** With a translation (`app/[locale]/layout.tsx`), the header items and menus, the header button (its Sign in display the record's where it sets one, else `_site.mdx`'s `header.signIn`), the footer columns, the bottom bar (the record's links, then the cookie-settings link; no FAQ) and the closing footer's locality and actions come from it; a part the record leaves out is absent, never refilled from the files. The legal bar, the mark-only rule, "Your account", the bare header's back arrow, the social links and the logo are unchanged. Every page carries one `<meta name="ailk-nav-source">` in `<head>`, `content="record"` with `data-version="<n>"` or `content="files"`, whatever the header style; the element wrapping the site header, when one renders, carries the same as `data-nav-source` / `data-nav-version` (for #12403's and #12404's proof of render).
1132
+ - **Styles.** Style belongs to the hub's design record, not the navigation record (#12470 D7): `resolveHomeChrome` (`lib/page-chrome.ts`) lays the design record's `chrome` — `header`, `footer` and each route family's `header` / `footer` — over `_site.mdx`'s through `withDesignChrome`, where the record sets them, whenever the hub read carries a design record. A family's `path` stays the file's, and a page's own frontmatter still wins over both. The navigation record holds words and links only; a stored navigation row an older hub wrote with style keys is read without them. It answers the rendered navigation record as `navigation`, which is the layout's one read of it. A resolved `mark-only` header draws the logomark alone with no menus, whether a look, `_site.mdx`, a page or the design record set it.
1133
+ - **The fallback, until #12404.** With no record, no hub read, or a failed read with nothing held, every page renders from `lib/nav-config.ts`, its `nav` labels and `_site.mdx` exactly as before; those stay read on every request until #12404 removes them.
1134
+
1135
+ ## A site's look from its hub
1136
+
1137
+ **A hub-connected site renders its colours, type treatments, layout and fonts from its workspace's design record when its hub read carries one (#12473).** The record (#12470, `siteDesignSchema`) rides the same `readHubSite()` read as the identity and the navigation: one request, one cache entry under `siteConfigTag()`, refreshed by the `site-config` purge a save awaits, so a save shows on the next request with no deploy. `lib/site-design.ts`'s `readSiteDesign()` reads two parts of it and nothing else: the settings the hub worked out from the record's library look and its differences (`design.settings`, `resolveDesign` on the hub — the site never works a look out and never imports the look catalogue) and the record's `brand.colors` / `brand.fonts`. `chrome` (the header and footer styles) is #12470's, laid over `_site.mdx` by `withDesignChrome` (§ A site's navigation from its hub); `look`, `from`, `changes`, `brand.logo` and every free-text field are never read.
1138
+
1139
+ - **What renders.** With worked-out settings, the theme is `compileDesignTheme(settings)` (`@working-theory/theme`, the compile `create-ailk` runs, held equal to it by `packages/create-ailk/__tests__/design-compile-parity.test.ts`) in both modes with its band set, and the layout knobs are `compileDesignLayout(settings.layout)` in place of the generated `lib/site-chrome.ts` — in the locale layout, `resolveHomeChrome` (its `knobs`, which the home's deck knobs default to), the deck pages' `inputsFor` and the root 404, by one rule: `design?.layout ?? siteChrome`. The record's brand colours and fonts lie over whichever theme renders (`hubBrandToSiteBrand`: the primary in both modes with a readable `primaryFg` for a plain hex, the first secondary as `accent`, one font for both roles or two for display and body). Each part the record leaves out is the files': `_site.mdx`'s `theme:` and `brand:`, the generated `site-chrome.ts` and `site-fonts.ts`. The ground is `matchedGround` of the rendered colours (#12500 D3).
1140
+ - **No record renders today's page.** `readSiteDesign()` answers `null` — and the theme head, `<html>` class and knobs are character for character the files' — with no record, a record whose `settings` is `null` and whose brand sets no colours or fonts (a record holding only `chrome`, as #12470's migration writes), no hub read, or a failed read with nothing held. A failed read serves the last good record.
1141
+ - **All or nothing, and the barrier.** Every check and translation runs in one `try`: the shared schemas again at render (a cached entry may predate a tightened grammar), no newline and balanced quotes in every font stack, a 65,536-character bound on what is compiled, and `recordThemeHead` — the one function that writes record CSS — refusing a record value holding a `<` or CSS holding `</`. Any failure renders theme, faces and layout from the files with one `[site-design] record not rendered (<error name>)` warning per record version.
1142
+ - **Fonts.** Every face in `LIBRARY_FONTS` (`@working-theory/theme`) is built into every site from its `@fontsource-variable` package by `lib/library-fonts.ts` (`next/font/local`, never preloaded, so a page downloads only the face it uses), and the record switches among them live: a stack's library family is written as its `var(--font-lib-<slug>)`, and `<html>` carries the classes of the faces the rendered stacks use. A face outside the library is built in at the next deploy: on a hub-connected production build, `next.config.mjs` reads the record once (5 s bound) and rewrites `lib/deploy-fonts.ts` with one `next/font/google` call per family next/font can build without a weight (a variable font with a `latin` subset), skipping any other with one warning naming its role; every other build, and any failed read, leaves the committed empty default, so a local hub-connected `next build` can leave that file changed. `designFontEffects` (`@working-theory/theme`) answers which of a record's font roles are `live` and which wait for the next deploy, for the record's read to answer the Admin.
1143
+
1123
1144
  ## AEO & performance
1124
1145
 
1125
1146
  - Static rendering is the default. Don't introduce client rendering without a reason.
@@ -1136,7 +1157,13 @@ A list page whose frontmatter sets `navOnly: true` (valid on a registry list typ
1136
1157
  - Don't reach into `apps/api` or `apps/mcp` from `apps/web`. They're peer apps — talk via HTTP/MCP.
1137
1158
  - Don't commit images to `screenshots/` — only the `.gitkeep` is tracked.
1138
1159
 
1139
- Last updated: 2026-11-24 — § Pricing page: the billing toggle's three `pricingOfferings` keys, placed on every pricing section by `renderPage` (#12284) — verified against `messages/en.json` and `packages/page-renderer/src/{index.tsx,billing-toggle-labels.ts}`; 2026-11-24 — § Pricing page: every pricing section with a shown or hidden billing toggle follows the `ailk:billing-period` event, so two sections on one page show one period (#12281) — verified against `packages/ui/src/sections/Pricing.tsx`; 2026-11-24 — § Pricing page: a plan column's price carries the product's Stripe unit label, as its card's does (#12280) — verified against `lib/offerings-pricing.ts` and `packages/ui/src/blocks/PlanBar.tsx`.
1160
+ Last updated: 2026-11-28 — § A site's look from its hub: the design record's worked-out settings and brand render the theme, layout knobs and fonts, each part else the files', with library faces built in and switched live and other faces written at the next deploy (#12473) — verified against `lib/{site-design,site-theme-head,library-fonts,deploy-fonts,page-chrome,deck-page}.ts`, `app/[locale]/layout.tsx`, `app/not-found.tsx`, `next.config.mjs` and `packages/theme/src/{design-compile,library-fonts}.ts`.
1161
+
1162
+ Prior: 2026-11-26 — § A site's navigation from its hub: the hub read carries the workspace's navigation record, one translator turns it into the Nav and Footer props, the record's styles win over `_site.mdx`'s where it sets them and only when it renders, and the `<head>` meta and the header wrapper name its source (#12401) — verified against `lib/{hub-site-config,site-navigation,page-chrome}.ts` and `app/[locale]/layout.tsx`.
1163
+
1164
+ Prior: 2026-11-25 — § A hub-connected site's identity: a single-tenant site with no spoke key reads its one workspace's identity and seo when it names an API address over `https:` or loopback, a refused keyless read is held as no rows, and a failed one waits 15 s (#12390) — verified against `lib/hub-site-config.ts`, `packages/api-client/src/http.ts`, `packages/api/src/routes/content/site-config.ts` and `packages/api/src/services/revalidation.ts`.
1165
+
1166
+ Prior: 2026-11-24 — § Pricing page: the billing toggle's three `pricingOfferings` keys, placed on every pricing section by `renderPage` (#12284) — verified against `messages/en.json` and `packages/page-renderer/src/{index.tsx,billing-toggle-labels.ts}`; 2026-11-24 — § Pricing page: every pricing section with a shown or hidden billing toggle follows the `ailk:billing-period` event, so two sections on one page show one period (#12281) — verified against `packages/ui/src/sections/Pricing.tsx`; 2026-11-24 — § Pricing page: a plan column's price carries the product's Stripe unit label, as its card's does (#12280) — verified against `lib/offerings-pricing.ts` and `packages/ui/src/blocks/PlanBar.tsx`.
1140
1167
 
1141
1168
  Prior: 2026-11-23 — § Pricing page: a comparison table's plan columns — the plan column, `withPlanColumns`, `offeringsPlanColumns`, the start period and the billing event, the unresolved column and its advisory finding, the checkout cell-link rule — and the retired `with-comparison-table` read as a pricing section and a comparison table (#12246) — verified against `lib/pricing-page.ts`, `lib/offerings-pricing.ts`, `packages/validation/src/schemas/{page-sections,offerings}.ts`, `packages/ui/src/blocks/PlanBar.tsx` and `packages/ui/src/sections/ComparisonTable.tsx`.
1142
1169
 
@@ -6,8 +6,7 @@
6
6
  // Session-aware Nav actions — Sign in signed out, one "Your account" link signed in (#4984, #11095 D6)
7
7
  // Auth route group — the marketing chrome is dropped on the five (auth) paths (#5963)
8
8
  // Account area — the marketing chrome AND the consent Banner are dropped on /account paths (#7430)
9
- // Site-declared theme — `_site.mdx` `theme:` block → token overlay → CSS vars
10
- // Design web faces — generated `lib/site-fonts.ts` → beneath `brand.fonts` (#7720)
9
+ // Site look — the hub design record, else the base look under `_site.mdx` `brand:` (#12473, #12477)
11
10
  //
12
11
  // Sits under app/[locale]/ and sets the <html lang> attribute to the
13
12
  // active locale. next-intl's NextIntlClientProvider is wired here so
@@ -49,6 +48,7 @@ import {
49
48
  } from "@working-theory/ui/chrome";
50
49
  import {
51
50
  cookiePurpose,
51
+ isBarHeader,
52
52
  NEWSLETTER_FLOW_SLUG,
53
53
  resolveConsentStatement,
54
54
  SITE_CONSENT_CONFIG_DEFAULTS,
@@ -117,7 +117,7 @@ import {
117
117
  withPublicServicesPaths,
118
118
  } from "../../lib/services-path";
119
119
  import { resolveContentRoot, resolveSiteBrand } from "../../lib/site-brand";
120
- import { siteChrome, type SiteChrome } from "../../lib/site-chrome";
120
+ import { BASE_SITE_LAYOUT, readSiteDesign, type SiteLayoutKnobs } from "../../lib/site-design";
121
121
  import {
122
122
  ACCOUNT_LABEL_KEY,
123
123
  HEADER_CTA_LABEL_KEY,
@@ -134,6 +134,14 @@ import "../../lib/site-identity";
134
134
  // live listicle's landing page gets its shelves and each entry its page
135
135
  // (#7521). Inert without AILK_LISTING_PUBLIC_KEY or the paid package.
136
136
  import "../../lib/listings";
137
+ // The design library's faces (#12473 D6): every page's stylesheet carries
138
+ // their `@font-face` rules, so a hub design record switches among them with
139
+ // no build. None is preloaded; a browser fetches one only when it is used.
140
+ import "../../lib/library-fonts";
141
+ // Registers the hub's look for each page type's sections with page-renderer,
142
+ // so a section takes the look's settings when shown (#12474). Inert on a site
143
+ // that is not hub-connected.
144
+ import "../../lib/section-look";
137
145
  import { siteThemeHead } from "../../lib/site-theme-head";
138
146
  import { siteHidden } from "../../lib/site-visibility";
139
147
  import {
@@ -147,19 +155,6 @@ import { ConsentBanner } from "./consent-banner";
147
155
 
148
156
  import { readSiteContactLines } from "../../lib/site-contact-lines";
149
157
 
150
- /**
151
- * The generated `siteChrome`, read through a widened type (#7740 D8): a
152
- * scaffold generated before `deckPresentation` existed has no such member,
153
- * so this compiles against both shapes of the generated file, as the home
154
- * page reads `deckGrounds`. `colorMode` and `chromeStyle` (#7742 D1) likewise.
155
- */
156
- const chrome: SiteChrome & {
157
- deckPresentation?: true;
158
- colorMode?: "light";
159
- chromeStyle?: "minimal";
160
- closingFooterPaths?: readonly string[];
161
- } = siteChrome;
162
-
163
158
  // ── Constants ────────────────────────────────────────────────────────────────
164
159
 
165
160
  const DEFAULT_LOCALE = "en";
@@ -395,10 +390,21 @@ export default async function LocaleLayout({
395
390
  // #11456 D4 — awaited before `readSiteContactLines`, so the held hub value
396
391
  // the contact lines read is this render's.
397
392
  const brand = await resolveSiteBrand();
398
- // #7742 D2 — `colorMode: "light"` pins the mode: a saved dark cookie is
399
- // ignored, no flash script runs and no theme switch renders.
400
- const pinLight = chrome.colorMode === "light";
401
- const themeMode: ThemeMode = pinLight ? "light" : await resolveThemeMode();
393
+ // #12473 D3/D4 — the hub design record, read once: its theme head (both
394
+ // theme modes gated by [data-theme="dark"], #1532 — one helper, shared with
395
+ // the minimal 404, #7742 D6), and its layout knobs. #12477 D1 — with no
396
+ // record, the base look: the theme's defaults under `_site.mdx`'s `brand:`,
397
+ // no face class on <html>, and `BASE_SITE_LAYOUT` (`resolveHomeChrome`
398
+ // applies the same rule).
399
+ const design = await readSiteDesign();
400
+ const chrome: SiteLayoutKnobs = design?.layout ?? BASE_SITE_LAYOUT;
401
+ const themeHead = siteThemeHead(design);
402
+ // #12500 D3 — a site whose light and dark palettes match is drawn on one
403
+ // ground in every mode, worked out from its colours: every cookie gets the
404
+ // same page, so no flash script runs and no theme switch renders. A site
405
+ // whose palettes differ follows the visitor's cookie, then their device.
406
+ const ground = themeHead.ground;
407
+ const themeMode: ThemeMode = ground ?? (await resolveThemeMode());
402
408
  // #7742 D3/D5 — the minimal chrome: the closing slide, the hairline consent
403
409
  // bar and the cue offset.
404
410
  const isMinimalChrome = chrome.chromeStyle === "minimal";
@@ -457,10 +463,30 @@ export default async function LocaleLayout({
457
463
  // `account` namespace, beside the nav keys.
458
464
  const tAccount = await getTranslations({ locale, namespace: "account" });
459
465
  navItemLabels[ACCOUNT_LABEL_KEY] = tAccount("yourAccount");
466
+ // #12401 D3 — the workspace's navigation record, read with the identity
467
+ // (one hub read per request). With one, the header items, menus, button,
468
+ // footer columns, legal links and closing footer come from it, through the
469
+ // translator only — the record itself never reaches a component. With
470
+ // none, or when the translator refuses it, every line below runs as before
471
+ // from `nav-config.ts` and `_site.mdx` (removed by #12404). The home's
472
+ // chrome resolution (below) answers it, so the record's styles apply
473
+ // exactly when its links render.
474
+ const home = await resolveHomeChrome(locale, BASE_SITE_LAYOUT);
475
+ const recordNavigation = home.navigation;
476
+ const recordChrome = recordNavigation?.chrome ?? null;
477
+ if (recordChrome) Object.assign(navItemLabels, recordChrome.labels);
460
478
  // The site's own signed-out header button (#10046) — `_site.mdx`'s
461
- // `header.cta`. Its label is site content, written straight into the map;
462
- // the composition is `signedOutHeaderActions` below.
463
- const siteHeader = readSiteHeader();
479
+ // `header.cta`, or the record's button with its Sign in display (the
480
+ // record's where it sets one, else the file's). Its label is site content,
481
+ // written straight into the map; the composition is `signedOutHeaderActions` below.
482
+ const fileHeader = readSiteHeader();
483
+ const recordSignIn = recordChrome?.signIn ?? fileHeader?.signIn;
484
+ const siteHeader = recordChrome
485
+ ? {
486
+ ...(recordChrome.button ? { cta: recordChrome.button } : {}),
487
+ ...(recordSignIn !== undefined ? { signIn: recordSignIn } : {}),
488
+ }
489
+ : fileHeader;
464
490
  if (siteHeader?.cta) {
465
491
  navItemLabels[HEADER_CTA_LABEL_KEY] = siteHeader.cta.label;
466
492
  }
@@ -520,7 +546,7 @@ export default async function LocaleLayout({
520
546
  // path is `/` for the default locale and `/<locale>` for every other one.
521
547
  const homePath = locale === DEFAULT_LOCALE ? "/" : `/${locale}`;
522
548
 
523
- // Deck home (#5612 D3): `siteChrome.home === "deck"` only ever applies
549
+ // Deck home (#5612 D3): a `home: "deck"` knob only ever applies
524
550
  // `snap="mandatory"` + `deckHero` on the locale-root route — every other
525
551
  // path renders byte-identically regardless of the knob. `x-pathname` is the
526
552
  // same header `generateMetadata` above reads (forwarded by middleware.ts);
@@ -532,9 +558,8 @@ export default async function LocaleLayout({
532
558
  // design's chrome exactly as before: the deck home and `innerPages: "bare"`
533
559
  // (#7721 D4 — bare header + one-bar footer on every page but the home) are
534
560
  // that resolver's design level. Fail-safe: a missing `x-pathname`
535
- // resolves to the home path.
561
+ // resolves to the home path. `home` is resolved above, with the record.
536
562
  const isHome = pathname === homePath;
537
- const home = await resolveHomeChrome(locale, chrome);
538
563
  const homeLayout = home.layout;
539
564
  const isDeckHome = homeLayout === "deck" && isHome;
540
565
  const pageChrome = isHome
@@ -554,7 +579,10 @@ export default async function LocaleLayout({
554
579
  locales: readLocales(),
555
580
  }),
556
581
  });
557
- const headerIsFull = pageChrome.header === "full";
582
+ // #12470 D7 — `mark-only` is the full bar with the logomark alone, so it
583
+ // is a full header everywhere below but the mark and the menus.
584
+ const headerIsFull = isBarHeader(pageChrome.header);
585
+ const headerIsMarkOnly = pageChrome.header === "mark-only";
558
586
 
559
587
  // Only a full header carries actions (#7718 D1, #10049). Under a bare or no
560
588
  // header the auth links move to the footer — the auth pair signed out,
@@ -566,7 +594,18 @@ export default async function LocaleLayout({
566
594
  // on the closing footer in every header state) and its legal bar. The
567
595
  // site's labels ride `itemLabels` under keys no nav key can collide with
568
596
  // (no nav key contains a dot).
569
- const closingFooter = readClosingFooterSettings();
597
+ // #12401 D3 — with a record, its closing footer's location and buttons
598
+ // (none when it has none); the legal bar stays the file's.
599
+ const fileClosingFooter = readClosingFooterSettings();
600
+ const closingFooter = recordChrome
601
+ ? {
602
+ legalBar: fileClosingFooter.legalBar,
603
+ ...(recordChrome.closing?.locality !== undefined
604
+ ? { locality: recordChrome.closing.locality }
605
+ : {}),
606
+ ...(recordChrome.closing ? { actions: recordChrome.closing.actions } : {}),
607
+ }
608
+ : fileClosingFooter;
570
609
  const closingFooterActions = closingFooter.actions?.map(
571
610
  (action, i) => ({
572
611
  labelKey: `closingFooter.action.${i}`,
@@ -686,7 +725,8 @@ export default async function LocaleLayout({
686
725
  // #10049 D5 — the hybrid deck home (a full header) keeps the full bar,
687
726
  // pinned, with no `deckMorph`; a bare header on a non-deck home is the
688
727
  // bare bar, unpinned.
689
- ...(siteChrome.nav === "mark-only" ? { logoDisplay: "mark" as const } : {}),
728
+ // #12470 D7 — keyed on the resolved header, whoever set `mark-only`.
729
+ ...(headerIsMarkOnly ? { logoDisplay: "mark" as const } : {}),
690
730
  ...(isHome && pageChrome.header === "bare"
691
731
  ? { ...(isDeckHome ? { sticky: true, deckMorph: true } : {}), bar: "bare" as const }
692
732
  : {}),
@@ -729,12 +769,17 @@ export default async function LocaleLayout({
729
769
  // site's docs path; `nav-config.ts` itself is never edited.
730
770
  // #10043 D9 — likewise every path at `/services`, at the services base.
731
771
  // #11385 D8 — a renamed route family's links follow its served segment.
732
- const publicNavItems = withRenamedNavPaths(withPublicServicesPaths(withPublicDocsPaths(navItems)));
733
- const footerColumnDefs = withRenamedColumns(withPublicServicesColumns(withPublicDocsColumns(footerColumns))).map((col) => ({
734
- heading: labelFor(col.headingKey),
735
- headingKey: col.headingKey,
736
- items: col.items.map((item) => ({ ...item, label: labelFor(item.labelKey) })),
737
- }));
772
+ // #12401 D3 — a record's items and columns are already at their public
773
+ // paths (the translator resolves its page targets), so no pass rewrites them.
774
+ const publicNavItems =
775
+ recordChrome?.navItems ?? withRenamedNavPaths(withPublicServicesPaths(withPublicDocsPaths(navItems)));
776
+ const footerColumnDefs =
777
+ recordChrome?.columns ??
778
+ withRenamedColumns(withPublicServicesColumns(withPublicDocsColumns(footerColumns))).map((col) => ({
779
+ heading: labelFor(col.headingKey),
780
+ headingKey: col.headingKey,
781
+ items: col.items.map((item) => ({ ...item, label: labelFor(item.labelKey) })),
782
+ }));
738
783
 
739
784
  // The bare header's back arrow (operator handoff 2026-11-09): the page's
740
785
  // served parent — a content page, a page route the app builds or a nav entry —
@@ -776,26 +821,22 @@ export default async function LocaleLayout({
776
821
  // and `/terms`) — since a mark-only nav (its usual pairing, #5589) has
777
822
  // nowhere else on the page linking it. The default `columns` footer keeps
778
823
  // exactly today's two-entry list, byte-identical.
779
- const legalLinks = [
780
- { label: "Privacy Policy", href: "/privacy" },
781
- { label: "Terms of Service", href: "/terms" },
782
- // #6739 — a link, not the reopen button: the privacy page's
783
- // #cookie-settings anchor explains the choice, and arriving there
784
- // reopens the consent banner (BannerConsentIsland).
785
- { label: tConsent("settingsLabel"), href: "/privacy#cookie-settings" },
786
- ...(siteChrome.footer === "centered"
787
- ? [{ label: tNav("faq"), href: "/faq" }]
788
- : []),
789
- ];
790
-
791
- // The site's own declared colours (`content/_site.mdx` `theme:` + `brand:`)
792
- // as a token overlay, the design's web faces (#7720) beneath `brand.fonts`,
793
- // both theme modes gated by [data-theme="dark"] (#1532) and the site's shape
794
- // settings after them — one helper, shared with the minimal 404 (#7742 D6).
795
- // A site that declares no theme gets byte-for-byte the CSS it got before
796
- // this wiring existed; with no design faces <html> gets no class.
797
- // themeMode still drives the initial data-theme attribute below.
798
- const themeHead = siteThemeHead();
824
+ // #6739 — a link, not the reopen button: the privacy page's
825
+ // #cookie-settings anchor explains the choice, and arriving there
826
+ // reopens the consent banner (BannerConsentIsland).
827
+ const cookieSettingsLink = { label: tConsent("settingsLabel"), href: "/privacy#cookie-settings" };
828
+ // #12401 D3 — with a record, its bottom bar, then the cookie-settings link
829
+ // (the consent banner's reopen point, not navigation); FAQ is not added.
830
+ const legalLinks = recordChrome
831
+ ? [...recordChrome.legalLinks, cookieSettingsLink]
832
+ : [
833
+ { label: "Privacy Policy", href: "/privacy" },
834
+ { label: "Terms of Service", href: "/terms" },
835
+ cookieSettingsLink,
836
+ ...(chrome.footer === "centered"
837
+ ? [{ label: tNav("faq"), href: "/faq" }]
838
+ : []),
839
+ ];
799
840
 
800
841
  return (
801
842
  <html
@@ -808,9 +849,9 @@ export default async function LocaleLayout({
808
849
  >
809
850
  <head>
810
851
  {/* Flash-prevention: runs synchronously before any styled element.
811
- Not under `colorMode: light` (#7742 D2) — the mode is pinned, and
812
- the script would apply the OS dark preference. */}
813
- {pinLight ? null : (
852
+ Not on a matching look (#12500 D3) — no mode changes what is
853
+ painted, and the script would apply the OS dark preference. */}
854
+ {ground !== undefined ? null : (
814
855
  <script
815
856
  data-testid="theme-flash-prevention"
816
857
  dangerouslySetInnerHTML={{ __html: FLASH_PREVENTION_SCRIPT }}
@@ -857,6 +898,21 @@ export default async function LocaleLayout({
857
898
  <link rel="manifest" href="/site.webmanifest" />
858
899
  <GoogleAnalytics />
859
900
  <VerificationMeta />
901
+ {/* #12401 (SEC-12403-3, #12404 M3) — which navigation this page
902
+ renders, whatever the header style: one per page. */}
903
+ <meta
904
+ name="ailk-nav-source"
905
+ content={recordNavigation ? "record" : "files"}
906
+ {...(recordNavigation ? { "data-version": String(recordNavigation.version) } : {})}
907
+ />
908
+ {/* #12476 D7 — which look this page renders, from the record (at its
909
+ version) or, as "files", none: the base look since #12477. One
910
+ per page. */}
911
+ <meta
912
+ name="ailk-design-source"
913
+ content={design ? "record" : "files"}
914
+ {...(design ? { "data-version": String(design.version) } : {})}
915
+ />
860
916
  </head>
861
917
  <body>
862
918
  {/* Skip link (operator ruling 2026-09-23): the first Tab stop on every
@@ -905,7 +961,7 @@ export default async function LocaleLayout({
905
961
  // footer divider on that same edge.
906
962
  gutters="none"
907
963
  bannerPlacement="above-nav"
908
- {...(siteChrome.announcementBanner
964
+ {...(chrome.announcementBanner
909
965
  ? {
910
966
  banner: (
911
967
  <Banner
@@ -976,22 +1032,30 @@ export default async function LocaleLayout({
976
1032
  // 2026-11-09 — the arrow goes to the page's served parent
977
1033
  // (`bareBackLink` above), superseding #7744 D7's
978
1034
  // people-slide rule.
979
- // #10049 D1 — `none` renders no header; a site-set `full`
980
- // header shows the menus even on a `mark-only` design.
981
- pageChrome.header === "none" ? undefined : bareBackLink ? (
982
- <Nav {...navProps} navItems={[]} bar="bare" backLink={bareBackLink} />
983
- ) : (
984
- <Nav
985
- {...navProps}
986
- navItems={
987
- siteChrome.nav === "mark-only" &&
988
- (session !== null ||
989
- pageChrome.header === "bare" ||
990
- pageChrome.headerFromTemplate)
991
- ? []
992
- : publicNavItems
993
- }
994
- />
1035
+ // #10049 D1 — `none` renders no header; #12470 D7 — a
1036
+ // resolved `mark-only` header shows no menus, and a `full`
1037
+ // one shows them even on a `mark-only` design.
1038
+ // #12401 (SEC-12403-3) — the wrapper names the header's
1039
+ // source, `record` with its version or `files`, so the
1040
+ // import (#12403) can prove which one a site renders;
1041
+ // `contents` adds no box.
1042
+ pageChrome.header === "none" ? undefined : (
1043
+ <div
1044
+ className="contents"
1045
+ data-nav-source={recordNavigation ? "record" : "files"}
1046
+ {...(recordNavigation
1047
+ ? { "data-nav-version": String(recordNavigation.version) }
1048
+ : {})}
1049
+ >
1050
+ {bareBackLink ? (
1051
+ <Nav {...navProps} navItems={[]} bar="bare" backLink={bareBackLink} />
1052
+ ) : (
1053
+ <Nav
1054
+ {...navProps}
1055
+ navItems={headerIsMarkOnly ? [] : publicNavItems}
1056
+ />
1057
+ )}
1058
+ </div>
995
1059
  )
996
1060
  }
997
1061
  footer={
@@ -1052,8 +1116,8 @@ export default async function LocaleLayout({
1052
1116
  // #7823 — the minimal closing slide's actions are a button,
1053
1117
  // then a text link; Footer reads the style from this.
1054
1118
  {...(isMinimalChrome ? { chromeStyle: "minimal" as const } : {})}
1055
- // #7742 D2 — no theme switch under `colorMode: light`.
1056
- showThemeToggle={!pinLight}
1119
+ // #12500 D3 — no theme switch on a matching look: it would change nothing.
1120
+ showThemeToggle={ground === undefined}
1057
1121
  {...(footerSignup !== undefined && { subscribe: footerSignup })}
1058
1122
  bottomBarAlign="content"
1059
1123
  copyrightText={copyrightText}
@@ -161,8 +161,9 @@ describe("the llms.txt heading — a hub-connected site's name (#11456 D4, AC-2)
161
161
  body: { identity: { kind: "Organization", name, url: "https://elsewhere.example" }, seo: null },
162
162
  });
163
163
 
164
- // #11515 — hub-connected is a spoke key on the wire alone, so these cases
165
- // run a file-content site (CONTENT_ADAPTER unset).
164
+ // #11515 — hub-connected is a spoke key on the wire, or (#12390) an API
165
+ // address with no key, whatever the content adapter, so these cases run a
166
+ // file-content site (CONTENT_ADAPTER unset).
166
167
  beforeEach(() => {
167
168
  delete process.env.CONTENT_ADAPTER;
168
169
  process.env.NEXT_PUBLIC_BASE_URL = BASE;
@@ -191,10 +192,19 @@ describe("the llms.txt heading — a hub-connected site's name (#11456 D4, AC-2)
191
192
  expect(text.split("\n")[1]).toBe("");
192
193
  });
193
194
 
195
+ // #12390 D2, AC-6 — a single-tenant site (its own API's address, no key)
196
+ // reads its workspace's name too.
197
+ it("carries the workspace name on a site with no spoke key and an API address", async () => {
198
+ mockSiteConfigGet.mockResolvedValue(identity("Solo Co"));
199
+ expect((await llms("../route", PUBLIC_ROWS)).split("\n")[0]).toBe("# Solo Co — content index");
200
+ expect(mockSiteConfigGet).toHaveBeenCalled();
201
+ });
202
+
194
203
  it.each([
195
204
  ["CONTENT_ADAPTER unset", () => undefined],
196
205
  ["CONTENT_ADAPTER=database", () => (process.env.CONTENT_ADAPTER = "database")],
197
- ])("carries SITE_NAME with no AILK_SPOKE_KEY (%s), and never calls the hub", async (_label, arrange) => {
206
+ ])("carries SITE_NAME with no AILK_SPOKE_KEY and no API address (%s), and never calls the hub", async (_label, arrange) => {
207
+ delete process.env.AILK_API_URL;
198
208
  arrange();
199
209
  mockSiteConfigGet.mockResolvedValue(identity("Hub Co"));
200
210
  const { SITE_NAME } = jest.requireActual<typeof import("../../../lib/site-brand")>("../../../lib/site-brand");
@@ -11,8 +11,10 @@
11
11
  // theme instead: its own <html> and <body> (the documented pattern for a root
12
12
  // not-found under a pass-through root layout), the theme variables and font
13
13
  // class the locale layout emits (`siteThemeHead`), the site's mark, one
14
- // statement and a back link. `data-theme` is fixed at light — the one mode a
15
- // `colorMode: light` site has. Without the knob it renders today's markup.
14
+ // statement and a back link. `data-theme` is the site's ground when its two
15
+ // palettes match (#12500 D3), else light. Without the knob it renders today's
16
+ // markup. #12473 D4 / #12477 D1 — the knob and the theme are the hub design
17
+ // record's; with no record the knob is unset, so the base 404 renders.
16
18
  import "./globals.css";
17
19
 
18
20
  import { BrandLogo } from "@working-theory/ui/blocks";
@@ -20,17 +22,14 @@ import { Heading, Link, Text } from "@working-theory/ui/primitives";
20
22
  import type { ReactElement } from "react";
21
23
 
22
24
  import { SITE_NAME } from "../lib/site-brand";
23
- import { siteChrome, type SiteChrome } from "../lib/site-chrome";
25
+ import { readSiteDesign, type RenderedDesign } from "../lib/site-design";
24
26
  import { siteLogo } from "../lib/site-logo";
25
27
  import { siteThemeHead } from "../lib/site-theme-head";
26
28
 
27
- /** Widened as the locale layout reads it: an older generated file has no `chromeStyle`. */
28
- const chrome: SiteChrome & { chromeStyle?: "minimal" } = siteChrome;
29
-
30
- function ThemedNotFound(): ReactElement {
31
- const head = siteThemeHead();
29
+ function ThemedNotFound({ design }: { design: RenderedDesign | null }): ReactElement {
30
+ const head = siteThemeHead(design);
32
31
  return (
33
- <html lang="en" data-theme="light" className={head.fontClassName}>
32
+ <html lang="en" data-theme={head.ground ?? "light"} className={head.fontClassName}>
34
33
  <head>
35
34
  <style data-ailk="theme-vars" dangerouslySetInnerHTML={{ __html: head.css }} />
36
35
  </head>
@@ -57,8 +56,9 @@ function ThemedNotFound(): ReactElement {
57
56
  );
58
57
  }
59
58
 
60
- export default function NotFound(): ReactElement {
61
- if (chrome.chromeStyle === "minimal") return <ThemedNotFound />;
59
+ export default async function NotFound(): Promise<ReactElement> {
60
+ const design = await readSiteDesign();
61
+ if (design?.layout?.chromeStyle === "minimal") return <ThemedNotFound design={design} />;
62
62
  return (
63
63
  <main className="flex min-h-screen flex-col items-center justify-center gap-4 bg-(--color-bg) p-card text-(--color-fg)">
64
64
  <Heading level={1} visual={3}>