commit e95d22625ee92b637dcb27bcb5a51bf29a55e772
parent 9499cc168ddba48dbbf256d8e64086f4c972f2f6
Author: I Mean I'm Just Saying <imeanimjustsaying@kiwifarms.st>
Date: Sat, 10 Oct 2026 14:41:43 -0400
plans: e2e speed S4, S5a, S5b as shipped (release 24, r24/e2e-speed); changelog
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Diffstat:
2 files changed, 75 insertions(+), 0 deletions(-)
diff --git a/editor/CHANGELOG.md b/editor/CHANGELOG.md
@@ -136,6 +136,9 @@
- **An agent can answer the operator's notes in umtool, and its replies say they are an agent's.** The MCP's `notes` tool now writes a reply (`action: "reply"`, with `note_id`, `text` and `resolve`) in umtool instead of answering with the `umtool notes reply` command to run; umtool stamps it "agent" and badges it on the page. umtool takes an agent's write only with the editor's `WORKER_TOKEN` as a bearer token — from its own environment, else the editor's `editor/.env` — and refuses any other token (401); a write from umtool's own page is the operator's as before. Register the MCP with `UMTOOL_URL` and `WORKER_TOKEN`. Needs a rebuild and restart of umtool, and a restart of the MCP server.
- **Captions the index re-read under the newer caption-track rule now reach the stats and charts.** When the index re-reads a video's captions without any of its files changing — as it did once for videos whose served `en` track had parsed to nothing — the stats behind the homepage, the hub and the sites' charts kept the old figures (no transcript, the old cue count) until something else about the video changed. The stats now follow the captions the index holds, and the first stats build after updating corrects the videos already affected. Needs a rebuild and restart of the editor, then a stats build (or a site, hub or homepage build).
- **Every e2e run records its own per-spec timings.** The editor, umtool, homepage and export suites now record each run in the branch's timing history the moment it ends (`scripts/e2e-timings-reporter.mjs`), so re-running a few specs no longer loses the record of the full run before it; `node scripts/e2e-timings.mjs` still prints a run against the last one. umtool's suite skips, with the reason, the face-detector tests on a machine without the detector and the chunk-twin check when the data has no twins, instead of failing.
+- **Different e2e suites run side by side, and `pnpm e2e:all` runs them all with one summary.** Each package's suite now waits only for another run of the SAME suite (`e2e-editor`, `e2e-export`, `e2e-homepage`, `e2e-umtool`), so the editor, export, homepage and umtool suites can run at once. `pnpm e2e:all` starts one per package, writes each suite's output to `test-results-e2e-all/`, and ends with one table — passed, failed, flaky and skipped per suite, how long each waited, every failed test by file and line — and the wall time against the sum of the suites' own.
+- **The heavy slot admits jobs by memory, one build at a time.** An e2e suite (1.5 GB) or a capped `next build` (its 5 GB cap) now starts beside other heavy work while the memory left after what the running jobs were promised stays above the 6000 MB floor; two `next build`s still never run at once. A job that declares no estimate — a render, a hand `pnpm heavy -- …`, a publish stage's build — runs alone, as before. A waiter is told what it waits for (`waiting for memory — … MB promised to 2 running jobs`, `waiting for the build slot`).
+- **The editor suite can run on several workers, each with servers of its own.** `E2E_WORKERS=2` (or `auto`, from memory, up to 3) gives every worker its own editor, export server and Ollama stub over its own data directory; specs that write into the checkout's build outputs or time a wall clock run afterwards on one worker. One worker stays the default until the parallel runs are measured.
## [0.11.0] - 2026-09-30
- **Transcripts that arrived after a video was first seen are counted.** The stats behind the homepage, the hub and every site's charts were cached per video and refreshed only when the video's metadata changed, so a transcript that came later — a Whisper run days after the download, or a video downloaded after the last index build — never reached them, and a video with YouTube captions alone had no transcription date. Counts and charts were low; the homepage could show a site with 0 transcripts, 0 channels and 0 hours while it served its videos. A stat is now also redone whenever the index re-reads the video, every transcript has a date, and a captioned video is dated by when its captions arrived rather than by a later Normalize run, so its place on "Transcribed over time" can move. **After updating, rebuild and restart the editor before anything else:** until then, **Build stats dataset** runs the old code and would undo the new stats, while a site, hub or homepage build already runs the new code — and the first stats build of any kind re-reads every video once (about 10–30 minutes on a large archive; it can be stopped and picks up where it stopped). Then build the index, the stats, the homepage, the hub, and the sites.
diff --git a/plans/e2e-speed.md b/plans/e2e-speed.md
@@ -235,3 +235,75 @@ the reporter (`.git/e2e-timings/umtool/r23_fixes.json`). The first run of the th
passed, 9 failed (triage's page check looked for a `link`), 6 skipped — recorded too, which is the point.
`E2E_MODE=dev pnpm e2e import-video.spec.ts` 3 passed, 33.9 s; the same in start mode (the editor's e2e build rebuilt
through the heavy slot, 42 s) 3 passed, 12.2 s.
+
+### S4, as shipped (release 24, `r24/e2e-speed`)
+
+**Each package's suite queues under its own name.** `scripts/queue-lock.mjs --name e2e-<pkg>`: `e2e-editor`,
+`e2e-export` (all four export configs — one at a time among themselves), `e2e-homepage`, `e2e-umtool`. The same suite
+never runs twice machine-wide; two different suites run at once. The unnamed default `e2e` (the sharded runner) keeps
+the one-for-all queue and the old order (the slot, then the queue). A named suite's order: its queue, the port
+preflight, its start-mode build (`--prebuild <pkg>` → `e2e-stamp.mjs ensure`, a build admitted as a build, so a
+rebuild is never inside the suite's estimate; the config then trusts `E2E_BUILD_CHECKED`), then its own admission.
+`E2E_QUEUE_LOCK_FILE` names the legacy queue's file; a named suite's sits beside it (`<file>.<name>`).
+
+**The heavy slot admits by memory.** A job declares an estimate (`--estimate <MB>`; a `systemd-run … -p MemoryMax=…`
+cap is one, so the e2e build is 5120 MB with no change to `e2e-stamp.mjs`; `--build`, or `next build` in the command,
+makes it a build) and is admitted while `MemAvailable − Σ(running estimates) ≥ HEAVY_MIN_FREE_MB`. One build at a time
+stays hard: a build in line only TRIES the build slot; a build nested in an admitted run waits for it
+(`HEAVY_HELD=build` inside a build passes through). Ruled: **a job that declares nothing runs alone**, as before —
+renders, a hand `pnpm heavy -- …`, the publish stages' uncapped `next build`, preparePlayable's ffmpeg, the sharded
+runner. The pieces, beside the slot's lock in the git common dir: `heavy-queue.lock` (held SHARED by a weighted job,
+EXCLUSIVELY by a lone one — so a checkout on older code, which always takes it exclusively, still waits for every
+new-style job and is never joined by one), `.admit` (the line; held only until admitted, so nobody slips in while the
+head waits for memory), `.build`, `.jobs/<pid>.json` (tickets; pid + start time, a dead one dropped). Every suite's
+script declares `--estimate 1500`; the editor's is per worker (`--scale-by E2E_WORKERS`, `auto` = 3).
+
+**`pnpm e2e:all`** (`scripts/e2e-all.mjs`): one lane per package, all at once, each suite through its own package
+script (through `worktree.mjs run`, so a worktree's ports); a line per suite start/end; logs in
+`test-results-e2e-all/<suite>.log`; one summary — per suite passed/failed/flaky/skipped from its own json report (only a
+report started after this run's launch counts), its test time, how long it waited, every failure by `file:line`; the
+wall against the sum. `--only <pkg|suite>,…`.
+
+**Found on the way.** Next 16 refuses a second `next dev` over one dist dir (`<distDir>/dev/lock`), so the editor
+suite's export dev server and the export suite's own could not run at once: `export/next.config.ts` reads
+`E2E_NEXT_DIST_DIR` like the editor's, and the editor suite's export server builds into `.next/e2e-editor`. A waiter
+killed while it waited (`timeout`, Ctrl-C) left its holder file naming a dead pid: the signal handlers are now installed
+before the wait and exit through `process.exit`.
+
+### S5a, as shipped (release 24, `r24/e2e-speed`)
+
+Every spec's test-data paths come from `testPaths()` (`editor/e2e/testPaths.ts`, re-exported by `helpers.ts`):
+`transcriptsDir`, `settingsFile`, `exportPublicDir`, `editorChangelog`, `exportChangelog`, under one root.
+`dev:test` / `start:test` take the same root as `${E2E_DATA_ROOT:-$(pwd)}`. Ruled: **one E2E_-prefixed root, not
+`TRANSCRIPTS_DIR` / `SETTINGS_FILE` from the env** — a `--share-data` worktree's `.worktree-env` sets
+`TRANSCRIPTS_DIR` to the real corpus, and `resetData()` deletes the test data directory. Mechanical, by a script over
+string literals, then read line by line: `git grep` over `editor/e2e/*.ts` — before, 108 files and 451 literal
+occurrences (`test-transcripts` 386, `test-settings.json` 60, `test-changelog.md` 4, `test-export-changelog.md` 1);
+after, two in code (`fixturesRoot/test-transcripts/<fixture>`, the fixture SOURCE, rightly literal) and the rest in
+comments; 443 `testPaths()` calls in 108 files. Three joins the script could not see were fixed by hand
+(`path.join(here, "..", ROOT, …)` in cookies-mode and no-subs-fallback, `exportOutLink.ts`).
+
+### S5b, as shipped (release 24, `r24/e2e-speed`) — ready to measure
+
+A server set per worker. With `E2E_WORKERS` > 1 each worker slot has its own editor test server, export dev server and
+Ollama stub over its own data root: slot 0 is the config's `webServer` entries over the editor directory, as before;
+slot n (`editor/.e2e-workers/w<n>`, gitignored) is started by `globalSetup` on three ports from the unused top of the
+worktree's block (`x060 + 3(n−1)`…), refused naming the pid when one is bound, and stopped (the process group,
+TERM then KILL) by `globalTeardown`. Ruled: **servers per SLOT from globalSetup, not a worker-scoped fixture** — the
+config is evaluated again in every worker with `TEST_PARALLEL_INDEX` set (verified on Playwright 1.59), so
+`baseURL`, `PLAYWRIGHT_BASE_URL`, `EXPORT_PORT` and `testPaths()` are the slot's before a spec loads and no spec's
+`test` import changes; a restarted worker keeps its slot's servers. One definition of the servers
+(`editor/e2e/servers.ts`) serves the config and globalSetup. A second `next dev` gets its own dist dir
+(`.next/e2e-dev-w<n>`, `.next/e2e-editor-w<n>`); start-mode slots share the stamped `.next/e2e`.
+
+`E2E_WORKERS`: a number (≤ 8) or `auto` = floor((MemAvailable − floor) / 1.5 GB), 1 to 3; the runner pins the result
+for its workers. Ruled: **the default stays 1** until the full runs at 1, 2 and 3 workers are green — then it becomes
+`auto` (one line in `resolveWorkers`). `@serial`: the files in `editor/e2e/serial.ts` — the checkout's build outputs
+(`export/out`, `homepage/out`: build, deploy-page, publish, publish-lane, site-publish-preview, sites-crud,
+sites-homepage) and timing under contention (pacing, rate-limit, audio-check-scenarios, fetch-window, channel-storage,
+storage-locations, whisper) — run in a `serial` project that is the parallel project's `teardown` (Playwright runs a
+teardown even when a parallel test failed, where a dependent project would be skipped — verified), on one worker. With
+one worker there is one project, as before. 590 tests parallel, 107 serial at `E2E_WORKERS=3` (`--list`).
+
+**Found on the way.** `playwright test --list` was recorded by release 23 F5's timing reporter as a run (a report whose
+tests have no results); it now records nothing.