Record your screen, ship a demo. Free and open-source, GPU-accelerated, no watermarks, no subscriptions. Windows, macOS, Linux. Actively maintained.
TypeScript cross-platformelectronffmpegopen-sourceproduct-demorustscreen-capturescreen-recorderscreen-recordingscreen-studioscreencastspeech-to-texttypescriptvideo-editingvideo-editorwaylandwgpuwhisper
docs: the AI layer, providers, build/packaging, CI, release and test docs
Etienne Lescot5d79af0ac38c
diff --git a/technical-documentation/architecture/ai-agent.md b/technical-documentation/architecture/ai-agent.mdnew file mode 100644index 000000000..c30f75ac3--- /dev/null+++ b/technical-documentation/architecture/ai-agent.md@@ -0,0 +1,88 @@+# AI agent++The optional AI editing layer lives in `electron/ai-edition/` and `src/components/ai-edition/`. It connects the editor's chat UI to configured language models and exposes a fixed set of validated operations over the shared project document.++## What it is and what gates it++`AI_FEATURES_ENABLED` in `src/components/video-editor/featureFlags.ts` gates the provider settings, chat panel, suggestions, and checkpoint-restore UI. Its current default is `true`, so the AI surface is enabled unless the source constant is changed.++The boundary is intentionally narrow: the flag gates only the LLM and agent UI. The editing model, project panel, timeline, transcript and export surfaces ship to every user. Local Whisper transcription is privacy-preserving and is not behind this flag.++## The tool loop++The deep-agent service builds one `createDeepAgent` instance per user turn. It streams model text and tool lifecycle events to the renderer while a mutable document holder ensures that each call in the turn sees the preceding call's result.++```mermaid+sequenceDiagram+ actor User+ participant Chat as Chat service+ participant Provider as Configured provider+ participant Tools as Validated tool executor+ participant Doc as Project document++ User->>Chat: Send message+ Chat->>Chat: Validate document and save pre-turn checkpoint+ Chat->>Provider: History, document context, and fixed tool schemas+ loop Agent iterations (createDeepAgent default cap: 10)+ Provider-->>Chat: Text delta or tool call(s)+ alt Tool calls requested+ Chat->>Tools: Validate JSON arguments with shared Zod schema+ Tools->>Doc: Apply validated operation to current snapshot+ Doc-->>Tools: Updated document+ Tools-->>Provider: JSON result or validation error+ else Final answer+ Provider-->>Chat: Final text+ end+ end+ Chat-->>User: Streamed answer, tool summaries, and updated document+```++OpenScreen does not override `createDeepAgent`'s recursion limit, so the installed deep-agent runtime's default cap is 10 model/tool iterations for a turn.++## Tool schema++The model never free-writes the project document. It can only call the fixed tool set declared in `agent-tools.ts`; the executor parses JSON, validates arguments with Zod, and returns either a new schema-valid snapshot or an error. The tools operate on the same [document model](document-model.md) as manual editing.++| Tool | What it does | What it mutates |+|---|---|---|+| `getCurrentDocument` | Reads a compact project, asset, clip, trim, and modifier snapshot with explicit time bases. | Nothing. |+| `getTranscript` | Reads up to 800 transcript segments for an asset or the primary asset. | Nothing. |+| `addTrim` | Adds a source-time cut inside a clip. | `timeline.trimRanges`. |+| `setTrim` | Moves or resizes an existing source-time trim. | The matching `timeline.trimRanges` entry. |+| `setClipRange` | Changes a clip's source in/out points and relays clips back-to-back. | The clip range and any anchored regions clamped or removed by the shared timeline mutator. |+| `replaceTimeline` | Rebuilds the primary-asset timeline from kept source-time intervals; refuses to discard user-placed clips. | Timeline clips and trim ranges. |+| `addZoom` | Adds a clip-anchored zoom over virtual timeline time. | `zoomRanges`. |+| `setZoom` | Moves, resizes, or restyles a zoom pill. | The clip-anchored `zoomRanges` fragments represented by that pill. |+| `addSpeed` | Adds a clip-anchored speed region over virtual timeline time. | `legacyEditor.speedRegions`. |+| `setSpeed` | Moves, resizes, or changes an existing speed pill. | The corresponding `legacyEditor.speedRegions` fragments. |+| `addAnnotation` | Adds a positioned text annotation over virtual timeline time. | `annotations`. |+| `setAnnotation` | Moves, resizes, or changes an annotation's text. | The corresponding clip-anchored `annotations` fragments. |+| `addCameraFullscreen` | Adds a camera-fullscreen region over virtual timeline time. | `legacyEditor.cameraFullscreenRegions`. |+| `setCameraFullscreen` | Moves or resizes a camera-fullscreen pill. | The corresponding `legacyEditor.cameraFullscreenRegions` fragments. |+| `removeTrim` | Deletes a trim so its source span plays and exports again. | `timeline.trimRanges`. |+| `removeModifier` | Resolves and deletes a zoom, speed, annotation, or camera-fullscreen modifier by ID. | The matching modifier collection. |+| `removeClip` | Deletes a placed clip, closes the gap, and drops effects anchored only to it. | Timeline clips and affected anchored modifiers. |++Clips and trims use source time. Zoom, speed, annotation, and camera-fullscreen tools use virtual edited-timeline time; the executor converts these spans to the clip-anchored millisecond representation used by the document.++## Checkpoints and undo++Before a user message starts an agent turn, `chat-service.ts` clones the current document and associates it with that user message. All write calls produced by the turn operate from that checkpoint lineage, so restoring the message reverts the complete tool batch as one undo unit rather than undoing each model call separately. Rewind also truncates later conversation messages and invalidates later checkpoints.++## Context management++`chat-compaction.ts` uses a four-characters-per-token estimate, adds tool-summary text, and compares history with an 80,000-token budget. Once a session has at least four messages and reaches 70% of that budget, it asks the active provider to summarize the older half at a user-message boundary and inserts an `Earlier context` assistant message while retaining recent turns. Compaction failure leaves history unchanged. The chat path also sends only the latest 20 stored messages to the agent.++`chatBudget.ts` duplicates the same lightweight estimate in the renderer so Electron-only code is not bundled into the UI. It drives the context-percentage badge and the manual compact action. The heuristic deliberately leaves room for the system prompt and tool payloads; it is not a provider tokenizer.++## Sessions++Sessions are scoped first by project ID and then by session ID. Each session stores a generated ID, project ID, title, creation timestamp, messages, and per-user-message checkpoint references. The renderer can create, select, rename, delete, compact, and rewind sessions through the native bridge.++Chat sessions and checkpoints live only in nested process-memory `Map` objects in `chat-service.ts`. They are not written to project files or user data, so restarting Electron loses the conversation and its restore checkpoints. Provider configuration and encrypted credentials are separate and do persist.++## Known gaps++- Chat sessions and message checkpoints have no durable persistence.+- `allowAgentEdits` is exposed in provider settings, but `chat-service.ts` only reads it; the deep-agent tool list and mutating executor do not enforce it. There is therefore no working confirmation or permission gate before write tools.+- The deep-agent instance is rebuilt for every turn without a LangGraph checkpointer, so stateful agent threads do not persist independently of the explicit chat history.diff --git a/technical-documentation/architecture/llm-providers.md b/technical-documentation/architecture/llm-providers.mdindex d3e7163a0..78d8d5038 100644--- a/technical-documentation/architecture/llm-providers.md+++ b/technical-documentation/architecture/llm-providers.md@@ -1,217 +1,68 @@-# Provider feature parity plan (axcut → OpenScreen)--Goal: ship OpenScreen's AI provider feature at axcut parity, plus GitHub-Device Flow + Codex Device Flow + PAT for the existing providers, then-loop CUA e2e to verify.--Scope is fixed to the 6 deliverables below; everything outside is out.--## What exists today-- `electron/ai-edition/provider-registry.ts` — 8 provider definitions- (anthropic, openai, google, mistral, openrouter, openai-compatible,- openai-oauth, copilot-proxy).-- `electron/ai-edition/llm-config-store.ts` — `LlmConfigStore` with- `safeStorage` for secrets and a JSON `LlmConfig` on disk.-- `electron/native-bridge/services/aiEditionService.ts` — IPC handlers- `llmGetSnapshot`, `llmSetConfig`, `llmSetApiKey`, `llmRemoveApiKey`.-- `src/components/ai-edition/ProviderSettings.tsx` — modal with list/form- modes. Works for `api-key` auth; `oauth-device` and `pat` show- "connect flow not implemented yet".-- `electron/ai-edition/chat-service.ts` — chat routing already exists but- the "Configure AI Model" CTA still shows because nothing wires the- selected `LlmConfig` into `runChat`'s modelId/baseUrl/apiKey resolution.--## Plan--### D1. Provider auth flows in main process (Electron)-New file `electron/ai-edition/llm-provider-auth.ts`:-- `beginCodexDeviceAuth(): Promise<CodexDeviceChallenge>` — copy of axcut- `apps/server/src/llm/provider-runtime/openai-account.ts::beginCodexDeviceAuth`- (`https://auth.openai.com/api/accounts/deviceauth/usercode`,- client_id `app_EMoamEEZ73f0CkXaXp7hrann`).-- `completeCodexDeviceAuth({ deviceAuthId, userCode, intervalMs, expiresAt })`- polling `https://auth.openai.com/api/accounts/deviceauth/token` then- `oauth/token`. Persist to `app.getPath("userData")/openai-codex-auth.json`- (mirrors axcut's `accountAuthRoot`).-- `beginGithubDeviceAuth(): Promise<GithubDeviceChallenge>` and- `completeGithubDeviceAuth(...)` — polling- `https://github.com/login/device/code` +- `https://github.com/login/oauth/access_token` with client- `Iv1.b507a08c87ecfe98`, scope `read:user`. Persist to- `userData/copilot-auth.json`.-- `validateGithubCopilotToken(token: string): Promise<boolean>` —- exchange for a Copilot API token via- `https://api.github.com/copilot_internal/v2/token`. Returns the- token + `expiresAt` (axcut `copilot-account.ts::resolveCopilotApiToken`).- Caller is responsible for caching; in this codebase the cache lives- inside the existing `safeStorage` blob (see D1a below) instead of a- plain-json file like axcut.--D1a. OAuth tokens go through `safeStorage` (not plain JSON on disk).-We keep the single `userData/llm-credentials.enc` blob used by-`LlmConfigStore`, but expand the JSON shape from-`{ [providerId]: string }` to-`{ [providerId]: { kind: "api-key" | "codex" | "github-device" | "github-pat", apiKey, refreshToken?, expiresAt?, accountId?, email? } }`.-Existing rows (plain-string keys) keep working — the loader coerces-them to `{ kind: "api-key", apiKey }`. The store also gets:-- `getCredential(providerId)` — returns the typed entry.-- `setCredential(providerId, entry)` — persists the entry.-- `clearCredential(providerId)` — drop that provider's creds.--### D2. IPC bridge surface-Add to `AiEditionLlmSnapshot` (contracts):-- `oauthTokens: Record<providerId, "codex" | "github-device" | "github-pat">`- so the renderer can show "Connected via OAuth" vs "via API key" without- leaking the token.--Add to `aiEditionService.ts`:-- `llmBeginDeviceAuth(providerId: 'openai-oauth' | 'copilot-proxy')`-- `llmCompleteDeviceAuth(providerId, challenge: DeviceChallenge)`-- `llmCheckDeviceAuth(providerId)` — polling probe used by UI-- (unchanged) `llmSetApiKey` is now used for the GitHub PAT kind only.--Add new device-flow shapes to `contracts.ts`:-```ts-interface DeviceChallenge {- verificationUri: string;- verificationUriComplete?: string;- userCode: string;- deviceCode?: string; // github only- deviceAuthId?: string; // codex only- intervalMs: number;- expiresAt: number;-}-```--### D3. ProviderSettings.tsx rewrite (axcut parity)-- Three screens stacked in the modal, navigated by URL-less state:- 1. **list** — read axcut `provider-grid`: 2-col cards, each shows- label, default model pill, `CONNECTED` / `OAUTH` / `TOKEN` / `API KEY`- badge. Active provider gets `accent` ring.- 2. **connect-form** — single form per provider: model (free text + small- "Use provider default" hint), baseUrl (only providers with- `baseUrl` set or `id === "openai-compatible"`), reasoning effort- (only when `supportsReasoningEffort`).- 3. **device-challenge** — when the user clicks **Connect** for an- oauth/pat provider, show: provider label, copyable `<code>` block- with the user code, "Copy code" button (icon swap to Check for 1.4 s),- "Open login page" external link, and a "Completing sign-in…"- affordance that runs `llmCompleteDeviceAuth` then refreshes the- snapshot.-- All buttons get aria-labels (axcut uses `<IconButton icon label />`- everywhere).-- Save flow: `Save & use` writes config + key, closes the form, refreshes- the snapshot; on failure shows the error inline (no toast).-- Disconnect flow: wipes `safeStorage` entry for the provider, clears- any cached `config.provider`, refreshes snapshot.--### D4. Wire chat routing-`chat-service.ts` already accepts `modelId`, `baseUrl`, `apiKey`-individually. Add a small resolver at the top of `runChat` that reads-`LlmConfigStore` for the configured provider and surfaces a clear-error if no provider is configured (instead of the bland "Configure AI-Model" CTA). The "applied: …" line is already produced by-`agent-tools.ts`'s wrapped tool invocation — verify it renders in the-chat history once a real provider answers.--### D5. CUA e2e loop-For each iteration:-1. Rebuild + restart the desktop app (or trigger Vite HMR).-2. `get_app_state` for `electron`, then run a sequence:- - Open chat strip → click `AI settings`.- - Pick `OpenAI API`, paste a dummy key → save → expect "configured"- toast + provider shows CONNECTED.- - Pick `ChatGPT (OAuth)`, click Connect → assert the challenge card- opens with a `userCode` and "Open login page" link (no actual login).- - Pick `GitHub Copilot`, click Connect → same assertion for the- GitHub device challenge.-3. Send the message `trim a silence from 1 to 2 seconds` in chat, wait- for a response, check for the `applied: …` tool-call line.-4. Re-run the relevant specs from the previous hunt (`p1.7`, `p3.3`,- etc.) to confirm parity or surface regressions.--We loop until either the 7 pre-existing specs report PASS / CANNOT-TEST-(no new FAILs introduced) and the device-flow UI is reachable end-to-end.--## Files I'll touch (and only these)-- `electron/ai-edition/provider-registry.ts` — small additions to- descriptions; `baseUrl` for `openai-oauth` & `copilot-proxy`.-- `electron/ai-edition/llm-config-store.ts` — `oauth` helpers.-- `electron/ai-edition/llm-provider-auth.ts` — **new**, device flow +- GitHub PAT exchange.-- `electron/native-bridge/services/aiEditionService.ts` — new handlers.-- `electron/preload.ts` — expose the new handlers on the bridge.-- `src/native/contracts.ts` — new `DeviceChallenge` type + snapshot- augmentation.-- `src/components/ai-edition/ProviderSettings.tsx` — full rewrite to- axcut parity.-- `electron/ai-edition/chat-service.ts` — wire `LlmConfigStore` into- `runChat`.--## Explicitly out of scope-- Codex/GitHub backing chat-model invocation (we only wire the- credential side; LLM message generation still uses the existing- Anthropic adapter or stubbed model).-- Server-side `provider-registry.ts` aliases (axcut uses 9 ids; we keep- 8 — no need to mint a `copilot-oauth` separate id, the same- `copilot-proxy` covers both PAT and device-flow paths).-- Mobile / Linux packaging of this feature.-- Translation i18n keys (we only have English on this surface).--## Verification-- `npm run lint`, `npx tsc --noEmit`, `npm run test` before CUA loop.-- CUA loop ends when the 7 pre-existing specs report PASS /- CANNOT-TEST and GitHub + Codex device flows open a challenge card in- the rendered app, or when a clear blocking bug is found.--## Iteration log--### Dynamic model list for OAuth/PAT providers-The first CUA pass surfaced that the Model field was a plain text-input, so ChatGPT (OAuth) and GitHub Copilot (PAT) only ever showed-the hard-coded `gpt-4o` / `gpt-4o` default — no live fetch from the-account. Fixed in this commit:--- `electron/ai-edition/llm-provider-auth.ts`- - `listOpenAiAccountModels(accessToken)` — `GET {OPENAI_ACCOUNT_BASE_URL}/codex/models`- with `chatgpt-account-id` header derived from the JWT, filters to- `visibility === "list"`, sorts by `priority`.- - `listGithubCopilotModels(githubToken)` — exchanges the stored PAT for- a short-lived Copilot bearer via `exchangeGithubCopilotRuntimeToken`,- then `GET {runtime.baseUrl}/models` (baseUrl pulled from the JWT's- `endpoints.api` claim, with `api.individual.githubcopilot.com` as the- fallback), sorts alphabetically.- - `GithubCopilotRuntimeToken` now also exposes `baseUrl` so the- model list can use the per-account endpoint.-- `electron/native-bridge/services/aiEditionService.ts` — new- `llmListProviderModels(providerId)` IPC handler. Reads the credential- from `LlmConfigStore`, calls the right fetcher, returns- `{ models: string[]; error?: string }`.-- `electron/ipc/nativeBridge.ts` + `src/native/contracts.ts` +- `src/native/client.ts` — wire the new IPC action and the- `AiEditionLlmProviderModelsResult` contract.-- `src/components/ai-edition/ProviderSettings.tsx`- - `ProviderForm` gains a `listProviderModels` prop.- - When `isConnected && supportsDynamicModels`, a `useEffect` kicks off- the IPC call on mount. While pending, the Model field shows a- small "Loading models…" hint.- - If the result is non-empty, the Model field renders a `<select>` with- one `<option>` per model, plus an extra "saved" entry if the current- `config.model` is not in the list (so a stale saved value still- round-trips).- - If the result is empty or errors, it falls back to the existing free-text- input and shows the error in the hint.-- Two new unit tests in `llm-provider-auth.test.ts` exercise the Codex- filter/sort and the Copilot exchange-then-list flow.--### Verified end-to-end-- Codex device flow still produces a real OpenAI user code (`JR44-3PCM0`)- and the "Open login page" link points at `https://auth.openai.com/codex/device`.- Sending `trim a silence from 1 to 2 seconds` then puts the editor into- `addSkip` placement mode ("Click to place · Esc to cancel") with the- `openai-oauth / gpt-4o` provider pill underneath the input.-- Provider card with `CONNECTED` pill now appears for `openai-oauth` and- `copilot-proxy` after the user completes the device flow manually.-- The modal opens via the chat panel's "Configure AI Model" button (CUA- click was the reliable path; the editor's top-right Settings button- still lands on the Shortcuts dialog when clicked via element_index).+# LLM providers++The provider layer lives in `electron/ai-edition/provider-registry.ts`, `llm-config-store.ts`, `llm-provider-auth.ts`, `llm-call.ts`, and `codex-session.ts`, with settings in `src/components/ai-edition/ProviderSettings.tsx`. It defines model metadata, protects credentials, authenticates account-backed providers, discovers models, and translates chat and tool calls to provider wire formats.++## The registry++Each `ProviderDefinition` contains a stable ID and label, default model, authentication kind, environment-variable fallbacks, reasoning-effort support, and optional base URL, setup hint, required-base-URL marker, and wire protocol. `ProviderSettings` renders its cards and forms directly from `PROVIDER_DEFINITIONS`.++The registered definitions are:++| ID | Display name | Default model | Wire shape |+|---|---|---|---|+| `anthropic` | Claude API | `claude-haiku-4-5` | Anthropic Messages |+| `openai` | OpenAI API | `gpt-4o` | OpenAI-compatible |+| `google` | Gemini API | `gemini-3-flash-preview` | Google's OpenAI-compatible endpoint |+| `mistral` | Mistral API | `mistral-large-latest` | OpenAI-compatible in `llm-call.ts`; first-party Mistral in the deep-agent model factory |+| `openrouter` | OpenRouter API | `anthropic/claude-3.5-sonnet` | OpenAI-compatible |+| `openai-oauth` | ChatGPT (OAuth) | `gpt-5.4` | Codex/ChatGPT account path |+| `copilot-proxy` | GitHub Copilot | `gpt-4.1` | OpenAI-compatible after Copilot token exchange |+| `minimax` | MiniMax API | `MiniMax-M3` | Anthropic-compatible |+| `minimax-token-plan` | MiniMax Token Plan | `MiniMax-M3` | Anthropic-compatible |+| `openai-compatible` | OpenAI Compatible | User-supplied | OpenAI-compatible at a required custom base URL |++Historical aliases normalize before lookup: `claude` and `anthropic-proxy` map to `anthropic`, while `gemini` maps to `google`.++## Auth modes++| Mode | How it works | Providers |+|---|---|---|+| API key | The user pastes a key, or the main process resolves the first populated environment variable listed by the definition. A custom OpenAI-compatible endpoint may omit authentication; the deep-agent adapter supplies an internal placeholder key. | `anthropic`, `openai`, `google`, `mistral`, `openrouter`, `minimax`, `minimax-token-plan`, `openai-compatible` |+| OAuth device flow | The main process requests a ChatGPT device challenge, polls for authorization, exchanges the authorization code, extracts the account ID, and stores access and refresh tokens. The UI displays only the code and verification URL. | `openai-oauth` |+| PAT | The user can paste a GitHub token, which is exchanged for a short-lived Copilot runtime bearer at call time. The same provider also implements GitHub's device flow and stores its resulting token as a `github-device` credential. | `copilot-proxy` |++The three modes are wired through the renderer and native bridge. There is no registry auth mode that is merely a UI stub. However, the deep-agent model factory's local-provider comments lag the fetch path: it sends the stored ChatGPT token to a generic `ChatOpenAI` backend and sends the stored GitHub token directly to the Copilot base URL, rather than using `llm-call.ts`'s bespoke Codex transport and Copilot runtime-token exchange.++## Credential storage++`LlmConfigStore` writes non-secret selection data—provider, model, base URL, reasoning effort, and the edit toggle—to `llm-config.json`. Credentials never land in that plain JSON file.++API keys, ChatGPT tokens and refresh tokens, account IDs, expiries, GitHub device tokens, and GitHub PATs are serialized together, encrypted with Electron `safeStorage`, and written to `llm-credentials.enc`. Electron delegates encryption to the operating system's credential protection. Writes fail rather than falling back to plaintext when encryption is unavailable. The loader still accepts legacy string-only encrypted entries and normalizes them to typed API-key credentials.++The main process may use provider-specific environment variables instead of the encrypted entry. Renderer snapshots expose connection and credential-kind summaries, not raw credential values.++## Calling a model++`streamLlm` resolves a registry entry, checks its credential requirements, and dispatches to a fetch-based transport:++- OpenAI-compatible providers send streaming `POST {baseUrl}/chat/completions` requests. Messages, fixed function schemas, tool-call deltas, and provider-specific reasoning fields are translated to the OpenAI shape.+- Anthropic-shaped providers send streaming `POST {baseUrl}/v1/messages` requests with `x-api-key`, Anthropic content blocks, `input_schema` tools, and provider-appropriate thinking fields.+- ChatGPT OAuth sends the Codex Responses dialect to `/codex/responses`, including account/session identity headers, transformed tools, reasoning options, and an SSE parser for text and function calls.+- GitHub Copilot first exchanges the stored GitHub token at GitHub's Copilot token endpoint, derives the account-specific API base URL, then uses the OpenAI-compatible streaming path with the short-lived bearer.++`callLlm` is the buffered convenience wrapper around `streamLlm`; it collects text and complete tool calls. The active chat editor currently invokes the LangChain-backed deep-agent model factory, which selects `ChatAnthropic`, `ChatMistralAI`, or `ChatOpenAI` adapters and maps reasoning options separately.++## Adding a provider++1. Add a complete `ProviderDefinition` in `electron/ai-edition/provider-registry.ts`, including auth kind, environment keys, default model, base URL, protocol, and reasoning support.+2. Add or extend credential and authentication helpers in `llm-config-store.ts` and `llm-provider-auth.ts` when the existing credential kinds do not fit.+3. Route the provider in `llm-call.ts`, including request/response transformations, streaming parser behavior, model discovery, and reasoning fields.+4. Add the corresponding deep-agent adapter and capability mapping under `electron/ai-edition/deep-agent/` so chat and direct fetch paths agree.+5. Extend the native bridge model-list or auth handlers and their contracts when the provider requires new operations.+6. Verify `ProviderSettings.tsx` renders the right fields and connection action from registry metadata, then add registry, auth, transport, and UI tests.++## Known gaps++- The fetch transport and the LangChain deep-agent transport duplicate provider routing and reasoning logic, and the ChatGPT/Copilot deep-agent paths do not yet use the more complete token/session handling implemented by `llm-call.ts`.+- Copilot runtime bearers are exchanged on demand and are not cached despite carrying an expiry.+- Token refresh exists for Codex sessions, but the active chat service does not refresh an expired stored ChatGPT credential before creating its deep-agent model.diff --git a/technical-documentation/engineering/build-and-packaging.md b/technical-documentation/engineering/build-and-packaging.mdnew file mode 100644index 000000000..56d8a958f--- /dev/null+++ b/technical-documentation/engineering/build-and-packaging.md@@ -0,0 +1,60 @@+# Build and packaging++OpenScreen builds its renderer, Electron main process, preload bridge, native helpers, and installers from the root npm scripts, `vite.config.ts`, `electron-builder.json5`, and platform-native projects under `electron/native/`. Nix provides a separate Linux package and development shell.++## Commands++| Command | What it does |+|---|---|+| `npm run dev` | Starts Vite with the Electron plugin; builds and launches main/preload unless `NO_ELECTRON` is set. |+| `npm run build-vite` | Runs TypeScript checking and Vite only. It produces `dist/` and `dist-electron/` but no installer. |+| `npm run build` | Runs TypeScript checking, Vite, then unrestricted `electron-builder`. This is the full generic packaging command, but it does not proactively build platform helpers. |+| `npm run build:mac` | Builds the ScreenCaptureKit and cursor helpers, checks TypeScript, runs Vite, and packages the macOS target. |+| `npm run build:win` | Builds WGC/cursor helpers and the D3D11 compositor addon, fetches FFmpeg, checks TypeScript, runs Vite, and packages the Windows NSIS target without npm rebuild. |+| `npm run build:win:store` | Performs the Windows native and renderer build, then asks electron-builder for the configured AppX Store package. |+| `npm run build:linux` | Checks TypeScript, runs Vite, then packages AppImage, Debian, and pacman artifacts without npm rebuild. |+| `npm run build:native:mac` | Uses SwiftPM to build requested single-architecture ScreenCaptureKit and macOS cursor helpers and stages them under `electron/native/bin/darwin-*`. |+| `npm run build:native:win` | Uses CMake/Ninja in an MSVC environment to build WGC capture and cursor-sampler executables and stage x64 binaries. |+| `npm run build:native:compositor` | Uses Cargo/MSVC and the pinned shared FFmpeg SDK to build `compositor_view.node`. |+| `npm run build:whisper-binaries` | Runs the whisper.cpp CMake build and stages the speech-to-text executable plus ggml backend sidecars for the host. |+| `npm run fetch:ffmpeg` | Downloads and stages the FFmpeg binaries used by native Windows capture/compositing paths. |+| `nix build` | Builds the flake's default Linux package with system Electron rather than electron-builder. |+| `nix develop` | Opens the Linux Node/Electron/native-build/Playwright development shell defined by the flake. |++`vite.config.ts` uses `vite-plugin-electron` to compile `electron/main.ts` and `electron/preload.ts` into `dist-electron/` while Vite emits the renderer to `dist/`. The main `tsconfig.json` is strict, covers `src` and `electron`, and has `noEmit`; TypeScript is therefore a check while Vite performs emission. `build-vite` is the renderer/Electron-bundle build used when an installer is not needed, whereas `build` continues through electron-builder.++## Native artifacts++A usable full package depends on generated artifacts that are not committed:++| Artifact | Build/staging path | Toolchain |+|---|---|---|+| Windows WGC capture helper and cursor sampler | `electron/native/bin/win32-x64/` from `electron/native/wgc-capture/build/` | Visual Studio C++ Build Tools, Windows SDK, CMake, Ninja |+| macOS ScreenCaptureKit capture helper and cursor helper | `electron/native/bin/darwin-arm64/` or `darwin-x64/` | Full Xcode, Swift, SwiftPM; Command Line Tools alone may be insufficient |+| Whisper STT server and ggml/whisper backend libraries | `electron/native/bin/<platform>-<arch>/` | CMake plus host compiler; Metal on Apple Silicon, Vulkan SDK on supported Windows/Linux builds, CPU fallback, optional CUDA |+| Native D3D11 compositor addon | `electron/native/compositor-view/build/compositor_view.node` | Rust MSVC toolchain, Visual Studio/Windows SDK, LLVM/libclang, and the exact pinned shared FFmpeg SDK |+| FFmpeg runtime files | matching `electron/native/bin/<platform>-<arch>/` directory | Downloaded by `fetch:ffmpeg` for the Windows build path |++Electron-builder copies only the matching `electron/native/bin/<platform>-<arch>/` directory into each package. The compositor `.node` file is included by the Windows `files` rule and unpacked from ASAR because native addons cannot be loaded from inside the archive.++`electron/native/bin/`, local native build directories, the compositor build output, models, and caches are gitignored. Rebuilding from a source checkout therefore requires the complete platform toolchain and third-party SDKs; running the generic `npm run build` alone does not manufacture missing native artifacts. The Windows compositor's D3D11/FFmpeg prerequisites are described by the source POC in `poc-d3d/README.md`, while capture helper lookup and output conventions are documented in `electron/native/README.md`.++## Platform packaging++### Windows++The default electron-builder target is NSIS, with an assisted installer that allows users to change the installation directory. `npm run build:win:store` explicitly selects the configured `appx` target for Microsoft Store packaging. The AppX identity, publisher, capabilities, and Store languages come from `electron-builder.json5`. Release CI builds and retains both the NSIS installer and AppX package, although the GitHub release publisher currently downloads only the `openscreen-windows` NSIS artifact.++### macOS++Electron-builder targets DMG for both `arm64` and `x64`, enables hardened runtime, and applies `macos.entitlements` to the app and inherited code. The entitlements allow Electron JIT/native library loading and audio, camera, and screen capture. The configuration itself sets `notarize: false`; release CI packages the `.app`, creates and signs the DMG manually, submits stable tags to `notarytool`, staples the ticket, and validates Gatekeeper. Pre-release tags skip DMG signing/notarization, and missing Apple credentials produce an unsigned artifact.++### Linux and Nix++Electron-builder produces AppImage, `.deb`, and `.pacman` targets. The flake separately supports `x86_64-linux` and `aarch64-linux`, offers NixOS and Home Manager modules, and builds a wrapper around nixpkgs' system Electron. `nix/package.nix` runs Vite directly, installs `dist/`, `dist-electron/`, production npm dependencies, wallpapers, icons, and a desktop entry; it does not invoke electron-builder. The release workflow later opens a PR to update the Nix package version and npm dependency hash after stable releases.++## Node and toolchain versions++`package.json#engines` and `.nvmrc` both pin Node.js `22.22.1`. The package manifest pins npm `10.9.4` through both `packageManager` and `engines.npm`. The Nix shell supplies Node 22, while the shared GitHub Actions setup currently requests the Node 22 release line rather than the exact patch.++TypeScript is `5.9.3`, Vite is `7.3.2`, Electron is `41.2.1`, and electron-builder is `26.8.1` in `package.json`. Native versions are controlled by their platform tools and project files rather than a single repository-wide compiler version.diff --git a/technical-documentation/engineering/ci-workflows.md b/technical-documentation/engineering/ci-workflows.mdindex e572940f5..f46b73ea0 100644--- a/technical-documentation/engineering/ci-workflows.md+++ b/technical-documentation/engineering/ci-workflows.md@@ -1,261 +1,142 @@# GitHub Actions workflows-## Overview--The repository uses 14 workflow files across five functional tiers. This document describes the triggers, job dependencies, and artifact flow for each tier.+The repository's 15 workflow files under `.github/workflows/` cover application CI, release builds and management, package registries, native STT binaries, documentation deployment, and repository automation. This reference describes their verified triggers, dependencies, and artifact flow.## Workflow dependency graph```mermaid-graph TD- subgraph Tier 1 - CI- ci[ci.yml<br/>push / PR → main]- ci_lint[lint]- ci_typecheck[typecheck]- ci_test[test]- ci_build[build]- ci_semantic[semantic-pr]- ci --> ci_lint- ci --> ci_typecheck- ci --> ci_test- ci --> ci_build- ci --> ci_semantic+flowchart TD+ subgraph T1["Tier 1 — application and docs CI"]+ CI["ci.yml<br/>push and PR to main"] --> Lint[lint]+ CI --> Type[typecheck]+ CI --> Test[unit and browser tests]+ CI --> BuildSmoke[Vite build]+ CI --> Semantic[semantic PR title]+ Docs["docs.yml<br/>website changes or dispatch"] --> DocsBuild[website build artifact]+ DocsBuild --> DocsDeploy[GitHub Pages deploy on main]end- subgraph Tier 2 - Release build- build[build.yml<br/>tag v* / dispatch]- build_win[build-windows]- build_mac[build-macos<br/>matrix arm64 x64]- build_linux[build-linux]- build_release[publish-release]- build --> build_win- build --> build_mac- build --> build_linux- build_win --> build_release- build_mac --> build_release- build_linux --> build_release+ subgraph T2["Tier 2 — native and release builds"]+ Whisper["build-whisper-stt.yml<br/>native source changes or dispatch"] --> WhisperArtifacts["four platform STT archives"]+ ReleaseBuild["build.yml<br/>v* tag or dispatch"] --> Win[Windows NSIS]+ ReleaseBuild --> Store[Windows AppX]+ ReleaseBuild --> Mac["macOS arm64 and x64 DMGs"]+ ReleaseBuild --> Linux["AppImage, deb, pacman"]+ Win --> Publish[GitHub release]+ Mac --> Publish+ Linux --> Publishend- subgraph Tier 2.5 - Release management- prerelease[prerelease.yml<br/>dispatch]- promote[promote.yml<br/>dispatch]- prerelease -->|push tag vX.Y.Z-rc.N| build- promote -->|push tag vX.Y.Z| build+ subgraph T25["Tier 2.5 — release management"]+ RC["prerelease.yml<br/>workflow_dispatch"] -->|dispatch build at RC tag| ReleaseBuild+ Promote["promote.yml<br/>workflow_dispatch"] -->|dispatch build at stable tag| ReleaseBuildend- subgraph Tier 3 - Package registries- homebrew[update-homebrew-cask.yml<br/>release published]- winget[publish-winget.yml<br/>release published]- nix[bump-nix-package.yml<br/>release published]- aur[aur-publish.yml<br/>release published]+ subgraph T3["Tier 3 — stable package distribution"]+ Homebrew[update-homebrew-cask.yml]+ Winget[publish-winget.yml]+ Nix[bump-nix-package.yml]+ AUR[aur-publish.yml]end- subgraph Tier 4 - Automation- discord_pr[discord-pr-notify.yml<br/>PR events, review, comment]- discord_roadmap[discord-roadmap-sync.yml<br/>push to main]- discord_leaderboard[discord-weekly-leaderboard.yml<br/>schedule mon 12:00 UTC]- bookkeeping[merged-pr-bookkeeping.yml<br/>PR closed merged]- diag[diagnostic-artifact.yml<br/>push / PR / dispatch]- diag_win[build-windows]- diag_mac[build-macos<br/>matrix arm64 x64]- diag --> diag_win- diag --> diag_mac+ Publish -->|stable release published| Homebrew+ Publish -->|stable release published| Winget+ Publish -->|stable release published| Nix+ Publish -->|stable release published| AUR++ subgraph T4["Tier 4 — automation and diagnostics"]+ PRDiscord[discord-pr-notify.yml]+ Roadmap[discord-roadmap-sync.yml]+ Leaderboard[discord-weekly-leaderboard.yml]+ Bookkeeping[merged-pr-bookkeeping.yml]+ Diagnostic[diagnostic-artifact.yml] --> DiagWin[Windows diagnostic ZIP]+ Diagnostic --> DiagMac[macOS diagnostic archives]end-- build_release -->|PAT: gh release create| homebrew- build_release -->|PAT: gh release create| winget- build_release -->|PAT: gh release create| nix- build_release -->|PAT: gh release create| aur- promote -->|if: success| discord_announce_rc[discord-release-announce.mjs<br/>#rc-testing]- prerelease -->|if: success| discord_announce_stable[discord-release-announce.mjs<br/>#announcements]```-> Note: the announce-edge arrows above are inverted for readability — `prerelease.yml` posts to `#rc-testing`, and `promote.yml` posts to `#announcements`.--## Tier 1: CI checks--**File:** `ci.yml`+The STT workflow uploads standalone archives for binary refresh and does not currently feed `build.yml` automatically; release packages consume binaries already staged in the source snapshot. Stable package workflows are additionally guarded against prereleases.-Triggered on every push to `main` and every pull request targeting `main`. Four parallel, independent jobs with no interdependencies:+## Workflow inventory-| Job | Runner | Purpose |+| Tier | Workflow | Trigger ||---|---|---|-| `lint` | ubuntu-latest | Biome check |-| `typecheck` | ubuntu-latest | `tsc --noEmit` |-| `test` | ubuntu-latest | Vitest unit tests + Playwright browser tests |-| `build` | ubuntu-latest | `vite build` (renderer-only, no electron-builder) |--All jobs use the shared composite action `.github/actions/setup` for Node.js installation and `npm ci`. Failure of one job does not cancel the others.--## Tier 2: Release build and publish--### build.yml--Triggered by version tags (`v*`) or manual `workflow_dispatch` (with optional macOS architecture selection and release tag override).--**Jobs:**--1. **`build-windows`** (windows-latest): Compiles NSIS installer via `electron-builder --win`. Uploads artifact `openscreen-windows` (30-day retention).--2. **`build-macos`** (macos-latest, matrix `arm64` / `x64`): Compiles native helpers, runs `tsc && vite build`, builds `.app` bundle, creates and signs a DMG. Uploads artifacts `openscreen-mac-arm64` and `openscreen-mac-x64` (30-day retention). Signing and notarization are conditional on the presence of Apple developer secrets (`MAC_CERTIFICATE_P12`, `APPLE_ID`, etc.). Without secrets, produces an unsigned DMG.--3. **`build-linux`** (ubuntu-latest): Installs `libarchive-tools` for `.pacman` support, runs `electron-builder --linux AppImage deb pacman`. Uploads artifact `openscreen-linux` (30-day retention).--4. **`publish-release`** (ubuntu-latest, needs all three build jobs): Downloads all four artifacts by explicit name, validates that `package.json` version matches the tag, and publishes them to a GitHub Release via `gh release create` or `gh release upload --clobber`. The download step uses explicit `name:` parameters to fail fast on missing artifacts rather than silently skipping them.--All three build jobs use a shared caption-assets cache keyed by `runner.os` and the hash of `scripts/fetch-caption-model.mjs` to avoid cross-platform cache collisions.--## Tier 2.5: Release management--Two `workflow_dispatch` workflows manage the release cycle. Both run on `main` and require the `OPENSCREEN_RELEASE_TOKEN` secret.--### prerelease.yml--Triggered manually to cut a release candidate.--**Inputs:** `bump` (`patch|minor|major`, default `minor`), `rc_number` (default `1`), `target_version` (optional override).--**Steps:**-1. Checkout, setup Node.-2. Compute next SemVer from `package.json` + `bump`, derive `vX.Y.Z-rc.N` tag.-3. **Migrate** all items from the rolling `Next Release` milestone into a fresh `vX.Y.Z` milestone (idempotent — each migrated item gets an HTML marker comment).-4. Bump `package.json` to `X.Y.Z-rc.N` and commit on `main`.-5. Push the `vX.Y.Z-rc.N` tag → triggers `build.yml`.-6. Announce in `#rc-testing` on Discord via `discord-release-announce.mjs`.--### promote.yml--Triggered manually to promote an RC to a stable release.--**Inputs:** `rc_tag` (e.g. `v1.5.0-rc.2`), `release_notes_extra` (optional).--**Steps:**-1. Validate the tag matches `^vX.Y.Z-(rc|beta|alpha)\.N$`; derive `X.Y.Z`.-2. Close the `vX.Y.Z` milestone (snapshots the closed-issue list for release notes).-3. Strip `-rc.N` from `package.json` and commit on `main`.-4. Push the `vX.Y.Z` tag → triggers `build.yml` → publishes a stable release.-5. Tier 3 fires automatically because the release was created with `OPENSCREEN_RELEASE_TOKEN` (which propagates the `release: published` event).-6. Announce in `#announcements` on Discord with the release notes + closed-issue list.--### Manual fallback--```bash-git tag v1.5.0-rc.1 <sha>-git push origin v1.5.0-rc.1--# later-git tag v1.5.0 <sha>-git push origin v1.5.0-```--This works because `build.yml` is triggered by any tag matching `v*`. It skips milestone migration and Discord announcements — useful for emergency cuts when the dispatch UI is unavailable.--### Why a fine-grained PAT (`OPENSCREEN_RELEASE_TOKEN`)?--`GITHUB_TOKEN` cannot trigger downstream workflows from the actions it performs. Specifically, `gh release create` using `GITHUB_TOKEN` does **not** fire the `release: published` event, so homebrew/winget/nix/aur would silently skip every release. The fine-grained PAT (scoped to `getopenscreen/openscreen` with `contents: write` + `issues: write`) is the standard fix. See `docs/secrets.md` for creation and rotation instructions.--## Tier 3: Package registries--These workflows react to `release: published` events and push the release to external package registries. Each also supports `workflow_dispatch` for manual re-runs.--### update-homebrew-cask.yml--Finds both `arm64` and `x64` DMG assets in the release, downloads them, computes SHA-256, generates a Ruby cask file, and pushes it to a separate Homebrew tap repository (`vars.HOMEBREW_TAP_OWNER` / `vars.HOMEBREW_TAP_REPO`).--Before scanning for assets, a polling loop waits up to 12 minutes for DMGs to appear in the release, accounting for the Apple notarization delay.--Conditional on `vars.HOMEBREW_TAP_OWNER`, `vars.HOMEBREW_TAP_REPO`, and `secrets.HOMEBREW_TAP_TOKEN`.--### publish-winget.yml--Delegates to `vedantmgoyal9/winget-releaser@v2`, which finds the Windows installer matching `Setup\..*\.exe$` and publishes a manifest to the WinGet Community Repository.--Conditional on `vars.WINGET_IDENTIFIER` and `secrets.WINGET_ACC_TOKEN`.--### bump-nix-package.yml--Checks out `main`, installs Nix, runs `prefetch-npm-deps` on `package-lock.json` to compute the new `npmDepsHash`, patches `nix/package.nix` with `sed`, and opens a PR against `main` on branch `chore/bump-nix-{version}`.--Conditional on non-prerelease releases.--### aur-publish.yml--Finds the `.pacman` asset in the release, computes SHA-256, clones the AUR repository via SSH, updates `PKGBUILD` and `.SRCINFO`, and pushes the updated package.--Conditional on `vars.AUR_PACKAGE_NAME` and `secrets.AUR_SSH_PRIVATE_KEY`.--## Tier 4: Automation and diagnostics--### discord-pr-notify.yml--Triggered by `pull_request_target` (opened, reopened, synchronize, edited, labeled, unlabeled, closed, converted_to_draft, ready_for_review), `pull_request_review` (submitted), and `issue_comment` (created).--Runs `node .github/scripts/discord-pr-sync.mjs`, which creates or updates a Discord forum thread for each PR. Thread state is persisted via an HTML comment (`<!-- discord-thread-id:... -->`) in the PR body. Tag updates (draft, ready, changes requested, approved, merged, closed) are applied via the Discord API. The job is marked `continue-on-error: true` so that Discord failures never block the PR workflow.--All Discord traffic goes through a single bot (`DISCORD_BOT_TOKEN`, secret). The script creates the forum thread via `POST /channels/{forumChannelId}/threads` and posts review/comment updates into the existing thread via `POST /channels/{threadId}/messages`. Required bot permissions on the PR forum channel: View Channel, Send Messages, Embed Links, **Create Public Threads** (initial thread), **Send Messages in Threads** (subsequent updates), Manage Threads (for tag/archive/lock). Optional failure alerts can be sent to a separate channel via `DISCORD_ALERT_CHANNEL_ID` (variable); unset to silence.--### discord-roadmap-sync.yml--Triggered on push to `main` and on merged PRs targeting `main`. Runs `node .github/scripts/discord-roadmap-sync.mjs`, which:+| 1 | `ci.yml` | Push to `main`; pull request to `main` |+| 1 | `docs.yml` | Website/workflow changes on `main` or a PR; manual dispatch |+| 2 | `build.yml` | Any `v*` tag; manual dispatch |+| 2 | `build-whisper-stt.yml` | Native STT/build-script changes; manual dispatch |+| 2.5 | `prerelease.yml` | Manual dispatch |+| 2.5 | `promote.yml` | Manual dispatch |+| 3 | `update-homebrew-cask.yml` | Published release; manual dispatch |+| 3 | `publish-winget.yml` | Published release; manual dispatch |+| 3 | `bump-nix-package.yml` | Published release; manual dispatch |+| 3 | `aur-publish.yml` | Published release; manual dispatch |+| 4 | `discord-pr-notify.yml` | PR target, review, and issue-comment events |+| 4 | `discord-roadmap-sync.yml` | Merged PR to `main`; push to `main` |+| 4 | `discord-weekly-leaderboard.yml` | Monday 12:00 UTC schedule; manual dispatch |+| 4 | `merged-pr-bookkeeping.yml` | Closed pull request, conditional on merge to `main` |+| 4 | `diagnostic-artifact.yml` | Push or PR to `main`; manual dispatch |++## Tier 1: application and documentation CI++`ci.yml` runs independent `lint`, `typecheck`, `test`, and renderer-build jobs. Pull requests also run `semantic-pr`.++| Job | Runner | Command or purpose |+|---|---|---|+| `lint` | Ubuntu | `npm run lint` |+| `typecheck` | Ubuntu | `npx tsc --noEmit` |+| `test` | Ubuntu | Vitest unit tests, Chromium installation, then browser-mode Vitest |+| `build` | Ubuntu | `npx vite build`; this is not electron-builder packaging |+| `semantic-pr` | Ubuntu | Validates Conventional Commit-style PR titles |-- Detects whether `ROADMAP.md` changed in the event-- Fetches the current `ROADMAP.md` from `main`-- Updates (or creates and pins) a Discord message in the `#roadmap` channel-- Uses the channel's pinned message as persistent state; self-heals if a moderator unpins it+Jobs that need the root dependencies use `.github/actions/setup`, which requests Node 22 and runs `npm ci`; callers perform checkout themselves.-Requires `DISCORD_BOT_TOKEN` (secret) and `DISCORD_ROADMAP_CHANNEL_ID` (variable). `DISCORD_ROADMAP_MESSAGE_ID` (variable) is an optional escape hatch that bypasses the pin-based lookup.+`docs.yml` is separate from the technical-documentation checker. It installs dependencies in `website/`, type-checks and builds the site, uploads a Pages artifact, and deploys only after a push to `main`.-### discord-weekly-leaderboard.yml+## Tier 2: native and release builds-Triggered by schedule (Mondays at 12:00 UTC) and `workflow_dispatch`. Runs `node .github/scripts/discord-weekly-leaderboard.mjs`, which queries the GitHub Search API for merged PRs in the last 7 days, ranks contributors by PR count, and posts a top-10 leaderboard to the `#🌟・contributor-spotlight` channel via the same bot (`DISCORD_BOT_TOKEN`).+### `build.yml`-Requires `DISCORD_SPOTLIGHT_CHANNEL_ID` (variable) and the bot to have View Channel + Send Messages + Embed Links on that channel.+A `v*` tag or manual dispatch starts platform builds. Dispatch accepts `arch` (`arm64`, `x64`, or `both`) for macOS and an optional `release_tag` that enables publication.-### merged-pr-bookkeeping.yml+- `build-windows` runs `npm run build:win` and uploads `openscreen-windows` for 30 days.+- `build-windows-store` runs `npm run build:win:store` and uploads `openscreen-windows-store` for 30 days.+- `build-macos` is an `arm64`/`x64` matrix. It builds Vite/Electron and native helpers, packages and optionally signs the app, creates DMGs, notarizes stable signed builds, and uploads one artifact per architecture for 30 days.+- `build-linux` produces AppImage, zsync, deb, and pacman files and uploads `openscreen-linux` for 30 days.+- `publish-release` waits for Windows NSIS, macOS, and Linux jobs; the Store job is not a dependency. It checks the tag against `package.json`, downloads the NSIS/macOS/Linux artifacts, and creates or updates a GitHub release with `OPENSCREEN_RELEASE_TOKEN`.-Triggered by `pull_request_target: closed` on merged PRs targeting `main`. Uses a GraphQL query (`closingIssuesReferences`) to find linked issues, then:+The build comments and package behavior refer to the local Whisper architecture documented in [transcription and captions](../architecture/transcription-and-captions.md). The STT model downloads to user data at runtime and is not a release-build asset.-- Adds labels `status: fixed in main` and `status: pending release`-- Removes `status: in progress` and `status: needs triage`-- Assigns the `Next Release` milestone (creates it if missing)-- Closes the issue with `state_reason: completed`-- Posts an idempotent comment with a marker comment+### `build-whisper-stt.yml`-### diagnostic-artifact.yml+This matrix builds `whisper-stt-server` and its ggml backend sidecars for macOS arm64, macOS x64, Linux x64, and Windows x64. It uploads four 30-day archives named `whisper-stt-<platform>-<arch>`. The workflow installs the platform compiler dependencies and Vulkan SDK where configured. See [transcription and captions](../architecture/transcription-and-captions.md) for the runtime role of these binaries.-Triggered on push to `main`, PRs targeting `main`, and `workflow_dispatch`. Produces platform-specific diagnostic bundles for troubleshooting:+## Tier 2.5: release management-- **`build-windows`** (windows-latest): Compiles the WGC capture helper via CMake, bundles it with diagnostic scripts into a ZIP, smoke-tests the bundle structure.-- **`build-macos`** (macos-latest, matrix `arm64` / `x64`): Compiles the ScreenCaptureKit helper, bundles it with diagnostic scripts into a `.tar.gz`.+`prerelease.yml` and `promote.yml` orchestrate the frozen release branch, version tags, milestones, build dispatch, and Discord announcements. The full procedure, fallback, branch freeze, and credential requirements live in [release and secrets](release-and-secrets.md).-Artifacts are retained for 14 days (shorter than release artifacts).+At a high level, the RC workflow creates or reuses `release/vX.Y.Z`, tags its tip, and dispatches `build.yml` at that tag. Promotion creates the stable version and tag from the same release branch, syncs it back through a PR, and dispatches the stable build at the tag.-## Shared infrastructure+## Tier 3: package registries-### Composite action: `.github/actions/setup`+These workflows run for stable published releases and support manual replay with a tag:-A single composite action used by all jobs that need Node.js:+- `update-homebrew-cask.yml` waits for both macOS DMGs, hashes them, writes a cask, and pushes to the configured tap.+- `publish-winget.yml` passes the matching NSIS release asset to `winget-releaser`.+- `bump-nix-package.yml` computes `npmDepsHash`, updates `nix/package.nix`, and opens a PR.+- `aur-publish.yml` hashes the pacman release asset, updates `PKGBUILD` and `.SRCINFO`, and pushes over SSH.-```yaml-runs:- using: composite- steps:- - uses: actions/setup-node@v4- with:- node-version: 22- cache: npm- - run: npm ci- shell: bash-```+Each workflow gates itself on its required variables or credentials. `bump-nix-package.yml` uses the repository `GITHUB_TOKEN`; the others require external registry credentials described in [release and secrets](release-and-secrets.md).-When the Node.js version needs to change, only this one file is updated. The action does not include `actions/checkout`; callers manage their own checkout step to allow for custom `ref`, `repository`, or `fetch-depth` options.+## Tier 4: automation and diagnostics-### Inline scripts: `.github/scripts/`+- `discord-pr-notify.yml` mirrors PR events, reviews, and comments into a Discord forum thread. It is `continue-on-error`, so Discord does not block PR work.+- `discord-roadmap-sync.yml` updates a pinned Discord roadmap message after a merged PR or push to `main`.+- `discord-weekly-leaderboard.yml` posts a weekly contributor leaderboard.+- `merged-pr-bookkeeping.yml` finds closing issue references, applies pending-release labels and the rolling milestone, closes the issue, and adds an idempotent marker comment.+- `diagnostic-artifact.yml` builds WGC and ScreenCaptureKit helpers and bundles platform diagnostics. Its Windows ZIP and two macOS archives are retained for 14 days.-Scripts previously embedded as `actions/github-script@v7` inline JavaScript blocks are now standalone `.mjs` files invoked via `node`. This allows:+## Artifact flow-- Biome linting and formatting coverage in CI-- TypeScript type-checking coverage in CI-- Local execution and debugging outside of GitHub Actions+Release platform artifacts have 30-day Actions retention. `publish-release` copies the NSIS installer, two architecture-specific DMGs when present, and Linux packages into the GitHub release. It intentionally does not download the independently uploaded Store artifact. A stable published release then fans out to Homebrew, WinGet, Nix, and AUR.-The scripts import `@actions/core` and `@actions/github` (added to `devDependencies`) to access the same APIs (`core.info`, `core.warning`, `context`, `getOctokit`) that `actions/github-script@v7` provides as globals.+Diagnostic artifacts remain Actions-only for 14 days. Whisper archives remain Actions-only for 30 days and are used as a binary-refresh output rather than being downloaded by the release workflow. The website build artifact flows only into GitHub Pages deployment.diff --git a/technical-documentation/engineering/release-and-secrets.md b/technical-documentation/engineering/release-and-secrets.mdindex b10714d08..eeaa94a6c 100644--- a/technical-documentation/engineering/release-and-secrets.md+++ b/technical-documentation/engineering/release-and-secrets.md@@ -1,153 +1,131 @@-# Secrets and tokens+# Release and secrets-OpenScreen uses a small set of GitHub Actions secrets and repository variables. This file documents what each one does and how to create or rotate it.+OpenScreen's release machinery lives in `.github/workflows/prerelease.yml`, `promote.yml`, and `build.yml`; its credentials are repository secrets and variables consumed by those workflows and the downstream package and Discord automations. This page is the operational reference for cutting releases and maintaining those credentials.-## Required for releases+## Release flow-### `OPENSCREEN_RELEASE_TOKEN`--A **fine-grained personal access token** used by the release pipeline (`build.yml#publish-release`, `prerelease.yml`, `promote.yml`) for the actions that `GITHUB_TOKEN` cannot perform reliably:--- Creating a GitHub Release via `gh release create` such that the `release: published` event **does** fire downstream workflows (homebrew/winget/nix/aur). With `GITHUB_TOKEN`, the event is suppressed to prevent recursive workflow runs.-- Pushing commits and tags to `main` from `prerelease.yml` and `promote.yml` in a way that can later trigger downstream CI.-- Closing milestones and posting comments during the issue-migration step.+### Cut a release candidate-**Why not just use `GITHUB_TOKEN` for everything else?**+Run the `Cut a release candidate` workflow (`prerelease.yml`) with:-Most of the repo's workflows (CI, build, Tier 3 publishers, Discord sync) only need read access or scoped write access within a single repo. `GITHUB_TOKEN` is fine for those and is the safer default. The release pipeline needs cross-workflow event firing, which only a PAT can provide.+- `bump`: `patch`, `minor`, or `major`; default `minor`.+- `rc_number`: the numeric `rc.N` counter; default `1`.+- `target_version`: optional stable-version override such as `2.0.0`.-**How to create it:**+The workflow computes `X.Y.Z-rc.N`, migrates items from `Next Release` to the `vX.Y.Z` milestone, creates or reuses `release/vX.Y.Z`, commits the prerelease version there, tags the frozen branch tip, explicitly dispatches `build.yml` at the RC tag, and announces the pre-release in the configured RC Discord channel.-1. Go to <https://github.com/settings/tokens?type=beta> (fine-grained PATs).-2. **Resource owner**: `getopenscreen` (only this org — do not grant access to personal repos).-3. **Repository access**: `getopenscreen/openscreen` only.-4. **Permissions**:- - `Contents`: Read and write- - `Issues`: Read and write- - `Pull requests`: Read and write (the release pipeline opens a PR to bump `package.json` and rebase-merges it into `main` because the org-level workflow permissions block `GITHUB_TOKEN` from creating PRs)- - `Actions`: Read and write (the release pipeline triggers `build.yml` via `gh workflow run`; GITHUB_TOKEN tag pushes don't fire downstream workflows in this org)- - `Workflows`: Read and write (the release branch contains the workflow files; creating it requires writing to `.github/workflows/`)- - `Metadata`: Read-only (auto-selected)-5. **Expiration**: 1 year. Set a calendar reminder to rotate.-6. Generate the token, copy it once, then add it as a repository secret. The `gh` CLI does **not** accept the value as a positional argument — use `--body` or stdin:- ```bash- # Either:- gh secret set OPENSCREEN_RELEASE_TOKEN --body "ghp_xxxxxxxxxxxxxxxxxxxx" --repo getopenscreen/openscreen- # Or:- echo "ghp_xxxxxxxxxxxxxxxxxxxx" | gh secret set OPENSCREEN_RELEASE_TOKEN --repo getopenscreen/openscreen- ```-7. Verify by triggering a test `workflow_dispatch` on `prerelease.yml` with `bump=patch`, `rc_number=99` against an empty milestone, then revert the resulting `package.json` bump PR/commit.+### Promote to stable-**Rotation:**+Run `Promote RC to stable release` (`promote.yml`) with:-Old token and new token both work in parallel until the old one expires or is revoked. Rotate by:+- `rc_tag`: required tag matching `vX.Y.Z-(rc|beta|alpha).N`.+- `release_notes_extra`: optional text prepended to the stable Discord announcement.-1. Generate the new token.-2. Update the secret.-3. Revoke the old token.+The workflow validates the tag, closes the version milestone, checks out `release/vX.Y.Z`, changes `package.json` to the stable version, tags that branch tip, opens and rebase-merges a release-sync PR into `main`, explicitly dispatches `build.yml` at the stable tag, and announces the stable release. The build publishes signed/notarized artifacts when Apple credentials are complete; publication with `OPENSCREEN_RELEASE_TOKEN` emits the event that starts stable Homebrew, WinGet, Nix, and AUR workflows.-There's no need to coordinate a rotation window — the release pipeline runs at most a few times per month.+### Release-branch freeze rule-## Required repo ruleset bypass+An RC cut creates `release/vX.Y.Z`. That branch is not merged into `main` until the stable tag is published, and only cherry-picked RC bug fixes land on it during the RC window. Subsequent RCs reuse the same branch. This rule exists because a promote workflow once tagged `main` instead of the tested RC snapshot and shipped unreleased commits.-The `main` branch is protected by the repository ruleset `main-protection` (id `18060803` on this repo), which requires changes to be made through a pull request. The release pipeline (`prerelease.yml` and `promote.yml`) commits `package.json` directly to `main` because the version bump has to land before the tag is pushed and the build runs.+Development continues on `main`; the freeze applies to the release branch. Day-to-day branching, PR, review, and cherry-pick procedure is maintained in [the operational git workflow](../../.harness/docs/git-workflow.md).-To allow that direct push, the ruleset has two bypass actors:+### Manual tag fallback-- **`EtienneLescot`** (id `215859519`) — so manual pushes from the maintainer's local checkout work.-- **`github-actions[bot]`** (id `41898282`) — so the workflow's `GITHUB_TOKEN` push (the default `actions/checkout@v4` auth) is also accepted.+When the dispatch UI is unavailable, prepare the correct prerelease or stable `package.json` commit on the frozen release branch, then push the tag at that exact commit:-## Required repo ruleset bypass and PR flow--The `main` branch is protected by the repository ruleset `main-protection` (id `18060803` on this repo). It enforces:+```bash+git tag v1.8.0-rc.1 <release-branch-sha>+git push origin v1.8.0-rc.1-- `deletion` — branches can't be deleted-- `non_fast_forward` — no force pushes-- `required_linear_history` — fast-forward only-- `pull_request` — 1 approving review + code owner review, only rebase merge allowed (`merge` and `squash` are disabled at the repo level)+# After QA and the stable version commit on the same release branch:+git tag v1.8.0 <stable-release-branch-sha>+git push origin v1.8.0+```-The release pipeline (`prerelease.yml` and `promote.yml`) cannot bypass this directly because:+Any `v*` tag triggers `build.yml`. The fallback skips milestone migration/closure, release-branch automation, explicit build dispatch, main synchronization, and Discord announcements, so the operator must preserve the freeze and version/tag match manually.-- The org policy disables `GITHUB_TOKEN` write permissions (`Allow GitHub Actions to create and approve pull requests` is OFF at the org level), so `GITHUB_TOKEN` cannot create the bump PR.-- Fine-grained PATs do not satisfy ruleset bypass actors, so a PAT-driven direct push is rejected with `GH013`.+## Required release credential-So the workflow:+### `OPENSCREEN_RELEASE_TOKEN`-1. Pushes the bump commit to a `release/vX.Y.Z` branch using the PAT (no rule check on non-main branches).-2. Opens the PR using the PAT (`gh pr create` with `GH_TOKEN=$OPENSCREEN_RELEASE_TOKEN`).-3. Rebase-merges the PR using the PAT. EtienneLescot is a ruleset bypass actor with `bypass_mode: "always"`, so the `pull_request` review requirement is skipped for this merge.+This fine-grained personal access token is used by `prerelease.yml`, `promote.yml`, and `build.yml`. It migrates and closes issues/milestones, pushes release branches, creates and merges the release-sync PR, dispatches `build.yml`, and creates GitHub releases so `release: published` can start downstream workflows. The automatic `GITHUB_TOKEN` cannot reliably trigger those subsequent workflows.-The ruleset has two bypass actors:+Grant the token access only to the OpenScreen repository with:-- **`EtienneLescot`** (id `215859519`) — so the PAT-driven PR merge satisfies the `pull_request` rule.-- **`github-actions[bot]`** (id `41898282`) — added defensively, though `GITHUB_TOKEN`-driven operations are blocked by the org policy regardless.+- Contents: read and write.+- Issues: read and write.+- Pull requests: read and write.+- Actions: read and write, for explicit build dispatch.+- Workflows: read and write, because the pushed release branch contains `.github/workflows/`.+- Metadata: read-only.-To confirm the bypass list:+Create a fine-grained token from GitHub settings, set a finite expiry, and save it as the repository secret `OPENSCREEN_RELEASE_TOKEN`:```bash-gh api /repos/getopenscreen/openscreen/rulesets/18060803 --jq '.bypass_actors'-# Expect both 215859519 and 41898282 with bypass_mode "always".+gh secret set OPENSCREEN_RELEASE_TOKEN --body "<token>" --repo getopenscreen/openscreen```-## Required for Discord announcements--### `DISCORD_BOT_TOKEN`--Bot token from a Discord application added to the OpenScreen Discord server with the `bot` scope and at minimum:+Rotate it by creating the replacement with the same repository and scopes, updating the secret, verifying a non-destructive workflow/API operation, then revoking the old token. Do not revoke the previous token until the replacement is installed.-- `Send Messages` in any text channels where the bot posts-- `Create Public Threads` in the forum channels (for the release announce script)-- `Send Messages in Threads` so the first message in a new thread goes through-- `Manage Messages` if you want the roadmap-sync workflow to pin its message-- `Read Message History` (usually default)+The repository's main-branch ruleset must also permit the configured maintainer/PAT flow to rebase-merge the release-sync PR with `--admin`; that bypass is repository configuration rather than a secret.-Stored as a repository secret.+## Apple signing and notarization-### `DISCORD_RC_TESTING_CHANNEL_ID`+`build.yml` enables signing only when all of these secrets are present:-Snowflake ID of the Discord channel where release candidates are announced. Can be a regular text channel or a forum channel — the `discord-release-announce.mjs` script auto-detects the type:+| Secret | Purpose |+|---|---|+| `MAC_CERTIFICATE_P12` | Base64-encoded Developer ID Application certificate and private key imported into a temporary keychain. |+| `MAC_CERTIFICATE_PASSWORD` | Password protecting the P12 archive. |+| `MAC_CSC_NAME` | Signing identity passed to electron-builder and `codesign`. |+| `APPLE_ID` | Apple account used by `notarytool`. |+| `APPLE_TEAM_ID` | Apple Developer team identifier. |+| `APPLE_APP_SPECIFIC_PASSWORD` | App-specific password used by `notarytool`. |-- **Text channel** (`type=0`): posts the announcement as a regular message.-- **Forum channel** (`type=15` or `16`): creates a new thread with the announcement as the first message. One thread per release, named like `v1.5.1-rc.1 RC — testing`.+The certificate account needs Developer ID signing capability, and the Apple account/app-specific password must be able to submit notarization requests for the team. Stable tags sign the DMG, notarize, staple, and validate it. Pre-release tags skip DMG signing/notarization. If any value is missing, the macOS job disables signing and still creates an unsigned DMG.-Set as a **repository variable** (not a secret — it's not sensitive):--```bash-gh variable set DISCORD_RC_TESTING_CHANNEL_ID --body "1521416826146263051" --repo getopenscreen/openscreen-```--### `DISCORD_RELEASE_CHANNEL_ID`--Same pattern as above, for the stable release announcement channel.--```bash-gh variable set DISCORD_RELEASE_CHANNEL_ID --body "<id>" --repo getopenscreen/openscreen-```+Rotate the certificate by exporting a replacement P12, base64-encoding it without line-wrap changes, updating the P12/password/name secrets together, testing a stable-format manual build, then revoking the old certificate if required. Rotate the app-specific password in Apple ID settings, replace `APPLE_APP_SPECIFIC_PASSWORD`, verify notarization, and revoke the old password. `APPLE_ID` and `APPLE_TEAM_ID` normally change only when the owning account or team changes.-### `DISCORD_ROADMAP_CHANNEL_ID` and `DISCORD_ROADMAP_MESSAGE_ID`+## Discord secrets and variables-Used by `discord-roadmap-sync.yml` to keep the pinned roadmap message in sync. Repository variables.+| Name | Kind | Used for |+|---|---|---|+| `DISCORD_BOT_TOKEN` | Secret | RC/stable announcements, PR forum sync, roadmap sync, and weekly leaderboard posts. |+| `DISCORD_REVIEWER_ROLE_ID` | Secret | Role mention used by PR-to-Discord synchronization. |+| `DISCORD_RC_TESTING_CHANNEL_ID` | Variable | RC announcement destination. |+| `DISCORD_RELEASE_CHANNEL_ID` | Variable | Stable announcement destination. |+| `DISCORD_PR_FORUM_CHANNEL_ID` | Variable | Forum that receives PR threads. |+| `DISCORD_ALERT_CHANNEL_ID` | Variable | Optional alert destination for PR sync failures. |+| `DISCORD_ROADMAP_CHANNEL_ID` | Variable | Channel containing the synchronized roadmap message. |+| `DISCORD_ROADMAP_MESSAGE_ID` | Variable | Optional explicit message override; pin discovery is otherwise used. |+| `DISCORD_SPOTLIGHT_CHANNEL_ID` | Variable | Weekly leaderboard destination. |-## Tier 3 package registries+The bot token comes from a Discord application authorized with the `bot` scope. Grant only the channel permissions each automation needs: View Channel, Send Messages, Embed Links, Create Public Threads and Send Messages in Threads for forum use, Manage Threads for forum state, and Manage Messages when roadmap pinning is required. Rotate by resetting the bot token in the Discord developer portal, updating `DISCORD_BOT_TOKEN`, testing a non-release post/sync, then invalidating the old token automatically through the reset. Channel and role IDs are identifiers rather than credentials; update their repository variable/secret when channels or roles are replaced.-Each external registry has its own credential set. See the per-workflow README comments at the top of these files:+## Package registry credentials and variables-- `.github/workflows/update-homebrew-cask.yml` — `HOMEBREW_TAP_TOKEN`, `HOMEBREW_TAP_OWNER`, `HOMEBREW_TAP_REPO`, `HOMEBREW_CASK_NAME`-- `.github/workflows/publish-winget.yml` — `WINGET_ACC_TOKEN`, `WINGET_IDENTIFIER`-- `.github/workflows/bump-nix-package.yml` — uses `GITHUB_TOKEN` (no extra secret required)-- `.github/workflows/aur-publish.yml` — `AUR_SSH_PRIVATE_KEY`, `AUR_KNOWN_HOSTS`, `AUR_PACKAGE_NAME`+| Name | Kind | Required access and use | Rotation |+|---|---|---|---|+| `HOMEBREW_TAP_TOKEN` | Secret | Token accepted by checkout/push for the repository named by `HOMEBREW_TAP_OWNER` and `HOMEBREW_TAP_REPO`; contents write is sufficient for a dedicated tap. | Create a replacement, update the secret, manually dispatch `update-homebrew-cask.yml`, then revoke the old token. |+| `HOMEBREW_TAP_OWNER` | Variable | Owner of the tap repository. | Update when the tap moves. |+| `HOMEBREW_TAP_REPO` | Variable | Tap repository name. | Update when the tap moves. |+| `HOMEBREW_CASK_NAME` | Variable | Cask filename/name; defaults to `openscreen` when unset. | Update with the tap's cask rename. |+| `WINGET_ACC_TOKEN` | Secret | Token consumed by `winget-releaser` to submit to the WinGet community repository; grant the scopes required by that action's upstream submission account and no unrelated repository access. | Replace the token, update the secret, replay `publish-winget.yml` for a stable tag, then revoke the old token. |+| `WINGET_IDENTIFIER` | Variable | Package identifier passed to the WinGet action. | Update only if the Store/community identifier changes. |+| `AUR_SSH_PRIVATE_KEY` | Secret | Private SSH key whose public key is authorized for the configured AUR package repository. | Add a replacement public key to AUR, update the private-key secret, manually dispatch and verify, then remove the old AUR key. |+| `AUR_KNOWN_HOSTS` | Variable | Pinned `aur.archlinux.org` host-key lines; required because strict host checking is enabled. | Replace only after independently verifying an AUR host-key change. |+| `AUR_PACKAGE_NAME` | Variable | AUR repository/package name and workflow gate. | Update if the package is renamed. |-All four already gate on `!prerelease`, so a `vX.Y.Z-rc.N` tag will not push to homebrew/winget/nix/aur.+`bump-nix-package.yml` uses the workflow-scoped `GITHUB_TOKEN`; it requires repository contents and pull-request write permissions as declared in the workflow and has no additional long-lived secret.-## Apple notarization+## Automatic `GITHUB_TOKEN`-`build.yml` skips notarization when the tag contains a `-` (i.e. any pre-release), so the macOS secrets below are only consulted for stable releases:+GitHub supplies `GITHUB_TOKEN` per run. Workflows use it for semantic PR validation, release-asset reads, issue bookkeeping, and the Nix bump PR. Its scopes come from each workflow's `permissions` block and it is not manually created or rotated. Do not replace it with a PAT unless cross-workflow triggering or external-repository access is actually required.-- `MAC_CERTIFICATE_P12` (base64 of the Developer ID Application `.p12`)-- `MAC_CERTIFICATE_PASSWORD`-- `MAC_CSC_NAME`-- `APPLE_ID`-- `APPLE_TEAM_ID`-- `APPLE_APP_SPECIFIC_PASSWORD`+## Secret-handling rules-If any of these is missing, the build produces an **unsigned** DMG without notarization. This is the expected behavior for forks and CI debug runs. The release pipeline still works; the macOS DMG will trigger a Gatekeeper warning on first install.\ No newline at end of file+- Store credentials as repository or environment secrets, never repository variables or committed files.+- Keep non-sensitive channel IDs, package IDs, repository names, and known-host material in variables.+- Scope tokens to the single repository or external package destination they need.+- Rotate before expiry and verify the replacement before revoking the previous credential.+- Treat workflow logs and manual shell commands as public: pass values through secret inputs/environment variables and never echo them.diff --git a/technical-documentation/testing/writing-tests.md b/technical-documentation/testing/writing-tests.mdindex 09ede7ed6..69d1b5dda 100644--- a/technical-documentation/testing/writing-tests.md+++ b/technical-documentation/testing/writing-tests.md@@ -1,6 +1,14 @@# Writing Tests-This project uses [Vitest](https://vitest.dev/) for both unit/integration tests and browser tests. There are two separate configs — each targets a different set of files.+This project uses Vitest for unit/integration tests and browser tests, plus Playwright for desktop end-to-end coverage. The configs select distinct file sets and execution environments.++## Test types at a glance++| Test type | Config | What it is for | Run it |+|---|---|---|---|+| Unit / jsdom | `vitest.config.ts` | Logic, data transformations, React behavior, and integrations that do not require real browser media/graphics APIs. | `npm run test` or `npm run test:watch` |+| Browser / Playwright in Vitest | `vitest.browser.config.ts` | Source-level tests in real headless Chromium for Canvas, WebCodecs, MediaRecorder, WebGL, and related APIs. | `npm run test:browser:install`, then `npm run test:browser` |+| End-to-end / Playwright | `playwright.config.ts` | Full workflows under `tests/e2e`, including Electron/native integration checklists and export flows. | `npm run test:e2e` |## Unit tests@@ -147,3 +155,5 @@ npm run test:browser| `VideoDecoder` / `VideoEncoder` / `MediaRecorder` | Browser test || `OffscreenCanvas` / WebGL / Pixi.js rendering | Browser test || File export producing a real `Blob` | Browser test |++Automated suites do not exercise every hardware, permission, codec, signing, and packaged-app combination. Use the [manual end-to-end checklist](manual-e2e-checklist.md) for those release and platform checks.diff --git a/tests/e2e/roadmap-coverage.spec.ts b/tests/e2e/roadmap-coverage.spec.tsindex 300b1ec69..1fc16674e 100644--- a/tests/e2e/roadmap-coverage.spec.ts+++ b/tests/e2e/roadmap-coverage.spec.ts@@ -1,10 +1,13 @@-// ponytail: agentic-style roadmap coverage. One test per ✅ row in-// `docs/architecture/ai-edition-roadmap.md` (the ones with specs in-// `specs/`). Each test seeds the browser-shim with a known project,-// opens the editor, and asserts on observable behavior (data-*-// attributes, visible text, console errors). Fails = the roadmap's-// ✅ is a false claim. The agent would re-snapshot the DOM and patch-// brittle selectors; we go straight to the contract.+// ponytail: each test seeds the browser-shim with a known project, opens the+// editor, and asserts on observable behavior (data-* attributes, visible text,+// console errors) rather than on the DOM shape.+//+// STALE: these were written against the pre-v4 editor shell and still target+// `data-testid="timeline-pane"` and the old right-panel help popover, neither of+// which the v4 shell renders. They are kept only as a record of the behaviours+// worth covering; rewrite them against `src/components/ai-edition/v4/` before+// trusting a pass. What the suite is checking is described in+// `technical-documentation/testing/manual-e2e-checklist.md`.import { expect, type Page, test } from "@playwright/test";const EDITOR_URL = "http://localhost:5173/?windowType=editor";