Skip to content

armgit / alook

Public Imported from GitHub
0

Multi-Agent Collaboration for Team and Friends

ci: harden scoped checks and UI E2E (#447)

Gener46729fa5b2d3
diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml
index b63ae94df..431398858 100644
--- a/.github/workflows/ci.yml
+++ b/.github/workflows/ci.yml
@@ -71,7 +71,6 @@ jobs:
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- uses: pnpm/action-setup@0977fd99725f1db4007ccb2928dbb4e90d06cc86 # v6
- - uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7
with:
node-version: 22
@@ -107,7 +106,6 @@ jobs:
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- uses: pnpm/action-setup@0977fd99725f1db4007ccb2928dbb4e90d06cc86 # v6
- - uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7
with:
node-version: 22
@@ -124,7 +122,6 @@ jobs:
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- uses: pnpm/action-setup@0977fd99725f1db4007ccb2928dbb4e90d06cc86 # v6
- - uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7
with:
node-version: 22
@@ -144,7 +141,6 @@ jobs:
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- uses: pnpm/action-setup@0977fd99725f1db4007ccb2928dbb4e90d06cc86 # v6
- - uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7
with:
node-version: 22
@@ -199,6 +195,8 @@ jobs:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- uses: pnpm/action-setup@0977fd99725f1db4007ccb2928dbb4e90d06cc86 # v6
- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2
+ with:
+ bun-version: 1.3.11
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7
with:
node-version: 22
@@ -215,7 +213,6 @@ jobs:
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- uses: pnpm/action-setup@0977fd99725f1db4007ccb2928dbb4e90d06cc86 # v6
- - uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7
with:
node-version: 22
@@ -264,7 +261,6 @@ jobs:
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- uses: pnpm/action-setup@0977fd99725f1db4007ccb2928dbb4e90d06cc86 # v6
- - uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7
with:
node-version: 22
diff --git a/.github/workflows/e2e-ui.yml b/.github/workflows/e2e-ui.yml
index 441d6fddc..825b676df 100644
--- a/.github/workflows/e2e-ui.yml
+++ b/.github/workflows/e2e-ui.yml
@@ -1,8 +1,6 @@
name: E2E UI
on:
- push:
- branches: [main]
pull_request:
branches: [main]
merge_group:
@@ -56,7 +54,6 @@ jobs:
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7
- uses: pnpm/action-setup@0977fd99725f1db4007ccb2928dbb4e90d06cc86 # v6
- - uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7
with:
node-version: 22
@@ -110,7 +107,9 @@ jobs:
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7
with:
name: playwright-artifacts-${{ matrix.shard }}
- path: src/web/test-results/
+ path: |
+ src/web/test-results/
+ src/web/e2e-service-logs/
retention-days: 14
merge-reports:
diff --git a/.github/workflows/publish-app.yml b/.github/workflows/publish-app.yml
index cf6e95ee4..5cba3612d 100644
--- a/.github/workflows/publish-app.yml
+++ b/.github/workflows/publish-app.yml
@@ -41,6 +41,8 @@ jobs:
- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2
if: steps.check.outputs.skip == 'false'
+ with:
+ bun-version: 1.3.11
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7
if: steps.check.outputs.skip == 'false'
diff --git a/.github/workflows/publish-cli.yml b/.github/workflows/publish-cli.yml
index 8a8caaaf3..78c07678c 100644
--- a/.github/workflows/publish-cli.yml
+++ b/.github/workflows/publish-cli.yml
@@ -41,6 +41,8 @@ jobs:
- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2
if: steps.check.outputs.skip == 'false'
+ with:
+ bun-version: 1.3.11
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7
if: steps.check.outputs.skip == 'false'
diff --git a/.github/workflows/publish-daemon.yml b/.github/workflows/publish-daemon.yml
index 0a0e59edb..d59780fc0 100644
--- a/.github/workflows/publish-daemon.yml
+++ b/.github/workflows/publish-daemon.yml
@@ -41,6 +41,8 @@ jobs:
- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2
if: steps.check.outputs.skip == 'false'
+ with:
+ bun-version: 1.3.11
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7
if: steps.check.outputs.skip == 'false'
diff --git a/AGENTS.md b/AGENTS.md
index 1d5726c92..b96d9306a 100644
--- a/AGENTS.md
+++ b/AGENTS.md
@@ -45,9 +45,9 @@ This triggers:
- **CF Workers** → each module redeploys when its own `package.json` changes
### E2E UI (browser tests)
-Playwright browser E2E for the web UI lives in `src/web/src/test/e2e-ui/` and runs via `e2e-ui.yml` **on PRs that touch `src/web`/`src/shared`/`src/ws-do`** — regressions are caught before merge, keeping main green. It is deliberately NOT tied to the release chain: a `release:` bump only changes version numbers, so gating there would test nothing, and the production web app deploys via Cloudflare's own Git integration (outside GitHub Actions) which a workflow gate can't block anyway. Run locally with `pnpm test:e2e-ui` (backs up and restores your local `.wrangler/state`).
+Playwright browser E2E for the web UI lives in `src/web/src/test/e2e-ui/`. The `e2e-ui.yml` workflow starts for every PR and merge-queue check, then runs the browser matrix only when the diff touches `src/web`/`src/shared`/`src/ws-do`; blog-only and unrelated changes finish through the lightweight scope and gate jobs. The workflow also supports scheduled and manual full runs, but does not run after pushes to `main`. It is deliberately NOT tied to the release chain: a `release:` bump only changes version numbers, so gating there would test nothing, and the production web app deploys via Cloudflare's own Git integration (outside GitHub Actions) which a workflow gate can't block anyway. Run locally with `pnpm test:e2e-ui` (backs up and restores your local `.wrangler/state`).
-> **Don't mark "UI Playwright E2E" as a required status check** in branch protection as-is. Because it uses a `paths:` filter, a PR that doesn't touch those paths never starts the job, and a required check that never runs leaves the PR pending forever. Keep it advisory, or add an always-runs skip-job with the same check name first.
+> Branch protection may require the stable `UI E2E Gate` check. Do not require the individual `UI Playwright E2E (n/N)` matrix jobs, because skipped shards are expected for changes outside the UI scope.
## Plan-driven Development
- You must make a markdown plan at `plans/` before you implement any my request, otherwise I will reject your implementation.
diff --git a/scripts/ci/changed-scopes.mjs b/scripts/ci/changed-scopes.mjs
index 780669f4f..5ee85d6d4 100644
--- a/scripts/ci/changed-scopes.mjs
+++ b/scripts/ci/changed-scopes.mjs
@@ -3,7 +3,7 @@ import { appendFileSync, readFileSync } from "node:fs"
import { resolve } from "node:path"
import { fileURLToPath } from "node:url"
-const BLOG_CONTENT = /^src\/web\/src\/content\/.*\.mdx$/
+const BLOG_CONTENT = /^src\/web\/src\/content\/[^/]+\.mdx$/
const BLOG_ASSET = /^src\/web\/public\/blog(?:\/|$)/
const MARKDOWN = /(?:^|\/)\w[^/]*\.md$/i
const WORKFLOW = /^\.github\/workflows\//
@@ -16,13 +16,21 @@ const GLOBAL_PATHS = new Set([
"vitest.config.ts",
])
const KNOWN_ROOTS = [
- ".github/",
".claude/",
".openai/",
"docs/",
- "scripts/",
- "src/",
- "tests/",
+ "src/app/",
+ "src/cli/",
+ "src/daemon/",
+ "src/desktop/",
+ "src/email-worker/",
+ "src/shared/",
+ "src/wake-worker/",
+ "src/web/",
+ "src/ws-do/",
+ "tests/integration/cli/",
+ "tests/integration/daemon/",
+ "tests/utils/",
]
function normalizePath(path) {
@@ -80,6 +88,7 @@ export function classifyPaths(inputPaths, options = {}) {
path.startsWith("src/ws-do/")
)
const app = full || paths.some((path) => path.startsWith("src/app/"))
+ const integration = full || paths.some((path) => path.startsWith("tests/integration/"))
const codeChanged =
full || paths.some((path) => !isMarkdownPath(path) && !isBlogPath(path))
const runCodeChecks = codeChanged && !effectiveBlogOnly && !effectiveDocsOnly
@@ -92,7 +101,7 @@ export function classifyPaths(inputPaths, options = {}) {
workflow_changed: workflowChanged,
run_code_checks: runCodeChecks,
run_windows: runCodeChecks && (full || cli || daemon || shared),
- run_e2e: runCodeChecks && (full || web || shared || cli || daemon || worker),
+ run_e2e: runCodeChecks && (full || web || shared || cli || daemon || worker || integration),
run_ui_e2e: !effectiveBlogOnly && runCodeChecks && (full || web || shared || wsDo),
run_rust: runCodeChecks && (full || desktop),
run_lighthouse: runCodeChecks && (full || web),
diff --git a/scripts/ci/changed-scopes.test.ts b/scripts/ci/changed-scopes.test.ts
index 30750c0ea..f349423cc 100644
--- a/scripts/ci/changed-scopes.test.ts
+++ b/scripts/ci/changed-scopes.test.ts
@@ -47,6 +47,26 @@ describe("classifyPaths", () => {
expect(result.run_e2e).toBe(true)
})
+ it("routes CLI and daemon integration test changes through Linux E2E", () => {
+ for (const path of [
+ "tests/integration/cli/session-resume.test.ts",
+ "tests/integration/daemon/control-plane.test.ts",
+ ]) {
+ const result = classifyPaths([path])
+ expect(result.full).toBe(false)
+ expect(result.run_e2e).toBe(true)
+ }
+ })
+
+ it("only accepts top-level MDX posts for the blog fast path", () => {
+ const result = classifyPaths(["src/web/src/content/nested/example.mdx"])
+
+ expect(result.blog_only).toBe(false)
+ expect(result.run_code_checks).toBe(true)
+ expect(result.run_ui_e2e).toBe(true)
+ expect(result.run_lighthouse).toBe(true)
+ })
+
it("routes desktop-only changes through Rust without UI E2E", () => {
const result = classifyPaths(["src/desktop/src-tauri/src/lib.rs"])
@@ -59,6 +79,7 @@ describe("classifyPaths", () => {
expect(classifyPaths([".github/dependabot.yml"]).full).toBe(true)
expect(classifyPaths(["scripts/bump-version.mjs"]).full).toBe(true)
expect(classifyPaths(["pnpm-lock.yaml"]).full).toBe(true)
+ expect(classifyPaths(["src/future-package/src/index.ts"]).full).toBe(true)
expect(classifyPaths(["unexpected/file.txt"]).full).toBe(true)
expect(classifyPaths([]).full).toBe(true)
})
diff --git a/scripts/ci/e2e-shards.mjs b/scripts/ci/e2e-shards.mjs
index 134b8b6fc..f7705f7cb 100644
--- a/scripts/ci/e2e-shards.mjs
+++ b/scripts/ci/e2e-shards.mjs
@@ -3,7 +3,7 @@ import { relative, resolve } from "node:path"
import { fileURLToPath } from "node:url"
export const E2E_SPEC_ROOT = "src/web/src/test/e2e-ui"
-export const E2E_SHARD_COUNT = 2
+export const E2E_SHARD_COUNT = 5
export const DEFAULT_SPEC_SECONDS = 60
export const SPEC_SECONDS = {
diff --git a/scripts/ci/e2e-shards.test.ts b/scripts/ci/e2e-shards.test.ts
index fe4842193..153f83ef7 100644
--- a/scripts/ci/e2e-shards.test.ts
+++ b/scripts/ci/e2e-shards.test.ts
@@ -37,6 +37,7 @@ describe("planE2eShards", () => {
expect(first).toHaveLength(E2E_SHARD_COUNT)
expect([...assigned].sort()).toEqual(specs)
expect(new Set(assigned).size).toBe(specs.length)
+ expect(totals.sort((left, right) => left - right)).toEqual([118, 121, 121, 122, 126])
expect(Math.max(...totals) / Math.min(...totals)).toBeLessThanOrEqual(1.15)
})
@@ -61,13 +62,22 @@ describe("planE2eShards", () => {
describe("createE2eMatrix", () => {
it("emits shell-safe repo-local spec arguments", () => {
- const matrix = createE2eMatrix(["a.spec.ts", "nested/b.spec.ts"])
+ const matrix = createE2eMatrix([
+ "a.spec.ts",
+ "nested/b.spec.ts",
+ "c.spec.ts",
+ "d.spec.ts",
+ "e.spec.ts",
+ ])
const argumentsList = matrix.include.flatMap((entry) => entry.specs)
expect(argumentsList.sort()).toEqual([
"src/test/e2e-ui/a.spec.ts",
+ "src/test/e2e-ui/c.spec.ts",
+ "src/test/e2e-ui/d.spec.ts",
+ "src/test/e2e-ui/e.spec.ts",
"src/test/e2e-ui/nested/b.spec.ts",
])
- expect(matrix.include.every((entry) => entry.total === 2)).toBe(true)
+ expect(matrix.include.every((entry) => entry.total === E2E_SHARD_COUNT)).toBe(true)
})
})
diff --git a/scripts/ci/font-contract.test.ts b/scripts/ci/font-contract.test.ts
new file mode 100644
index 000000000..fea9b0024
--- /dev/null
+++ b/scripts/ci/font-contract.test.ts
@@ -0,0 +1,27 @@
+import { existsSync, readFileSync } from "node:fs"
+import { resolve } from "node:path"
+import { describe, expect, it } from "vitest"
+
+const appRoot = resolve(import.meta.dirname, "../../src/web/src/app")
+const layout = readFileSync(resolve(appRoot, "layout.tsx"), "utf8")
+const ogRoute = readFileSync(resolve(appRoot, "og/route.tsx"), "utf8")
+const fontDefinitions = readFileSync(resolve(appRoot, "fonts.ts"), "utf8")
+
+describe("web font contract", () => {
+ it("keeps layout and Open Graph rendering independent of Google Fonts", () => {
+ for (const source of [layout, ogRoute, fontDefinitions]) {
+ expect(source).not.toMatch(/next\/font\/google|fonts\.googleapis\.com|fonts\.gstatic\.com/)
+ }
+ })
+
+ it("references committed local font files", () => {
+ const paths = [...fontDefinitions.matchAll(/(?:src|path): "\.\/fonts\/([^\"]+)"/g)]
+ .map((match) => match[1])
+ .concat("dm-sans-600.ttf")
+
+ expect(paths).toHaveLength(8)
+ for (const path of paths) {
+ expect(existsSync(resolve(appRoot, "fonts", path))).toBe(true)
+ }
+ })
+})
diff --git a/scripts/ci/workflow-contract.test.ts b/scripts/ci/workflow-contract.test.ts
new file mode 100644
index 000000000..7152cd9ed
--- /dev/null
+++ b/scripts/ci/workflow-contract.test.ts
@@ -0,0 +1,36 @@
+import { readFileSync } from "node:fs"
+import { resolve } from "node:path"
+import { describe, expect, it } from "vitest"
+
+const workflowRoot = resolve(import.meta.dirname, "../../.github/workflows")
+const workflow = readFileSync(resolve(workflowRoot, "e2e-ui.yml"), "utf8")
+const ciWorkflow = readFileSync(resolve(workflowRoot, "ci.yml"), "utf8")
+const publishWorkflows = ["publish-app.yml", "publish-cli.yml", "publish-daemon.yml"]
+ .map((name) => readFileSync(resolve(workflowRoot, name), "utf8"))
+
+describe("E2E UI workflow", () => {
+ it("runs before merge without running on main pushes", () => {
+ expect(workflow).toMatch(/^ pull_request:/m)
+ expect(workflow).toMatch(/^ merge_group:/m)
+ expect(workflow).not.toMatch(/^ push:/m)
+ })
+
+ it("uploads service logs when a Playwright shard fails", () => {
+ expect(workflow).toContain("src/web/e2e-service-logs/")
+ })
+
+ it("does not install Bun for Node-only browser tests", () => {
+ expect(workflow).not.toContain("oven-sh/setup-bun")
+ })
+})
+
+describe("Bun workflow setup", () => {
+ it("installs Bun only in the CI build job and pins every retained setup", () => {
+ expect(ciWorkflow.match(/oven-sh\/setup-bun/g)).toHaveLength(1)
+ expect(ciWorkflow).toContain("bun-version: 1.3.11")
+ for (const publishWorkflow of publishWorkflows) {
+ expect(publishWorkflow).toContain("oven-sh/setup-bun")
+ expect(publishWorkflow).toContain("bun-version: 1.3.11")
+ }
+ })
+})
diff --git a/src/web/.gitignore b/src/web/.gitignore
index d6dff5f32..a453751b6 100644
--- a/src/web/.gitignore
+++ b/src/web/.gitignore
@@ -17,6 +17,7 @@
/test-results/
/playwright-report/
/blob-report/
+/e2e-service-logs/
/playwright/.cache/
src/test/e2e-ui/.auth/
# local-run D1/DO state backup taken by the E2E harness
diff --git a/src/web/src/app/fonts.test.ts b/src/web/src/app/fonts.test.ts
new file mode 100644
index 000000000..14fd95e13
--- /dev/null
+++ b/src/web/src/app/fonts.test.ts
@@ -0,0 +1,79 @@
+import { describe, expect, it, vi } from "vitest"
+
+const { localFont } = vi.hoisted(() => ({
+ localFont: vi.fn((options: { variable: string }) => ({
+ className: options.variable,
+ style: { fontFamily: options.variable },
+ variable: options.variable,
+ })),
+}))
+
+vi.mock("next/font/local", () => ({ default: localFont }))
+
+import { caveat, dmMono, dmSans, instrumentSerif, literata, vt323 } from "./fonts"
+
+describe("local font configuration", () => {
+ it("loads every design font from committed assets", () => {
+ expect(localFont.mock.calls.map(([options]) => options)).toEqual([
+ {
+ src: "./fonts/dm-sans-latin.woff2",
+ variable: "--font-dm-sans",
+ weight: "400 900",
+ style: "normal",
+ display: "swap",
+ },
+ {
+ src: "./fonts/dm-mono-latin-400.woff2",
+ variable: "--font-dm-mono",
+ weight: "400",
+ style: "normal",
+ display: "swap",
+ },
+ {
+ src: [
+ {
+ path: "./fonts/instrument-serif-latin-400.woff2",
+ weight: "400",
+ style: "normal",
+ },
+ {
+ path: "./fonts/instrument-serif-latin-400-italic.woff2",
+ weight: "400",
+ style: "italic",
+ },
+ ],
+ variable: "--font-instrument-serif",
+ display: "swap",
+ },
+ {
+ src: "./fonts/caveat-latin.woff2",
+ variable: "--font-caveat",
+ weight: "400 700",
+ style: "normal",
+ display: "swap",
+ },
+ {
+ src: "./fonts/vt323-latin-400.woff2",
+ variable: "--font-vt323",
+ weight: "400",
+ style: "normal",
+ display: "swap",
+ },
+ {
+ src: "./fonts/literata-latin.woff2",
+ variable: "--font-literata",
+ weight: "400 600",
+ style: "normal",
+ display: "swap",
+ },
+ ])
+ expect([dmSans, dmMono, instrumentSerif, caveat, vt323, literata].map(font => font.variable)).toEqual([
+ "--font-dm-sans",
+ "--font-dm-mono",
+ "--font-instrument-serif",
+ "--font-caveat",
+ "--font-vt323",
+ "--font-literata",
+ ])
+ })
+})
diff --git a/src/web/src/app/fonts.ts b/src/web/src/app/fonts.ts
new file mode 100644
index 000000000..e92b74de7
--- /dev/null
+++ b/src/web/src/app/fonts.ts
@@ -0,0 +1,58 @@
+import localFont from "next/font/local";
+
+export const dmSans = localFont({
+ src: "./fonts/dm-sans-latin.woff2",
+ variable: "--font-dm-sans",
+ weight: "400 900",
+ style: "normal",
+ display: "swap",
+});
+
+export const dmMono = localFont({
+ src: "./fonts/dm-mono-latin-400.woff2",
+ variable: "--font-dm-mono",
+ weight: "400",
+ style: "normal",
+ display: "swap",
+});
+
+export const instrumentSerif = localFont({
+ src: [
+ {
+ path: "./fonts/instrument-serif-latin-400.woff2",
+ weight: "400",
+ style: "normal",
+ },
+ {
+ path: "./fonts/instrument-serif-latin-400-italic.woff2",
+ weight: "400",
+ style: "italic",
+ },
+ ],
+ variable: "--font-instrument-serif",
+ display: "swap",
+});
+
+export const caveat = localFont({
+ src: "./fonts/caveat-latin.woff2",
+ variable: "--font-caveat",
+ weight: "400 700",
+ style: "normal",
+ display: "swap",
+});
+
+export const vt323 = localFont({
+ src: "./fonts/vt323-latin-400.woff2",
+ variable: "--font-vt323",
+ weight: "400",
+ style: "normal",
+ display: "swap",
+});
+
+export const literata = localFont({
+ src: "./fonts/literata-latin.woff2",
+ variable: "--font-literata",
+ weight: "400 600",
+ style: "normal",
+ display: "swap",
+});
diff --git a/src/web/src/app/fonts/README.md b/src/web/src/app/fonts/README.md
new file mode 100644
index 000000000..ea1c6a047
--- /dev/null
+++ b/src/web/src/app/fonts/README.md
@@ -0,0 +1,12 @@
+# Local web fonts
+
+The WOFF2 files are the Latin subsets from Fontsource 5.3.0:
+
+- `@fontsource-variable/dm-sans`
+- `@fontsource/dm-mono`
+- `@fontsource/instrument-serif`
+- `@fontsource-variable/caveat`
+- `@fontsource/vt323`
+- `@fontsource-variable/literata`
+
+`dm-sans-600.ttf` is the DM Sans 9pt SemiBold file used by the Open Graph image route. Each family is distributed under the SIL Open Font License 1.1; the corresponding license text is in `licenses/`.
diff --git a/src/web/src/app/fonts/caveat-latin.woff2 b/src/web/src/app/fonts/caveat-latin.woff2
new file mode 100644
index 000000000..5a3423426
Binary files /dev/null and b/src/web/src/app/fonts/caveat-latin.woff2 differ
diff --git a/src/web/src/app/fonts/dm-mono-latin-400.woff2 b/src/web/src/app/fonts/dm-mono-latin-400.woff2
new file mode 100644
index 000000000..03e485981
Binary files /dev/null and b/src/web/src/app/fonts/dm-mono-latin-400.woff2 differ
diff --git a/src/web/src/app/fonts/dm-sans-600.ttf b/src/web/src/app/fonts/dm-sans-600.ttf
new file mode 100644
index 000000000..664c540da
Binary files /dev/null and b/src/web/src/app/fonts/dm-sans-600.ttf differ
diff --git a/src/web/src/app/fonts/dm-sans-latin.woff2 b/src/web/src/app/fonts/dm-sans-latin.woff2
new file mode 100644
index 000000000..01383d7e5
Binary files /dev/null and b/src/web/src/app/fonts/dm-sans-latin.woff2 differ
diff --git a/src/web/src/app/fonts/instrument-serif-latin-400-italic.woff2 b/src/web/src/app/fonts/instrument-serif-latin-400-italic.woff2
new file mode 100644
index 000000000..197abca25
Binary files /dev/null and b/src/web/src/app/fonts/instrument-serif-latin-400-italic.woff2 differ
diff --git a/src/web/src/app/fonts/instrument-serif-latin-400.woff2 b/src/web/src/app/fonts/instrument-serif-latin-400.woff2
new file mode 100644
index 000000000..0ad69719c
Binary files /dev/null and b/src/web/src/app/fonts/instrument-serif-latin-400.woff2 differ
diff --git a/src/web/src/app/fonts/licenses/caveat-OFL.txt b/src/web/src/app/fonts/licenses/caveat-OFL.txt
new file mode 100644
index 000000000..5303054dc
--- /dev/null
+++ b/src/web/src/app/fonts/licenses/caveat-OFL.txt
@@ -0,0 +1,93 @@
+Copyright 2014 The Caveat Project Authors (https://github.com/googlefonts/caveat)
+
+This Font Software is licensed under the SIL Open Font License, Version 1.1.
+This license is copied below, and is also available with a FAQ at:
+http://scripts.sil.org/OFL
+
+
+-----------------------------------------------------------
+SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
+-----------------------------------------------------------
+
+PREAMBLE
+The goals of the Open Font License (OFL) are to stimulate worldwide
+development of collaborative font projects, to support the font creation
+efforts of academic and linguistic communities, and to provide a free and
+open framework in which fonts may be shared and improved in partnership
+with others.
+
+The OFL allows the licensed fonts to be used, studied, modified and
+redistributed freely as long as they are not sold by themselves. The
+fonts, including any derivative works, can be bundled, embedded,
+redistributed and/or sold with any software provided that any reserved
+names are not used by derivative works. The fonts and derivatives,
+however, cannot be released under any other type of license. The
+requirement for fonts to remain under this license does not apply
+to any document created using the fonts or their derivatives.
+
+DEFINITIONS
+"Font Software" refers to the set of files released by the Copyright
+Holder(s) under this license and clearly marked as such. This may
+include source files, build scripts and documentation.
+
+"Reserved Font Name" refers to any names specified as such after the
+copyright statement(s).
+
+"Original Version" refers to the collection of Font Software components as
+distributed by the Copyright Holder(s).
+
+"Modified Version" refers to any derivative made by adding to, deleting,
+or substituting -- in part or in whole -- any of the components of the
+Original Version, by changing formats or by porting the Font Software to a
+new environment.
+
+"Author" refers to any designer, engineer, programmer, technical
+writer or other person who contributed to the Font Software.
+
+PERMISSION & CONDITIONS
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of the Font Software, to use, study, copy, merge, embed, modify,
+redistribute, and sell modified and unmodified copies of the Font
+Software, subject to the following conditions:
+
+1) Neither the Font Software nor any of its individual components,
+in Original or Modified Versions, may be sold by itself.
+
+2) Original or Modified Versions of the Font Software may be bundled,
+redistributed and/or sold with any software, provided that each copy
+contains the above copyright notice and this license. These can be
+included either as stand-alone text files, human-readable headers or
+in the appropriate machine-readable metadata fields within text or
+binary files as long as those fields can be easily viewed by the user.
+
+3) No Modified Version of the Font Software may use the Reserved Font
+Name(s) unless explicit written permission is granted by the corresponding
+Copyright Holder. This restriction only applies to the primary font name as
+presented to the users.
+
+4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
+Software shall not be used to promote, endorse or advertise any
+Modified Version, except to acknowledge the contribution(s) of the
+Copyright Holder(s) and the Author(s) or with their explicit written
+permission.
+
+5) The Font Software, modified or unmodified, in part or in whole,
+must be distributed entirely under this license, and must not be
+distributed under any other license. The requirement for fonts to
+remain under this license does not apply to any document created
+using the Font Software.
+
+TERMINATION
+This license becomes null and void if any of the above conditions are
+not met.
+
+DISCLAIMER
+THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
+OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
+COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
+DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
+OTHER DEALINGS IN THE FONT SOFTWARE.
diff --git a/src/web/src/app/fonts/licenses/dm-mono-OFL.txt b/src/web/src/app/fonts/licenses/dm-mono-OFL.txt
new file mode 100644
index 000000000..980dfea9d
--- /dev/null
+++ b/src/web/src/app/fonts/licenses/dm-mono-OFL.txt
@@ -0,0 +1,93 @@
+Copyright 2020 The DM Mono Project Authors (https://www.github.com/googlefonts/dm-mono) DMMono-LightItalic.ttf: Copyright 2020 The DM Mono Project Authors (https://www.github.com/googlefonts/dm-mono) DMMono-Regular.ttf: Copyright 2020 The DM Mono Project Authors (https://www.github.com/googlefonts/dm-mono) DMMono-Italic.ttf: Copyright 2020 The DM Mono Project Authors (https://www.github.com/googlefonts/dm-mono) DMMono-Medium.ttf: Copyright 2020 The DM Mono Project Authors (https://www.github.com/googlefonts/dm-mono) DMMono-MediumItalic.ttf: Copyright 2020 The DM Mono Project Authors (https://www.github.com/googlefonts/dm-mono)
+
+This Font Software is licensed under the SIL Open Font License, Version 1.1.
+This license is copied below, and is also available with a FAQ at:
+http://scripts.sil.org/OFL
+
+
+-----------------------------------------------------------
+SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
+-----------------------------------------------------------
+
+PREAMBLE
+The goals of the Open Font License (OFL) are to stimulate worldwide
+development of collaborative font projects, to support the font creation
+efforts of academic and linguistic communities, and to provide a free and
+open framework in which fonts may be shared and improved in partnership
+with others.
+
+The OFL allows the licensed fonts to be used, studied, modified and
+redistributed freely as long as they are not sold by themselves. The
+fonts, including any derivative works, can be bundled, embedded,
+redistributed and/or sold with any software provided that any reserved
+names are not used by derivative works. The fonts and derivatives,
+however, cannot be released under any other type of license. The
+requirement for fonts to remain under this license does not apply
+to any document created using the fonts or their derivatives.
+
+DEFINITIONS
+"Font Software" refers to the set of files released by the Copyright
+Holder(s) under this license and clearly marked as such. This may
+include source files, build scripts and documentation.
+
+"Reserved Font Name" refers to any names specified as such after the
+copyright statement(s).
+
+"Original Version" refers to the collection of Font Software components as
+distributed by the Copyright Holder(s).
+
+"Modified Version" refers to any derivative made by adding to, deleting,
+or substituting -- in part or in whole -- any of the components of the
+Original Version, by changing formats or by porting the Font Software to a
+new environment.
+
+"Author" refers to any designer, engineer, programmer, technical
+writer or other person who contributed to the Font Software.
+
+PERMISSION & CONDITIONS
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of the Font Software, to use, study, copy, merge, embed, modify,
+redistribute, and sell modified and unmodified copies of the Font
+Software, subject to the following conditions:
+
+1) Neither the Font Software nor any of its individual components,
+in Original or Modified Versions, may be sold by itself.
+
+2) Original or Modified Versions of the Font Software may be bundled,
+redistributed and/or sold with any software, provided that each copy
+contains the above copyright notice and this license. These can be
+included either as stand-alone text files, human-readable headers or
+in the appropriate machine-readable metadata fields within text or
+binary files as long as those fields can be easily viewed by the user.
+
+3) No Modified Version of the Font Software may use the Reserved Font
+Name(s) unless explicit written permission is granted by the corresponding
+Copyright Holder. This restriction only applies to the primary font name as
+presented to the users.
+
+4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
+Software shall not be used to promote, endorse or advertise any
+Modified Version, except to acknowledge the contribution(s) of the
+Copyright Holder(s) and the Author(s) or with their explicit written
+permission.
+
+5) The Font Software, modified or unmodified, in part or in whole,
+must be distributed entirely under this license, and must not be
+distributed under any other license. The requirement for fonts to
+remain under this license does not apply to any document created
+using the Font Software.
+
+TERMINATION
+This license becomes null and void if any of the above conditions are
+not met.
+
+DISCLAIMER
+THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
+OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
+COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
+DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
+OTHER DEALINGS IN THE FONT SOFTWARE.
diff --git a/src/web/src/app/fonts/licenses/dm-sans-OFL.txt b/src/web/src/app/fonts/licenses/dm-sans-OFL.txt
new file mode 100644
index 000000000..917aaa663
--- /dev/null
+++ b/src/web/src/app/fonts/licenses/dm-sans-OFL.txt
@@ -0,0 +1,93 @@
+Copyright 2014 The DM Sans Project Authors (https://github.com/googlefonts/dm-fonts) DMSans-Italic[opsz,wght].ttf: Copyright 2014 The DM Sans Project Authors (https://github.com/googlefonts/dm-fonts)
+
+This Font Software is licensed under the SIL Open Font License, Version 1.1.
+This license is copied below, and is also available with a FAQ at:
+http://scripts.sil.org/OFL
+
+
+-----------------------------------------------------------
+SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
+-----------------------------------------------------------
+
+PREAMBLE
+The goals of the Open Font License (OFL) are to stimulate worldwide
+development of collaborative font projects, to support the font creation
+efforts of academic and linguistic communities, and to provide a free and
+open framework in which fonts may be shared and improved in partnership
+with others.
+
+The OFL allows the licensed fonts to be used, studied, modified and
+redistributed freely as long as they are not sold by themselves. The
+fonts, including any derivative works, can be bundled, embedded,
+redistributed and/or sold with any software provided that any reserved
+names are not used by derivative works. The fonts and derivatives,
+however, cannot be released under any other type of license. The
+requirement for fonts to remain under this license does not apply
+to any document created using the fonts or their derivatives.
+
+DEFINITIONS
+"Font Software" refers to the set of files released by the Copyright
+Holder(s) under this license and clearly marked as such. This may
+include source files, build scripts and documentation.
+
+"Reserved Font Name" refers to any names specified as such after the
+copyright statement(s).
+
+"Original Version" refers to the collection of Font Software components as
+distributed by the Copyright Holder(s).
+
+"Modified Version" refers to any derivative made by adding to, deleting,
+or substituting -- in part or in whole -- any of the components of the
+Original Version, by changing formats or by porting the Font Software to a
+new environment.
+
+"Author" refers to any designer, engineer, programmer, technical
+writer or other person who contributed to the Font Software.
+
+PERMISSION & CONDITIONS
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of the Font Software, to use, study, copy, merge, embed, modify,
+redistribute, and sell modified and unmodified copies of the Font
+Software, subject to the following conditions:
+
+1) Neither the Font Software nor any of its individual components,
+in Original or Modified Versions, may be sold by itself.
+
+2) Original or Modified Versions of the Font Software may be bundled,
+redistributed and/or sold with any software, provided that each copy
+contains the above copyright notice and this license. These can be
+included either as stand-alone text files, human-readable headers or
+in the appropriate machine-readable metadata fields within text or
+binary files as long as those fields can be easily viewed by the user.
+
+3) No Modified Version of the Font Software may use the Reserved Font
+Name(s) unless explicit written permission is granted by the corresponding
+Copyright Holder. This restriction only applies to the primary font name as
+presented to the users.
+
+4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
+Software shall not be used to promote, endorse or advertise any
+Modified Version, except to acknowledge the contribution(s) of the
+Copyright Holder(s) and the Author(s) or with their explicit written
+permission.
+
+5) The Font Software, modified or unmodified, in part or in whole,
+must be distributed entirely under this license, and must not be
+distributed under any other license. The requirement for fonts to
+remain under this license does not apply to any document created
+using the Font Software.
+
+TERMINATION
+This license becomes null and void if any of the above conditions are
+not met.
+
+DISCLAIMER
+THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
+OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
+COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
+DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
+OTHER DEALINGS IN THE FONT SOFTWARE.
diff --git a/src/web/src/app/fonts/licenses/instrument-serif-OFL.txt b/src/web/src/app/fonts/licenses/instrument-serif-OFL.txt
new file mode 100644
index 000000000..a39b7e09b
--- /dev/null
+++ b/src/web/src/app/fonts/licenses/instrument-serif-OFL.txt
@@ -0,0 +1,93 @@
+Copyright 2022 The Instrument Serif Project Authors (https://github.com/Instrument/instrument-serif) InstrumentSerif-Italic.ttf: Copyright 2022 The Instrument Serif Project Authors (https://github.com/Instrument/instrument-serif)
+
+This Font Software is licensed under the SIL Open Font License, Version 1.1.
+This license is copied below, and is also available with a FAQ at:
+http://scripts.sil.org/OFL
+
+
+-----------------------------------------------------------
+SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
+-----------------------------------------------------------
+
+PREAMBLE
+The goals of the Open Font License (OFL) are to stimulate worldwide
+development of collaborative font projects, to support the font creation
+efforts of academic and linguistic communities, and to provide a free and
+open framework in which fonts may be shared and improved in partnership
+with others.
+
+The OFL allows the licensed fonts to be used, studied, modified and
+redistributed freely as long as they are not sold by themselves. The
+fonts, including any derivative works, can be bundled, embedded,
+redistributed and/or sold with any software provided that any reserved
+names are not used by derivative works. The fonts and derivatives,
+however, cannot be released under any other type of license. The
+requirement for fonts to remain under this license does not apply
+to any document created using the fonts or their derivatives.
+
+DEFINITIONS
+"Font Software" refers to the set of files released by the Copyright
+Holder(s) under this license and clearly marked as such. This may
+include source files, build scripts and documentation.
+
+"Reserved Font Name" refers to any names specified as such after the
+copyright statement(s).
+
+"Original Version" refers to the collection of Font Software components as
+distributed by the Copyright Holder(s).
+
+"Modified Version" refers to any derivative made by adding to, deleting,
+or substituting -- in part or in whole -- any of the components of the
+Original Version, by changing formats or by porting the Font Software to a
+new environment.
+
+"Author" refers to any designer, engineer, programmer, technical
+writer or other person who contributed to the Font Software.
+
+PERMISSION & CONDITIONS
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of the Font Software, to use, study, copy, merge, embed, modify,
+redistribute, and sell modified and unmodified copies of the Font
+Software, subject to the following conditions:
+
+1) Neither the Font Software nor any of its individual components,
+in Original or Modified Versions, may be sold by itself.
+
+2) Original or Modified Versions of the Font Software may be bundled,
+redistributed and/or sold with any software, provided that each copy
+contains the above copyright notice and this license. These can be
+included either as stand-alone text files, human-readable headers or
+in the appropriate machine-readable metadata fields within text or
+binary files as long as those fields can be easily viewed by the user.
+
+3) No Modified Version of the Font Software may use the Reserved Font
+Name(s) unless explicit written permission is granted by the corresponding
+Copyright Holder. This restriction only applies to the primary font name as
+presented to the users.
+
+4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
+Software shall not be used to promote, endorse or advertise any
+Modified Version, except to acknowledge the contribution(s) of the
+Copyright Holder(s) and the Author(s) or with their explicit written
+permission.
+
+5) The Font Software, modified or unmodified, in part or in whole,
+must be distributed entirely under this license, and must not be
+distributed under any other license. The requirement for fonts to
+remain under this license does not apply to any document created
+using the Font Software.
+
+TERMINATION
+This license becomes null and void if any of the above conditions are
+not met.
+
+DISCLAIMER
+THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
+OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
+COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
+DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
+OTHER DEALINGS IN THE FONT SOFTWARE.
diff --git a/src/web/src/app/fonts/licenses/literata-OFL.txt b/src/web/src/app/fonts/licenses/literata-OFL.txt
new file mode 100644
index 000000000..5030063f4
--- /dev/null
+++ b/src/web/src/app/fonts/licenses/literata-OFL.txt
@@ -0,0 +1,93 @@
+Copyright 2017 The Literata Project Authors (https://github.com/googlefonts/literata) Literata-Italic[opsz,wght].ttf: Copyright 2017 The Literata Project Authors (https://github.com/googlefonts/literata)
+
+This Font Software is licensed under the SIL Open Font License, Version 1.1.
+This license is copied below, and is also available with a FAQ at:
+http://scripts.sil.org/OFL
+
+
+-----------------------------------------------------------
+SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
+-----------------------------------------------------------
+
+PREAMBLE
+The goals of the Open Font License (OFL) are to stimulate worldwide
+development of collaborative font projects, to support the font creation
+efforts of academic and linguistic communities, and to provide a free and
+open framework in which fonts may be shared and improved in partnership
+with others.
+
+The OFL allows the licensed fonts to be used, studied, modified and
+redistributed freely as long as they are not sold by themselves. The
+fonts, including any derivative works, can be bundled, embedded,
+redistributed and/or sold with any software provided that any reserved
+names are not used by derivative works. The fonts and derivatives,
+however, cannot be released under any other type of license. The
+requirement for fonts to remain under this license does not apply
+to any document created using the fonts or their derivatives.
+
+DEFINITIONS
+"Font Software" refers to the set of files released by the Copyright
+Holder(s) under this license and clearly marked as such. This may
+include source files, build scripts and documentation.
+
+"Reserved Font Name" refers to any names specified as such after the
+copyright statement(s).
+
+"Original Version" refers to the collection of Font Software components as
+distributed by the Copyright Holder(s).
+
+"Modified Version" refers to any derivative made by adding to, deleting,
+or substituting -- in part or in whole -- any of the components of the
+Original Version, by changing formats or by porting the Font Software to a
+new environment.
+
+"Author" refers to any designer, engineer, programmer, technical
+writer or other person who contributed to the Font Software.
+
+PERMISSION & CONDITIONS
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of the Font Software, to use, study, copy, merge, embed, modify,
+redistribute, and sell modified and unmodified copies of the Font
+Software, subject to the following conditions:
+
+1) Neither the Font Software nor any of its individual components,
+in Original or Modified Versions, may be sold by itself.
+
+2) Original or Modified Versions of the Font Software may be bundled,
+redistributed and/or sold with any software, provided that each copy
+contains the above copyright notice and this license. These can be
+included either as stand-alone text files, human-readable headers or
+in the appropriate machine-readable metadata fields within text or
+binary files as long as those fields can be easily viewed by the user.
+
+3) No Modified Version of the Font Software may use the Reserved Font
+Name(s) unless explicit written permission is granted by the corresponding
+Copyright Holder. This restriction only applies to the primary font name as
+presented to the users.
+
+4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
+Software shall not be used to promote, endorse or advertise any
+Modified Version, except to acknowledge the contribution(s) of the
+Copyright Holder(s) and the Author(s) or with their explicit written
+permission.
+
+5) The Font Software, modified or unmodified, in part or in whole,
+must be distributed entirely under this license, and must not be
+distributed under any other license. The requirement for fonts to
+remain under this license does not apply to any document created
+using the Font Software.
+
+TERMINATION
+This license becomes null and void if any of the above conditions are
+not met.
+
+DISCLAIMER
+THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
+OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
+COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
+DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
+OTHER DEALINGS IN THE FONT SOFTWARE.
diff --git a/src/web/src/app/fonts/licenses/vt323-OFL.txt b/src/web/src/app/fonts/licenses/vt323-OFL.txt
new file mode 100644
index 000000000..bcb092f7e
--- /dev/null
+++ b/src/web/src/app/fonts/licenses/vt323-OFL.txt
@@ -0,0 +1,93 @@
+Copyright 2011, The VT323 Project Authors ([email protected])
+
+This Font Software is licensed under the SIL Open Font License, Version 1.1.
+This license is copied below, and is also available with a FAQ at:
+http://scripts.sil.org/OFL
+
+
+-----------------------------------------------------------
+SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
+-----------------------------------------------------------
+
+PREAMBLE
+The goals of the Open Font License (OFL) are to stimulate worldwide
+development of collaborative font projects, to support the font creation
+efforts of academic and linguistic communities, and to provide a free and
+open framework in which fonts may be shared and improved in partnership
+with others.
+
+The OFL allows the licensed fonts to be used, studied, modified and
+redistributed freely as long as they are not sold by themselves. The
+fonts, including any derivative works, can be bundled, embedded,
+redistributed and/or sold with any software provided that any reserved
+names are not used by derivative works. The fonts and derivatives,
+however, cannot be released under any other type of license. The
+requirement for fonts to remain under this license does not apply
+to any document created using the fonts or their derivatives.
+
+DEFINITIONS
+"Font Software" refers to the set of files released by the Copyright
+Holder(s) under this license and clearly marked as such. This may
+include source files, build scripts and documentation.
+
+"Reserved Font Name" refers to any names specified as such after the
+copyright statement(s).
+
+"Original Version" refers to the collection of Font Software components as
+distributed by the Copyright Holder(s).
+
+"Modified Version" refers to any derivative made by adding to, deleting,
+or substituting -- in part or in whole -- any of the components of the
+Original Version, by changing formats or by porting the Font Software to a
+new environment.
+
+"Author" refers to any designer, engineer, programmer, technical
+writer or other person who contributed to the Font Software.
+
+PERMISSION & CONDITIONS
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of the Font Software, to use, study, copy, merge, embed, modify,
+redistribute, and sell modified and unmodified copies of the Font
+Software, subject to the following conditions:
+
+1) Neither the Font Software nor any of its individual components,
+in Original or Modified Versions, may be sold by itself.
+
+2) Original or Modified Versions of the Font Software may be bundled,
+redistributed and/or sold with any software, provided that each copy
+contains the above copyright notice and this license. These can be
+included either as stand-alone text files, human-readable headers or
+in the appropriate machine-readable metadata fields within text or
+binary files as long as those fields can be easily viewed by the user.
+
+3) No Modified Version of the Font Software may use the Reserved Font
+Name(s) unless explicit written permission is granted by the corresponding
+Copyright Holder. This restriction only applies to the primary font name as
+presented to the users.
+
+4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
+Software shall not be used to promote, endorse or advertise any
+Modified Version, except to acknowledge the contribution(s) of the
+Copyright Holder(s) and the Author(s) or with their explicit written
+permission.
+
+5) The Font Software, modified or unmodified, in part or in whole,
+must be distributed entirely under this license, and must not be
+distributed under any other license. The requirement for fonts to
+remain under this license does not apply to any document created
+using the Font Software.
+
+TERMINATION
+This license becomes null and void if any of the above conditions are
+not met.
+
+DISCLAIMER
+THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
+OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
+COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
+DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
+OTHER DEALINGS IN THE FONT SOFTWARE.
diff --git a/src/web/src/app/fonts/literata-latin.woff2 b/src/web/src/app/fonts/literata-latin.woff2
new file mode 100644
index 000000000..c8da5e9ae
Binary files /dev/null and b/src/web/src/app/fonts/literata-latin.woff2 differ
diff --git a/src/web/src/app/fonts/vt323-latin-400.woff2 b/src/web/src/app/fonts/vt323-latin-400.woff2
new file mode 100644
index 000000000..fd760b5ba
Binary files /dev/null and b/src/web/src/app/fonts/vt323-latin-400.woff2 differ
diff --git a/src/web/src/app/layout.tsx b/src/web/src/app/layout.tsx
index 79a369446..9d6aa026e 100644
--- a/src/web/src/app/layout.tsx
+++ b/src/web/src/app/layout.tsx
@@ -1,58 +1,13 @@
import type { Metadata, Viewport } from "next";
-import {
- DM_Sans,
- DM_Mono,
- Instrument_Serif,
- Caveat,
- VT323,
- Literata,
-} from "next/font/google";
import { GoogleTagManager } from "@next/third-parties/google";
import { ThemeProvider } from "@/components/theme-provider";
import { ToasterProvider } from "@/components/toaster-provider";
import { TooltipProvider } from "@/components/ui/tooltip";
import { MockNetworkBanner } from "@/components/mock-network-banner";
import { TauriThemeSync } from "@/components/tauri-theme-sync";
+import { caveat, dmMono, dmSans, instrumentSerif, literata, vt323 } from "./fonts";
import "./globals.css";
-const dmSans = DM_Sans({
- variable: "--font-dm-sans",
- subsets: ["latin"],
- weight: ["400", "500", "600", "700", "800", "900"],
-});
-
-const dmMono = DM_Mono({
- variable: "--font-dm-mono",
- subsets: ["latin"],
- weight: ["400"],
-});
-
-const instrumentSerif = Instrument_Serif({
- variable: "--font-instrument-serif",
- subsets: ["latin"],
- weight: ["400"],
- style: ["normal", "italic"],
-});
-
-const caveat = Caveat({
- variable: "--font-caveat",
- subsets: ["latin"],
- weight: ["700"],
-});
-
-const vt323 = VT323({
- variable: "--font-vt323",
- subsets: ["latin"],
- weight: ["400"],
-});
-
-const literata = Literata({
- variable: "--font-literata",
- subsets: ["latin"],
- weight: ["400", "500", "600"],
-});
-
-
const SITE_URL = "https://alook.ai";
const OG_IMAGE_URL = "/og?title=Rooms%20for%20people%20and%20agents";
@@ -128,8 +83,6 @@ export default function RootLayout({
<link rel="manifest" href="/manifest.json" />
<meta name="mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
- <link rel="preconnect" href="https://fonts.googleapis.com" />
- <link rel="preconnect" href="https://fonts.gstatic.com" crossOrigin="anonymous" />
<script dangerouslySetInnerHTML={{ __html: `
document.addEventListener('gesturestart', function(e) { e.preventDefault(); });
`}} />
diff --git a/src/web/src/app/og/route.tsx b/src/web/src/app/og/route.tsx
index 01be47ed5..17e9c9e3d 100644
--- a/src/web/src/app/og/route.tsx
+++ b/src/web/src/app/og/route.tsx
@@ -1,18 +1,11 @@
import { ImageResponse } from "next/og";
import type { NextRequest } from "next/server";
-const FONT_URL =
- "https://fonts.gstatic.com/s/dmsans/v17/rP2tp2ywxg089UriI5-g4vlH9VoD8CmcqZG40F9JadbnoEwAfJtRSW3z.ttf";
-
-let fontCache: ArrayBuffer | null = null;
-
async function loadFont(): Promise<ArrayBuffer | null> {
- if (fontCache) return fontCache;
try {
- const res = await fetch(FONT_URL);
+ const res = await fetch(new URL("../fonts/dm-sans-600.ttf", import.meta.url));
if (!res.ok) return null;
- fontCache = await res.arrayBuffer();
- return fontCache;
+ return await res.arrayBuffer();
} catch {
return null;
}
diff --git a/src/web/src/components/community/message-share-dialog.tsx b/src/web/src/components/community/message-share-dialog.tsx
index 86bb003d7..9eb2388f0 100644
--- a/src/web/src/components/community/message-share-dialog.tsx
+++ b/src/web/src/components/community/message-share-dialog.tsx
@@ -82,7 +82,10 @@ export function MessageShareDialog({ m, open, onClose }: {
// differs machine-to-machine ("fine on mine, blurry/wrong on theirs"). Awaiting
// the specific face (then the global ready signal) closes that race.
try {
- if (document.fonts?.load) await document.fonts.load('16px "Caveat"')
+ const caveatFont = getComputedStyle(document.documentElement)
+ .getPropertyValue("--font-caveat")
+ .trim()
+ if (document.fonts?.load && caveatFont) await document.fonts.load(`16px ${caveatFont}`)
await document.fonts?.ready
} catch {
// Font API unavailable / load rejected — proceed; worst case is the
diff --git a/src/web/src/test/e2e-ui/10-eject-nav-auth.spec.ts b/src/web/src/test/e2e-ui/10-eject-nav-auth.spec.ts
index 320c486c9..4bbdcb72e 100644
--- a/src/web/src/test/e2e-ui/10-eject-nav-auth.spec.ts
+++ b/src/web/src/test/e2e-ui/10-eject-nav-auth.spec.ts
@@ -28,7 +28,7 @@ test.describe.serial("eject, navigation & logout", () => {
})
test("logout clears the session", async ({ asUser }) => {
- const { page } = await asUser("bob")
+ const { page } = await asUser("logout")
await page.goto("/c")
await page.waitForURL(/\/c/, { timeout: 20_000 , waitUntil: "commit" })
diff --git a/src/web/src/test/e2e-ui/_setup/paths.ts b/src/web/src/test/e2e-ui/_setup/paths.ts
index a4d46d973..353983a03 100644
--- a/src/web/src/test/e2e-ui/_setup/paths.ts
+++ b/src/web/src/test/e2e-ui/_setup/paths.ts
@@ -7,6 +7,7 @@ import { resolve } from "path"
export const REPO_ROOT = resolve(__dirname, "../../../../../..")
export const AUTH_DIR = resolve(__dirname, "../.auth")
export const MANIFEST_PATH = resolve(AUTH_DIR, "manifest.json")
+export const SERVICE_LOG_DIR = resolve(REPO_ROOT, "src/web/e2e-service-logs")
export const WEB_URL = process.env.ALOOK_SERVER_URL || "http://localhost:3000"
export const WS_URL = process.env.DEV_WS_DO_URL || "http://localhost:8789"
diff --git a/src/web/src/test/e2e-ui/_setup/services.ts b/src/web/src/test/e2e-ui/_setup/services.ts
index dbe897b3d..cd37b3135 100644
--- a/src/web/src/test/e2e-ui/_setup/services.ts
+++ b/src/web/src/test/e2e-ui/_setup/services.ts
@@ -1,7 +1,7 @@
import { spawn, spawnSync, type ChildProcess } from "child_process"
-import { cpSync, existsSync, rmSync } from "fs"
+import { closeSync, cpSync, existsSync, mkdirSync, openSync, rmSync } from "fs"
import { resolve } from "path"
-import { REPO_ROOT, WEB_URL, WS_URL } from "./paths"
+import { REPO_ROOT, SERVICE_LOG_DIR, WEB_URL, WS_URL } from "./paths"
export interface ManagedService {
name: string
@@ -104,12 +104,17 @@ function killPortOrphans(ports: number[]): void {
}
function startService(name: string, filter: string, healthUrl: string): ManagedService {
- const proc = spawn("pnpm", ["--filter", filter, "dev"], {
- cwd: REPO_ROOT,
- stdio: "ignore",
- detached: true,
- })
- return { name, proc, healthUrl }
+ const logFd = openSync(resolve(SERVICE_LOG_DIR, `${name}.log`), "a")
+ try {
+ const proc = spawn("pnpm", ["--filter", filter, "dev"], {
+ cwd: REPO_ROOT,
+ stdio: ["ignore", logFd, logFd],
+ detached: true,
+ })
+ return { name, proc, healthUrl }
+ } finally {
+ closeSync(logFd)
+ }
}
// Starts web (:3000) + ws-do (:8789). Realtime journeys REQUIRE ws-do, so a
@@ -119,8 +124,7 @@ function startService(name: string, filter: string, healthUrl: string): ManagedS
// (which only proves the process is up) doesn't mean `/c/channels/...` is
// compiled. The first spec to hit a route then eats multi-second cold-compile
// time and its `waitForURL` can time out. Pre-hit the hot routes so they're
-// warm before any spec runs. Best-effort: any response (even a redirect to
-// /sign-in) has already triggered compilation, so status is ignored.
+// warm before any spec runs.
async function warmUpRoutes(): Promise<void> {
// Include the DYNAMIC route segments the first specs land on — `next dev`
// compiles per route *file*, not per id, so a placeholder id triggers the
@@ -129,11 +133,12 @@ async function warmUpRoutes(): Promise<void> {
// server-root page also runs a data-gated redirect, so warming its chunk is
// what keeps that first `waitForURL` from eating cold-compile time.
const routes = ["/c", "/sign-in", "/c/me", "/c/channels/warmup", "/c/channels/warmup/warmup"]
- await Promise.all(
- routes.map((path) =>
- fetch(`${WEB_URL}${path}`, { redirect: "manual" }).catch(() => {}),
- ),
- )
+ await Promise.all(routes.map(async (path) => {
+ const response = await fetch(`${WEB_URL}${path}`, { redirect: "manual" })
+ if (response.status >= 500) {
+ throw new Error(`Route warm-up failed (${response.status} ${path})`)
+ }
+ }))
}
export async function startServices(): Promise<ManagedService[]> {
@@ -151,6 +156,8 @@ export async function startServices(): Promise<ManagedService[]> {
killPortOrphans(ports)
// Give the OS a moment to release the sockets before we bind them.
await new Promise((r) => setTimeout(r, 1000))
+ rmSync(SERVICE_LOG_DIR, { recursive: true, force: true })
+ mkdirSync(SERVICE_LOG_DIR, { recursive: true })
const services = [
startService("web", "@alook/web", webHealth),
diff --git a/src/web/src/test/e2e-ui/_setup/users.ts b/src/web/src/test/e2e-ui/_setup/users.ts
index 81a84f63f..f73c9a6a0 100644
--- a/src/web/src/test/e2e-ui/_setup/users.ts
+++ b/src/web/src/test/e2e-ui/_setup/users.ts
@@ -1,10 +1,6 @@
-// The community journeys use up to three concurrent users. Each gets a fresh
-// account seeded by the dev sign-in flow (email-only → DEV_PASSWORD auto
-// signup). Emails are unique per run via a stamp injected at setup time so a
-// re-run against a non-reset DB doesn't collide.
-export type UserKey = "alice" | "bob" | "carol"
+export type UserKey = "alice" | "bob" | "carol" | "logout"
-export const USER_KEYS: UserKey[] = ["alice", "bob", "carol"]
+export const USER_KEYS: UserKey[] = ["alice", "bob", "carol", "logout"]
export function emailFor(key: UserKey, stamp: string): string {
return `e2e-${key}-${stamp}@alook.test`
diff --git a/src/ws-do/src/ws-durable/user-auth.test.ts b/src/ws-do/src/ws-durable/user-auth.test.ts
index d9bcc1a78..5fc719881 100644
--- a/src/ws-do/src/ws-durable/user-auth.test.ts
+++ b/src/ws-do/src/ws-durable/user-auth.test.ts
@@ -50,6 +50,7 @@ import {
mockTouchMachineHeartbeat,
mockUpdateProfile,
mockUpsertMachineByMachineId,
+ mockWithD1Retry,
resetHarness
} from "./test-harness"
@@ -179,6 +180,36 @@ describe("WebSocketDurableObject", () => {
})
})
+ it("retries a transient session lookup before authenticating", async () => {
+ const { durable } = createDO()
+ mockGetValidSessionWithIdentity
+ .mockRejectedValueOnce(new Error("SQLITE_BUSY"))
+ .mockResolvedValueOnce({ userId: "user-42", name: "Ana", discriminator: "0012" })
+ mockWithD1Retry.mockImplementation(async (fn) => {
+ try {
+ return await fn()
+ } catch {
+ return fn()
+ }
+ })
+ const ws = createMockWebSocket()
+ ws.serializeAttachment({
+ type: "user",
+ userId: "",
+ targetUserId: "user-42",
+ authenticated: false,
+ })
+
+ await durable.webSocketMessage(ws as any, JSON.stringify({ type: "auth", token: "valid-token" }))
+
+ expect(mockWithD1Retry).toHaveBeenCalledWith(expect.any(Function), {
+ route: "ws-do:user-auth-session",
+ })
+ expect(mockGetValidSessionWithIdentity).toHaveBeenCalledTimes(2)
+ expect(ws.send).toHaveBeenCalledWith(JSON.stringify({ type: "auth.ok" }))
+ expect(ws.close).not.toHaveBeenCalled()
+ })
+
it("first authenticated user connection broadcasts online presence and starts a snapshot", async () => {
const { durable } = createDO()
mockGetValidSessionWithIdentity.mockResolvedValue({ userId: "user-42", name: "Ana", discriminator: "0012" })
@@ -358,6 +389,7 @@ describe("WebSocketDurableObject", () => {
expect(ws.close).toHaveBeenCalledWith(1008, "Unauthorized")
expect(ws.send).not.toHaveBeenCalled()
+ expect(mockGetValidSessionWithIdentity).toHaveBeenCalledTimes(1)
})
it("closes with 1008 when auth message has no token", async () => {
diff --git a/src/ws-do/src/ws-durable/user-auth.ts b/src/ws-do/src/ws-durable/user-auth.ts
index f1c5f0b76..fb16a7755 100644
--- a/src/ws-do/src/ws-durable/user-auth.ts
+++ b/src/ws-do/src/ws-durable/user-auth.ts
@@ -3,6 +3,7 @@ import {
isValidCommunityUserTarget,
queries,
readOrStale,
+ withD1Retry,
} from "@alook/shared"
import type {
CommunityMachineConnectionState,
@@ -348,7 +349,10 @@ async function validateToken(
token: string,
): Promise<{ userId: string; name: string; discriminator: string } | null> {
const db = createDb(context.env.DB)
- return queries.session.getValidSessionWithIdentity(db, token)
+ return withD1Retry(
+ () => queries.session.getValidSessionWithIdentity(db, token),
+ { route: "ws-do:user-auth-session" },
+ )
}
async function validateMachineToken(